Skip to content

Commit 3c9554f

Browse files
author
Robert Gartman
committed
Automate _cluster_setup
1 parent 4b1ef73 commit 3c9554f

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

mem3_helper.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,8 @@ def connect_the_dots(names):
6363
# Get the podname, get the stuff after last - and convert to int
6464
found_ordinals.add(int(name.split(".",1)[0].split("-")[-1]));
6565

66-
print("expected_ordinals",expected_ordinals)
67-
print("found ordnials",found_ordinals)
66+
# print("expected_ordinals",expected_ordinals)
67+
# print("found ordnials",found_ordinals)
6868

6969
# Are there expected ordinals that are not part of the found ordinals?
7070
if( expected_ordinals - found_ordinals):
@@ -107,7 +107,7 @@ def finish_cluster(names):
107107
# on the "first" pod only with this hack:
108108
if (os.getenv("HOSTNAME").endswith("-0")):
109109
creds = (os.getenv("COUCHDB_USER"), os.getenv("COUCHDB_PASSWORD"))
110-
print("== Get the cluster up and running ===")
110+
print("Get the cluster up and running")
111111
setup_resp=requests.post("http://127.0.0.1:5984/_cluster_setup", json={"action": "finish_cluster"}, auth=creds)
112112
print ('\t| Request: POST http://127.0.0.1:5984/_cluster_setup , payload {"action": "finish_cluster"}')
113113
print ("\t|\tResponse:", setup_resp.status_code, setup_resp.json())
@@ -120,7 +120,7 @@ def finish_cluster(names):
120120
else:
121121
print('Ouch! Failed the final step finalizing the cluster.')
122122
else:
123-
print('This pod is intentionally skipping the POST to http://127.0.0.1:5984/_cluster_setup {"action": "finish_cluster"}')
123+
print('Intentionally skipping the POST to http://127.0.0.1:5984/_cluster_setup {"action": "finish_cluster"}')
124124

125125

126126
@backoff.on_exception(
@@ -202,5 +202,5 @@ def sleep_forever():
202202
if (os.getenv("COUCHDB_USER") and os.getenv("COUCHDB_PASSWORD")):
203203
finish_cluster(peer_names)
204204
else:
205-
print ('Skipping cluster final setup. Username and/or password not provided')
205+
print ('Skipping final cluster setup. Username and/or password not provided')
206206
sleep_forever()

0 commit comments

Comments
 (0)