cwctl.py
branchstable
changeset 5796 351e84e18a61
parent 5608 f9ab62103ad4
child 5811 e77cea9721e7
--- a/cwctl.py	Fri Jun 18 18:14:55 2010 +0200
+++ b/cwctl.py	Fri Jun 18 18:49:17 2010 +0200
@@ -731,7 +731,9 @@
         if cubicwebversion > applcubicwebversion:
             toupgrade.append(('cubicweb', applcubicwebversion, cubicwebversion))
         if not self.config.fs_only and not toupgrade:
-            print '-> no software migration needed for instance %s.' % appid
+            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)
@@ -742,6 +744,22 @@
         mih.migrate(vcconf, reversed(toupgrade), self.config)
         # rewrite main configuration file
         mih.rewrite_configuration()
+        mih.shutdown()
+        # handle i18n upgrade
+        if not self.i18nupgrade(config):
+            return
+        print
+        print '-> instance migrated.'
+        if not (CWDEV or self.config.nostartstop):
+            # restart instance through fork to get a proper environment, avoid
+            # uicfg pb (and probably gettext catalogs, to check...)
+            forkcmd = '%s start %s' % (sys.argv[0], appid)
+            status = system(forkcmd)
+            if status:
+                print '%s exited with status %s' % (forkcmd, status)
+        print
+
+    def i18nupgrade(self, config):
         # handle i18n upgrade:
         # * install new languages
         # * recompile catalogs
@@ -753,21 +771,10 @@
         if errors:
             print '\n'.join(errors)
             if not ASK.confirm('Error while compiling message catalogs, '
-                               'continue anyway ?'):
+                               'continue anyway?'):
                 print '-> migration not completed.'
-                return
-        mih.shutdown()
-        print
-        print '-> instance migrated.'
-        if not (CWDEV or self.config.nostartstop):
-            # restart instance through fork to get a proper environment, avoid
-            # uicfg pb (and probably gettext catalogs, to check...)
-            forkcmd = '%s start %s' % (sys.argv[0], appid)
-            status = system(forkcmd)
-            if status:
-                print '%s exited with status %s' % (forkcmd, status)
-        print
-
+                return False
+        return True
 
 class ShellCommand(Command):
     """Run an interactive migration shell on an instance. This is a python shell