vs_port: Avoid detecting partial name

This ensures that a different port, which includes name of the port
being created, is ignored when checking whether the target already
exists.

Closes-Bug: #2043921
Change-Id: I4a8db4e7b0da87a00ef097c8e066a11bfc5fde90
This commit is contained in:
Takashi Kajinami
2023-11-19 20:33:38 +09:00
parent 35d4713eae
commit 5b42cda62f

View File

@@ -13,7 +13,7 @@ Puppet::Type.type(:vs_port).provide(:ovs) do
commands :vsctl => 'ovs-vsctl'
def exists?
vsctl('list-ports', @resource[:bridge]).include? @resource[:port]
vsctl('list-ports', @resource[:bridge]).split("\n").include? @resource[:port]
rescue Puppet::ExecutionFailure => e
return false
end