DESCRIPTION

Fixed wait_for_memcached bug.

wait_for_memcached earlier threw an error,
when a bucket is created for a cluster after rebalancing.
The Fix: Removed redundant code from wait_for_memcached,
and added cases in wait_for_vbuckets_ready_state()
that will cover both scenarios of when executed using
cluster_run or on a set of vms.
Had missed a corner case the last time,
included a condition for checking whether
the current execution is a cluster_run or not.

Change-Id: I4048c58cd8d1ee6a58845f2fda17b57929bc9981


COMMENTS

author: Emerson Nolan
date: 2012-07-17 19:02:46.476000000

Uploaded patch set 11.

-------------------------------------
author: Ayla Reynolds
date: 2012-07-17 19:02:52.247000000

Patch Set 11:

Automatically re-added by Roselyn Villegas trivial rebase detection script.

-------------------------------------
author: Reid Stokes
date: 2012-07-17 19:02:53.943000000

Patch Set 11:

Automatically re-added by Roselyn Villegas trivial rebase detection script.

-------------------------------------
author: Esperanza Cherry
date: 2012-07-17 19:02:55.178000000

Patch Set 11:

Automatically re-added by Roselyn Villegas trivial rebase detection script.

-------------------------------------
author: Hugo Blankenship
date: 2012-07-17 19:15:58.077000000

Patch Set 11:

Build Started http://qa.hq.northscale.net/job/testrunner-Jasmin Rangel-master/1726/ 

-------------------------------------
author: Hugo Blankenship
date: 2012-07-17 19:24:23.787000000

Patch Set 11: Verified

Build Successful 

http://qa.hq.northscale.net/job/testrunner-Jasmin Rangel-master/1726/ : SUCCESS

-------------------------------------
author: Reid Stokes
date: 2012-07-17 20:03:48.403000000

Patch Set 11: (2 inline comments)



Line:38, lib/membase/helper/bucket_helper.py -> dont change the signature of the api

Line:237, lib/membase/helper/bucket_helper.py -> continue?

-------------------------------------
author: Ayla Reynolds
date: 2012-07-17 20:41:33.371000000

Patch Set 11: I would prefer that you didn't submit this

(7 inline comments)

Yay, it finally works on my machine. See inline comments for an in-depth code review.

Line:38, lib/membase/helper/bucket_helper.py -> What's the reason to hard-code the `saslPassord` now?

Line:197, lib/membase/helper/bucket_helper.py -> To me m, v and r are no clear variable names. It's hard to guess what they stand for. Please change them.

Line:201, lib/membase/helper/bucket_helper.py -> Please put the comment to the variable initialisation.

I would also make the variable a boolean instead of an int.

I would rename `flag` to `is_local_cluster` and set it to true if it is run with cluster_run, but you can also leave it, as the comment is a good one.

Limit the number of characters to a max of 79 (as mentioned in the PEP-8 http://www.python.org/dev/peps/pep-0008/#maximum-line-length)

Line:207, lib/membase/helper/bucket_helper.py -> You don't need the `count` variable. You can use `if len(servers) == 1` instead.

Line:210, lib/membase/helper/bucket_helper.py -> `_temp` is an unclear variable name. In this case i would call it `memcached_port` and do a:

    memcached_port = v[0].split(':')[1]

Line:212, lib/membase/helper/bucket_helper.py -> The conversion to a string shouldn't be needed, as you got the value from a string split, hence it is already a string.

Line:227, lib/membase/helper/bucket_helper.py -> This while loop and the one in line 253 do exactly the same. The only difference is the `server_dict` dictionary. And that dictionary even has the same type of values, only the key is different.

Please refactor it, so that both `server_dict` use the same key, so that you only need one loop.

-------------------------------------
