summaryrefslogtreecommitdiffstats
path: root/lib/puppet/parser
diff options
context:
space:
mode:
Diffstat (limited to 'lib/puppet/parser')
-rw-r--r--lib/puppet/parser/scope.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/puppet/parser/scope.rb b/lib/puppet/parser/scope.rb
index 140c8c1b5..c974aee78 100644
--- a/lib/puppet/parser/scope.rb
+++ b/lib/puppet/parser/scope.rb
@@ -306,6 +306,12 @@ class Puppet::Parser::Scope
self.nodescope
end
+ def parent_module_name
+ return nil unless @parent
+ return nil unless @parent.source
+ @parent.source.module_name
+ end
+
# Return the list of scopes up to the top scope, ordered with our own first.
# This is used for looking up variables and defaults.
def scope_path