Ensure nova_manage detects existing networks
Previously, there was a bug in the exists? method of the nova_network provider where it could not detect if a network already existed. This is b/c it appended an extra /\d\d on the network id. This commit corrects the logic so that existing networks can be correctly detected.
This commit is contained in:
parent
bcca7bedc4
commit
bfd1fa5da8
|
@ -6,7 +6,10 @@ Puppet::Type.type(:nova_network).provide(:nova_manage) do
|
|||
|
||||
def exists?
|
||||
begin
|
||||
nova_manage("network", "list").match(/^#{resource[:network]}\/[0-9]{1,2} /)
|
||||
network_list = nova_manage("network", "list")
|
||||
return network_list.split("\n")[1..-1].detect do |n|
|
||||
n =~ /^(\S+)\s+(#{resource[:network]})/
|
||||
end
|
||||
rescue
|
||||
return false
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue