cwctl.py
branchstable
changeset 6145 528be1e059aa
parent 6144 40af8e328e64
child 6505 ac4cecb26813
equal deleted inserted replaced
6144:40af8e328e64 6145:528be1e059aa
   571         for appid in args:
   571         for appid in args:
   572             if askconfirm:
   572             if askconfirm:
   573                 print '*'*72
   573                 print '*'*72
   574                 if not ASK.confirm('%s instance %r ?' % (self.name, appid)):
   574                 if not ASK.confirm('%s instance %r ?' % (self.name, appid)):
   575                     continue
   575                     continue
   576             StopInstanceCommand().stop_instance(appid)
   576             StopInstanceCommand(self.logger).stop_instance(appid)
   577         forkcmd = [w for w in sys.argv if not w in args]
   577         forkcmd = [w for w in sys.argv if not w in args]
   578         forkcmd[1] = 'start'
   578         forkcmd[1] = 'start'
   579         forkcmd = ' '.join(forkcmd)
   579         forkcmd = ' '.join(forkcmd)
   580         for appid in reversed(args):
   580         for appid in reversed(args):
   581             status = system('%s %s' % (forkcmd, appid))
   581             status = system('%s %s' % (forkcmd, appid))
   582             if status:
   582             if status:
   583                 sys.exit(status)
   583                 sys.exit(status)
   584 
   584 
   585     def restart_instance(self, appid):
   585     def restart_instance(self, appid):
   586         StopInstanceCommand().stop_instance(appid)
   586         StopInstanceCommand(self.logger).stop_instance(appid)
   587         self.start_instance(appid)
   587         self.start_instance(appid)
   588 
   588 
   589 
   589 
   590 class ReloadConfigurationCommand(RestartInstanceCommand):
   590 class ReloadConfigurationCommand(RestartInstanceCommand):
   591     """Reload the given instances. This command is equivalent to a
   591     """Reload the given instances. This command is equivalent to a
   740             return
   740             return
   741         for cube, fromversion, toversion in toupgrade:
   741         for cube, fromversion, toversion in toupgrade:
   742             print '-> migration needed from %s to %s for %s' % (fromversion, toversion, cube)
   742             print '-> migration needed from %s to %s for %s' % (fromversion, toversion, cube)
   743         # only stop once we're sure we have something to do
   743         # only stop once we're sure we have something to do
   744         if not (CWDEV or self.config.nostartstop):
   744         if not (CWDEV or self.config.nostartstop):
   745             StopInstanceCommand().stop_instance(appid)
   745             StopInstanceCommand(self.logger).stop_instance(appid)
   746         # run cubicweb/componants migration scripts
   746         # run cubicweb/componants migration scripts
   747         mih.migrate(vcconf, reversed(toupgrade), self.config)
   747         mih.migrate(vcconf, reversed(toupgrade), self.config)
   748         # rewrite main configuration file
   748         # rewrite main configuration file
   749         mih.rewrite_configuration()
   749         mih.rewrite_configuration()
   750         mih.shutdown()
   750         mih.shutdown()