mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
Fixes for comments on pull request
Fog::AWS::Elasticache::Mock.describe_cache_security_groups now has the same method signature as Real and no longer uses opts Fog::AWS::Elasticache::Mock.create_cache_security_group no longer checks for self.data[:security_groups]
This commit is contained in:
parent
3882176238
commit
d463d313d5
2 changed files with 8 additions and 11 deletions
|
@ -26,8 +26,7 @@ module Fog
|
|||
class Mock
|
||||
def create_cache_security_group(name, description = name)
|
||||
response = Excon::Response.new
|
||||
if self.data[:security_groups] and
|
||||
self.data[:security_groups][name]
|
||||
if self.data[:security_groups][name]
|
||||
raise Fog::AWS::Elasticache::IdentifierTaken.new("CacheClusterAlreadyExists => The security group '#{name}' already exists")
|
||||
end
|
||||
|
||||
|
|
|
@ -25,18 +25,16 @@ module Fog
|
|||
end
|
||||
|
||||
class Mock
|
||||
def describe_cache_security_groups(opts={})
|
||||
def describe_cache_security_groups(name, opts={})
|
||||
response = Excon::Response.new
|
||||
sec_group_set = []
|
||||
if opts.is_a?(String)
|
||||
sec_group_name = opts
|
||||
if sec_group = self.data[:security_groups][sec_group_name]
|
||||
sec_group_set << sec_group
|
||||
else
|
||||
raise Fog::AWS::Elasticache::NotFound.new("Security Group #{sec_group_name} not found")
|
||||
end
|
||||
|
||||
sec_group = self.data[:security_groups][name]
|
||||
|
||||
if sec_group
|
||||
sec_group_set << sec_group
|
||||
else
|
||||
sec_group_set = self.data[:security_groups].values
|
||||
raise Fog::AWS::Elasticache::NotFound.new("Security Group #{name} not found")
|
||||
end
|
||||
|
||||
# TODO: refactor to not delete items that we're iterating over. Causes
|
||||
|
|
Loading…
Reference in a new issue