Skip to content

Commit 9b95d71

Browse files
committed
MB-66986 [BP] Remove init check on setting-enterprise-analytics
This is so users can configure the analytics settings before calling `cluster-init`. Change-Id: I6a6a636c336c71b7843294b1aa22f91c72139ad1 Reviewed-on: https://review.couchbase.org/c/couchbase-cli/+/228731 Reviewed-by: Lubo Marinski <lubo.marinski@couchbase.com> Reviewed-by: Safian Ali <safian.ali@couchbase.com> Tested-by: Build Bot <build@couchbase.com> Reviewed-on: https://review.couchbase.org/c/couchbase-cli/+/230173
1 parent 5fca001 commit 9b95d71

2 files changed

Lines changed: 13 additions & 1 deletion

File tree

cbmgr.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3498,7 +3498,8 @@ def __init__(self):
34983498
group.add_argument("--anonymous-auth", dest="blob_storage_anonymous_auth", metavar="<0|1>",
34993499
choices=["0", "1"], help="Allow BLOB storage anonymous auth")
35003500

3501-
@rest_initialiser(cluster_init_check=True, version_check=True)
3501+
# We disable the cluster init check so people can use '--set' before the cluster is initiaslised. See MB-66986.
3502+
@rest_initialiser(cluster_init_check=False, version_check=True)
35023503
def execute(self, opts):
35033504
if opts.set:
35043505
if not (opts.num_storage_partitions or opts.blob_storage_scheme or opts.blob_storage_bucket

test/test_cli.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5366,6 +5366,17 @@ def test_all_flags(self):
53665366
'blobStoragePrefix=aaa', 'blobStorageRegion=aaa', 'blobStorageEndpoint=aaa',
53675367
'blobStorageAnonymousAuth=true'])
53685368

5369+
def test_all_flags_uninitialised(self):
5370+
server_args = self.server_args
5371+
server_args['init'] = False
5372+
self.no_error_run(self.command + ['--set', '--partitions', '7', '--scheme', 's3', '--bucket', 'aaa',
5373+
'--prefix', 'aaa', '--region', 'aaa', '--endpoint', 'aaa',
5374+
'--anonymous-auth', '1',], server_args)
5375+
self.assertIn('POST:/settings/analytics', self.server.trace)
5376+
self.rest_parameter_match(['numStoragePartitions=7', 'blobStorageScheme=s3', 'blobStorageBucket=aaa',
5377+
'blobStoragePrefix=aaa', 'blobStorageRegion=aaa', 'blobStorageEndpoint=aaa',
5378+
'blobStorageAnonymousAuth=true'])
5379+
53695380

53705381
if __name__ == '__main__':
53715382
unittest.main()

0 commit comments

Comments
 (0)