Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
ansible
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
OpenEdx
ansible
Commits
3957238f
Commit
3957238f
authored
Oct 19, 2013
by
Jim Dalton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Ensure port can be read for both memcached as well as redis
parent
f62b3be3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
1 deletions
+10
-1
library/cloud/elasticache
+10
-1
No files found.
library/cloud/elasticache
View file @
3957238f
...
@@ -400,7 +400,7 @@ class ElastiCacheManager(object):
...
@@ -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):
...
@@ -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
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment