Fix log level when verbosity option is not specified

remotes/origin/feature/shell-lib
Darko Poljak 5 years ago
parent 90d9326740
commit b657ba8221
  1. 1
      cdist/argparse.py
  2. 10
      cdist/preos/debootstrap/debootstrap.py

1
cdist/argparse.py vendored

@ -21,6 +21,7 @@ parser = None
_verbosity_level_off = -2
_verbosity_level = {
None: logging.WARNING,
_verbosity_level_off: logging.OFF,
-1: logging.ERROR,
0: logging.WARNING,

@ -173,11 +173,11 @@ class Debian(object):
env = vars(args)
new_env = {}
for key in env:
if key == 'verbose':
if env[key] >= 3:
new_env['debug'] = "yes"
elif env[key] == 2:
new_env['verbose'] = "yes"
if key == 'verbose' and env[key]:
if env[key] >= 3:
new_env['debug'] = "yes"
elif env[key] == 2:
new_env['verbose'] = "yes"
elif not env[key]:
new_env[key] = ''
elif isinstance(env[key], bool) and env[key]:

Loading…
Cancel
Save