summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/puppet/util/settings.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/puppet/util/settings.rb b/lib/puppet/util/settings.rb
index 625bab42a..3e3bc7f76 100644
--- a/lib/puppet/util/settings.rb
+++ b/lib/puppet/util/settings.rb
@@ -494,7 +494,15 @@ class Puppet::Util::Settings
@sync.synchronize do # yay, thread-safe
@values[type][param] = value
@cache.clear
+
clearused
+
+ # Clear the list of environments, because they cache, at least, the module path.
+ # We *could* preferentially just clear them if the modulepath is changed,
+ # but we don't really know if, say, the vardir is changed and the modulepath
+ # is defined relative to it. We need the defined? stuff because of loading
+ # order issues.
+ Puppet::Node::Environment.clear if defined?(Puppet::Node) and defined?(Puppet::Node::Environment)
end
return value