From 06edead66ca60c8f41939bc7b1aba9ebc95c0aed Mon Sep 17 00:00:00 2001 From: "Ruben S. Montero" Date: Wed, 22 Nov 2023 11:57:55 +0100 Subject: [PATCH] B #-: Check vm_info is included in flow metadata Under certain conditions flow maybe missing VM information. This patch captures the execption and ignores the processing of the role. --- .../vnf/one-vnf/lib/appliance/plugin/haproxy.rb | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/appliances/lib/artifacts/vnf/one-vnf/lib/appliance/plugin/haproxy.rb b/appliances/lib/artifacts/vnf/one-vnf/lib/appliance/plugin/haproxy.rb index 3c62f43..9199cfb 100644 --- a/appliances/lib/artifacts/vnf/one-vnf/lib/appliance/plugin/haproxy.rb +++ b/appliances/lib/artifacts/vnf/one-vnf/lib/appliance/plugin/haproxy.rb @@ -543,8 +543,13 @@ def refresh_dynamic_backend_servers(lbs, static_backend_servers, dynamic_backend found_roles = oneflow_service['SERVICE']['roles'] found_roles.each do |role| role['nodes'].each do |node| - _vmid = node['vm_info']['VM']['ID'] - found_vms.append(_vmid.to_i) if !_vmid.to_s.strip.empty? + vmid = begin + node['vm_info']['VM']['ID'] + rescue StandardError + '' + end + + found_vms.append(vmid.to_i) unless vmid.to_s.strip.empty? end end