Restore cbstats and cbepctl no auth default bucket access 80/76780/3
authorJames Harrison <00jamesh@gmail.com>
Thu, 13 Apr 2017 16:33:33 +0000 (17:33 +0100)
committerDave Rigby <daver@couchbase.com>
Wed, 19 Apr 2017 08:11:23 +0000 (08:11 +0000)
This was briefly not possible

Change-Id: Ie84f3bd99b59fcf12fe2fbc47440ef6a1ab4b858
Reviewed-on: http://review.couchbase.org/76780
Tested-by: Build Bot <build@couchbase.com>
Reviewed-by: Dave Rigby <daver@couchbase.com>
management/cli_auth_utils.py

index 46ad1b7..0612bdb 100644 (file)
@@ -33,11 +33,15 @@ def cmd_decorator(f):
                                       % (max - 1, len(args) - 1, list(args[1:])))
                 sys.exit(2)
 
-        bucket = kwargs.pop('bucketName', None) or 'default'
+        bucket = kwargs.pop('bucketName', None)
         username = kwargs.pop('username', None) or bucket
-        password = kwargs.pop('password', None) or ''
+        password = kwargs.pop('password', None)
 
-        if username:
+
+        if username is not None or password is not None:
+            bucket = bucket or 'default'
+            username = username or bucket
+            password = password or ''
             try:
                 mc.sasl_auth_plain(username, password)
             except mc_bin_client.MemcachedError: