[Pkg-puppet-devel] [facter] 57/180: (FACT-247) Correct assumed regex for AIX netmask fact

Stig Sandbeck Mathisen ssm at debian.org
Mon Jun 30 15:06:30 UTC 2014


This is an automated email from the git hooks/post-receive script.

ssm pushed a commit to branch master
in repository facter.

commit 9f83d99a5182b5155433b15cc05207e8d51900cf
Author: Moses Mendoza <moses at puppetlabs.com>
Date:   Sun Feb 16 09:43:14 2014 -0800

    (FACT-247) Correct assumed regex for AIX netmask fact
    
    On AIX, the printed output of ifconfig is similar to the best family with
    respect to netmask (that is, prepends the value with 0x):
    
    [0] [AIX] root at pe-aix-61-agent:~ # uname -a
    AIX pe-aix-61-agent 1 6 00F7FD3A4C00 powerpc unknown AIX
    [0] [AIX] root at pe-aix-61-agent:~ # /etc/ifconfig en0
    en0: flags=1e080863,480<UP,BROADCAST,NOTRAILERS,RUNNING,SIMPLEX,MULTICAST,GROUPRT,64BIT,CHECKSUM_OFFLOAD(ACTIVE),CHAIN>
            inet <redacted> netmask 0xffffff00 broadcast <redacted>
            tcp_sendspace 262144 tcp_recvspace 262144 rfc1323 1
    
    Note netmask 0xffffff00, which is 255.255.255.0.
    
    This means the regex block in facter/util/netmask.rb that AIX belongs to is the
    one with the various bsd variants.
    
    Signed-off-by: Moses Mendoza <moses at puppetlabs.com>
---
 lib/facter/util/netmask.rb | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/facter/util/netmask.rb b/lib/facter/util/netmask.rb
index 765c2fc..4c4cf01 100644
--- a/lib/facter/util/netmask.rb
+++ b/lib/facter/util/netmask.rb
@@ -11,13 +11,13 @@ module Facter::NetMask
         :regex => %r{#{Facter.value(:ipaddress)}.*?(?:Mask:|netmask)\s*(#{ipregex})}x,
         :munge => nil,
       }
-    when 'SunOS','AIX'
+    when 'SunOS'
       ops = {
         :ifconfig_opts => ['-a'],
         :regex => %r{\s+ inet \s #{Facter.value(: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', 'GNU/kFreeBSD', 'DragonFly'
+    when 'FreeBSD','NetBSD','OpenBSD', 'Darwin', 'GNU/kFreeBSD', 'DragonFly', 'AIX'
       ops = {
         :ifconfig_opts => ['-a'],
         :regex => %r{\s+ inet \s #{Facter.value(:ipaddress)} \s netmask \s 0x(\w{8})}x,

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-puppet/facter.git



More information about the Pkg-puppet-devel mailing list