View | Details | Raw Unified | Return to bug 190796 | Differences between
and this patch

Collapse All | Expand All

(-)rubygem-facter/files/patch-lib__facter__interfaces.rb (-20 lines)
Lines 1-20 Link Here
1
--- ./lib/facter/interfaces.rb.orig	2014-06-08 11:05:48.000000000 -0500
2
+++ ./lib/facter/interfaces.rb	2014-06-08 11:06:21.000000000 -0500
3
@@ -39,3 +39,17 @@
4
     end
5
   end
6
 end
7
+
8
+# Get the firs 10 aliases on *BSD - however there could be more, just don't support them
9
+# as it pushes up execution time
10
+Facter::Util::IP.get_interfaces.each do |interface|
11
+  %w{ipaddress ipaddress6 netmask}.each do |label|
12
+    (0..9).each do |a|
13
+      Facter.add(label + "_" + Facter::Util::IP.alphafy(interface) + "_alias#{a}") do
14
+        setcode do
15
+          Facter::Util::IP.get_interface_value(interface, label, a)
16
+        end
17
+      end
18
+    end
19
+  end
20
+end
(-)rubygem-facter/files/patch-lib__facter__util__ip.rb (-23 lines)
Lines 1-23 Link Here
1
--- ./lib/facter/util/ip.rb.orig	2014-06-08 11:06:52.000000000 -0500
2
+++ ./lib/facter/util/ip.rb	2014-06-08 11:08:34.000000000 -0500
3
@@ -210,7 +210,7 @@
4
   #
5
   # @return [String] representing the requested value.  An empty array is
6
   # returned if the kernel is not supported by the REGEX_MAP constant.
7
-  def self.get_interface_value(interface, label)
8
+  def self.get_interface_value(interface, label, intalias = -1)
9
     if Facter.value(:kernel) == 'windows'
10
       require 'facter/util/ip/windows'
11
       return Facter::Util::IP::Windows.value_for_interface_and_label(interface, label)
12
@@ -252,7 +252,10 @@
13
       end
14
 
15
       if tmp1
16
-        value = tmp1.shift
17
+        (-1..intalias).each do |i|
18
+          value = tmp1.shift
19
+        end
20
+        value
21
       end
22
     end
23
   end

Return to bug 190796