Facter::Util::Vlans

A module to gather vlan facts

Public Class Methods

get_vlan_config() click to toggle source
    # File lib/facter/util/vlans.rb, line 4
 4:   def self.get_vlan_config
 5:     output = ""
 6:       if File.exists?('/proc/net/vlan/config') and File.readable?('/proc/net/vlan/config')
 7:         output = File.open('/proc/net/vlan/config').read
 8:       end
 9:     output
10:   end
get_vlans() click to toggle source
    # File lib/facter/util/vlans.rb, line 12
12:   def self.get_vlans
13:     vlans = Array.new
14:     if self.get_vlan_config
15:       self.get_vlan_config.each_line do |line|
16:         if line =~ /^([0-9A-Za-z]+)\.([0-9]+) /
17:           vlans.insert(1, $~[2]) if $~[2]
18:         end
19:       end
20:     end
21: 
22:     vlans.join(',')
23:   end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.