vmware_host: ensure idempotency with state=absent (#54608)
If a host is already missing, `self.host_update` is `None`. With this change,`state_exit_unchanged()` won't try anymore to access `self.host_update.runtime`.
This commit is contained in:
parent
656ca13f65
commit
bda0687d28
1 changed files with 3 additions and 1 deletions
|
@ -341,7 +341,9 @@ class VMwareHost(PyVmomi):
|
|||
|
||||
def state_exit_unchanged(self):
|
||||
"""Exit with status message"""
|
||||
if self.reconnect_disconnected and self.host_update.runtime.connectionState == 'disconnected':
|
||||
if not self.host_update:
|
||||
result = "Host already disconnected"
|
||||
elif self.reconnect_disconnected and self.host_update.runtime.connectionState == 'disconnected':
|
||||
self.state_reconnect_host()
|
||||
else:
|
||||
if self.folder_name:
|
||||
|
|
Loading…
Reference in a new issue