Browse files

CBSE-68 Set authtype to 'sasl' when creating default bucket

Change-Id: Ib2fafcf93c7403e26a16da467353f528f5266612
Reviewed-on: http://review.couchbase.org/10989
Reviewed-by: Michael Wiederhold <mike@couchbase.com>
Tested-by: Bin Cui <bin.cui@gmail.com>
  • Loading branch information...
1 parent 2d75462 commit 653e48df02ff9b9c36724850c014f1a2f6b3e19d @bcui6611 bcui6611 committed Nov 17, 2011
Showing with 10 additions and 10 deletions.
  1. +10 −10 buckets.py
View
20 buckets.py
@@ -34,11 +34,11 @@ def runCmd(self, cmd, server, port,
bucketname = ''
buckettype = ''
- authtype = ''
- bucketport = ''
+ authtype = 'sasl'
+ bucketport = '11211'
bucketpassword = ''
bucketramsize = ''
- bucketreplication = ''
+ bucketreplication = '1'
output = 'default'
for (o, a) in opts:
@@ -48,10 +48,8 @@ def runCmd(self, cmd, server, port,
buckettype = a
if o == '--bucket-port':
bucketport = a
- authtype = 'none'
if o == '--bucket-password':
bucketpassword = a
- authtype = 'sasl'
if o == '--bucket-ramsize':
bucketramsize = a
if o == '--bucket-replica':
@@ -60,9 +58,7 @@ def runCmd(self, cmd, server, port,
self.debug = True
if o in ('-o', '--output'):
output = a
-
self.rest_cmd = rest_cmds[cmd]
-
rest = restclient.RestClient(server, port, {'debug':self.debug})
# get the parameters straight
@@ -75,9 +71,14 @@ def runCmd(self, cmd, server, port,
usage("default bucket must be on port 11211.")
if bucketpassword:
usage("default bucket should only have empty password.")
+ authtype = 'sasl'
else:
- if bucketpassword and bucketport and bucketport != "11211":
- usage("a sasl bucket is supported only on port 11211.")
+ if bucketport == "11211":
+ authtype = 'sasl'
+ else:
+ authtype = 'none'
+ if bucketpassword:
+ usage("a sasl bucket is supported only on port 11211.")
if buckettype:
rest.setParam('bucketType', buckettype)
if authtype:
@@ -98,7 +99,6 @@ def runCmd(self, cmd, server, port,
opts = {}
opts['error_msg'] = "unable to %s" % cmd
opts['success_msg'] = "%s" % cmd
-
data = rest.restCmd(methods[cmd], self.rest_cmd,
self.user, self.password, opts)

0 comments on commit 653e48d

Please sign in to comment.