[Pkg-puppet-devel] [facter] 337/352: (maint) Remove extra argument from domain .exec calls

Stig Sandbeck Mathisen ssm at debian.org
Sun Apr 6 22:21:59 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 67e57de4fb9314382b950a7e016fd46046aa40a1
Author: Adrien Thebo <git at somethingsinistral.net>
Date:   Mon Mar 24 15:22:25 2014 -0700

    (maint) Remove extra argument from domain .exec calls
---
 lib/facter/domain.rb     |  4 ++--
 spec/unit/domain_spec.rb | 10 +++++-----
 2 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/lib/facter/domain.rb b/lib/facter/domain.rb
index 3c2dc4c..ac9aa68 100644
--- a/lib/facter/domain.rb
+++ b/lib/facter/domain.rb
@@ -41,11 +41,11 @@ Facter.add(:domain) do
                          basic_hostname
                        end
 
-    if name = Facter::Core::Execution.exec(hostname_command, :on_fail => nil) \
+    if name = Facter::Core::Execution.exec(hostname_command) \
       and name =~ /.*?\.(.+$)/
 
       return_value = $1
-    elsif Facter.value(:kernel) != "windows" and domain = Facter::Core::Execution.exec('dnsdomainname 2> /dev/null', :on_fail => nil) \
+    elsif Facter.value(:kernel) != "windows" and domain = Facter::Core::Execution.exec('dnsdomainname 2> /dev/null') \
       and domain =~ /.+/
 
       return_value = domain
diff --git a/spec/unit/domain_spec.rb b/spec/unit/domain_spec.rb
index f7dae51..c3701d5 100755
--- a/spec/unit/domain_spec.rb
+++ b/spec/unit/domain_spec.rb
@@ -24,11 +24,11 @@ describe "Domain name facts" do
       let(:dnsdomain_command) { "dnsdomainname 2> /dev/null" }
 
       def the_hostname_is(value)
-        Facter::Core::Execution.stubs(:exec).with(hostname_command, {:on_fail => nil}).returns(value)
+        Facter::Core::Execution.stubs(:exec).with(hostname_command).returns(value)
       end
 
       def the_dnsdomainname_is(value)
-        Facter::Core::Execution.stubs(:exec).with(dnsdomain_command, {:on_fail => nil}).returns(value)
+        Facter::Core::Execution.stubs(:exec).with(dnsdomain_command).returns(value)
       end
 
       before do
@@ -197,7 +197,7 @@ describe "Domain name facts" do
         it "should return nil" do
           expects_dnsdomains([nil])
 
-          Facter::Core::Execution.stubs(:exec).with(hostname_command, {:on_fail => nil}).returns('sometest')
+          Facter::Core::Execution.stubs(:exec).with(hostname_command).returns('sometest')
           FileTest.stubs(:exists?).with("/etc/resolv.conf").returns(false)
 
           Facter.fact(:domain).value.should be_nil
@@ -288,8 +288,8 @@ describe "Domain name facts" do
 
         describe scenario[:scenario] do
           before(:each) do
-            Facter::Core::Execution.stubs(:exec).with("hostname -f 2> /dev/null", {:on_fail => nil}).returns(scenario[:hostname])
-            Facter::Core::Execution.stubs(:exec).with("dnsdomainname 2> /dev/null", {:on_fail => nil}).returns(scenario[:dnsdomainname])
+            Facter::Core::Execution.stubs(:exec).with("hostname -f 2> /dev/null").returns(scenario[:hostname])
+            Facter::Core::Execution.stubs(:exec).with("dnsdomainname 2> /dev/null").returns(scenario[:dnsdomainname])
             resolv_conf_contains(
               "search #{scenario[:resolve_search]}",
               "domain #{scenario[:resolve_domain]}"

-- 
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