Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
LiliDeng committed Sep 19, 2024
1 parent a5ef096 commit 3b7ac8b
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
16 changes: 15 additions & 1 deletion lisa/sut_orchestrator/azure/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -1562,7 +1562,10 @@ def get_environment_context(environment: Environment) -> EnvironmentContext:


def wait_operation(
operation: Any, time_out: int = sys.maxsize, failure_identity: str = ""
operation: Any,
time_out: int = sys.maxsize,
failure_identity: str = "",
wait_on_updating: bool = False,
) -> Any:
timer = create_timer()
wait_result: Any = None
Expand All @@ -1572,7 +1575,18 @@ def wait_operation(
failure_identity = "Azure operation failed:"
while time_out > timer.elapsed(False):
check_cancelled()

if operation.done():
result = operation.result()
if result:
result = result.as_dict()
provisioning_state = result.get("provisioning_state", " ")
if wait_on_updating:
if provisioning_state == "Updating":
print("Provisioning state is 'Updating', continuing to wait...")
continue
else:
print(f"Provisioning state is '{provisioning_state}', continuing to wait...")
break
wait_result = operation.wait(1)
if wait_result:
Expand Down
2 changes: 1 addition & 1 deletion lisa/sut_orchestrator/azure/features.py
Original file line number Diff line number Diff line change
Expand Up @@ -2859,7 +2859,7 @@ def create_or_update(
vm_extension_name=name,
extension_parameters=extension_parameters,
)
result = wait_operation(operation, timeout)
result = wait_operation(operation, timeout, wait_on_updating=True)

return result

Expand Down

0 comments on commit 3b7ac8b

Please sign in to comment.