diff --git a/lib/puppet/provider/vs_bridge/ovs.rb b/lib/puppet/provider/vs_bridge/ovs.rb index 4665af92..223f1760 100644 --- a/lib/puppet/provider/vs_bridge/ovs.rb +++ b/lib/puppet/provider/vs_bridge/ovs.rb @@ -47,9 +47,13 @@ Puppet::Type.type(:vs_bridge).provide(:ovs) do old_ids = _split(get_external_ids(br)) new_ids = _split(value) - new_ids.each_pair do |k,v| - unless old_ids.has_key?(k) - vsctl('br-set-external-id', br, k, v) + new_ids.each do |k,v| + vsctl('br-set-external-id', br, k, v) + end + + old_ids.each do |k, v| + if ! new_ids.has_key?(k) + vsctl('br-set-external-id', br, k) end end end diff --git a/releasenotes/notes/bug-2043916-069f122907b13bc8.yaml b/releasenotes/notes/bug-2043916-069f122907b13bc8.yaml new file mode 100644 index 00000000..b207b8ff --- /dev/null +++ b/releasenotes/notes/bug-2043916-069f122907b13bc8.yaml @@ -0,0 +1,5 @@ +--- +fixes: + - | + The ``vs_bridge`` resource now updates existing keys when external ids are + set. Also, the keys not included by the given extenral ids are removed.