Skip to content

Commit 5a486e9

Browse files
committed
only load opts if salt is installed
1 parent ab39a7b commit 5a486e9

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

scripts/pepper

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,10 @@ logger.addHandler(NullHandler())
3333
class Pepper(object):
3434
def __init__(self):
3535
self.cli = PepperCli()
36-
self.opts = salt.config.client_config(self.cli.options.master)
36+
if HAS_SALT:
37+
self.opts = salt.config.client_config(self.cli.options.master)
38+
else:
39+
self.opts = {}
3740

3841
@property
3942
def output(self):
@@ -48,7 +51,7 @@ class Pepper(object):
4851
def __call__(self):
4952
try:
5053
for exit_code, result in self.cli.run():
51-
if HAS_SALT:
54+
if HAS_SALT and self.opts:
5255
logger.info('Use Salt outputters')
5356
for ret in json.loads(result)['return']:
5457
if isinstance(ret, dict):

0 commit comments

Comments
 (0)