summaryrefslogtreecommitdiff
path: root/lib/mixlib/config.rb
diff options
context:
space:
mode:
authorMatt Wrock <matt@mattwrock.com>2016-08-31 16:18:19 -0700
committerMatt Wrock <matt@mattwrock.com>2016-08-31 16:18:19 -0700
commit61008c33ab6de5dc21fe1de15ce08996f000dc9f (patch)
tree7ef44280dbbeec965d6847319dba2ded53bbff6e /lib/mixlib/config.rb
parentae2f0b958e21a68177ffab0312a636e36b004e2b (diff)
downloadmixlib-config-hash.tar.gz
allow a config context to be set from another config contexthash
Diffstat (limited to 'lib/mixlib/config.rb')
-rw-r--r--lib/mixlib/config.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/mixlib/config.rb b/lib/mixlib/config.rb
index 517aae7..4927153 100644
--- a/lib/mixlib/config.rb
+++ b/lib/mixlib/config.rb
@@ -174,6 +174,7 @@ module Mixlib
end
result
end
+ alias :to_hash :save
# Restore non-default values from the given hash.
#
@@ -416,7 +417,7 @@ module Mixlib
if configurables.has_key?(symbol)
configurables[symbol].set(self.configuration, value)
elsif config_contexts.has_key?(symbol)
- config_contexts[symbol].restore(value)
+ config_contexts[symbol].restore(value.to_hash)
else
if config_strict_mode == :warn
Chef::Log.warn("Setting unsupported config value #{symbol}.")