[Testbot] Plone 5.0 - Python 2.7 - Build # 2534 - Still failing! - 1 failure(s)

jenkins at plone.org jenkins at plone.org
Mon Jun 2 15:25:18 UTC 2014


-------------------------------------------------------------------------------
Plone 5.0 - Python 2.7 - Build # 2534 - Still Failing!
-------------------------------------------------------------------------------

http://jenkins.plone.org/job/plone-5.0-python-2.7/2534/


-------------------------------------------------------------------------------
CHANGES
-------------------------------------------------------------------------------

Repository: plone.app.contenttypes
Branch: refs/heads/master
Date: 2014-06-02T16:36:10+02:00
Author: Philip Bauer (pbauer) <bauer at starzel.de>
Commit: https://github.com/plone/plone.app.contenttypes/commit/d1d16e71f3969f0c35230ec7ad0b023c94f38f84

improve logging during migration

Files changed:
M plone/app/contenttypes/migration/atct_migrator_results.pt
M plone/app/contenttypes/migration/browser.py

diff --git a/plone/app/contenttypes/migration/atct_migrator_results.pt b/plone/app/contenttypes/migration/atct_migrator_results.pt
index 32801f0..e034637 100644
--- a/plone/app/contenttypes/migration/atct_migrator_results.pt
+++ b/plone/app/contenttypes/migration/atct_migrator_results.pt
@@ -26,7 +26,7 @@
     tal:define="results view/results">
 
   <tal:success tal:condition="results">
-    <p>The migration finished within <span tal:replace="results/duration">20</span> seconds</p>
+    <p>The migration finished within <span tal:replace="results/duration">20</span></p>
 
     <h3>Migrated Content</h3>
     <table>
diff --git a/plone/app/contenttypes/migration/browser.py b/plone/app/contenttypes/migration/browser.py
index a811e6c..a5b2e82 100644
--- a/plone/app/contenttypes/migration/browser.py
+++ b/plone/app/contenttypes/migration/browser.py
@@ -8,6 +8,7 @@
 from Products.Five.browser.pagetemplatefile import ViewPageTemplateFile
 from Products.statusmessages.interfaces import IStatusMessage
 from datetime import datetime
+from datetime import timedelta
 from plone.app.contenttypes.migration import migration
 from plone.app.contenttypes.migration.utils import ATCT_LIST
 from plone.app.contenttypes.migration.utils import isSchemaExtended
@@ -137,14 +138,24 @@ def __call__(self,
                 object_provides=v['iface'].__identifier__,
                 meta_type=v['old_meta_type'])
             )
-            # TODO: num objects is 0 for BlobFile and BlobImage
-            logger.info(
-                "Migrating %s objects of type %s" %
-                (amount_to_be_migrated, k)
-            )
+            starttime_for_current = datetime.now()
+            logger.info("Start migrating %s objects from %s to %s" % (
+                amount_to_be_migrated,
+                v['old_meta_type'],
+                v['new_type_name']))
+
             # call the migrator
             v['migrator'](portal)
 
+            # logging
+            duration_current = datetime.now() - starttime_for_current
+            duration_human = str(timedelta(seconds=duration_current.seconds))
+            logger.info("Finished migrating %s objects from %s to %s in %s" % (
+                amount_to_be_migrated,
+                v['old_meta_type'],
+                v['new_type_name'],
+                duration_human))
+
             # some data for the results-page
             migrated_types[k] = {}
             migrated_types[k]['amount_migrated'] = amount_to_be_migrated
@@ -165,25 +176,26 @@ def __call__(self,
         # switch on setModificationDate on changes
         self.resetNotifyModified()
 
-        endtime = datetime.now()
-        duration = (endtime - starttime).seconds
+        duration = str(timedelta(seconds=(datetime.now() - starttime).seconds))
+        if not_migrated:
+            msg = ("The following types were not migrated: \n %s"
+                   % "\n".join(not_migrated))
+        else:
+            msg = "Migration successful\n\n"
+        msg += '\n-----------------------------\n'
+        msg += 'Migration finished in: %s' % duration
+        msg += '\n-----------------------------\n'
+        msg += 'Migration statictics:\n'
+        msg += pformat(migrated_types)
+        msg += '\n-----------------------------\n'
+        msg += 'State before:\n'
+        msg += pformat(stats_before)
+        msg += '\n-----------------------------\n'
+        msg += 'Stats after:\n'
+        msg += pformat(self.stats())
+        msg += '\n-----------------------------\n'
         if not from_form:
-            if not_migrated:
-                msg = ("The following were not migrated as they "
-                       "have extended schemas (from "
-                       "archetypes.schemaextender): \n %s"
-                       % "\n".join(not_migrated))
-            else:
-                msg = "Default content types successfully migrated\n\n"
-
-            msg += 'Migration finished in %s seconds' % duration
-            msg += '\n-----------------------------\n'
-            msg += 'State before:\n'
-            msg += pformat(stats_before)
-            msg += '\n-----------------------------\n'
-            msg += 'Stats after:\n'
-            msg += pformat(self.stats())
-            msg += '\n-----------------------------\n'
+            logger.info(msg)
             return msg
         else:
             stats = {




-------------------------------------------------------------------------------
-------------- next part --------------
A non-text attachment was scrubbed...
Name: CHANGES.log
Type: application/octet-stream
Size: 4805 bytes
Desc: not available
URL: <http://lists.plone.org/pipermail/plone-testbot/attachments/20140602/8785314d/attachment-0002.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: build.log
Type: application/octet-stream
Size: 88431 bytes
Desc: not available
URL: <http://lists.plone.org/pipermail/plone-testbot/attachments/20140602/8785314d/attachment-0003.obj>


More information about the Testbot mailing list