Created
September 21, 2013 00:15
-
-
Save bodepd/6645593 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| diff --git a/lib/puppet/indirector/node/scenario.rb b/lib/puppet/indirector/node/scenario.rb | |
| index 039d8b4..5874bdf 100644 | |
| --- a/lib/puppet/indirector/node/scenario.rb | |
| +++ b/lib/puppet/indirector/node/scenario.rb | |
| @@ -154,7 +154,14 @@ This file maps nodes to the roles that they should be assigned. | |
| unless File.exists?(role_mapper) | |
| raise(Exception, "Role mapping file: #{role_mapper} should exist") | |
| end | |
| - YAML.load_file(role_mapper)[name] | |
| + role_mappings = YAML.load_file(role_mapper) | |
| + splt_name = name.split('.') | |
| + split_name.size.times do |index| | |
| + split_name.size.times do |x| | |
| + cur_name = split_name[0..split_name.size-x].join('.').inspect | |
| + return role_mappings[cur_name] if role_mappings[cur_name] | |
| + end | |
| + end | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment