Skip to content

Commit

Permalink
Black formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
gravesm committed Nov 8, 2021
1 parent 9624de0 commit b5c03f0
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions plugins/module_utils/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -361,13 +361,20 @@ def _elapsed():
return (datetime.now() - start).seconds

def result_empty(result):
return result is None or result.kind.endswith("List") and not result.get("items")
return (
result is None
or result.kind.endswith("List")
and not result.get("items")
)

while result_empty(result) and _elapsed() < wait_timeout:
try:
result = resource.get(name=name, namespace=namespace,
label_selector=','.join(label_selectors),
field_selector=','.join(field_selectors))
result = resource.get(
name=name,
namespace=namespace,
label_selector=",".join(label_selectors),
field_selector=",".join(field_selectors),
)
except NotFoundError:
pass
if not result_empty(result):
Expand Down

0 comments on commit b5c03f0

Please sign in to comment.