diff -r 330f240435b0 -r 9dbb0af82628 cubicweb/server/serverctl.py --- a/cubicweb/server/serverctl.py Tue Feb 07 18:18:22 2017 +0100 +++ b/cubicweb/server/serverctl.py Mon Feb 06 15:40:39 2017 +0100 @@ -37,6 +37,7 @@ from cubicweb.toolsutils import Command, CommandHandler, underline_title from cubicweb.cwctl import CWCTL, check_options_consistency, ConfigureInstanceCommand from cubicweb.server import SOURCE_TYPES +from cubicweb.server import checkintegrity from cubicweb.server.serverconfig import ( USER_OPTIONS, ServerConfiguration, SourceConfiguration, ask_source_config, generate_source_config) @@ -902,12 +903,8 @@ options = ( ('checks', {'short': 'c', 'type': 'csv', 'metavar': '', - 'default': ('entities', 'relations', - 'mandatory_relations', 'mandatory_attributes', - 'metadata', 'schema', 'text_index'), - 'help': 'Comma separated list of check to run. By default run all \ -checks, i.e. entities, relations, mandatory_relations, mandatory_attributes, \ -metadata, text_index and schema.'} + 'default': sorted(checkintegrity._CHECKERS), + 'help': 'Comma separated list of check to run. By default run all checks.'} ), ('autofix', @@ -930,13 +927,12 @@ ) def run(self, args): - from cubicweb.server.checkintegrity import check appid = args[0] config = ServerConfiguration.config_for(appid) config.repairing = self.config.force repo, _cnx = repo_cnx(config) with repo.internal_cnx() as cnx: - check(repo, cnx, + checkintegrity.check(repo, cnx, self.config.checks, self.config.reindex, self.config.autofix) @@ -953,11 +949,10 @@ min_args = 1 def run(self, args): - from cubicweb.server.checkintegrity import check_indexes config = ServerConfiguration.config_for(args[0]) repo, cnx = repo_cnx(config) with cnx: - status = check_indexes(cnx) + status = checkintegrity.check_indexes(cnx) sys.exit(status)