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
)
This commit is contained in:
parent
902c3c8cc0
commit
c3eb9ec9c9
@ -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…
Reference in New Issue
Block a user