summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRein Henrichs <rein@puppetlabs.com>2010-08-04 11:55:23 -0700
committerMarkus Roberts <Markus@reality.com>2010-08-04 17:49:09 -0700
commit6aac8f0185db1d153583230de726c30ce949fc78 (patch)
tree4e90b6b96f6c137cc7ddfcb2319061e569574055
parent1cba9a7a713261fd62ceec440a3e57667eb103ba (diff)
[#4467] Make Puppet Master respect facts_terminus settings
* Remove hard-coded facts terminus in master * Change facts_terminus default to 'yaml' for master and 'facter' for everything else. Paired-with: Matt Robinson <matt@puppetlabs.com> Signed-off-by: Rein Henrichs <rein@puppetlabs.com>
-rw-r--r--lib/puppet/application/master.rb3
-rw-r--r--lib/puppet/defaults.rb2
-rwxr-xr-xspec/unit/indirector/node/ldap_spec.rb4
-rwxr-xr-xspec/unit/node/facts_spec.rb15
4 files changed, 14 insertions, 10 deletions
diff --git a/lib/puppet/application/master.rb b/lib/puppet/application/master.rb
index 777a50eaa..fde474907 100644
--- a/lib/puppet/application/master.rb
+++ b/lib/puppet/application/master.rb
@@ -138,9 +138,6 @@ class Puppet::Application::Master < Puppet::Application
Puppet.settings.use :main, :master, :ssl
- # A temporary solution, to at least make the master work for now.
- Puppet::Node::Facts.terminus_class = :yaml
-
# Cache our nodes in yaml. Currently not configurable.
Puppet::Node.cache_class = :yaml
diff --git a/lib/puppet/defaults.rb b/lib/puppet/defaults.rb
index 1c5ca53f1..028f9118c 100644
--- a/lib/puppet/defaults.rb
+++ b/lib/puppet/defaults.rb
@@ -115,7 +115,7 @@ module Puppet
:node_terminus => ["plain", "Where to find information about nodes."],
:catalog_terminus => ["compiler", "Where to get node catalogs. This is useful to change if, for instance,
you'd like to pre-compile catalogs and store them in memcached or some other easily-accessed store."],
- :facts_terminus => ["facter", "Where to get node facts."],
+ :facts_terminus => [Puppet.application_name.to_s == "master" ? 'yaml' : 'facter', "The node facts terminus."],
:httplog => { :default => "$logdir/http.log",
:owner => "root",
:mode => 0640,
diff --git a/spec/unit/indirector/node/ldap_spec.rb b/spec/unit/indirector/node/ldap_spec.rb
index f9c5efa07..a5f14fc23 100755
--- a/spec/unit/indirector/node/ldap_spec.rb
+++ b/spec/unit/indirector/node/ldap_spec.rb
@@ -5,10 +5,6 @@ require File.dirname(__FILE__) + '/../../../spec_helper'
require 'puppet/indirector/node/ldap'
describe Puppet::Node::Ldap do
- before do
- Puppet::Node::Facts.stubs(:terminus_class).returns :yaml
- end
-
describe "when searching for a single node" do
before :each do
@searcher = Puppet::Node::Ldap.new
diff --git a/spec/unit/node/facts_spec.rb b/spec/unit/node/facts_spec.rb
index a2f4ab9f0..394db7913 100755
--- a/spec/unit/node/facts_spec.rb
+++ b/spec/unit/node/facts_spec.rb
@@ -88,9 +88,20 @@ describe Puppet::Node::Facts, "when indirecting" do
@facts.save
end
- it "should default to the 'facter' terminus" do
- Puppet::Node::Facts.indirection.terminus_class.should == :facter
+ describe "when the Puppet application is 'master'" do
+ it "should default to the 'yaml' terminus" do
+ pending "Cannot test the behavior of defaults in defaults.rb"
+ # Puppet::Node::Facts.indirection.terminus_class.should == :yaml
+ end
end
+
+ describe "when the Puppet application is not 'master'" do
+ it "should default to the 'facter' terminus" do
+ pending "Cannot test the behavior of defaults in defaults.rb"
+ # Puppet::Node::Facts.indirection.terminus_class.should == :facter
+ end
+ end
+
end
describe "when storing and retrieving" do