Skip to content

Commit

Permalink
Fix error with CLI monitor of ad hoc output (#15642)
Browse files Browse the repository at this point in the history
  • Loading branch information
AlanCoding authored Nov 18, 2024
1 parent 3dbcfb1 commit d26396c
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions awxkit/awxkit/cli/custom.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,13 +72,11 @@ def add_arguments(self, parser, resource_options_parser, with_pk=True):
def monitor(self, response, **kwargs):
mon = monitor_workflow if response.type == 'workflow_job' else monitor
if kwargs.get('monitor') or kwargs.get('wait'):
status = mon(
response,
self.page.connection.session,
print_stdout=not kwargs.get('wait'),
action_timeout=kwargs.get('action_timeout'),
interval=kwargs.get('interval'),
)
monitor_kwargs = {'print_stdout': bool(not kwargs.get('wait'))}
for key in ('action_timeout', 'interval'):
if key in kwargs:
monitor_kwargs[key] = kwargs[key]
status = mon(response, self.page.connection.session, **monitor_kwargs)
if status:
response.json['status'] = status
if status in ('failed', 'error'):
Expand Down

0 comments on commit d26396c

Please sign in to comment.