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`.
pull/55019/head
Gonéri Le Bouder 6 years ago committed by ansibot
parent 656ca13f65
commit bda0687d28

@ -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…
Cancel
Save