Fixed issue with vlan on redhat provider
When interface is a vlan, the VLAN=yes stanza must stick to interface configuration file and shouldn't be present on bridge ifcfg file either RHBZ#1160418 Change-Id: If1c40927f7e1b26b2ae6a7eb33f6d76d41983fc3
This commit is contained in:
parent
51fd30c22b
commit
fab186f37b
@ -39,6 +39,9 @@ Puppet::Type.type(:vs_port).provide(:ovs_redhat, :parent => :ovs) do
|
|||||||
end
|
end
|
||||||
|
|
||||||
port = IFCFG::Port.new(@resource[:interface], @resource[:bridge])
|
port = IFCFG::Port.new(@resource[:interface], @resource[:bridge])
|
||||||
|
if vlan?
|
||||||
|
port.set('VLAN' => 'yes')
|
||||||
|
end
|
||||||
port.save(BASE + @resource[:interface])
|
port.save(BASE + @resource[:interface])
|
||||||
|
|
||||||
bridge = IFCFG::Bridge.new(@resource[:bridge], template)
|
bridge = IFCFG::Bridge.new(@resource[:bridge], template)
|
||||||
@ -115,6 +118,17 @@ Puppet::Type.type(:vs_port).provide(:ovs_redhat, :parent => :ovs) do
|
|||||||
items.merge!(m[1] => m[2])
|
items.merge!(m[1] => m[2])
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
items.delete('VLAN') if items.has_key?('VLAN')
|
||||||
items
|
items
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def vlan?
|
||||||
|
if File.read('/proc/net/vlan/config') =~ /#{@resource[:interface]}/
|
||||||
|
return true
|
||||||
|
else
|
||||||
|
return false
|
||||||
|
end
|
||||||
|
rescue Errno::ENOENT
|
||||||
|
return false
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user