cwctl.py
changeset 1404 971b19de6b85
parent 1219 054bb575c013
child 1477 b056a49c16dc
equal deleted inserted replaced
1395:e7f12251945a 1404:971b19de6b85
   612         # need this since mro return StopApplicationCommand implementation
   612         # need this since mro return StopApplicationCommand implementation
   613         return ApplicationCommand.ordered_instances(self)
   613         return ApplicationCommand.ordered_instances(self)
   614     
   614     
   615     def upgrade_application(self, appid):
   615     def upgrade_application(self, appid):
   616         from logilab.common.changelog import Version
   616         from logilab.common.changelog import Version
   617         if not (CubicWebConfiguration.mode == 'dev' or self.config.nostartstop):
       
   618             self.stop_application(appid)
       
   619         config = CubicWebConfiguration.config_for(appid)
   617         config = CubicWebConfiguration.config_for(appid)
   620         config.creating = True # notice we're not starting the server
   618         config.creating = True # notice we're not starting the server
   621         config.verbosity = self.config.verbosity
   619         config.verbosity = self.config.verbosity
   622         try:
   620         try:
   623             config.set_sources_mode(self.config.ext_sources or ('migration',))
   621             config.set_sources_mode(self.config.ext_sources or ('migration',))
   657         if not self.config.fs_only and not toupgrade:
   655         if not self.config.fs_only and not toupgrade:
   658             print 'no software migration needed for application %s' % appid
   656             print 'no software migration needed for application %s' % appid
   659             return
   657             return
   660         for cube, fromversion, toversion in toupgrade:
   658         for cube, fromversion, toversion in toupgrade:
   661             print '**** %s migration %s -> %s' % (cube, fromversion, toversion)
   659             print '**** %s migration %s -> %s' % (cube, fromversion, toversion)
       
   660         # only stop once we're sure we have something to do
       
   661         if not (CubicWebConfiguration.mode == 'dev' or self.config.nostartstop):
       
   662             self.stop_application(appid)
   662         # run cubicweb/componants migration scripts
   663         # run cubicweb/componants migration scripts
   663         mih.migrate(vcconf, reversed(toupgrade), self.config)
   664         mih.migrate(vcconf, reversed(toupgrade), self.config)
   664         # rewrite main configuration file
   665         # rewrite main configuration file
   665         mih.rewrite_configuration()
   666         mih.rewrite_configuration()
   666         # handle i18n upgrade:
   667         # handle i18n upgrade: