[Pkg-puppet-devel] [SCM] Packaging of Facter for debian branch, upstream, updated. 3a39dd8353b6308cf49522990104cc63e55d7cda
James Turnbull
james at lovedthanlost.net
Fri Jan 29 17:22:18 UTC 2010
The following commit has been merged in the upstream branch:
commit 1288b26e35a2a9e126d4ae260f377d854b3c3848
Author: James Turnbull <james at lovedthanlost.net>
Date: Tue Mar 17 23:52:11 2009 +1100
Fixed #2080 - IPAddress resolutions should be reordered
diff --git a/CHANGELOG b/CHANGELOG
index b6dabab..b0f9931 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,4 +1,10 @@
1.6.x:
+ Fixed #2080 - IPAddress resolutions should be reordered
+
+ Fixed #2078 - ip.rb errors command not found
+
+ Fixed #2058 - Redirecting stderr doesn't work on all systems
+
Fixed #2081 - Fixed interfaces fact for vlan subinterfaces
Fixed #2063 - added kernelmajversion fact
diff --git a/lib/facter/ipaddress.rb b/lib/facter/ipaddress.rb
index d7496f0..4c0bfe4 100644
--- a/lib/facter/ipaddress.rb
+++ b/lib/facter/ipaddress.rb
@@ -1,44 +1,3 @@
-Facter.add(:ipaddress, :ldapname => "iphostnumber", :timeout => 2) do
- setcode do
- require 'resolv'
-
- begin
- if hostname = Facter.value(:hostname)
- ip = Resolv.getaddress(hostname)
- unless ip == "127.0.0.1"
- ip
- end
- else
- nil
- end
- rescue Resolv::ResolvError
- nil
- rescue NoMethodError # i think this is a bug in resolv.rb?
- nil
- end
- end
-end
-
-Facter.add(:ipaddress, :timeout => 2) do
- setcode do
- if hostname = Facter.value(:hostname)
- # we need Hostname to exist for this to work
- host = nil
- if host = Facter::Util::Resolution.exec("host #{hostname}")
- list = host.chomp.split(/\s/)
- if defined? list[-1] and
- list[-1] =~ /[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+/
- list[-1]
- end
- else
- nil
- end
- else
- nil
- end
- end
-end
-
Facter.add(:ipaddress) do
confine :kernel => :linux
setcode do
@@ -168,3 +127,44 @@ Facter.add(:ipaddress) do
ip
end
end
+
+Facter.add(:ipaddress, :ldapname => "iphostnumber", :timeout => 2) do
+ setcode do
+ require 'resolv'
+
+ begin
+ if hostname = Facter.value(:hostname)
+ ip = Resolv.getaddress(hostname)
+ unless ip == "127.0.0.1"
+ ip
+ end
+ else
+ nil
+ end
+ rescue Resolv::ResolvError
+ nil
+ rescue NoMethodError # i think this is a bug in resolv.rb?
+ nil
+ end
+ end
+end
+
+Facter.add(:ipaddress, :timeout => 2) do
+ setcode do
+ if hostname = Facter.value(:hostname)
+ # we need Hostname to exist for this to work
+ host = nil
+ if host = Facter::Util::Resolution.exec("host #{hostname}")
+ list = host.chomp.split(/\s/)
+ if defined? list[-1] and
+ list[-1] =~ /[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+/
+ list[-1]
+ end
+ else
+ nil
+ end
+ else
+ nil
+ end
+ end
+end
--
Packaging of Facter for debian
More information about the Pkg-puppet-devel
mailing list