diff options
| author | Luke Kanies <luke@madstop.com> | 2008-10-17 09:01:04 -0500 |
|---|---|---|
| committer | Luke Kanies <luke@madstop.com> | 2008-10-17 09:01:04 -0500 |
| commit | 8aee40de69e6fe8d67ab58a2e223443b15820584 (patch) | |
| tree | 89e230df3b43302a542f2cb6869f63e2fb93f6d8 /lib/puppet/util/settings.rb | |
| parent | 1b517d2fb048603bd1743a662bde74e8ae4b13dc (diff) | |
| parent | a74ec60d33dee1c592ec858faeccc23d7a7b79f3 (diff) | |
| download | puppet-8aee40de69e6fe8d67ab58a2e223443b15820584.tar.gz puppet-8aee40de69e6fe8d67ab58a2e223443b15820584.tar.xz puppet-8aee40de69e6fe8d67ab58a2e223443b15820584.zip | |
Merge branch '0.24.x' Removed the 'after' blocks that call Type.clear,
since that method is deprecated.
Conflicts:
CHANGELOG
bin/puppetca
lib/puppet/file_serving/fileset.rb
lib/puppet/network/xmlrpc/client.rb
lib/puppet/type/file/selcontext.rb
spec/unit/file_serving/metadata.rb
spec/unit/type/file.rb
Diffstat (limited to 'lib/puppet/util/settings.rb')
| -rw-r--r-- | lib/puppet/util/settings.rb | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/puppet/util/settings.rb b/lib/puppet/util/settings.rb index 64bb40b52..d0c16ec92 100644 --- a/lib/puppet/util/settings.rb +++ b/lib/puppet/util/settings.rb @@ -115,12 +115,14 @@ class Puppet::Util::Settings end # Do variable interpolation on the value. - def convert(value) + def convert(value, environment = nil) return value unless value return value unless value.is_a? String newval = value.gsub(/\$(\w+)|\$\{(\w+)\}/) do |value| varname = $2 || $1 - if pval = self.value(varname) + if varname == "environment" and environment + environment + elsif pval = self.value(varname) pval else raise Puppet::DevError, "Could not find value for %s" % value @@ -692,7 +694,7 @@ Generated on #{Time.now}. val = @config[param].default if val.nil? # Convert it if necessary - val = convert(val) + val = convert(val, environment) # And cache it @cache[environment||"none"][param] = val |
