aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorelijah <elijah@riseup.net>2013-05-22 16:36:49 -0700
committerelijah <elijah@riseup.net>2013-05-22 16:36:49 -0700
commit109a3700ac9f7dc62482d9c3e54e4de0396b2fe5 (patch)
tree7f02a0e2d6b948a75484d6d8a54ded9a56c8e8dd
parent0ae062fc08952951a8a9f6dec66a9aa08d60c5d3 (diff)
downloadleap_cli-109a3700ac9f7dc62482d9c3e54e4de0396b2fe5.tar.gz
leap_cli-109a3700ac9f7dc62482d9c3e54e4de0396b2fe5.tar.bz2
fixed bug with config list not supporting correctly not filters (eg nodes[:name => '!sloth'])
-rw-r--r--lib/leap_cli/config/object_list.rb7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/leap_cli/config/object_list.rb b/lib/leap_cli/config/object_list.rb
index 0c0da14..ebb0bb0 100644
--- a/lib/leap_cli/config/object_list.rb
+++ b/lib/leap_cli/config/object_list.rb
@@ -37,7 +37,12 @@ module LeapCli
key.each do |field, match_value|
field = field.is_a?(Symbol) ? field.to_s : field
match_value = match_value.is_a?(Symbol) ? match_value.to_s : match_value
- operator = match_value =~ /^!/ ? :not_equal : :equal
+ if match_value.is_a?(String) && match_value =~ /^!/
+ operator = :not_equal
+ match_value = match_value.sub(/^!/, '')
+ else
+ operator = :equal
+ end
each do |name, config|
value = config[field]
if value.is_a? Array