summaryrefslogtreecommitdiffstats
path: root/lib/puppet/indirector
diff options
context:
space:
mode:
authorJesse Wolfe <jes5199@gmail.com>2010-05-12 18:25:14 -0700
committertest branch <puppet-dev@googlegroups.com>2010-02-17 06:50:53 -0800
commitac7efc8f0284d6b35f5428da06ba371cf94998ec (patch)
treec1a6a6df5dd2d533c1d0b12b869a0758b8c4cb6f /lib/puppet/indirector
parent5665e3984f73c70b90f65dd8bf4445b5adda5121 (diff)
downloadpuppet-ac7efc8f0284d6b35f5428da06ba371cf94998ec.tar.gz
puppet-ac7efc8f0284d6b35f5428da06ba371cf94998ec.tar.xz
puppet-ac7efc8f0284d6b35f5428da06ba371cf94998ec.zip
Feature #2935 Puppet::Mode#master?
Use a predicate function on the Mode object instead of comparing with the executable name everywhere Signed-off-by: Jesse Wolfe <jes5199@gmail.com>
Diffstat (limited to 'lib/puppet/indirector')
-rw-r--r--lib/puppet/indirector/catalog/compiler.rb2
-rw-r--r--lib/puppet/indirector/file.rb2
-rw-r--r--lib/puppet/indirector/yaml.rb2
3 files changed, 3 insertions, 3 deletions
diff --git a/lib/puppet/indirector/catalog/compiler.rb b/lib/puppet/indirector/catalog/compiler.rb
index f83245a27..0dccf3613 100644
--- a/lib/puppet/indirector/catalog/compiler.rb
+++ b/lib/puppet/indirector/catalog/compiler.rb
@@ -53,7 +53,7 @@ class Puppet::Resource::Catalog::Compiler < Puppet::Indirector::Code
# Is our compiler part of a network, or are we just local?
def networked?
- $0 =~ /puppetmasterd/
+ Puppet.mode.master?
end
private
diff --git a/lib/puppet/indirector/file.rb b/lib/puppet/indirector/file.rb
index cc7ad9b07..0aedccf91 100644
--- a/lib/puppet/indirector/file.rb
+++ b/lib/puppet/indirector/file.rb
@@ -4,7 +4,7 @@ require 'puppet/indirector/terminus'
class Puppet::Indirector::File < Puppet::Indirector::Terminus
# Where do we store our data?
def data_directory
- name = Puppet[:name] == "puppetmasterd" ? :server_datadir : :client_datadir
+ name = Puppet.mode.master? ? :server_datadir : :client_datadir
File.join(Puppet.settings[name], self.class.indirection_name.to_s)
end
diff --git a/lib/puppet/indirector/yaml.rb b/lib/puppet/indirector/yaml.rb
index 782112ebd..710246686 100644
--- a/lib/puppet/indirector/yaml.rb
+++ b/lib/puppet/indirector/yaml.rb
@@ -45,7 +45,7 @@ class Puppet::Indirector::Yaml < Puppet::Indirector::Terminus
# Get the yaml directory
def base
- (Puppet[:name] == "puppetmasterd") ? Puppet[:yamldir] : Puppet[:clientyamldir]
+ Puppet.mode.master? ? Puppet[:yamldir] : Puppet[:clientyamldir]
end
# Return the path to a given node's file.