summaryrefslogtreecommitdiffstats
path: root/lib/puppet/parser/ast/leaf.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/puppet/parser/ast/leaf.rb')
-rw-r--r--lib/puppet/parser/ast/leaf.rb14
1 files changed, 12 insertions, 2 deletions
diff --git a/lib/puppet/parser/ast/leaf.rb b/lib/puppet/parser/ast/leaf.rb
index 1c1eae972..d10ea62f4 100644
--- a/lib/puppet/parser/ast/leaf.rb
+++ b/lib/puppet/parser/ast/leaf.rb
@@ -119,8 +119,18 @@ class Puppet::Parser::AST
end
def match(value)
- value = value.value if value.is_a?(HostName)
- return @value.match(value)
+ return @value.match(value) unless value.is_a?(HostName)
+
+ if value.regex? and self.regex?
+ # Wow this is some sweet design; maybe a touch of refactoring
+ # in order here.
+ return value.value.value == self.value.value
+ elsif value.regex? # we know if the existing name is not a regex, it won't match a regex
+ return false
+ else
+ # else, we could be either a regex or normal and it doesn't matter
+ return @value.match(value.value)
+ end
end
def regex?