Skip to content

Commit ab39a7b

Browse files
committed
handle runners and wheel clients that return as a dict without 'data'
1 parent 7496b75 commit ab39a7b

1 file changed

Lines changed: 13 additions & 7 deletions

File tree

scripts/pepper

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -52,13 +52,7 @@ class Pepper(object):
5252
logger.info('Use Salt outputters')
5353
for ret in json.loads(result)['return']:
5454
if isinstance(ret, dict):
55-
if 'data' in ret:
56-
salt.output.display_output(
57-
ret['data'],
58-
self.cli.options.output or ret.get('outputter', 'nested'),
59-
opts=self.opts
60-
)
61-
else:
55+
if self.cli.options.client == 'local':
6256
for minionid, minionret in ret.items():
6357
if isinstance(minionret, dict) and 'ret' in minionret:
6458
# version >= 2017.7
@@ -73,6 +67,18 @@ class Pepper(object):
7367
self.cli.options.output or self.output,
7468
opts=self.opts
7569
)
70+
elif 'data' in ret:
71+
salt.output.display_output(
72+
ret['data'],
73+
self.cli.options.output or ret.get('outputter', 'nested'),
74+
opts=self.opts
75+
)
76+
else:
77+
salt.output.display_output(
78+
{self.cli.options.client: ret},
79+
self.cli.options.output or ret.get('outputter', 'nested'),
80+
opts=self.opts
81+
)
7682
else:
7783
salt.output.display_output(
7884
{self.cli.options.client: ret},

0 commit comments

Comments
 (0)