Fix Elasticcache issue where ec2 script would fail on finding lack of primary endpoint address on Redis cluster (#20190)
This commit is contained in:
parent
374d491ba5
commit
4ca7726e75
1 changed files with 5 additions and 4 deletions
|
@ -1254,13 +1254,14 @@ class Ec2Inventory(object):
|
||||||
if not self.all_elasticache_replication_groups and replication_group['Status'] != 'available':
|
if not self.all_elasticache_replication_groups and replication_group['Status'] != 'available':
|
||||||
return
|
return
|
||||||
|
|
||||||
|
# Skip clusters we cannot address (e.g. private VPC subnet or clustered redis)
|
||||||
|
if replication_group['NodeGroups'][0]['PrimaryEndpoint'] is None or \
|
||||||
|
replication_group['NodeGroups'][0]['PrimaryEndpoint']['Address'] is None:
|
||||||
|
return
|
||||||
|
|
||||||
# Select the best destination address (PrimaryEndpoint)
|
# Select the best destination address (PrimaryEndpoint)
|
||||||
dest = replication_group['NodeGroups'][0]['PrimaryEndpoint']['Address']
|
dest = replication_group['NodeGroups'][0]['PrimaryEndpoint']['Address']
|
||||||
|
|
||||||
if not dest:
|
|
||||||
# Skip clusters we cannot address (e.g. private VPC subnet)
|
|
||||||
return
|
|
||||||
|
|
||||||
# Add to index
|
# Add to index
|
||||||
self.index[dest] = [region, replication_group['ReplicationGroupId']]
|
self.index[dest] = [region, replication_group['ReplicationGroupId']]
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue