On 24 April 2010 06:38, James Turnbull <ja...@lovedthanlost.net> wrote:
> From: Jonas Genannt <jo...@brachium-system.net> > > > Signed-off-by: James Turnbull <ja...@lovedthanlost.net> > --- > lib/facter/util/vlans.rb | 25 +++++++++++++++++++++++++ > lib/facter/vlans.rb | 8 ++++++++ > spec/unit/data/linux_vlan_config | 6 ++++++ > spec/unit/util/vlans.rb | 14 ++++++++++++++ > 4 files changed, 53 insertions(+), 0 deletions(-) > create mode 100644 lib/facter/util/vlans.rb > create mode 100644 lib/facter/vlans.rb > create mode 100644 spec/unit/data/linux_vlan_config > create mode 100644 spec/unit/util/vlans.rb > > diff --git a/lib/facter/util/vlans.rb b/lib/facter/util/vlans.rb > new file mode 100644 > index 0000000..a9925f5 > --- /dev/null > +++ b/lib/facter/util/vlans.rb > @@ -0,0 +1,25 @@ > +# A module to gather vlan facts > +# > +module Facter::Util::Vlans > + def self.get_vlan_config > + output = "" > + if File.exists?('/proc/net/vlan/config') and > File.readable?('/proc/net/vlan/config') > + output = File.open('/proc/net/vlan/config').read > + end > + end > + output > + end > + > + def self.get_vlans > + vlans = Array.new > + if self.get_vlan_config > + self.get_vlan_config.each do |line| > + if line =~ /^([0-9A-Za-z]+)\.([0-9]+) / > + vlans.insert(-1, $~[2]) if $~[2] > + end > + end > + end > + > + vlans.join(',') > + end > +end > diff --git a/lib/facter/vlans.rb b/lib/facter/vlans.rb > new file mode 100644 > index 0000000..d65bdd8 > --- /dev/null > +++ b/lib/facter/vlans.rb > @@ -0,0 +1,8 @@ > +require 'facter/util/vlans' > + > + Facter.add("vlans") do > + confine :kernel => :linux > Your github branch still seems to have: if Facter.value(:kernel) == "Linux" http://github.com/hggh/facter/blob/7dd8ca90c024b50ad3fb3ba40ff6a07552ea1db0/lib/facter/vlans.rb Can you ensure the version with the confine its pushed there and I'll merge. Paul -- You received this message because you are subscribed to the Google Groups "Puppet Developers" group. To post to this group, send email to puppet-...@googlegroups.com. To unsubscribe from this group, send email to puppet-dev+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-dev?hl=en.