From c943ceb6c0c0c70ede78382563bac8cb69a53444 Mon Sep 17 00:00:00 2001 From: Brian Nelson Date: Sun, 8 Sep 2013 18:41:43 -0700 Subject: [PATCH] Another fix from @jbence comments to simplify Excon response in authorize_cache_security_group_ingress --- .../authorize_cache_security_group_ingress.rb | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/lib/fog/aws/requests/elasticache/authorize_cache_security_group_ingress.rb b/lib/fog/aws/requests/elasticache/authorize_cache_security_group_ingress.rb index d8ab5f8c1..1e46c39e8 100644 --- a/lib/fog/aws/requests/elasticache/authorize_cache_security_group_ingress.rb +++ b/lib/fog/aws/requests/elasticache/authorize_cache_security_group_ingress.rb @@ -34,8 +34,6 @@ module Fog 'EC2SecurityGroupOwnerId' => ec2_owner_id } - response = Excon::Response.new - if sec_group = self.data[:security_groups][name] if sec_group['EC2SecurityGroups'].detect{|h| h['EC2SecurityGroupName'] == opts['EC2SecurityGroupName']} @@ -43,13 +41,15 @@ module Fog end sec_group['EC2SecurityGroups'] << opts.merge({'Status' => 'authorizing'}) - response.status = 200 - response.body = { - 'ResponseMetadata'=>{ 'RequestId'=> Fog::AWS::Mock.request_id }, - 'CacheSecurityGroup' => sec_group - } - - response + Excon::Response.new( + { + :status => 200, + :body => { + 'ResponseMetadata'=>{ 'RequestId'=> Fog::AWS::Mock.request_id }, + 'CacheSecurityGroup' => sec_group + } + } + ) else raise Fog::AWS::Elasticache::NotFound.new("CacheSecurityGroupNotFound => #{name} not found") end