Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 20 additions & 2 deletions plugins/module_utils/soap.py
Original file line number Diff line number Diff line change
Expand Up @@ -229,8 +229,26 @@ def update_system(self, soft_timeout=None, force=None):
)

if self.wait:
# TODO: how to wait?
pass
# Check every poll_interval seconds until update list is empty = update complete
for _i in range(0, self.wait_timeout, self.poll_interval):
time.sleep(self.poll_interval)
try:
update_list = self.client.GetSystemUpdateList()

# Empty update list means the update is complete
if not update_list or len(update_list) == 0:
return

# YELLOW state = status of the update (different than instance status)
instances = [dict(i) for i in update_list[0]]
if all(i['dispstatus'] != YELLOW for i in instances):
return

except Exception:
# Some API errors can occur during transitions - just continue waiting
pass

raise Exception(f"Timeout waiting for system update after {self.wait_timeout} seconds")

def start_system(self, instance):
self.client.StartSystem(
Expand Down