diff options
| author | Pierre Riteau <pierre@stackhpc.com> | 2024-09-12 20:19:49 +0200 |
|---|---|---|
| committer | Pierre Riteau <pierre@stackhpc.com> | 2024-09-12 20:19:49 +0200 |
| commit | 540766203884ab072b65fd1d14eaa75e60696cab (patch) | |
| tree | c3dae95b4422710d5b49005e8c8947d5c2a533eb /ansible/library | |
| parent | 753a7e1a127d5f8a1118f07d19207d126ef758a5 (diff) | |
| download | kolla-ansible-540766203884ab072b65fd1d14eaa75e60696cab.tar.gz kolla-ansible-540766203884ab072b65fd1d14eaa75e60696cab.zip | |
Separate outputs of kolla_toolbox inner module
Inner modules called by the kolla_toolbox module were returning stdout
and stderr as a single output object. This could break JSON parsing if
any data was present in stderr, for example warnings such as:
[WARNING]: Collection ansible.posix does not support Ansible version 2.14.17
Fix by using demux=True to separate the two streams. The stderr content
is logged as it could be useful for troubleshooting or catching
deprecation notices.
Change-Id: Iad0476d4511f28c837794352c9a3e2f47113d9a1
Closes-Bug: #2080544
Diffstat (limited to 'ansible/library')
| -rw-r--r-- | ansible/library/kolla_toolbox.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/ansible/library/kolla_toolbox.py b/ansible/library/kolla_toolbox.py index b3bc82dc4..569b06052 100644 --- a/ansible/library/kolla_toolbox.py +++ b/ansible/library/kolla_toolbox.py @@ -162,7 +162,9 @@ def use_docker(module): "ANSIBLE_LOAD_CALLBACK_PLUGINS": "True"} job = client.exec_create(kolla_toolbox, command_line, environment=environment, **kwargs) - json_output = client.exec_start(job) + json_output, error = client.exec_start(job, demux=True) + if error: + module.log(msg='Inner module stderr: %s' % error) try: output = json.loads(json_output) |
