Skip to content

Commit

Permalink
Proposed test PR for Issue (#1412)
Browse files Browse the repository at this point in the history
  • Loading branch information
Fred-sun authored Jan 22, 2024
1 parent 7edd3e8 commit bbc7e03
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion plugins/modules/azure_rm_virtualmachine.py
Original file line number Diff line number Diff line change
Expand Up @@ -2299,7 +2299,12 @@ def get_vm(self):
time.sleep(150)
vm = self.compute_client.virtual_machines.get(self.resource_group, self.name, expand='instanceview')
else:
break
p_state = None
for s in vm.instance_view.statuses:
if s.code.startswith('PowerState'):
p_state = s.code
if p_state is not None:
break
return vm
except Exception as exc:
self.fail("Error getting virtual machine {0} - {1}".format(self.name, str(exc)))
Expand Down

0 comments on commit bbc7e03

Please sign in to comment.