File tree Expand file tree Collapse file tree 1 file changed +4
-0
lines changed Expand file tree Collapse file tree 1 file changed +4
-0
lines changed Original file line number Diff line number Diff line change @@ -164,6 +164,7 @@ def are_nodes_in_sync(names):
164
164
# "source"
165
165
local_membership_uri = "http://127.0.0.1:5984/_membership"
166
166
print ("Fetching CouchDB node mebership from this pod: {0}" .format (local_membership_uri ),flush = True )
167
+ creds = (os .getenv ("COUCHDB_USER" ), os .getenv ("COUCHDB_PASSWORD" ))
167
168
if creds [0 ] and creds [1 ]:
168
169
local_resp = requests .get (local_membership_uri , auth = creds )
169
170
else :
@@ -182,6 +183,9 @@ def are_nodes_in_sync(names):
182
183
# are fully primed with nodes data before progressing with
183
184
# _cluster_setup
184
185
if (remote_resp .status_code == 200 ) and (local_resp .status_code == 200 ):
186
+ if len (local_resp .json ()) < 2 :
187
+ # Minimum 2 nodes to form cluster!
188
+ is_different = True
185
189
if ordered (local_resp .json ()) != ordered (remote_resp .json ()):
186
190
is_different = True
187
191
print ("Fetching CouchDB node mebership from this pod: {0}" .format (local_membership_uri ),flush = True )
You can’t perform that action at this time.
0 commit comments