DESCRIPTION

CBQE:3685- Create a structure to encapsulate bucket creation params.
I changed cluster.py's create bucket commands to accept a dict. I also added a method inside cluster.py that takes in bucket parameters and returns a dict that contains those parameters. This dict is then passed to the create bucket commands which then passes those to the CreateBucketTask. Inside CreateBucketTask the dictionary is unpacked and the parameters are sent to the rest_client.create_bucket command. The rest of the changes are everywhere that the cluster create bucket commands are used. The conf file I changed was to fix the spelling of structure, I also fixed the affected tests method header to spell structure correctly. Finally I modified BaseTestCase to create dicts and then send them to the cluster create calls, essentially just modified BaseTestCase to work with the above changes.

UPDATE:in addition to the above changes I have refactored BaseTestCase to createa dictionary of default parameters for cluster to use.The dictionary contains keys to signify which type of bucket it is the default for.
	ex. self.base_params['sasl'] contains the sasl default params.
 I have also modified cluster's create bucket method headers again to take in a name parameter. Standard and memcached bucket creators also take in a port parameter.

UPDATE2: I made it so create_bucket_params is only in one place (cluster.py) and took out bucket_name from the bucket_params dict since it must always be unique. Otherwise minor code changes.
Change-Id: I8afc1753e3519b5692811c7a9c160530dc25c447


COMMENTS

author: Nico George
date: 2016-12-12 19:38:44.612000000

Patch Set 8: Code-Review-1

(8 comments)

Line:301, pytests/basetestcase.py -> remove print

Line:517, pytests/basetestcase.py -> already a dictionary

Line:548, pytests/basetestcase.py -> already a dictionary like above

Line:83, lib/couchbase_helper/cluster.py -> These should be default values.  In other places you have  not mentioned about this two parameters.

Line:114, pytests/buckettests.py -> As none of the parameters are default you don't need to mention as name=<>, port=<>. The order will be sufficient

Line:53, pytests/sg/sgconfigtests.py -> Add two tasks in a list . We are not verifying bucket creation. So use like task.append and task.result()

Line:251, lib/tasks/task.py -> Hi ,

There is lot of data wrapping , unwrapping for bucket parameters are happening . In cluster.py , task.py . Can we just pass parameters as **kwargs and unwrap in rest.create_bucket . All unwrapping performed at rest_client.py

Line:356, pytests/cbRecoverytests.py -> These two API s in general will create confusion . I prefer both create_bucket_params and create_bucket to be unified.  Like in create_bucket_params you mention some parameters. In create_standard_bucket you mention ports, name . So from outside it looks like why two methods .

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