summaryrefslogtreecommitdiffstats
path: root/lib/puppet.rb
diff options
context:
space:
mode:
authorluke <luke@980ebf18-57e1-0310-9a29-db15c13687c0>2007-05-06 05:42:53 +0000
committerluke <luke@980ebf18-57e1-0310-9a29-db15c13687c0>2007-05-06 05:42:53 +0000
commit494675b1dbf2f7141c201d203b197e03a30b72e3 (patch)
tree0fc130b012161966829f907eb19f9b149ef5afd0 /lib/puppet.rb
parent1f8de9d0c211ac5641f5ad827a0f478fff6bd223 (diff)
downloadpuppet-494675b1dbf2f7141c201d203b197e03a30b72e3.tar.gz
puppet-494675b1dbf2f7141c201d203b197e03a30b72e3.tar.xz
puppet-494675b1dbf2f7141c201d203b197e03a30b72e3.zip
Fixing #206 and #422. Executables will still look for the deprecated config files and load them using the old parse method, but they now prefer a single configuration file, and files can set parameters (owner, mode, group) in brackets on the same line.
git-svn-id: https://reductivelabs.com/svn/puppet/trunk@2464 980ebf18-57e1-0310-9a29-db15c13687c0
Diffstat (limited to 'lib/puppet.rb')
-rw-r--r--lib/puppet.rb17
1 files changed, 17 insertions, 0 deletions
diff --git a/lib/puppet.rb b/lib/puppet.rb
index 86514d492..c96f9a08e 100644
--- a/lib/puppet.rb
+++ b/lib/puppet.rb
@@ -184,6 +184,23 @@ module Puppet
timer
end
+ # Parse the config file for this process.
+ def self.parse_config(oldconfig = nil)
+ # First look for the old configuration file.
+ oldconfig ||= File.join(Puppet[:confdir], Puppet[:name].to_s + ".conf")
+ if FileTest.exists?(oldconfig)
+ Puppet.warning "Individual config files are deprecated; remove %s and use puppet.conf" % oldconfig
+ Puppet.config.old_parse(oldconfig)
+ return
+ end
+
+ # Now check for the normal config.
+ if Puppet[:config] and File.exists? Puppet[:config]
+ Puppet.debug "Parsing %s" % Puppet[:config]
+ Puppet.config.parse(Puppet[:config])
+ end
+ end
+
# Relaunch the executable.
def self.restart
command = $0 + " " + self.args.join(" ")