cwctl.py
branchstable
changeset 3707 78596919ede3
parent 3700 fd550e4dc515
child 3709 e67ade20bf80
equal deleted inserted replaced
3706:f804bbd0670e 3707:78596919ede3
   739         )
   739         )
   740 
   740 
   741     def run(self, args):
   741     def run(self, args):
   742         appid = pop_arg(args, 99, msg="No instance specified !")
   742         appid = pop_arg(args, 99, msg="No instance specified !")
   743         if self.config.pyro:
   743         if self.config.pyro:
       
   744             from cubicweb import AuthenticationError
   744             from cubicweb.dbapi import connect
   745             from cubicweb.dbapi import connect
   745             from cubicweb.server.utils import manager_userpasswd
   746             from cubicweb.server.utils import manager_userpasswd
   746             from cubicweb.server.migractions import ServerMigrationHelper
   747             from cubicweb.server.migractions import ServerMigrationHelper
   747             login, pwd = manager_userpasswd(msg=None)
   748             while True:
   748             cnx = connect(appid, login=login, password=pwd,
   749                 try:
   749                           host=self.config.pyro_ns_host, mulcnx=False)
   750                     login, pwd = manager_userpasswd(msg=None)
       
   751                     cnx = connect(appid, login=login, password=pwd,
       
   752                                   host=self.config.pyro_ns_host, mulcnx=False)
       
   753                 except AuthenticationError, ex:
       
   754                     print ex
       
   755                 except (KeyboardInterrupt, EOFError):
       
   756                     print
       
   757                     sys.exit(0)
       
   758                 else:
       
   759                     break
       
   760             cnx.load_appobjects()
   750             repo = cnx._repo
   761             repo = cnx._repo
   751             mih = ServerMigrationHelper(None, repo=repo, cnx=cnx,
   762             mih = ServerMigrationHelper(None, repo=repo, cnx=cnx,
   752                                          # hack so it don't try to load fs schema
   763                                          # hack so it don't try to load fs schema
   753                                         schema=1)
   764                                         schema=1)
   754         else:
   765         else: