This commit is contained in:
Darko Poljak 2017-09-07 16:37:49 +02:00
parent 57f15f9cce
commit f08ac264a0
3 changed files with 6 additions and 3 deletions

View file

@ -418,7 +418,8 @@ def parse_and_configure(argv, singleton=True):
parser = get_parsers()
parser_args = parser['main'].parse_args(argv)
try:
cfg = cdist.configuration.Configuration(parser_args, singleton=singleton)
cfg = cdist.configuration.Configuration(parser_args,
singleton=singleton)
args = cfg.get_args()
except ValueError as e:
raise cdist.Error(str(e))

View file

@ -114,7 +114,8 @@ class Manifest(object):
}
self.env.update(
{'__cdist_loglevel': logging.getLevelName(self.log.getEffectiveLevel())})
{'__cdist_loglevel': logging.getLevelName(
self.log.getEffectiveLevel())})
def _open_logger(self):
self.log = logging.getLogger(self.target_host[0])

View file

@ -378,7 +378,8 @@ class ConfigurationTestCase(test.CdistTestCase):
# bypass singleton so we can test further
cc.Configuration.instance = None
configuration = cc.Configuration(args, env=env, config_files=('cdist.cfg'))
configuration = cc.Configuration(args, env=env,
config_files=('cdist.cfg'))
self.assertIsNotNone(configuration.args)
self.assertIsNotNone(configuration.env)
self.assertIsNotNone(configuration.config_files)