Apply suggestions from code review

more pythonic if/then/else on list

Co-authored-by: Pedro Algarvio <pedro@algarvio.me>
This commit is contained in:
jwyoungpm 2021-07-14 14:43:02 -05:00 committed by Megan Wilhite
parent 72bd29cdc8
commit 8006ca52bb

View file

@ -693,13 +693,13 @@ def wait_for_event(name, id_list, event_id="id", timeout=300, node="master"):
val_list = [id for id in id_list if id in val]
if len(val_list) == 0:
if not val_list:
log.trace(
"wait_for_event: Event identifier '%s' not in "
"id_list; skipping",
event_id,
)
elif len(val_list) > 0:
elif val_list:
minions_seen = ret["changes"].setdefault("minions_seen", [])
for found_val in val_list:
id_list.remove(found_val)