From cef1d215b265ff4f9cba1406d6ad08062387c02c Mon Sep 17 00:00:00 2001 From: Darko Poljak Date: Fri, 30 Jun 2017 09:08:22 +0200 Subject: [PATCH] Finally remove deprecated -d/--debug option. --- cdist/argparse.py | 13 ------------- docs/src/man1/cdist.rst | 18 +++++++----------- scripts/cdist | 6 ++---- 3 files changed, 9 insertions(+), 28 deletions(-) diff --git a/cdist/argparse.py b/cdist/argparse.py index 8689be79..8208d1f0 100644 --- a/cdist/argparse.py +++ b/cdist/argparse.py @@ -18,7 +18,6 @@ parser = None _verbosity_level_off = -2 -_verbosity_level_debug = 3 _verbosity_level = { _verbosity_level_off: logging.OFF, -1: logging.ERROR, @@ -86,10 +85,6 @@ def get_parsers(): parser = {} # Options _all_ parsers have in common parser['loglevel'] = argparse.ArgumentParser(add_help=False) - parser['loglevel'].add_argument( - '-d', '--debug', - help=('Set log level to debug (deprecated, use -vvv instead)'), - action='store_true', default=False) parser['loglevel'].add_argument( '-q', '--quiet', help='Quiet mode: disables logging, including WARNING and ERROR', @@ -223,15 +218,7 @@ def get_parsers(): def handle_loglevel(args): - if args.debug: - retval = "-d/--debug is deprecated, use -vvv instead" - args.verbose = _verbosity_level_debug - else: - retval = None - if args.quiet: args.verbose = _verbosity_level_off logging.root.setLevel(_verbosity_level[args.verbose]) - - return retval diff --git a/docs/src/man1/cdist.rst b/docs/src/man1/cdist.rst index dbfda34f..edcad828 100644 --- a/docs/src/man1/cdist.rst +++ b/docs/src/man1/cdist.rst @@ -11,23 +11,23 @@ SYNOPSIS :: - cdist [-h] [-d] [-v] [-V] {banner,config,shell,install} ... + cdist [-h] [-v] [-V] {banner,config,shell,install} ... - cdist banner [-h] [-d] [-v] + cdist banner [-h] [-v] - cdist config [-h] [-d] [-v] [-b] [-C CACHE_PATH_PATTERN] [-c CONF_DIR] + cdist config [-h] [-v] [-b] [-C CACHE_PATH_PATTERN] [-c CONF_DIR] [-i MANIFEST] [-j [JOBS]] [-n] [-o OUT_PATH] [--remote-copy REMOTE_COPY] [--remote-exec REMOTE_EXEC] [-f HOSTFILE] [-p] [-r REMOTE_OUT_PATH] [-s] [host [host ...]] - cdist install [-h] [-d] [-v] [-b] [-C CACHE_PATH_PATTERN] [-c CONF_DIR] + cdist install [-h] [-v] [-b] [-C CACHE_PATH_PATTERN] [-c CONF_DIR] [-i MANIFEST] [-j [JOBS]] [-n] [-o OUT_PATH] [--remote-copy REMOTE_COPY] [--remote-exec REMOTE_EXEC] [-f HOSTFILE] [-p] [-r REMOTE_OUT_PATH] [-s] [host [host ...]] - cdist shell [-h] [-d] [-v] [-s SHELL] + cdist shell [-h] [-v] [-s SHELL] DESCRIPTION @@ -46,10 +46,6 @@ All commands accept the following options: Show the help screen -.. option:: -d, --debug - - Set log level to debug (deprecated, use -vvv instead) - .. option:: -q, --quiet Quiet mode: disables logging, including WARNING and ERROR @@ -211,7 +207,7 @@ EXAMPLES .. code-block:: sh # Configure ikq05.ethz.ch with debug enabled - % cdist config -d ikq05.ethz.ch + % cdist config -vvv ikq05.ethz.ch # Configure hosts in parallel and use a different configuration directory % cdist config -c ~/p/cdist-nutzung \ @@ -245,7 +241,7 @@ EXAMPLES [--group GROUP] [--owner OWNER] [--mode MODE] object_id # Install ikq05.ethz.ch with debug enabled - % cdist install -d ikq05.ethz.ch + % cdist install -vvv ikq05.ethz.ch ENVIRONMENT ----------- diff --git a/scripts/cdist b/scripts/cdist index 605c5a6c..b55091f9 100755 --- a/scripts/cdist +++ b/scripts/cdist @@ -40,12 +40,10 @@ def commandline(): args = parser['main'].parse_args(sys.argv[1:]) # Loglevels are handled globally in here - retval = cdist.argparse.handle_loglevel(args) - if retval: - log.warning(retval) + cdist.argparse.handle_loglevel(args) - log.trace(args) log.info("version %s" % cdist.VERSION) + log.trace(args) # Work around python 3.3 bug: # http://bugs.python.org/issue16308