diff options
author | elijah <elijah@riseup.net> | 2014-10-15 14:44:04 -0700 |
---|---|---|
committer | elijah <elijah@riseup.net> | 2014-10-15 14:44:04 -0700 |
commit | 2ad234111acafcf6c78b424d7cd2dcfcb1431d3e (patch) | |
tree | dddae998e7ca5f5324008d63fafba7dabeb458b6 | |
parent | dc30308c8ff4b5cdfcb078b2100a74ce170313a3 (diff) |
filter: fix bug when given incorrect filter
-rw-r--r-- | lib/leap_cli/config/filter.rb | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/leap_cli/config/filter.rb b/lib/leap_cli/config/filter.rb index ce218da..123533f 100644 --- a/lib/leap_cli/config/filter.rb +++ b/lib/leap_cli/config/filter.rb @@ -109,9 +109,12 @@ module LeapCli return Config::ObjectList.new(node) elsif @environments.empty? if @manager.services[name] - @manager.env('_all_').services[name].node_list + return @manager.env('_all_').services[name].node_list elsif @manager.tags[name] - @manager.env('_all_').tags[name].node_list + return @manager.env('_all_').tags[name].node_list + else + LeapCli::Util.log :warning, "filter '#{name}' does not match any node names, tags, services, or environments." + return Config::ObjectList.new end else node_list = Config::ObjectList.new @@ -123,6 +126,8 @@ module LeapCli @environments.each do |env| node_list.merge!(@manager.env(env).tags[name].node_list) end + else + LeapCli::Util.log :warning, "filter '#{name}' does not match any node names, tags, services, or environments." end return node_list end |