Add check for vlan usage existing
Fuel-CI: disable Related-bug: #1460972 Change-Id: I4dcdfba3ae0a5ac344a6a63e1dbaadc93e95ea8d
This commit is contained in:
parent
d757cd41e4
commit
5bd0333f51
@ -38,14 +38,16 @@ class Puppet::Provider::L2_base < Puppet::Provider
|
||||
# }
|
||||
#
|
||||
vlan_ifaces = {}
|
||||
rc_c = /([\w+\.\-]+)\s*\|\s*(\d+)\s*\|\s*([\w+\-]+)/
|
||||
File.open("/proc/net/vlan/config", "r").each do |line|
|
||||
if (rv=line.match(rc_c))
|
||||
vlan_ifaces[rv[1]] = {
|
||||
:vlan_dev => rv[3],
|
||||
:vlan_id => rv[2],
|
||||
:vlan_mode => (rv[1].match('\.').nil? ? 'vlan' : 'eth' )
|
||||
}
|
||||
if File.exist? '/proc/net/vlan'
|
||||
rc_c = /([\w+\.\-]+)\s*\|\s*(\d+)\s*\|\s*([\w+\-]+)/
|
||||
File.open("/proc/net/vlan/config", "r").each do |line|
|
||||
if (rv=line.match(rc_c))
|
||||
vlan_ifaces[rv[1]] = {
|
||||
:vlan_dev => rv[3],
|
||||
:vlan_id => rv[2],
|
||||
:vlan_mode => (rv[1].match('\.').nil? ? 'vlan' : 'eth' )
|
||||
}
|
||||
end
|
||||
end
|
||||
end
|
||||
return vlan_ifaces
|
||||
|
Loading…
Reference in New Issue
Block a user