[Pkg-puppet-devel] [facter] 152/352: (FACT-207) Remove all uses of :ldapname
Stig Sandbeck Mathisen
ssm at debian.org
Sun Apr 6 22:21:41 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 818b58b7773d14d06fea53f4706403eceb4b9514
Author: Adrien Thebo <git at somethingsinistral.net>
Date: Wed Jan 15 13:17:54 2014 -0800
(FACT-207) Remove all uses of :ldapname
Commit 1da7261da deprecated the use of :ldapname for facts; this commit
removes the use of :ldapname from the related facts and test coverage.
---
lib/facter/hostname.rb | 2 +-
lib/facter/ipaddress.rb | 2 +-
spec/unit/facter_spec.rb | 12 ------------
spec/unit/util/collection_spec.rb | 23 +----------------------
4 files changed, 3 insertions(+), 36 deletions(-)
diff --git a/lib/facter/hostname.rb b/lib/facter/hostname.rb
index 2371ec8..4f98b67 100644
--- a/lib/facter/hostname.rb
+++ b/lib/facter/hostname.rb
@@ -11,7 +11,7 @@
# Caveats:
#
-Facter.add(:hostname, :ldapname => "cn") do
+Facter.add(:hostname) do
setcode do
hostname = nil
if name = Facter::Util::Resolution.exec('hostname')
diff --git a/lib/facter/ipaddress.rb b/lib/facter/ipaddress.rb
index f4b46b1..1f8400c 100644
--- a/lib/facter/ipaddress.rb
+++ b/lib/facter/ipaddress.rb
@@ -121,7 +121,7 @@ Facter.add(:ipaddress) do
end
end
-Facter.add(:ipaddress, :ldapname => "iphostnumber", :timeout => 2) do
+Facter.add(:ipaddress, :timeout => 2) do
setcode do
if Facter.value(:kernel) == 'windows'
require 'win32/resolv'
diff --git a/spec/unit/facter_spec.rb b/spec/unit/facter_spec.rb
index 1b69d56..9c3bdef 100755
--- a/spec/unit/facter_spec.rb
+++ b/spec/unit/facter_spec.rb
@@ -101,18 +101,6 @@ describe Facter do
end
end
- describe "Facter[:hostname]" do
- it "should have its ldapname set to 'cn'" do
- Facter[:hostname].ldapname.should == "cn"
- end
- end
-
- describe "Facter[:ipaddress]" do
- it "should have its ldapname set to 'iphostnumber'" do
- Facter[:ipaddress].ldapname.should == "iphostnumber"
- end
- end
-
# #33 Make sure we only get one mac address
it "should only return one mac address" do
if macaddress = Facter.value(:macaddress)
diff --git a/spec/unit/util/collection_spec.rb b/spec/unit/util/collection_spec.rb
index 6e20d26..8e211a8 100755
--- a/spec/unit/util/collection_spec.rb
+++ b/spec/unit/util/collection_spec.rb
@@ -27,15 +27,7 @@ describe Facter::Util::Collection do
end
it "should accept options" do
- collection.add(:myname, :ldapname => "whatever") { }
- end
-
- it "should set any appropriate options on the fact instances" do
- # Use a real fact instance, because we're using respond_to?
- fact = Facter::Util::Fact.new(:myname)
-
- collection.add(:myname, :ldapname => "testing")
- collection.fact(:myname).ldapname.should == "testing"
+ collection.add(:myname, :timeout => 1) { }
end
it "should set appropriate options on the resolution instance" do
@@ -48,19 +40,6 @@ describe Facter::Util::Collection do
collection.add(:myname, :timeout => "myval") {}
end
- it "should not pass fact-specific options to resolutions" do
- fact = Facter::Util::Fact.new(:myname)
- Facter::Util::Fact.expects(:new).with(:myname).returns fact
-
- resolve = Facter::Util::Resolution.new(:myname) {}
- fact.expects(:add).returns resolve
-
- fact.expects(:ldapname=).with("foo")
- resolve.expects(:timeout=).with("myval")
-
- collection.add(:myname, :timeout => "myval", :ldapname => "foo") {}
- end
-
it "should fail if invalid options are provided" do
lambda { collection.add(:myname, :foo => :bar) }.should raise_error(ArgumentError)
end
--
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