aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorelijah <elijah@riseup.net>2014-10-15 14:44:04 -0700
committerelijah <elijah@riseup.net>2014-10-15 14:44:04 -0700
commit2ad234111acafcf6c78b424d7cd2dcfcb1431d3e (patch)
treedddae998e7ca5f5324008d63fafba7dabeb458b6 /lib
parentdc30308c8ff4b5cdfcb078b2100a74ce170313a3 (diff)
downloadleap_cli-2ad234111acafcf6c78b424d7cd2dcfcb1431d3e.tar.gz
leap_cli-2ad234111acafcf6c78b424d7cd2dcfcb1431d3e.tar.bz2
filter: fix bug when given incorrect filter
Diffstat (limited to 'lib')
-rw-r--r--lib/leap_cli/config/filter.rb9
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