From 5a486e90f167ffaa22b0db6913a92f91f790dbfb Mon Sep 17 00:00:00 2001 From: Daniel Wallace Date: Thu, 17 May 2018 10:12:57 -0500 Subject: [PATCH] only load opts if salt is installed --- scripts/pepper | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/scripts/pepper b/scripts/pepper index 9d9c137..0e69e31 100755 --- a/scripts/pepper +++ b/scripts/pepper @@ -33,7 +33,10 @@ logger.addHandler(NullHandler()) class Pepper(object): def __init__(self): self.cli = PepperCli() - self.opts = salt.config.client_config(self.cli.options.master) + if HAS_SALT: + self.opts = salt.config.client_config(self.cli.options.master) + else: + self.opts = {} @property def output(self): @@ -48,7 +51,7 @@ class Pepper(object): def __call__(self): try: for exit_code, result in self.cli.run(): - if HAS_SALT: + if HAS_SALT and self.opts: logger.info('Use Salt outputters') for ret in json.loads(result)['return']: if isinstance(ret, dict):