forked from ungleich-public/cdist
Finally remove deprecated -d/--debug option.
This commit is contained in:
parent
015861e63b
commit
cef1d215b2
3 changed files with 9 additions and 28 deletions
|
@ -18,7 +18,6 @@ parser = None
|
||||||
|
|
||||||
|
|
||||||
_verbosity_level_off = -2
|
_verbosity_level_off = -2
|
||||||
_verbosity_level_debug = 3
|
|
||||||
_verbosity_level = {
|
_verbosity_level = {
|
||||||
_verbosity_level_off: logging.OFF,
|
_verbosity_level_off: logging.OFF,
|
||||||
-1: logging.ERROR,
|
-1: logging.ERROR,
|
||||||
|
@ -86,10 +85,6 @@ def get_parsers():
|
||||||
parser = {}
|
parser = {}
|
||||||
# Options _all_ parsers have in common
|
# Options _all_ parsers have in common
|
||||||
parser['loglevel'] = argparse.ArgumentParser(add_help=False)
|
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(
|
parser['loglevel'].add_argument(
|
||||||
'-q', '--quiet',
|
'-q', '--quiet',
|
||||||
help='Quiet mode: disables logging, including WARNING and ERROR',
|
help='Quiet mode: disables logging, including WARNING and ERROR',
|
||||||
|
@ -223,15 +218,7 @@ def get_parsers():
|
||||||
|
|
||||||
|
|
||||||
def handle_loglevel(args):
|
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:
|
if args.quiet:
|
||||||
args.verbose = _verbosity_level_off
|
args.verbose = _verbosity_level_off
|
||||||
|
|
||||||
logging.root.setLevel(_verbosity_level[args.verbose])
|
logging.root.setLevel(_verbosity_level[args.verbose])
|
||||||
|
|
||||||
return retval
|
|
||||||
|
|
|
@ -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]
|
[-i MANIFEST] [-j [JOBS]] [-n] [-o OUT_PATH]
|
||||||
[--remote-copy REMOTE_COPY] [--remote-exec REMOTE_EXEC]
|
[--remote-copy REMOTE_COPY] [--remote-exec REMOTE_EXEC]
|
||||||
[-f HOSTFILE] [-p] [-r REMOTE_OUT_PATH] [-s]
|
[-f HOSTFILE] [-p] [-r REMOTE_OUT_PATH] [-s]
|
||||||
[host [host ...]]
|
[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]
|
[-i MANIFEST] [-j [JOBS]] [-n] [-o OUT_PATH]
|
||||||
[--remote-copy REMOTE_COPY] [--remote-exec REMOTE_EXEC]
|
[--remote-copy REMOTE_COPY] [--remote-exec REMOTE_EXEC]
|
||||||
[-f HOSTFILE] [-p] [-r REMOTE_OUT_PATH] [-s]
|
[-f HOSTFILE] [-p] [-r REMOTE_OUT_PATH] [-s]
|
||||||
[host [host ...]]
|
[host [host ...]]
|
||||||
|
|
||||||
cdist shell [-h] [-d] [-v] [-s SHELL]
|
cdist shell [-h] [-v] [-s SHELL]
|
||||||
|
|
||||||
|
|
||||||
DESCRIPTION
|
DESCRIPTION
|
||||||
|
@ -46,10 +46,6 @@ All commands accept the following options:
|
||||||
|
|
||||||
Show the help screen
|
Show the help screen
|
||||||
|
|
||||||
.. option:: -d, --debug
|
|
||||||
|
|
||||||
Set log level to debug (deprecated, use -vvv instead)
|
|
||||||
|
|
||||||
.. option:: -q, --quiet
|
.. option:: -q, --quiet
|
||||||
|
|
||||||
Quiet mode: disables logging, including WARNING and ERROR
|
Quiet mode: disables logging, including WARNING and ERROR
|
||||||
|
@ -211,7 +207,7 @@ EXAMPLES
|
||||||
.. code-block:: sh
|
.. code-block:: sh
|
||||||
|
|
||||||
# Configure ikq05.ethz.ch with debug enabled
|
# 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
|
# Configure hosts in parallel and use a different configuration directory
|
||||||
% cdist config -c ~/p/cdist-nutzung \
|
% cdist config -c ~/p/cdist-nutzung \
|
||||||
|
@ -245,7 +241,7 @@ EXAMPLES
|
||||||
[--group GROUP] [--owner OWNER] [--mode MODE] object_id
|
[--group GROUP] [--owner OWNER] [--mode MODE] object_id
|
||||||
|
|
||||||
# Install ikq05.ethz.ch with debug enabled
|
# Install ikq05.ethz.ch with debug enabled
|
||||||
% cdist install -d ikq05.ethz.ch
|
% cdist install -vvv ikq05.ethz.ch
|
||||||
|
|
||||||
ENVIRONMENT
|
ENVIRONMENT
|
||||||
-----------
|
-----------
|
||||||
|
|
|
@ -40,12 +40,10 @@ def commandline():
|
||||||
args = parser['main'].parse_args(sys.argv[1:])
|
args = parser['main'].parse_args(sys.argv[1:])
|
||||||
|
|
||||||
# Loglevels are handled globally in here
|
# Loglevels are handled globally in here
|
||||||
retval = cdist.argparse.handle_loglevel(args)
|
cdist.argparse.handle_loglevel(args)
|
||||||
if retval:
|
|
||||||
log.warning(retval)
|
|
||||||
|
|
||||||
log.trace(args)
|
|
||||||
log.info("version %s" % cdist.VERSION)
|
log.info("version %s" % cdist.VERSION)
|
||||||
|
log.trace(args)
|
||||||
|
|
||||||
# Work around python 3.3 bug:
|
# Work around python 3.3 bug:
|
||||||
# http://bugs.python.org/issue16308
|
# http://bugs.python.org/issue16308
|
||||||
|
|
Loading…
Reference in a new issue