cwctl.py
changeset 2532 f7ca29d75183
parent 2512 106b2a05dc88
child 2615 1ea41b7c0836
equal deleted inserted replaced
2531:531ea4e7013e 2532:f7ca29d75183
   351         except OSError, ex:
   351         except OSError, ex:
   352             import errno
   352             import errno
   353             if ex.errno != errno.ENOENT:
   353             if ex.errno != errno.ENOENT:
   354                 raise
   354                 raise
   355         confignames = ', '.join([config.name for config in configs])
   355         confignames = ', '.join([config.name for config in configs])
   356         print 'instance %s (%s) deleted' % (appid, confignames)
   356         print '-> instance %s (%s) deleted.' % (appid, confignames)
   357 
   357 
   358 
   358 
   359 # instance commands ########################################################
   359 # instance commands ########################################################
   360 
   360 
   361 class StartInstanceCommand(InstanceCommand):
   361 class StartInstanceCommand(InstanceCommand):
   405         if system(command):
   405         if system(command):
   406             print 'an error occured while starting the instance, not started'
   406             print 'an error occured while starting the instance, not started'
   407             print
   407             print
   408             return False
   408             return False
   409         if not debug:
   409         if not debug:
   410             print 'instance %s started' % appid
   410             print '-> instance %s started.' % appid
   411         return True
   411         return True
   412 
   412 
   413 
   413 
   414 class StopInstanceCommand(InstanceCommand):
   414 class StopInstanceCommand(InstanceCommand):
   415     """Stop the given instances.
   415     """Stop the given instances.
   654             toupgrade.append(('cubicweb', applcubicwebversion, cubicwebversion))
   654             toupgrade.append(('cubicweb', applcubicwebversion, cubicwebversion))
   655         if not self.config.fs_only and not toupgrade:
   655         if not self.config.fs_only and not toupgrade:
   656             print '-> no software migration needed for instance %s.' % appid
   656             print '-> no software migration needed for instance %s.' % appid
   657             return
   657             return
   658         for cube, fromversion, toversion in toupgrade:
   658         for cube, fromversion, toversion in toupgrade:
   659             print '\n' + underline_title('%s migration %s -> %s' %
   659             print '-> migration needed from %s to %s for %s' % (fromversion, toversion, cube)
   660                                          (cube, fromversion, toversion))
       
   661         # only stop once we're sure we have something to do
   660         # only stop once we're sure we have something to do
   662         if not (cwcfg.mode == 'dev' or self.config.nostartstop):
   661         if not (cwcfg.mode == 'dev' or self.config.nostartstop):
   663             self.stop_instance(appid)
   662             self.stop_instance(appid)
   664         # run cubicweb/componants migration scripts
   663         # run cubicweb/componants migration scripts
   665         mih.migrate(vcconf, reversed(toupgrade), self.config)
   664         mih.migrate(vcconf, reversed(toupgrade), self.config)