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