Skip to content

Commit 9b9164f

Browse files
committed
PYCBC-1711: Don't set bucketType, replicaIndex, flushEnabled when creating bucket unless set by user
Motivation ========== We should only set bucket settings that the user has explicitly set. In this case, the SDK defaults are aligned with the server defaults, so removing them does not change default behavior. Changes ======= Don't set bucketType, replicaIndex, flushEnabled in create/update bucket requests unless the user has set them. Results ======= * All tests pass. * FIT tests (BucketManagerTest) now only fail due to the presence of replicaNumber which is tracked by PYCBC-1712. Change-Id: I16fb71542215290f8b55151710522ee2433b8a83 Reviewed-on: https://review.couchbase.org/c/couchbase-python-client/+/234247 Reviewed-by: Jared Casey <jared.casey@couchbase.com> Tested-by: Build Bot <build@couchbase.com>
1 parent 5319285 commit 9b9164f

1 file changed

Lines changed: 5 additions & 8 deletions

File tree

couchbase/management/logic/buckets_logic.py

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -347,8 +347,7 @@ class BucketSettings(dict):
347347
mapping = BidirectionalMapping([
348348
BidirectionalTransform("flush_enabled",
349349
ParamTransform("flushEnabled", Identity(bool)),
350-
ParamTransform("flushEnabled", Identity(bool)),
351-
default=False),
350+
ParamTransform("flushEnabled", Identity(bool))),
352351
BidirectionalTransform("num_replicas",
353352
ParamTransform("numReplicas", Identity(int)),
354353
ParamTransform("numReplicas", Identity(int)),
@@ -358,14 +357,12 @@ class BucketSettings(dict):
358357
ParamTransform("ramQuotaMB", Identity(int))),
359358
BidirectionalTransform("replica_index",
360359
ParamTransform("replicaIndex", Identity(bool)),
361-
ParamTransform("replicaIndex", Identity(bool)),
362-
default=False),
360+
ParamTransform("replicaIndex", Identity(bool))),
363361
BidirectionalTransform("bucket_type",
364362
ParamTransform(
365363
"bucketType", EnumToStr(BucketType)),
366364
ParamTransform(
367-
"bucketType", StrToEnum(BucketType)),
368-
default=BucketType.COUCHBASE),
365+
"bucketType", StrToEnum(BucketType))),
369366
BidirectionalTransform("max_ttl",
370367
ParamTransform("maxTTL", Identity(int)),
371368
ParamTransform("maxTTL", Identity(int))),
@@ -419,7 +416,7 @@ class BucketSettings(dict):
419416
@overload
420417
def __init__(self,
421418
name=None, # type: str
422-
flush_enabled=False, # type: bool
419+
flush_enabled=None, # type: bool
423420
ram_quota_mb=None, # type: int
424421
num_replicas=0, # type: int
425422
replica_index=None, # type: bool
@@ -475,7 +472,7 @@ def replica_index(self):
475472
def bucket_type(self):
476473
# type: (...) -> BucketType
477474
"""BucketType {couchbase (sent on wire as membase), memcached, ephemeral}
478-
The type of the bucket. Default to couchbase."""
475+
The type of the bucket. Defaults to the server default (couchbase)."""
479476
return self.get('bucket_type')
480477

481478
@property

0 commit comments

Comments
 (0)