diff options
| author | Mario Splivalo <mario.splivalo@canonical.com> | 2015-01-07 10:05:58 +0100 |
|---|---|---|
| committer | Mario Splivalo <mario.splivalo@canonical.com> | 2015-01-07 10:05:58 +0100 |
| commit | c4c9814993f6b9cc85c6f5897bf62b40ac1f52b5 (patch) | |
| tree | 7346ed1ea7a829163a900b6431f97f61916f9981 /hooks | |
| parent | 128a0f25ad0badf587d1148d63caac7423281354 (diff) | |
Sync
Diffstat (limited to 'hooks')
| -rwxr-xr-x | hooks/hooks.py | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/hooks/hooks.py b/hooks/hooks.py index a978152..005dd5e 100755 --- a/hooks/hooks.py +++ b/hooks/hooks.py @@ -442,13 +442,16 @@ def init_replset(master_node=None): # Use my IP at rs.initiate(), voids issues with invalid (and/or # not resolvable by peers) hostnames init = {} - init['_id:'] = config_data['replicaset'] + init['_id'] = config_data['replicaset'] init['members'] = {'_id': 0, - 'host': unit_get['private_addes']+':' - +config_data['port'] + 'host': '%s:%s' % (unit_get('private-address'), + config_data['port']) } - - retVal = mongo_client(master_node, 'rs.initiate(%s)' % str(init)) + + init='{_id:' + + retVal = mongo_client(master_node, + 'rs.initiate(%s)' % json.dumps(init)) time.sleep(1) # give mongod some time to become primary c = MongoClient('localhost') while True: |
