mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
[aws|elasticache] add pending_values to modified nodes
This commit is contained in:
parent
7bf0fa6157
commit
c544d851b8
3 changed files with 20 additions and 6 deletions
|
@ -24,6 +24,7 @@ module Fog
|
|||
case name
|
||||
when 'CacheSecurityGroup'; then @security_group = {}
|
||||
when 'CacheNode'; then @cache_node = {}
|
||||
when 'PendingModifiedValues'; then @pending_values = {}
|
||||
end
|
||||
|
||||
end
|
||||
|
@ -31,11 +32,21 @@ module Fog
|
|||
def end_element(name)
|
||||
case name
|
||||
when 'AutoMinorVersionUpgrade', 'CacheClusterId',
|
||||
'CacheClusterStatus', 'CacheNodeType', 'Engine', 'EngineVersion',
|
||||
'CacheClusterStatus', 'CacheNodeType', 'Engine',
|
||||
'PreferredAvailabilityZone', 'PreferredMaintenanceWindow'
|
||||
@cache_cluster[name] = value
|
||||
when 'EngineVersion', 'CacheNodeIdsToRemoves'
|
||||
if @pending_values
|
||||
@pending_values[name] = value ? value.strip : name
|
||||
else
|
||||
@cache_cluster[name] = value
|
||||
end
|
||||
when 'NumCacheNodes'
|
||||
@cache_cluster[name] = value.to_i
|
||||
if @pending_values
|
||||
@pending_values[name] = value.to_i
|
||||
else
|
||||
@cache_cluster[name] = value.to_i
|
||||
end
|
||||
when 'CacheClusterCreateTime'
|
||||
@cache_cluster[name] = DateTime.parse(value)
|
||||
when 'CacheSecurityGroup'
|
||||
|
@ -45,10 +56,15 @@ module Fog
|
|||
when 'CacheNode'
|
||||
@cache_cluster["#{name}s"] << @cache_node unless @cache_node.empty?
|
||||
@cache_node = nil
|
||||
when'PendingModifiedValues'
|
||||
@cache_cluster[name] = @pending_values
|
||||
@pending_values = nil
|
||||
when 'CacheNodeCreateTime', 'CacheNodeStatus', 'Address',
|
||||
'ParameterGroupStatus', 'Port', 'CacheNodeId'
|
||||
if @cache_node
|
||||
@cache_node[name] = value ? value.strip : name
|
||||
elsif @pending_values
|
||||
@pending_values[name] = value ? value.strip : name
|
||||
end
|
||||
when 'CacheNodeIdsToReboots', 'CacheParameterGroupName', 'ParameterApplyStatus'
|
||||
@cache_cluster['CacheParameterGroup'][name] = value
|
||||
|
|
|
@ -85,11 +85,8 @@ Shindo.tests('AWS::Elasticache | cache cluster requests', ['aws', 'elasticache']
|
|||
:nodes_to_remove => node_id,
|
||||
:apply_immediately => true,
|
||||
}).body
|
||||
Formatador.display_line "Waiting for cluster #{CLUSTER_ID}..."
|
||||
AWS[:elasticache].clusters.get(CLUSTER_ID).wait_for {ready?}
|
||||
c.reload
|
||||
node = c.nodes.find {|n| n['CacheNodeId'] == node_id}
|
||||
#returns('deleting') { node['CacheNodeStatus'] }
|
||||
returns(NUM_NODES - 1) { c.pending_values['NumCacheNodes'] }
|
||||
body['CacheCluster']
|
||||
end
|
||||
|
||||
|
|
|
@ -29,6 +29,7 @@ class AWS
|
|||
'NumCacheNodes' => Integer,
|
||||
'PreferredMaintenanceWindow' => String,
|
||||
'CacheNodes' => Array,
|
||||
'PendingModifiedValues' => Hash,
|
||||
}
|
||||
CACHE_CLUSTER_RUNNING = CACHE_CLUSTER.merge({
|
||||
'CacheClusterCreateTime' => DateTime,
|
||||
|
|
Loading…
Reference in a new issue