From e9d32a0c1f98296c5869d963d263bce90321a2f0 Mon Sep 17 00:00:00 2001 From: Daniel Clavijo Coca Date: Thu, 2 Sep 2021 10:45:07 -0500 Subject: [PATCH] B OpenNebula/one#5521: Fix lxd reboot arguments (#1424) (cherry picked from commit 9efe7cdd2ce507197528d851d66634bcca996a83) --- src/vmm_mad/exec/one_vmm_exec.rb | 4 ++-- src/vnm_mad/remotes/lib/nic.rb | 6 ++++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/vmm_mad/exec/one_vmm_exec.rb b/src/vmm_mad/exec/one_vmm_exec.rb index acdbee23b9..e40a1f784b 100755 --- a/src/vmm_mad/exec/one_vmm_exec.rb +++ b/src/vmm_mad/exec/one_vmm_exec.rb @@ -1325,12 +1325,12 @@ class ExecDriver < VirtualMachineDriver { :driver => :vnm, :action => :post, - :parameters => [:deploy_info, :host], + :parameters => [:deploy_id, :host], :fail_actions => [ { :driver => :vmm, :action => :cancel, - :parameters => [:deploy_info, :host] + :parameters => [:deploy_id, :host] } ] } diff --git a/src/vnm_mad/remotes/lib/nic.rb b/src/vnm_mad/remotes/lib/nic.rb index 3d41bfd5de..1af36f43bf 100644 --- a/src/vnm_mad/remotes/lib/nic.rb +++ b/src/vnm_mad/remotes/lib/nic.rb @@ -118,10 +118,12 @@ module VNMMAD deploy_id = vm['DEPLOY_ID'] end - return if !deploy_id || !vm.vm_info[:dumpxml].nil? + return if !deploy_id || !vm.vm_info[:dumpxml].nil? || deploy_id.empty? cmd = "#{@lxc_cmd} config show #{deploy_id}" - config, _e, _s = Open3.capture3(cmd) + config, _e, s = Open3.capture3(cmd) + + return unless s.exitstatus.zero? vm.vm_info[:dumpxml] = YAML.safe_load(config)