Clean up run_checks a bit.
This commit is contained in:
parent
e639cdb117
commit
ef83374fd3
@ -276,22 +276,26 @@ def _checker_enabled(args, group, name):
|
|||||||
return name in args.checkers.split(',')
|
return name in args.checkers.split(',')
|
||||||
|
|
||||||
|
|
||||||
|
def _parse_args():
|
||||||
|
"""Parse commandline args via argparse."""
|
||||||
|
parser = argparse.ArgumentParser(description='Run various checkers.')
|
||||||
|
parser.add_argument('-s', '--setup', help="Run additional setup checks",
|
||||||
|
action='store_true')
|
||||||
|
parser.add_argument('checkers', help="Checkers to run (or 'all')",
|
||||||
|
default='all', nargs='?')
|
||||||
|
return parser.parse_args()
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
"""Main entry point."""
|
"""Main entry point."""
|
||||||
global config
|
|
||||||
utils.change_cwd()
|
utils.change_cwd()
|
||||||
read_files = config.read('.run_checks')
|
read_files = config.read('.run_checks')
|
||||||
if not read_files:
|
if not read_files:
|
||||||
raise IOError("Could not read config!")
|
raise IOError("Could not read config!")
|
||||||
exit_status = collections.OrderedDict()
|
exit_status = collections.OrderedDict()
|
||||||
exit_status_bool = {}
|
exit_status_bool = {}
|
||||||
parser = argparse.ArgumentParser(description='Run various checkers.')
|
|
||||||
parser.add_argument('-s', '--setup', help="Run additional setup checks",
|
|
||||||
action='store_true')
|
|
||||||
parser.add_argument('checkers', help="Checkers to run (or 'all')",
|
|
||||||
default='all', nargs='?')
|
|
||||||
args = parser.parse_args()
|
|
||||||
|
|
||||||
|
args = _parse_args()
|
||||||
checkers = _get_checkers()
|
checkers = _get_checkers()
|
||||||
|
|
||||||
groups = ['global']
|
groups = ['global']
|
||||||
|
Loading…
Reference in New Issue
Block a user