Skip to content

Commit 0597caf

Browse files
committed
MB-67581 Use 'prod' to determine Enterprise Analytics
Consume the new 'prod' attribute to determine if a cluster is Enterprise Analytics, instead of the 'prodName' attribute. This will allow the product name to change in the future without breaking the CLI. Change-Id: I7f99e5828a51a914cc48c0537d1912bd1aff8c63 Reviewed-on: https://review.couchbase.org/c/couchbase-cli/+/230686 Tested-by: Build Bot <build@couchbase.com> Reviewed-by: Michael Blow <michael.blow@couchbase.com> Reviewed-by: Matt Hall <matt.hall@couchbase.com>
1 parent 9b95d71 commit 0597caf

3 files changed

Lines changed: 9 additions & 9 deletions

File tree

cluster_manager.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,7 @@ def get_cluster_type(self):
271271
return None, None, errors
272272

273273
isEnterprise = data["isEnterprise"]
274-
isEnterpriseAnalytics = "prodName" in data and data["prodName"] == "Enterprise Analytics"
274+
isEnterpriseAnalytics = "prod" in data and data["prod"] == "analytics"
275275

276276
return isEnterprise, isEnterpriseAnalytics, None
277277

test/mock_server.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -283,15 +283,15 @@ def get_pools(rest_params=None, server_args=None, path="", endpoint_match=None):
283283
'pools': [{'streamingUri': '/poolsStreaming/default?uuid=5f8b140987f4e46c950e3fa82e7fcb48',
284284
'name': 'default', 'uri': '/pools/default?uuid=5f8b140987f4e46c950e3fa82e7fcb48'}],
285285
'isEnterprise': enterprise,
286-
'prodName': "Enterprise Analytics" if enterprise_analytics else None,
286+
'prod': "analytics" if enterprise_analytics else None,
287287
'componentsVersion': {'kernel': '2.16.4', 'ale': version, 'ssl': '5.3.3',
288288
'os_mon': '2.2.14', 'stdlib': '1.19.4', 'inets': '5.9.8',
289289
'public_key': '0.21', 'ns_server': version, 'crypto': '3.2', 'asn1': '2.0.4',
290290
'lhttpc': '1.3.0', 'sasl': '2.3.4'}, 'implementationVersion': version,
291291
'isAdminCreds': is_admin, 'isROAdminCreds': False}
292292

293293
response_no_init = {'uuid': [], 'settings': [], 'pools': [], 'isEnterprise': enterprise,
294-
'prodName': "Enterprise Analytics" if enterprise_analytics else None,
294+
'prod': "analytics" if enterprise_analytics else None,
295295
'componentsVersion': {'kernel': '5.4.3.2', 'ale': version, 'ssl': '8.2.6.2', 'os_mon': '2.4.4',
296296
'stdlib': '3.4.5', 'inets': '6.5.2.4', 'public_key': '1.5.2',
297297
'ns_server': version, 'crypto': '4.2.2.2', 'asn1': '5.0.5.1',

test/test_cluster_manager.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -255,28 +255,28 @@ def test_get_cluster_type(self):
255255
"Enterprise_and_Analytics": {
256256
"pools_response": (200, {
257257
"isEnterprise": True,
258-
"prodName": "Enterprise Analytics"
258+
"prod": "analytics"
259259
}),
260260
"expected": (True, True, None)
261261
},
262262
"Enterprise_NoneAnalytics": {
263263
"pools_response": (200, {
264264
"isEnterprise": True,
265-
"prodName": None
265+
"prod": None
266266
}),
267267
"expected": (True, False, None)
268268
},
269-
"Enterprise_MissingProdNameField": {
269+
"Enterprise_MissingProdField": {
270270
"pools_response": (200, {
271271
"isEnterprise": True
272-
# prodName field is missing, should default to False
272+
# prod field is missing, should default to False
273273
}),
274274
"expected": (True, False, None)
275275
},
276-
"NonEnterprise_MissingProdNameField": {
276+
"NonEnterprise_MissingProdField": {
277277
"pools_response": (200, {
278278
"isEnterprise": False
279-
# prodName field is missing, should default to False
279+
# prod field is missing, should default to False
280280
}),
281281
"expected": (False, False, None)
282282
},

0 commit comments

Comments
 (0)