From d26396ce741c88aa2c6e471cfae73b95fd36e7a9 Mon Sep 17 00:00:00 2001 From: Alan Rominger Date: Mon, 18 Nov 2024 13:52:20 -0500 Subject: [PATCH] Fix error with CLI monitor of ad hoc output (#15642) --- awxkit/awxkit/cli/custom.py | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/awxkit/awxkit/cli/custom.py b/awxkit/awxkit/cli/custom.py index 909ea8caaae5..0bbaea3b59d2 100644 --- a/awxkit/awxkit/cli/custom.py +++ b/awxkit/awxkit/cli/custom.py @@ -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'):