mirror of
https://github.com/OpenNebula/one.git
synced 2026-11-09 05:27:20 +09:00
NIC can only have one of IP/IP6/MAC to get a lease from the network. As
all address tuples are indexed only the relevant one is preserved.
(cherry picked from commit 9adcefb05b)
This commit is contained in:
1 file changed
+19
@@ -299,6 +299,7 @@ module TransferManager
|
||||
template.delete('NIC')
|
||||
else
|
||||
remove_keys(NIC_LIST, template['NIC'])
|
||||
remove_address(template['NIC'])
|
||||
end
|
||||
|
||||
remove_empty(template)
|
||||
@@ -340,6 +341,24 @@ module TransferManager
|
||||
end
|
||||
end
|
||||
|
||||
# Sanity check - A NIC can only have one of IP / IP6 / MAC.
|
||||
def remove_address(nic)
|
||||
return if nic.nil?
|
||||
|
||||
if nic.instance_of? Array
|
||||
nic.each {|n| remove_addresses(n) }
|
||||
else
|
||||
if nic['IP']
|
||||
nic.delete('MAC')
|
||||
nic.delete('IP6')
|
||||
nic.delete('IP6_ULA')
|
||||
nic.delete('IP6_GLOBAL')
|
||||
elsif nic['IP6']
|
||||
nic.delete('MAC')
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
# Renders a template attribute in text form
|
||||
def render_template_value(str, value)
|
||||
if value.class == Hash
|
||||
|
||||
Reference in new issue
Block a user