Merge branch 'fix/20338-start-vm-at-reboot'
This commit is contained in:
commit
97b8edde6b
|
@ -181,7 +181,7 @@ begin
|
||||||
vm_pool = VirtualMachinePool.new(client, USERFLAG)
|
vm_pool = VirtualMachinePool.new(client, USERFLAG)
|
||||||
|
|
||||||
if File.exist?(RUNVMFILE)
|
if File.exist?(RUNVMFILE)
|
||||||
running_vms = File.open(RUNVMFILE,'r')
|
running_vms = File.readlines(RUNVMFILE)
|
||||||
else
|
else
|
||||||
running_vms = []
|
running_vms = []
|
||||||
end
|
end
|
||||||
|
@ -211,11 +211,9 @@ begin
|
||||||
when "suspend"
|
when "suspend"
|
||||||
_do_suspend(vm, options[:wait])
|
_do_suspend(vm, options[:wait])
|
||||||
when "resume"
|
when "resume"
|
||||||
force = FALSE
|
if running_vms.include?("#{vm.id}\n")
|
||||||
if running_vms.include?('vm.id')
|
_do_resume(vm, options[:wait], TRUE)
|
||||||
force = TRUE
|
|
||||||
end
|
end
|
||||||
_do_resume(vm, options[:wait], force)
|
|
||||||
else
|
else
|
||||||
puts("#{vm.name}\t#{vm.status}")
|
puts("#{vm.name}\t#{vm.status}")
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue