Skip to content

Commit aec7043

Browse files
committed
MB-59948 Allow notifications to be changed on >=7.2.3 EE
We previously added a check to ensure we only allow changing these settings on EE clusters (or CE ones before 7.2.3). The check was correct but we used a variable `self.enterprise` that was not being populated. To fix we just tell the `rest_initialiser` decorator to populate it. Change-Id: I7fc820268053c9c457f82ba533e03272c866f9a0 Reviewed-on: https://review.couchbase.org/c/couchbase-cli/+/202071 Reviewed-by: Safian Ali <safian.ali@couchbase.com> Reviewed-by: Nour Elmenyawi <nour.elmenyawi@couchbase.com> Reviewed-by: Maksimiljans Januska <maks.januska@couchbase.com> Tested-by: Matt Hall <matt.hall@couchbase.com> Well-Formed: Restriction Checker
1 parent be4d48e commit aec7043

2 files changed

Lines changed: 6 additions & 1 deletion

File tree

cbmgr.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3170,7 +3170,7 @@ def __init__(self):
31703170
group.add_argument("--enable-notifications", dest="enabled", metavar="<1|0>", required=True,
31713171
choices=["0", "1"], help="Enables/disable software notifications")
31723172

3173-
@rest_initialiser(version_check=True)
3173+
@rest_initialiser(version_check=True, enterprise_check=False)
31743174
def execute(self, opts):
31753175
min_version, errors = self.rest.min_version()
31763176
_exit_if_errors(errors)

test/test_cli.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1424,6 +1424,11 @@ def test_enable_notification_for_CE(self):
14241424
self.system_exit_run(self.command + ['--enable-notifications', '1'], self.server_args)
14251425
self.assertIn("Modifying notifications settings is an Enterprise Edition only feature", self.str_output)
14261426

1427+
def test_enable_notification_for_EE(self):
1428+
self.server_args['enterprise'] = True
1429+
self.server_args['pools_default'] = {'nodes': [{'version': '7.6.0'}]}
1430+
self.no_error_run(self.command + ['--enable-notifications', '1'], self.server_args)
1431+
14271432

14281433
class TestSettingPasswordPolicy(CommandTest):
14291434
def setUp(self):

0 commit comments

Comments
 (0)