incubator-deltacloud-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Lutterkort <lut...@redhat.com>
Subject Re: [PATCH] implements 'firewalls' - ec2 security groups [revision 2]
Date Fri, 03 Jun 2011 09:53:46 GMT
And one more nit:

On Mon, 2011-05-30 at 17:33 +0300, marios@redhat.com wrote:

> diff --git a/server/lib/deltacloud/drivers/ec2/ec2_driver.rb b/server/lib/deltacloud/drivers/ec2/ec2_driver.rb
> index 0c0471a..c3911cc 100644
> --- a/server/lib/deltacloud/drivers/ec2/ec2_driver.rb
> +++ b/server/lib/deltacloud/drivers/ec2/ec2_driver.rb
> @@ -571,6 +574,73 @@ module Deltacloud
>            end
>          end
>  
> +#--
> +#FIREWALLS - ec2 security groups
> +#--
> +      def firewalls(credentials, opts={})
> +          ec2 = new_client(credentials)
> +          the_firewalls = []
> +          groups = []
> +          safely do
> +            if opts[:id]
> +              groups = ec2.describe_security_groups([opts[:id]])
> +            else
> +              groups = ec2.describe_security_groups()
> +            end
> +          end
> +          groups.each do |security_group|
> +            the_firewalls << convert_security_group(security_group)
> +          end
> +          filter_on(the_firewalls, :id, opts)
> +      end

The filter_on shouldn't be necessary, since we already only look up the
one security group if given an :id.

David



Mime
View raw message