From c6d50954ef54d3caaba60ad2764e2d817f76ff71 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pavel=20Czern=C3=BD?= Date: Thu, 26 Oct 2023 10:45:30 +0200 Subject: [PATCH] B #6367: Fix onevnet update for empty attributes (#2787) --- src/vnm/VirtualNetwork.cc | 3 ++- src/vnm_mad/remotes/lib/no_vlan.rb | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/vnm/VirtualNetwork.cc b/src/vnm/VirtualNetwork.cc index f5d76b77db..1c66fa04a0 100644 --- a/src/vnm/VirtualNetwork.cc +++ b/src/vnm/VirtualNetwork.cc @@ -514,7 +514,8 @@ void VirtualNetwork::set_updated_attributes(Template* new_tmpl, bool removed) string new_value; if ( UPDATE_ATTRIBUTES.count(sa->name()) == 1 - && !new_tmpl->get(sa->name(), new_value) ) + && !new_tmpl->get(sa->name(), new_value) + && !sa->value().empty()) { update_attr->replace(sa->name(), sa->value()); } diff --git a/src/vnm_mad/remotes/lib/no_vlan.rb b/src/vnm_mad/remotes/lib/no_vlan.rb index 19a045bea5..e2393e2e63 100644 --- a/src/vnm_mad/remotes/lib/no_vlan.rb +++ b/src/vnm_mad/remotes/lib/no_vlan.rb @@ -114,7 +114,7 @@ module VNMMAD begin changes = @vm.changes.select {|k, _| SUPPORTED_UPDATE.include?(k) } - return 0 if changes[:phydev].nil? + return 0 if changes[:phydev].nil? || changes[:phydev].empty? @bridges = list_bridges