cwctl.py
branchtls-sprint
changeset 1477 b056a49c16dc
parent 1446 e951a860eeaf
parent 1404 971b19de6b85
child 1898 39b37f90a8a4
--- a/cwctl.py	Fri Apr 24 16:48:38 2009 +0200
+++ b/cwctl.py	Fri Apr 24 17:04:14 2009 +0200
@@ -616,8 +616,6 @@
 
     def upgrade_application(self, appid):
         from logilab.common.changelog import Version
-        if not (cwcfg.mode == 'dev' or self.config.nostartstop):
-            self.stop_application(appid)
         config = cwcfg.config_for(appid)
         config.creating = True # notice we're not starting the server
         config.verbosity = self.config.verbosity
@@ -661,6 +659,9 @@
             return
         for cube, fromversion, toversion in toupgrade:
             print '**** %s migration %s -> %s' % (cube, fromversion, toversion)
+        # only stop once we're sure we have something to do
+        if not (cwcfg.mode == 'dev' or self.config.nostartstop):
+            self.stop_application(appid)
         # run cubicweb/componants migration scripts
         mih.migrate(vcconf, reversed(toupgrade), self.config)
         # rewrite main configuration file