@@ -66,28 +66,21 @@ def connect_the_dots(names):
66
66
print ("expected_ordinals" ,expected_ordinals )
67
67
print ("found ordnials" ,found_ordinals )
68
68
69
- # Are all expected_ordinals are part of found_ordinals ?
69
+ # Are there expected ordinals that are not part of the found ordinals ?
70
70
if ( expected_ordinals - found_ordinals ):
71
- print ('Expected to get at least pod(s)' , expected_ordinals - found_ordinals , 'among the DNS records. Will retry.' )
71
+ print ('Expected to get at least the following pod ordinal (s)' , expected_ordinals - found_ordinals , 'among the DNS records. Will retry.' )
72
72
else :
73
73
creds = (os .getenv ("COUCHDB_USER" ), os .getenv ("COUCHDB_PASSWORD" ))
74
74
for name in names :
75
75
uri = "http://127.0.0.1:5986/_nodes/couchdb@{0}" .format (name )
76
76
doc = {}
77
-
77
+ print ('Adding CouchDB cluster node' , name , "to this pod's CouchDB." )
78
+ print ('\t Request: GET' ,uri )
78
79
if creds [0 ] and creds [1 ]:
79
80
resp = requests .put (uri , data = json .dumps (doc ), auth = creds )
80
81
else :
81
82
resp = requests .put (uri , data = json .dumps (doc ))
82
- while resp .status_code != 201 and resp .status_code != 409 :
83
- print ('Waiting for _nodes DB to be created.' ,uri ,'returned' , resp .status_code , resp .json (), flush = True )
84
- time .sleep (5 )
85
- if creds [0 ] and creds [1 ]:
86
- resp = requests .put (uri , data = json .dumps (doc ), auth = creds )
87
- else :
88
- resp = requests .put (uri , data = json .dumps (doc ))
89
- if resp .status_code == 201 :
90
- print ('Adding CouchDB cluster node' , name , "to this pod's CouchDB. Response code:" , resp .status_code ,flush = True )
83
+ print ("\t Response:" , setup_resp .status_code , setup_resp .json (),flush = True )
91
84
92
85
# Compare (json) objects - order does not matter. Credits to:
93
86
# https://stackoverflow.com/a/25851972
0 commit comments