Issue #1345 has been updated by msf.

File ip_rb.diff added

The attached patch makes get_interface_value_bsd return the first ip_address 
and netmask found on an interface as opposed to the last, which is the 
problematic behaviour described in this ticket. The patch does not attempt to 
report multiple values. 

<pre>
diff --git a/lib/facter/util/ip.rb b/lib/facter/util/ip.rb
index fb13383..1a0c611 100644
--- a/lib/facter/util/ip.rb
+++ b/lib/facter/util/ip.rb
@@ -66,7 +66,7 @@ module Facter::IPAddress

    def self.get_interface_value_bsd(interface, label)

-    tmp1 = nil
+    tmp1 = []

     int_hash = {}
     output_int = %x{/sbin/ifconfig #{interface}}
@@ -85,12 +85,12 @@ module Facter::IPAddress

     if interface != "lo" && interface != "lo0"
       output_int.each { |s|
-        tmp1 = $1 if s =~ regex
+        tmp1.push($1) if s =~ regex
       }
     end

     if tmp1
-       value = tmp1
+       value = tmp1.shift
     end

    end
</pre>
----------------------------------------
Bug #1345: facter 1.5.0rc1 does not correctly handle  BSD-style interface 
aliases
http://reductivelabs.com/redmine/issues/show/1345

Author: mcbride
Status: Unreviewed
Priority: Normal
Assigned to: luke
Category: library
Target version: 
Keywords: 
Complexity: Unknown
Patch: None


Facter returns the last interface alias for an interface rather than the 
primary address, or better yet, all the addresses on that interface:


ipaddress_udav0 => 192.168.0.12
netmask_udav0 => 0xffffffff

On [[OpenBSD]] -current (but applies to previous versions and probably other 
BSD varients):

$ ifconfig udav0
udav0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
        lladdr 00:0a:79:64:b4:09
        media: Ethernet autoselect (100baseTX full-duplex)
        status: active
        inet 192.168.0.10 netmask 0xffffff00 broadcast 192.168.0.255
        inet6 fe80::20a:79ff:fe64:b409%udav0 prefixlen 64 scopeid 0x5
        inet 192.168.0.11 netmask 0xffffffff broadcast 192.168.0.11
        inet 192.168.0.12 netmask 0xffffffff broadcast 192.168.0.12


----------------------------------------
You have received this notification because you have either subscribed to it, 
or are involved in it.
To change your notification preferences, please click here: 
http://reductivelabs.com/redmine/my/account

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Puppet Bugs" 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-bugs?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to