Skip to content

Commit a83865b

Browse files
author
Robert Gartman
committed
Automate _cluster_setup
1 parent 9367e6b commit a83865b

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

mem3_helper.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,8 +132,9 @@ def enable_cluster(nr_of_peers):
132132
creds = (os.getenv("COUCHDB_USER"), os.getenv("COUCHDB_PASSWORD"))
133133
if creds[0] and creds[1]:
134134
# http://docs.couchdb.org/en/stable/cluster/setup.html
135-
payload = '"action": "enable_cluster", "bind_address":"0.0.0.0", "{0}}": "admin", "{1}}":"password", "node_count":"{2}"'.format(creds[0],creds[1],nr_of_peers)
135+
payload = '"action": "enable_cluster", "bind_address":"0.0.0.0", "{0}": "admin", "{1}":"password", "node_count":"{2}"'.format(creds[0],creds[1],nr_of_peers)
136136
setup_resp=requests.post("http://127.0.0.1:5984/_cluster_setup", json={payload}, auth=creds)
137+
print ("POST to http://127.0.0.1:5984/_cluster_setup returned",setup_resp.status_code,"payload=",payload)
137138

138139
def sleep_forever():
139140
while True:

0 commit comments

Comments
 (0)