server/serverctl.py
changeset 2473 490f88fb99b6
parent 2461 1f38b65cbd20
child 2476 1294a6bdf3bf
equal deleted inserted replaced
2472:a459a6ab78d0 2473:490f88fb99b6
   690          {'short': 'r', 'type' : "yn", 'metavar' : '<yes or no>',
   690          {'short': 'r', 'type' : "yn", 'metavar' : '<yes or no>',
   691           'default' : False,
   691           'default' : False,
   692           'help': 're-indexes the database for full text search if this \
   692           'help': 're-indexes the database for full text search if this \
   693 option is set to "y" or "yes" (may be long for large database).'}
   693 option is set to "y" or "yes" (may be long for large database).'}
   694          ),
   694          ),
       
   695         ("force",
       
   696          {'short': 'f', 'action' : "store_true",
       
   697           'default' : False,
       
   698           'help': 'don\'t check instance is up to date.'}
       
   699          ),
   695 
   700 
   696         )
   701         )
   697 
   702 
   698     def run(self, args):
   703     def run(self, args):
   699         from cubicweb.server.checkintegrity import check
   704         from cubicweb.server.checkintegrity import check
   700         appid = pop_arg(args, 1, msg="No application specified !")
   705         appid = pop_arg(args, 1, msg="No application specified !")
   701         config = ServerConfiguration.config_for(appid)
   706         config = ServerConfiguration.config_for(appid)
       
   707         config.repairing = self.config.force
   702         repo, cnx = repo_cnx(config)
   708         repo, cnx = repo_cnx(config)
   703         check(repo, cnx,
   709         check(repo, cnx,
   704               self.config.checks, self.config.reindex, self.config.autofix)
   710               self.config.checks, self.config.reindex, self.config.autofix)
   705 
   711 
   706 
   712