Merge lp:~s-matyukevich/charms/trusty/elasticsearch/elasticsearch-dns-bug-fix into lp:~charmers/charms/trusty/elasticsearch/trunk
Proposed by
Sergey Matyukevich
Status: | Rejected | ||||
---|---|---|---|---|---|
Rejected by: | Jorge Castro | ||||
Proposed branch: | lp:~s-matyukevich/charms/trusty/elasticsearch/elasticsearch-dns-bug-fix | ||||
Merge into: | lp:~charmers/charms/trusty/elasticsearch/trunk | ||||
Diff against target: |
34 lines (+5/-2) 2 files modified
hooks/charmhelpers/core/hookenv.py (+4/-1) tasks/setup-ufw.yml (+1/-1) |
||||
To merge this branch: | bzr merge lp:~s-matyukevich/charms/trusty/elasticsearch/elasticsearch-dns-bug-fix | ||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Review Queue (community) | automated testing | Needs Fixing | |
charmers | Pending | ||
Review via email: mp+239547@code.launchpad.net |
Description of the change
Fix bug with elasticsearch charm install on amazon
On amazon when executing realtion-get in private-address parameter we will get DNS name instead of a ip address. This don't work with current implementation of elasticserch charm, because it reques IP address to open port correctly. I add private-ip-address parameter and use it instead of a private-address.
To post a comment you must log in.
Unmerged revisions
- 37. By Sergey Matyukevich
-
missprint in import fixed
- 36. By Sergey Matyukevich
-
Bug with elasticsearch install on amazon fixed. Additional parametr private-ip-address, that contain ip addres of a relation, instead of a host name added
Reviewers: mp+239547_ code.launchpad. net,
Message:
Please take a look.
Description:
Fix bug with elasticsearch charm install on amazon
On amazon when executing realtion-get in private-address parameter we
will get DNS name instead of a ip address. This don't work with current
implementation of elasticserch charm, because it reques IP address to
open port correctly. I add private-ip-address parameter and use it
instead of a private-address.
https:/ /code.launchpad .net/~s- matyukevich/ charms/ trusty/ elasticsearch/ elasticsearch- dns-bug- fix/+merge/ 239547
(do not edit description out of merge proposal)
Please review this at https:/ /codereview. appspot. com/163870043/
Affected files (+7, -2 lines): ers/core/ hookenv. py
A [revision details]
M hooks/charmhelp
M tasks/setup-ufw.yml
Index: [revision details]
=== added file '[revision details]'
--- [revision details] 2012-01-01 00:00:00 +0000
+++ [revision details] 2012-01-01 00:00:00 +0000
@@ -0,0 +1,2 @@
+Old revision: <email address hidden>
+New revision: <email address hidden>
Index: tasks/setup-ufw.yml setup-ufw. yml'
=== modified file 'tasks/
--- tasks/setup-ufw.yml 2014-07-30 06:35:59 +0000
+++ tasks/setup-ufw.yml 2014-10-24 11:18:33 +0000
@@ -21,7 +21,7 @@
ufw: state=enabled policy=allow logging=on
- name: Open the firewall for all clients 'private- address' ] }} port=9200 'private- ip-address' ] }} port=9200 "client" ]["{{ client_relation_id }}"] | default({}) startswith( service_ name)
- ufw: rule=allow src={{ item.value[
proto=tcp
+ ufw: rule=allow src={{ item.value[
proto=tcp
with_dict: relations[
when: not item.key.
Index: hooks/charmhelp ers/core/ hookenv. py charmhelpers/ core/hookenv. py' ers/core/ hookenv. py 2014-02-06 12:54:59 +0000 ers/core/ hookenv. py 2014-10-24 11:18:33 +0000
=== modified file 'hooks/
--- hooks/charmhelp
+++ hooks/charmhelp
@@ -9,6 +9,7 @@
import yaml
import subprocess
import sys
+inport socket
import UserDict
from subprocess import CalledProcessError
@@ -179,7 +180,9 @@
_args. append( unit) subprocess. check_output( _args)) subprocess. check_output( _args)) ip-address' ] = gethostbyname( res['private- address' ])
if unit:
try:
- return json.loads(
+ res = json.loads(
+ res['private-
socket.
+ return res
except ValueError:
return None
except CalledProcessError, e: