diff options
author | elijah <elijah@riseup.net> | 2016-08-29 13:40:01 -0700 |
---|---|---|
committer | elijah <elijah@riseup.net> | 2016-08-29 13:40:01 -0700 |
commit | 6dbb8af5eeb0f7bd0300feb3a564011be1f08d93 (patch) | |
tree | 8af277b18791a97efa880b4075848ab734e14fb3 /lib/leap_cli | |
parent | ad5acc562718df0505a318907e26185c8b91a284 (diff) |
fix bug when nodes have bad tags
Diffstat (limited to 'lib/leap_cli')
-rw-r--r-- | lib/leap_cli/config/manager.rb | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/lib/leap_cli/config/manager.rb b/lib/leap_cli/config/manager.rb index b42f1ae0..e39334c8 100644 --- a/lib/leap_cli/config/manager.rb +++ b/lib/leap_cli/config/manager.rb @@ -324,8 +324,8 @@ module LeapCli node['tags'].each do |node_tag| tag = node_env.tags[node_tag] if tag.nil? - msg = 'in node "%s": the tag "%s" does not exist.' % [node['name'], node_tag] - log 0, :error, msg + msg = 'in node `%s`: the tag "%s" does not exist!' % [node['name'], node_tag] + LeapCli.log 0, :error, msg raise LeapCli::ConfigError.new(node, "error " + msg) if throw_exceptions else new_node.deep_merge!(tag) @@ -384,8 +384,11 @@ module LeapCli end if node['tags'] node['tags'].to_a.each do |node_tag| - env(node.environment).tags[node_tag].node_list.add(node.name, node) - env('_all_').tags[node_tag].node_list.add(node.name, node) + if env(node.environment).tags[node_tag] + # if tag exists + env(node.environment).tags[node_tag].node_list.add(node.name, node) + env('_all_').tags[node_tag].node_list.add(node.name, node) + end end end if node.name == 'default' || environment_names.include?(node.name) |