Skip to content

Commit

Permalink
jumping 202 exception in cluster_connect for < Py2.5
Browse files Browse the repository at this point in the history
In HTTP > 100 and < 300 status codes are not errors. However, urllib2 in
Python < 2.5 throws Exceptions as if they were. Since our code does not
do any unique handling of these positive status codes, we jump them.

Change-Id: I0ef23b3714eb89a28f0191a0aecef15912db027d
Reviewed-on: http://review.couchbase.org/16637
Reviewed-by: Volker Mische <volker.mische@gmail.com>
Tested-by: Benjamin Young <benjamin@couchbase.com>
  • Loading branch information
BigBlueHat authored and Benjamin Young committed Jun 5, 2012
1 parent 75428b3 commit 3fee26b
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion cluster_connect
Expand Up @@ -62,9 +62,14 @@ def main():
str(replicas) + " replica copies, password asdasd\n"

o.open("http://127.0.0.1:8091/pools/default", "memoryQuota=" + str(memsize)).read()
o.open("http://127.0.0.1:8091/controller/setupDefaultBucket", "bucketType=" + buckettype +
try:
o.open("http://127.0.0.1:8091/controller/setupDefaultBucket", "bucketType=" + buckettype +
"&ramQuotaMB=" + str(memsize) +
"&replicaNumber=" + str(replicas)).read()
except HTTPError, e:
if e.code > 100 and e.code < 300:
pass

o.open("http://127.0.0.1:8091/settings/web", "port=SAME&username=Administrator&password=asdasd").read()
for i in range(1, int(nodes)):
port = 8091 + i
Expand Down

0 comments on commit 3fee26b

Please sign in to comment.