Browse Source

Add guard to ensure a mapping has a valid key

This change will ensure our list comprehension doesn't
fault when attempting to perform a "containers" lookup
against a given resultant. While the result object
should always have a "containers" we've seen intermitent
failures in CI pointing at this being an issue.

Change-Id: I8f22888ba473c78dd56988546ae402ca41c8b89f
Closes-Bug: #1886636
Signed-off-by: Kevin Carter <kecarter@redhat.com>
(cherry picked from commit a446dd4fce)
changes/30/751630/1
Kevin Carter 1 week ago
committed by Emilien Macchi
parent
commit
00fae36bcb
1 changed files with 1 additions and 1 deletions
  1. +1
    -1
      tripleo_ansible/ansible_plugins/action/container_status.py

+ 1
- 1
tripleo_ansible/ansible_plugins/action/container_status.py View File

@@ -206,7 +206,7 @@ class ActionModule(ActionBase):
module_args=dict(name=containers),
task_vars=tvars
)
return [c for c in result["containers"]]
return [c for c in result["containers"] if "containers" in result]

@tenacity.retry(
reraise=True,


Loading…
Cancel
Save