Skip to content

Loading…

Mock for filter ec2 instance by security group name #1018

Merged
merged 1 commit into from

3 participants

@phillc

No description provided.

@dylanegan dylanegan merged commit caab191 into fog:master
@geemus
fog member

Thanks!

@alanthing alanthing referenced this pull request
Commit has since been removed from the repository and is no longer available.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Jul 3, 2012
  1. @phillc
This page is out of date. Refresh to see the latest.
Showing with 2 additions and 0 deletions.
  1. +2 −0 lib/fog/aws/requests/compute/describe_instances.rb
View
2 lib/fog/aws/requests/compute/describe_instances.rb
@@ -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])}
Something went wrong with that request. Please try again.