Skip to content

Commit

Permalink
Update command output field casing and include zones when null (#3212)
Browse files Browse the repository at this point in the history
  • Loading branch information
greenms authored Apr 15, 2021
1 parent 7c03424 commit f8b4a81
Show file tree
Hide file tree
Showing 7 changed files with 1,180 additions and 4,055 deletions.
5 changes: 5 additions & 0 deletions src/redisenterprise/HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@
Release History
===============

0.1.1
++++++
* Renamed remaining snake_case command output fields to camelCase to be consistent with the REST API.
* Listed the following cluster attribute as null in the command output when the cluster attribute is null: zones.

0.1.0
++++++
* Initial release.
7 changes: 6 additions & 1 deletion src/redisenterprise/azext_redisenterprise/manual/custom.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

from azure.cli.core.util import sdk_no_wait
from azure.cli.core.azclierror import MutuallyExclusiveArgumentError
from msrest.serialization import last_restapi_key_transformer


def _get_database_client(cli_ctx):
Expand All @@ -17,7 +18,11 @@ def _get_database_client(cli_ctx):

def _get_cluster_with_databases(cluster,
databases):
result = cluster.as_dict()
result = cluster.as_dict(key_transformer=last_restapi_key_transformer)
# Restore select null cluster attributes that were removed by cluster.as_dict()
if cluster.zones is None:
result['zones'] = None

result['databases'] = []
for database in databases:
result['databases'].append(database)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,7 @@ def step_create(test, rg, checks=None):
test.cmd('az redisenterprise create '
'--cluster-name "{cluster}" '
'--sku "EnterpriseFlash_F300" '
'--capacity 3 '
'--tags tag1="value1" '
'--zones "1" "2" "3" '
'--minimum-tls-version "1.2" '
'--no-database '
'--resource-group "{rg}"',
checks=checks)
Expand Down

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,9 @@ def call_scenario1(test, rg):
test.check("sku.capacity", 4),
test.check("tags.tag1", "value1"),
test.check("zones", ["1", "2", "3"]),
test.check("minimum_tls_version", "1.2"),
test.check("provisioning_state", "Succeeded"),
test.check("resource_state", "Running"),
test.check("minimumTlsVersion", "1.2"),
test.check("provisioningState", "Succeeded"),
test.check("resourceState", "Running"),
test.check("type", "Microsoft.Cache/redisEnterprise"),
test.check("databases[0].name", "default"),
test.check("databases[0].resourceGroup", "{rg}"),
Expand Down Expand Up @@ -114,7 +114,7 @@ def call_scenario2(test, rg):
test.check("sku.name", "EnterpriseFlash_F300"),
test.check("sku.capacity", 3),
test.check("tags.tag1", "value1"),
test.check("zones", ["1", "2", "3"]),
test.check("zones", None),
test.check("minimumTlsVersion", "1.2"),
test.check("provisioningState", "Succeeded"),
test.check("resourceState", "Running"),
Expand All @@ -127,10 +127,10 @@ def call_scenario2(test, rg):
test.check("sku.name", "EnterpriseFlash_F300"),
test.check("sku.capacity", 3),
test.check("tags.tag1", "value1"),
test.check("zones", ["1", "2", "3"]),
test.check("minimum_tls_version", "1.2"),
test.check("provisioning_state", "Succeeded"),
test.check("resource_state", "Running"),
test.check("zones", None),
test.check("minimumTlsVersion", "1.2"),
test.check("provisioningState", "Succeeded"),
test.check("resourceState", "Running"),
test.check("type", "Microsoft.Cache/redisEnterprise"),
test.check("length(databases)", 0),
])
Expand Down
2 changes: 1 addition & 1 deletion src/redisenterprise/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
from setuptools import setup, find_packages

# HISTORY.rst entry.
VERSION = '0.1.0'
VERSION = '0.1.1'
try:
from azext_redisenterprise.manual.version import VERSION
except ImportError:
Expand Down

0 comments on commit f8b4a81

Please sign in to comment.