From 205b61dfe721e6d88fc06b050a0497eeb35f4e02 Mon Sep 17 00:00:00 2001 From: elijah Date: Thu, 21 Jul 2016 00:55:12 -0700 Subject: added 'leap vm' command --- lib/leap_cli/config/filter.rb | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'lib/leap_cli/config/filter.rb') diff --git a/lib/leap_cli/config/filter.rb b/lib/leap_cli/config/filter.rb index 27502577..07424894 100644 --- a/lib/leap_cli/config/filter.rb +++ b/lib/leap_cli/config/filter.rb @@ -29,6 +29,7 @@ module LeapCli # options -- hash, possible keys include # :nopin -- disregard environment pinning # :local -- if false, disallow local nodes + # :warning -- if false, don't print a warning when no nodes are found. # # A nil value in the filters array indicates # the default environment. This is in order to support @@ -139,9 +140,11 @@ module LeapCli return @manager.env('_all_').services[name].node_list elsif @manager.tags[name] return @manager.env('_all_').tags[name].node_list - else + elsif @options[:warning] != false LeapCli.log :warning, "filter '#{name}' does not match any node names, tags, services, or environments." return Config::ObjectList.new + else + return Config::ObjectList.new end else node_list = Config::ObjectList.new @@ -153,7 +156,7 @@ module LeapCli @environments.each do |env| node_list.merge!(@manager.env(env).tags[name].node_list) end - else + elsif @options[:warning] != false LeapCli.log :warning, "filter '#{name}' does not match any node names, tags, services, or environments." end return node_list -- cgit v1.2.3