cwctl.py
changeset 9556 12ee310541bb
parent 9511 241b1232ed7f
child 9770 112c884b2d8d
equal deleted inserted replaced
9555:370a7c40864f 9556:12ee310541bb
   780         # run cubicweb/componants migration scripts
   780         # run cubicweb/componants migration scripts
   781         if self.config.fs_only or toupgrade:
   781         if self.config.fs_only or toupgrade:
   782             for cube, fromversion, toversion in toupgrade:
   782             for cube, fromversion, toversion in toupgrade:
   783                 print '-> migration needed from %s to %s for %s' % (fromversion, toversion, cube)
   783                 print '-> migration needed from %s to %s for %s' % (fromversion, toversion, cube)
   784             with mih.cnx:
   784             with mih.cnx:
   785                 mih.migrate(vcconf, reversed(toupgrade), self.config)
   785                 with mih.cnx.security_enabled(False, False):
       
   786                     mih.migrate(vcconf, reversed(toupgrade), self.config)
   786         else:
   787         else:
   787             print '-> no data migration needed for instance %s.' % appid
   788             print '-> no data migration needed for instance %s.' % appid
   788         # rewrite main configuration file
   789         # rewrite main configuration file
   789         mih.rewrite_configuration()
   790         mih.rewrite_configuration()
   790         mih.shutdown()
   791         mih.shutdown()
   949             mih, shutdown_callback = self._handle_inmemory(appid)
   950             mih, shutdown_callback = self._handle_inmemory(appid)
   950         else:
   951         else:
   951             mih, shutdown_callback = self._handle_networked(appuri)
   952             mih, shutdown_callback = self._handle_networked(appuri)
   952         try:
   953         try:
   953             with mih.cnx:
   954             with mih.cnx:
   954                 if args:
   955                 with mih.cnx.security_enabled(False, False):
   955                     # use cmdline parser to access left/right attributes only
   956                     if args:
   956                     # remember that usage requires instance appid as first argument
   957                         # use cmdline parser to access left/right attributes only
   957                     scripts, args = self.cmdline_parser.largs[1:], self.cmdline_parser.rargs
   958                         # remember that usage requires instance appid as first argument
   958                     for script in scripts:
   959                         scripts, args = self.cmdline_parser.largs[1:], self.cmdline_parser.rargs
   959                             mih.cmd_process_script(script, scriptargs=args)
   960                         for script in scripts:
   960                             mih.commit()
   961                                 mih.cmd_process_script(script, scriptargs=args)
   961                 else:
   962                                 mih.commit()
   962                     mih.interactive_shell()
   963                     else:
       
   964                         mih.interactive_shell()
   963         finally:
   965         finally:
   964             shutdown_callback()
   966             shutdown_callback()
   965 
   967 
   966 
   968 
   967 class RecompileInstanceCatalogsCommand(InstanceCommand):
   969 class RecompileInstanceCatalogsCommand(InstanceCommand):