From 2c03995839437729bf48332124a7a30c112dba18 Mon Sep 17 00:00:00 2001 From: elijah Date: Wed, 4 Jun 2014 14:54:19 -0700 Subject: by default, skip local nodes on `leap facts update` --- lib/leap_cli/config/manager.rb | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'lib/leap_cli/config/manager.rb') diff --git a/lib/leap_cli/config/manager.rb b/lib/leap_cli/config/manager.rb index 1a66bff..00d2f97 100644 --- a/lib/leap_cli/config/manager.rb +++ b/lib/leap_cli/config/manager.rb @@ -182,9 +182,16 @@ module LeapCli # # if conditions is prefixed with +, then it works like an AND. Otherwise, it works like an OR. # - def filter(filters) + # options: + # :local -- if :local is false and the filter is empty, then local nodes are excluded. + # + def filter(filters, options={}) if filters.empty? - return nodes + if options[:local] === false + return nodes[:environment => '!local'] + else + return nodes + end end if filters[0] =~ /^\+/ # don't let the first filter have a + prefix -- cgit v1.2.3