1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-01-10 01:17:40 +03:00

Merge pull request #156 from n40lab/master

Fix B#4928 import vcenter networks with same name in different clusters
This commit is contained in:
Tino Vázquez 2016-11-18 18:36:14 +01:00 committed by GitHub
commit d4f21fcbcf

View File

@ -517,21 +517,24 @@ class VIClient
next if !n[:host][0]
# Networks can be in several cluster, create one per cluster
Array(n[:host][0]).each{ |host_system|
net_names = []
Array(n[:host]).each{ |host_system|
net_name = "#{n.name} - #{host_system.parent.name}"
if !vnpool["VNET[BRIDGE=\"#{n[:name]}\"]/\
TEMPLATE[VCENTER_TYPE=\"Port Group\"]"]
one_nets << {
:name => net_name,
:bridge => n.name,
:cluster => host_system.parent.name,
:type => "Port Group",
:one => "NAME = \"#{net_name}\"\n" \
"BRIDGE = \"#{n[:name]}\"\n" \
"VN_MAD = \"dummy\"\n" \
"VCENTER_TYPE = \"Port Group\""
}
if !net_names.include?(net_name)
if !vnpool["VNET[BRIDGE=\"#{n[:name]}\"]/\
TEMPLATE[VCENTER_TYPE=\"Port Group\"]"]
one_nets << {
:name => net_name,
:bridge => n.name,
:cluster => host_system.parent.name,
:type => "Port Group",
:one => "NAME = \"#{net_name}\"\n" \
"BRIDGE = \"#{n[:name]}\"\n" \
"VN_MAD = \"dummy\"\n" \
"VCENTER_TYPE = \"Port Group\""
}
net_names << net_name
end
end
}
}