Merge branch 'fix/20338-start-vm-at-reboot'

This commit is contained in:
Daniel Dehennin 2017-06-07 09:02:04 +02:00
commit 97b8edde6b
1 changed files with 3 additions and 5 deletions

View File

@ -181,7 +181,7 @@ begin
vm_pool = VirtualMachinePool.new(client, USERFLAG)
if File.exist?(RUNVMFILE)
running_vms = File.open(RUNVMFILE,'r')
running_vms = File.readlines(RUNVMFILE)
else
running_vms = []
end
@ -211,11 +211,9 @@ begin
when "suspend"
_do_suspend(vm, options[:wait])
when "resume"
force = FALSE
if running_vms.include?('vm.id')
force = TRUE
if running_vms.include?("#{vm.id}\n")
_do_resume(vm, options[:wait], TRUE)
end
_do_resume(vm, options[:wait], force)
else
puts("#{vm.name}\t#{vm.status}")
end