Fixing critical bug to remove only the specified Host instead of the entire Host cluster (#32642)

This commit is contained in:
Nitin Madhok 2016-04-18 10:47:27 -04:00 committed by Mike Place
parent 9942ea9319
commit 97b0e360b0

View File

@ -3574,12 +3574,12 @@ def remove_host(kwargs=None, call=None):
)
try:
if isinstance(host_ref.parent, vim.ComputeResource):
# This is a standalone host system
task = host_ref.parent.Destroy_Task()
else:
if isinstance(host_ref.parent, vim.ClusterComputeResource):
# This is a host system that is part of a Cluster
task = host_ref.Destroy_Task()
else:
# This is a standalone host system
task = host_ref.parent.Destroy_Task()
salt.utils.vmware.wait_for_task(task, host_name, 'remove host', log_level='info')
except Exception as exc:
log.error(