diff options
Diffstat (limited to 'lib/leap_cli/config')
-rw-r--r-- | lib/leap_cli/config/manager.rb | 11 |
1 files changed, 9 insertions, 2 deletions
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 |