Mock for filter ec2 instance by security group name #1018

Merged
merged 1 commit into from Jul 3, 2012
Jump to file or symbol
Failed to load files and symbols.
+2 −0
Diff settings

Always

Just for now

@@ -148,6 +148,8 @@ def describe_instances(filters = {})
elsif state_reason_key = filter_key.split('state-reason-')[1]
aliased_key = state_reason_aliases[state_reason_key]
instance_set = instance_set.reject{|instance| ![*filter_value].include?(instance['stateReason'][aliased_key])}
+ elsif filter_key == "group-name"
+ instance_set = instance_set.reject {|instance| !instance['groupSet'].include?(filter_value)}
else
aliased_key = aliases[filter_key]
instance_set = instance_set.reject {|instance| ![*filter_value].include?(instance[aliased_key])}