[migration] when there are no data migration needed, we still want to rewrite the configuration and to restart the server. Closes #1760927 stable
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Mon, 20 Jun 2011 12:55:40 +0200
branchstable
changeset 7538 849c04098f3f
parent 7537 1af162bd78b8
child 7540 074a6cec246b
[migration] when there are no data migration needed, we still want to rewrite the configuration and to restart the server. Closes #1760927
cwctl.py
--- a/cwctl.py	Sat Jun 18 23:27:23 2011 +0200
+++ b/cwctl.py	Mon Jun 20 12:55:40 2011 +0200
@@ -757,18 +757,16 @@
             applcubicwebversion = vcconf.get('cubicweb')
         if cubicwebversion > applcubicwebversion:
             toupgrade.append(('cubicweb', applcubicwebversion, cubicwebversion))
-        if not self.config.fs_only and not toupgrade:
-            print '-> no data migration needed for instance %s.' % appid
-            self.i18nupgrade(config)
-            mih.shutdown()
-            return
-        for cube, fromversion, toversion in toupgrade:
-            print '-> migration needed from %s to %s for %s' % (fromversion, toversion, cube)
         # only stop once we're sure we have something to do
         if not (CWDEV or self.config.nostartstop):
             StopInstanceCommand(self.logger).stop_instance(appid)
         # run cubicweb/componants migration scripts
-        mih.migrate(vcconf, reversed(toupgrade), self.config)
+        if self.config.fs_only or toupgrade:
+            for cube, fromversion, toversion in toupgrade:
+                print '-> migration needed from %s to %s for %s' % (fromversion, toversion, cube)
+            mih.migrate(vcconf, reversed(toupgrade), self.config)
+        else:
+            print '-> no data migration needed for instance %s.' % appid
         # rewrite main configuration file
         mih.rewrite_configuration()
         mih.shutdown()