1
0
Fork 0
mirror of https://github.com/fog/fog.git synced 2022-11-09 13:51:43 -05:00

[vsphere] force poweroff of instance of vmware tools are not installed

This commit is contained in:
Ohad Levy 2012-03-26 15:07:26 +02:00 committed by Ohad Levy
parent 09d52dac8d
commit 0644377c60

View file

@ -53,7 +53,7 @@ module Fog
end
def stop(options = {})
options = { :force => false }.merge(options)
options = { :force => !tools_installed? }.merge(options)
requires :instance_uuid
connection.vm_power_off('instance_uuid' => instance_uuid, 'force' => options[:force])
end
@ -100,6 +100,14 @@ module Fog
new_vm
end
def ready?
power_state == "poweredOn"
end
def tools_installed?
tools_state != "toolsNotInstalled"
end
end
end