From 43d0796dc2d7ba1706ac64fbe01af351ea349899 Mon Sep 17 00:00:00 2001 From: "Ruben S. Montero" Date: Mon, 5 Apr 2021 13:21:40 +0200 Subject: [PATCH] B #-: Fix bug accesing xpath_filter --- src/vnm_mad/remotes/lib/vm.rb | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/vnm_mad/remotes/lib/vm.rb b/src/vnm_mad/remotes/lib/vm.rb index e3051bddd3..c04cc60752 100644 --- a/src/vnm_mad/remotes/lib/vm.rb +++ b/src/vnm_mad/remotes/lib/vm.rb @@ -56,8 +56,13 @@ module VNMMAD @nics = nics nics_alias = VNMNetwork::Nics.new(hypervisor) - xpath_alias = xpath_filter.gsub('TEMPLATE/NIC', - 'TEMPLATE/NIC_ALIAS') + + if xpath_filter.nil? + xpath_alias = nil + else + xpath_alias = xpath_filter.gsub('TEMPLATE/NIC', + 'TEMPLATE/NIC_ALIAS') + end @vm_root.elements.each(xpath_alias) do |nic_element| nic = nics_alias.new_nic