projects
/
mirror
/
dsa-puppet.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix has_role to handle richer data structures properly
[mirror/dsa-puppet.git]
/
modules
/
puppetmaster
/
lib
/
puppet
/
parser
/
functions
/
has_role.rb
diff --git
a/modules/puppetmaster/lib/puppet/parser/functions/has_role.rb
b/modules/puppetmaster/lib/puppet/parser/functions/has_role.rb
index
c8b537f
..
5c1af8e
100644
(file)
--- a/
modules/puppetmaster/lib/puppet/parser/functions/has_role.rb
+++ b/
modules/puppetmaster/lib/puppet/parser/functions/has_role.rb
@@
-7,6
+7,11
@@
module Puppet::Parser::Functions
err "Failed to look up missing role #{role}"
return false
end
err "Failed to look up missing role #{role}"
return false
end
- return roles[role].include?(fqdn)
+ return roles[role].map{ |k|
+ case k
+ when Hash then k.keys.first
+ else k
+ end
+ }.include?(fqdn)
end
end
end
end