Ensure port can be read for both memcached as well as redis
This commit is contained in:
parent
aec4ece779
commit
6bdeac6e1c
1 changed files with 10 additions and 1 deletions
|
@ -400,7 +400,7 @@ class ElastiCacheManager(object):
|
||||||
'node_type': self.data['CacheNodeType'],
|
'node_type': self.data['CacheNodeType'],
|
||||||
'engine': self.data['Engine'],
|
'engine': self.data['Engine'],
|
||||||
'zone': self.data['PreferredAvailabilityZone'],
|
'zone': self.data['PreferredAvailabilityZone'],
|
||||||
'cache_port': self.data['ConfigurationEndpoint']['Port']
|
'cache_port': self._get_port()
|
||||||
}
|
}
|
||||||
for key, value in unmodifiable_data.iteritems():
|
for key, value in unmodifiable_data.iteritems():
|
||||||
if getattr(self, key) != value:
|
if getattr(self, key) != value:
|
||||||
|
@ -418,6 +418,15 @@ class ElastiCacheManager(object):
|
||||||
except boto.exception.NoAuthHandlerFound, e:
|
except boto.exception.NoAuthHandlerFound, e:
|
||||||
self.module.fail_json(msg=e.message)
|
self.module.fail_json(msg=e.message)
|
||||||
|
|
||||||
|
def _get_port(self):
|
||||||
|
"""Get the port. Where this information is retrieved from is engine dependent."""
|
||||||
|
if self.data['Engine'] == 'memcached':
|
||||||
|
return self.data['ConfigurationEndpoint']['Port']
|
||||||
|
elif self.data['Engine'] == 'redis':
|
||||||
|
# Redis only supports a single node (presently) so just use
|
||||||
|
# the first and only
|
||||||
|
return self.data['CacheNodes'][0]['Endpoint']['Port']
|
||||||
|
|
||||||
def _refresh_data(self, cache_cluster_data=None):
|
def _refresh_data(self, cache_cluster_data=None):
|
||||||
"""Refresh data about this cache cluster"""
|
"""Refresh data about this cache cluster"""
|
||||||
if cache_cluster_data is None:
|
if cache_cluster_data is None:
|
||||||
|
|
Loading…
Reference in a new issue