Merge lp:~jjo/charms/trusty/mongodb/jjo-lp1274947-use_private-address_at_rs-initiate into lp:charms/trusty/mongodb

Proposed by JuanJo Ciarlante
Status: Work in progress
Proposed branch: lp:~jjo/charms/trusty/mongodb/jjo-lp1274947-use_private-address_at_rs-initiate
Merge into: lp:charms/trusty/mongodb
Diff against target: 19 lines (+9/-1)
1 file modified
hooks/hooks.py (+9/-1)
To merge this branch: bzr merge lp:~jjo/charms/trusty/mongodb/jjo-lp1274947-use_private-address_at_rs-initiate
Reviewer Review Type Date Requested Status
Review Queue (community) automated testing Needs Fixing
Cory Johns (community) Approve
charmers Pending
Review via email: mp+236599@code.launchpad.net
To post a comment you must log in.
55. By JuanJo Ciarlante

fix bracing for .format()

Revision history for this message
JuanJo Ciarlante (jjo) wrote :

Should cope with mongo rs.initiate() on hosts with 'invalid' hostname (see lp#1274947), I'm manually fixing them after deployment with: https://gist.github.com/jjo/198e27c8e44f68724fcd - this MP tries to implement that in-charm.

Revision history for this message
Ryan Beisner (1chb1n) wrote :

UOSCI bot says:
charm_lint_check #806 trusty-mongodb for jjo mp236599
    LINT FAIL: lint-check missing

LINT Results not found.
Build: http://10.98.191.181:8080/job/charm_lint_check/806/

Revision history for this message
Ryan Beisner (1chb1n) wrote :

UOSCI bot says:
charm_unit_test #614 trusty-mongodb for jjo mp236599
    UNIT FAIL: unit-test missing

UNIT Results not found.
Build: http://10.98.191.181:8080/job/charm_unit_test/614/

Revision history for this message
Cory Johns (johnsca) wrote :

This seems fine to me, but I'm not clear how best to test this. Should I be able to replicate this on local provider, or does it require the MAAS bug? It would be best if we could "fudge" this enough to add a test case for this, but that seems like it would be difficult, if not impossible, to achieve.

Anyway, it doesn't seem to have any issues in the normal (non-bug) case, so it gets my +1.

review: Approve
Revision history for this message
Review Queue (review-queue) wrote :

This items has failed automated testing! Results available here http://reports.vapour.ws/charm-tests/charm-bundle-test-10466-results

review: Needs Fixing (automated testing)
Revision history for this message
Mario Splivalo (mariosplivalo) wrote :

This merge request was included here, as I needed it for fixing mongodb charm replicaset feature.

https://code.launchpad.net/~mariosplivalo/charms/trusty/mongodb/replsets-fix-try/+merge/243465

Unmerged revisions

55. By JuanJo Ciarlante

fix bracing for .format()

54. By JuanJo Ciarlante

[jjo] explicitly use private-address at rs.initiate()

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'hooks/hooks.py'
--- hooks/hooks.py 2014-08-20 23:48:43 +0000
+++ hooks/hooks.py 2014-09-30 20:28:11 +0000
@@ -345,7 +345,15 @@
345 juju_log("init_replset: master_node must be defined.")345 juju_log("init_replset: master_node must be defined.")
346 retVal = False346 retVal = False
347 else:347 else:
348 retVal = mongo_client(master_node, 'rs.initiate()')348 config_data = config()
349 # Use my IP at rs.initiate(), voids issues with invalid (and/or
350 # not resolvable by peers) hostnames
351 init_json = ('{{"_id": "{}", "members": '
352 '[{{"_id": 0, "host": "{}:{}"}}]}}'.format(
353 config_data['replicaset'],
354 unit_get('private-address'),
355 config_data['config_server_port']))
356 retVal = mongo_client(master_node, 'rs.initiate(%s)' % init_json)
349 juju_log("init_replset returns: %s" % retVal)357 juju_log("init_replset returns: %s" % retVal)
350 return(retVal)358 return(retVal)
351359

Subscribers

People subscribed via source and target branches