+1 On Aug 23, 2009, at 8:03 AM, Paul Nasrat wrote:
> > > Signed-off-by: Paul Nasrat <[email protected]> > --- > lib/facter/netmask.rb | 2 +- > lib/facter/util/netmask.rb | 8 +++++++- > 2 files changed, 8 insertions(+), 2 deletions(-) > > diff --git a/lib/facter/netmask.rb b/lib/facter/netmask.rb > index e4ddbc5..bad3648 100644 > --- a/lib/facter/netmask.rb > +++ b/lib/facter/netmask.rb > @@ -9,7 +9,7 @@ > require 'facter/util/netmask' > > Facter.add("netmask") do > - confine :kernel => > [ :sunos, :linux, :freebsd, :openbsd, :netbsd ] > + confine :kernel => > [ :sunos, :linux, :freebsd, :openbsd, :netbsd, :darwin ] > setcode do > Facter::NetMask.get_netmask > end > diff --git a/lib/facter/util/netmask.rb b/lib/facter/util/netmask.rb > index dcbb795..160cdbd 100644 > --- a/lib/facter/util/netmask.rb > +++ b/lib/facter/util/netmask.rb > @@ -14,7 +14,13 @@ module Facter::NetMask > when 'SunOS' > ops = { > :ifconfig => '/usr/sbin/ifconfig -a', > - :regex => %r{\s+ inet\s+? #{Facter.ipaddress} \+? > mask (\w{8})}x, > + :regex => %r{\s+ inet \s #{Facter.ipaddress} \s > netmask \s (\w{8})}x, > + :munge => Proc.new { |mask| mask.scan(/../).collect > do |byte| byte.to_i(16) end.join('.') } > + } > + when 'FreeBSD','NetBSD','OpenBSD', 'Darwin' > + ops = { > + :ifconfig => '/sbin/ifconfig -a', > + :regex => %r{\s+ inet \s #{Facter.ipaddress} \s > netmask \s 0x(\w{8})}x, > :munge => Proc.new { |mask| mask.scan(/../).collect > do |byte| byte.to_i(16) end.join('.') } > } > end > -- > 1.6.1.3 > > > > -- Censorship, like charity, should begin at home; but, unlike charity, it should end there. --Clare Booth Luce --------------------------------------------------------------------- Luke Kanies | http://reductivelabs.com | http://madstop.com --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Puppet Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/puppet-dev?hl=en -~----------~----~----~----~------~----~------~--~---
