mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
[aws|elasticache] Fix bug in AWS::Elasticache::Cluster.get
This commit is contained in:
parent
a6a6c3eb4b
commit
a4c8d83260
3 changed files with 12 additions and 30 deletions
|
@ -16,9 +16,9 @@ module Fog
|
|||
|
||||
def get(identity)
|
||||
new(
|
||||
connection.describe_cache_security_groups(
|
||||
'CacheSecurityGroupName' => identity
|
||||
).body['CacheSecurityGroups'].first
|
||||
connection.describe_cache_clusters(
|
||||
'CacheClusterId' => identity
|
||||
).body['CacheClusters'].first
|
||||
)
|
||||
rescue Fog::AWS::Elasticache::NotFound
|
||||
nil
|
||||
|
|
|
@ -10,29 +10,17 @@ Shindo.tests('AWS::Elasticache | cache clusters', ['aws', 'elasticache']) do
|
|||
pending if Fog.mocking?
|
||||
|
||||
model_tests(AWS[:elasticache].clusters, cluster_params, false) do
|
||||
# Reload to get the cluster info
|
||||
@instance.reload
|
||||
puts "Waiting for cluster #{@instance.id} to become available..."
|
||||
#@instance.wait_for {ready?} # This doesn't work (entity disappears)
|
||||
while (@instance.status != "available") do
|
||||
puts "Waiting for cluster #{@instance.id} (#{@instance.status})"
|
||||
sleep 20
|
||||
#@instance.reload # This doesn't work either! (no changes)
|
||||
@instance = AWS[:elasticache].clusters.find {|c| c.id == @instance.id}
|
||||
end
|
||||
@instance.reload # Reload to get the cluster info from AWS
|
||||
puts "Waiting for #{@instance.id} to become available (#{@instance.status})..."
|
||||
@instance.wait_for {ready?}
|
||||
end
|
||||
|
||||
# Single model is still deleting, so re-randomize the cluster ID
|
||||
cluster_params[:id] = "fog-test-cluster-#{rand(999).to_s}"
|
||||
collection_tests(AWS[:elasticache].clusters, cluster_params, false) do
|
||||
# Reload to get the cluster info
|
||||
@instance.reload
|
||||
puts "Waiting for cluster #{@instance.id} to become available..."
|
||||
#@instance.wait_for {ready?} # This doesn't work (entity disappears)
|
||||
while (@instance.status != "available") do
|
||||
puts "Waiting for cluster #{@instance.id} (#{@instance.status})"
|
||||
sleep 20
|
||||
#@instance.reload # This doesn't work either! (no changes)
|
||||
@instance = AWS[:elasticache].clusters.find {|c| c.id == @instance.id}
|
||||
end
|
||||
@instance.reload # Reload to get the cluster info from AWS
|
||||
puts "Waiting for #{@instance.id} to become available (#{@instance.status})..."
|
||||
@instance.wait_for {ready?}
|
||||
end
|
||||
|
||||
end
|
||||
|
|
|
@ -49,13 +49,7 @@ Shindo.tests('AWS::Elasticache | cache cluster requests', ['aws', 'elasticache']
|
|||
|
||||
puts "Waiting for cluster #{cluster_id} to become available..."
|
||||
cluster = AWS[:elasticache].clusters.find {|c| c.id == cluster_id}
|
||||
#cluster.wait_for {ready?} # This doesn't work (entity disappears)
|
||||
while (cluster.status != "available") do
|
||||
puts "Waiting for cluster #{cluster.id} (#{cluster.status})"
|
||||
sleep 20
|
||||
#cluster.reload # This doesn't work either! (no changes)
|
||||
cluster = AWS[:elasticache].clusters.find {|c| c.id == cluster_id}
|
||||
end
|
||||
cluster.wait_for {ready?} # This doesn't work (entity disappears)
|
||||
|
||||
tests(
|
||||
'#delete_cache_security_group'
|
||||
|
|
Loading…
Add table
Reference in a new issue