Skip to content

Commit f8b4a81

Browse files
authored
Update command output field casing and include zones when null (Azure#3212)
1 parent 7c03424 commit f8b4a81

File tree

7 files changed

+1180
-4055
lines changed

7 files changed

+1180
-4055
lines changed

src/redisenterprise/HISTORY.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,11 @@
33
Release History
44
===============
55

6+
0.1.1
7+
++++++
8+
* Renamed remaining snake_case command output fields to camelCase to be consistent with the REST API.
9+
* Listed the following cluster attribute as null in the command output when the cluster attribute is null: zones.
10+
611
0.1.0
712
++++++
813
* Initial release.

src/redisenterprise/azext_redisenterprise/manual/custom.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99
from azure.cli.core.util import sdk_no_wait
1010
from azure.cli.core.azclierror import MutuallyExclusiveArgumentError
11+
from msrest.serialization import last_restapi_key_transformer
1112

1213

1314
def _get_database_client(cli_ctx):
@@ -17,7 +18,11 @@ def _get_database_client(cli_ctx):
1718

1819
def _get_cluster_with_databases(cluster,
1920
databases):
20-
result = cluster.as_dict()
21+
result = cluster.as_dict(key_transformer=last_restapi_key_transformer)
22+
# Restore select null cluster attributes that were removed by cluster.as_dict()
23+
if cluster.zones is None:
24+
result['zones'] = None
25+
2126
result['databases'] = []
2227
for database in databases:
2328
result['databases'].append(database)

src/redisenterprise/azext_redisenterprise/manual/tests/latest/example_steps.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,7 @@ def step_create(test, rg, checks=None):
1414
test.cmd('az redisenterprise create '
1515
'--cluster-name "{cluster}" '
1616
'--sku "EnterpriseFlash_F300" '
17-
'--capacity 3 '
1817
'--tags tag1="value1" '
19-
'--zones "1" "2" "3" '
20-
'--minimum-tls-version "1.2" '
2118
'--no-database '
2219
'--resource-group "{rg}"',
2320
checks=checks)

src/redisenterprise/azext_redisenterprise/manual/tests/latest/recordings/test_redisenterprise_scenario1.yaml

Lines changed: 517 additions & 3621 deletions
Large diffs are not rendered by default.

src/redisenterprise/azext_redisenterprise/manual/tests/latest/recordings/test_redisenterprise_scenario2.yaml

Lines changed: 643 additions & 421 deletions
Large diffs are not rendered by default.

src/redisenterprise/azext_redisenterprise/manual/tests/latest/test_redisenterprise_scenario.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,9 @@ def call_scenario1(test, rg):
4646
test.check("sku.capacity", 4),
4747
test.check("tags.tag1", "value1"),
4848
test.check("zones", ["1", "2", "3"]),
49-
test.check("minimum_tls_version", "1.2"),
50-
test.check("provisioning_state", "Succeeded"),
51-
test.check("resource_state", "Running"),
49+
test.check("minimumTlsVersion", "1.2"),
50+
test.check("provisioningState", "Succeeded"),
51+
test.check("resourceState", "Running"),
5252
test.check("type", "Microsoft.Cache/redisEnterprise"),
5353
test.check("databases[0].name", "default"),
5454
test.check("databases[0].resourceGroup", "{rg}"),
@@ -114,7 +114,7 @@ def call_scenario2(test, rg):
114114
test.check("sku.name", "EnterpriseFlash_F300"),
115115
test.check("sku.capacity", 3),
116116
test.check("tags.tag1", "value1"),
117-
test.check("zones", ["1", "2", "3"]),
117+
test.check("zones", None),
118118
test.check("minimumTlsVersion", "1.2"),
119119
test.check("provisioningState", "Succeeded"),
120120
test.check("resourceState", "Running"),
@@ -127,10 +127,10 @@ def call_scenario2(test, rg):
127127
test.check("sku.name", "EnterpriseFlash_F300"),
128128
test.check("sku.capacity", 3),
129129
test.check("tags.tag1", "value1"),
130-
test.check("zones", ["1", "2", "3"]),
131-
test.check("minimum_tls_version", "1.2"),
132-
test.check("provisioning_state", "Succeeded"),
133-
test.check("resource_state", "Running"),
130+
test.check("zones", None),
131+
test.check("minimumTlsVersion", "1.2"),
132+
test.check("provisioningState", "Succeeded"),
133+
test.check("resourceState", "Running"),
134134
test.check("type", "Microsoft.Cache/redisEnterprise"),
135135
test.check("length(databases)", 0),
136136
])

src/redisenterprise/setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
from setuptools import setup, find_packages
1111

1212
# HISTORY.rst entry.
13-
VERSION = '0.1.0'
13+
VERSION = '0.1.1'
1414
try:
1515
from azext_redisenterprise.manual.version import VERSION
1616
except ImportError:

0 commit comments

Comments
 (0)