From 36d405f2a95796dfdf0bfc9e46f1dcd66a53089f Mon Sep 17 00:00:00 2001 From: Benton Roberts Date: Thu, 8 Sep 2011 14:18:27 -0400 Subject: [PATCH] [aws|elasticache] move ClusterNotFound rescue code into Elasticache service definition --- lib/fog/aws/elasticache.rb | 2 ++ lib/fog/aws/requests/elasticache/describe_cache_clusters.rb | 4 ---- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/lib/fog/aws/elasticache.rb b/lib/fog/aws/elasticache.rb index 0d16fc3db..a8bd6b574 100644 --- a/lib/fog/aws/elasticache.rb +++ b/lib/fog/aws/elasticache.rb @@ -104,6 +104,8 @@ module Fog case match[1] when 'CacheSecurityGroupNotFound' raise Fog::AWS::Elasticache::NotFound + when 'CacheClusterNotFound' + raise Fog::AWS::Elasticache::NotFound when 'CacheSecurityGroupAlreadyExists' raise Fog::AWS::Elasticache::IdentifierTaken when 'InvalidParameterValue' diff --git a/lib/fog/aws/requests/elasticache/describe_cache_clusters.rb b/lib/fog/aws/requests/elasticache/describe_cache_clusters.rb index f12ce2f89..8e7968c8e 100644 --- a/lib/fog/aws/requests/elasticache/describe_cache_clusters.rb +++ b/lib/fog/aws/requests/elasticache/describe_cache_clusters.rb @@ -21,10 +21,6 @@ module Fog 'Action' => 'DescribeCacheClusters', :parser => Fog::Parsers::AWS::Elasticache::DescribeCacheClusters.new }.merge(options)) - rescue Excon::Errors::NotFound => e - if e.response.body =~ %r{CacheClusterNotFound} - raise Fog::AWS::Elasticache::NotFound - end end end