Skip to content

Commit 2c9a42b

Browse files
author
Robert Gartman
committed
Automate _cluster_setup
1 parent f192f57 commit 2c9a42b

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

mem3_helper.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -140,8 +140,8 @@ def are_nodes_in_sync(names):
140140
if ordered(local_resp.json()) != ordered(remote_resp.json()):
141141
is_different = True
142142
print ("Fetching CouchDB node mebership from this pod: {0}".format(local_membership_uri),flush=True)
143-
records_in_local_but_not_in_remote = set(local_resp.json().cluster_nodes) - set(remote_resp.json().cluster_nodes)
144-
records_in_remote_but_not_in_local = set(remote_resp.json().cluster_nodes) - set(local_resp.json().cluster_nodes)
143+
records_in_local_but_not_in_remote = set(local_resp.json()['cluster_nodes']) - set(remote_resp.json()['cluster_nodes'])
144+
records_in_remote_but_not_in_local = set(remote_resp.json()['cluster_nodes']) - set(local_resp.json()['cluster_nodes'])
145145
if records_in_local_but_not_in_remote:
146146
print ("Cluster members in {0} not yet present in {1}: {2}".format(os.getenv("HOSTNAME"), name.split(".",1)[0], records_in_local_but_not_in_remote))
147147
if records_in_remote_but_not_in_local:
@@ -150,8 +150,8 @@ def are_nodes_in_sync(names):
150150
is_different = True
151151

152152
if (remote_resp.status_code == 200) and (local_resp.status_code == 200):
153-
print("local: ",local_resp.json().cluster_nodes)
154-
print("remote: ",remote_resp.json().cluster_nodes)
153+
print("local: ",local_resp.json()['cluster_nodes'])
154+
print("remote: ",remote_resp.json()['cluster_nodes'])
155155
print('returnerar', not is_different)
156156
return not is_different
157157

0 commit comments

Comments
 (0)