From 77e9ec3403c761a525d4f3af591769b90ef40b34 Mon Sep 17 00:00:00 2001 From: Sam Kottler Date: Jun 22 2013 01:22:03 +0000 Subject: Add upstream patch to prevent using the loopback IP (127.0.0.1) instead of the first valid one (BZ#976942) --- diff --git a/0002-976942-correct-ipaddress-non-loopback.patch b/0002-976942-correct-ipaddress-non-loopback.patch new file mode 100644 index 0000000..1662252 --- /dev/null +++ b/0002-976942-correct-ipaddress-non-loopback.patch @@ -0,0 +1,21 @@ +diff -uNr facter-1.6.18/lib/facter/ipaddress.rb facter-1.6.18/lib/facter/ipaddress.rb +--- lib/facter/ipaddress.rb 2013-03-13 14:17:44.000000000 -0400 ++++ lib/facter/ipaddress.rb 2013-06-21 20:44:33.997664732 -0400 +@@ -28,10 +28,14 @@ + confine :kernel => :linux + setcode do + ip = nil +- if output = Facter::Util::IP.exec_ifconfig(["2>/dev/null"]) ++ output = Facter::Util::IP.exec_ifconfig(["2>/dev/null"]) ++ if output + regexp = /inet (?:addr:)?([0-9]+\.[0-9]+\.[0-9]+\.[0-9]+)/ +- if match = regexp.match(output) +- match[1] unless /^127/.match(match[1]) ++ output.split("\n").each do |line| ++ match = regexp.match(line) ++ if match ++ break match[1] unless /^127/.match(match[1]) ++ end + end + end + end diff --git a/facter.spec b/facter.spec index cf212ea..14bee87 100644 --- a/facter.spec +++ b/facter.spec @@ -16,7 +16,7 @@ Name: facter Version: 1.6.18 -Release: 3%{?dist} +Release: 4%{?dist} Summary: Command and ruby library for gathering system information Group: System Environment/Base @@ -27,6 +27,7 @@ Source1: http://downloads.puppetlabs.com/%{name}/%{name}-%{version}.tar.g # https://bugzilla.redhat.com/719611 # https://projects.puppetlabs.com/issues/19989 Patch0: 0001-19989-Filter-virt-what-warnings-from-virtual-fact.patch +Patch1: 0002-976942-correct-ipaddress-non-loopback.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildRequires: ruby >= 1.8.1 @@ -69,6 +70,7 @@ key off the values returned by facts. %prep %setup -q %patch0 -p1 +%patch1 -p0 %build @@ -112,6 +114,9 @@ rspec spec %changelog +* Fri Jun 21 2013 Sam Kottler 1.6.18-4 +- Apply upstream patch to ensure the first non-127.0.0.1 interface + * Wed Apr 03 2013 Todd Zullinger - 1.6.18-3 - Avoid warnings when virt-what produces no output