cwctl.py
changeset 3674 387d51af966d
parent 3629 559cad62c786
parent 3638 648d6dbec630
child 3720 5376aaadd16b
--- a/cwctl.py	Tue Oct 13 18:21:24 2009 +0200
+++ b/cwctl.py	Thu Oct 15 10:31:54 2009 +0200
@@ -18,10 +18,9 @@
 from logilab.common.shellutils import ASK
 
 from cubicweb import ConfigurationError, ExecutionError, BadCommandUsage
-from cubicweb.cwconfig import CubicWebConfiguration as cwcfg, CONFIGURATIONS
+from cubicweb.cwconfig import CubicWebConfiguration as cwcfg, CWDEV, CONFIGURATIONS
 from cubicweb.toolsutils import Command, main_run, rm, create_dir, underline_title
 
-
 def wait_process_end(pid, maxtry=10, waittime=1):
     """wait for a process to actually die"""
     import signal
@@ -657,7 +656,7 @@
         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 (cwcfg.mode == 'dev' or self.config.nostartstop):
+        if not (CWDEV or self.config.nostartstop):
             StopInstanceCommand().stop_instance(appid)
         # run cubicweb/componants migration scripts
         mih.migrate(vcconf, reversed(toupgrade), self.config)
@@ -680,7 +679,7 @@
         mih.shutdown()
         print
         print '-> instance migrated.'
-        if not (cwcfg.mode == 'dev' or self.config.nostartstop):
+        if not (CWDEV or self.config.nostartstop):
             StartInstanceCommand().start_instance(appid)
         print