From fbf951dc9f60161b97a3e1be014d94b179f1400e Mon Sep 17 00:00:00 2001 From: Wenhao Zhang Date: Tue, 18 Jan 2022 11:07:01 +0800 Subject: [PATCH 1/2] Fix certificate output error --- src/spring-cloud/azext_spring_cloud/_transformers.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/spring-cloud/azext_spring_cloud/_transformers.py b/src/spring-cloud/azext_spring_cloud/_transformers.py index 1f64170bcd5..47b6767c55e 100644 --- a/src/spring-cloud/azext_spring_cloud/_transformers.py +++ b/src/spring-cloud/azext_spring_cloud/_transformers.py @@ -83,13 +83,19 @@ def transform_spring_cloud_certificate_output(result): result = [result] for item in result: - item['Certificate Name'] = item['properties']['keyVaultCertName'] + item['Certificate Name'] = item['name'] item['Thumbprint'] = item['properties']['thumbprint'] item['Activate Date'] = item['properties']['activateDate'].split("T")[0] - item['Certificate Version'] = item['properties']['certVersion'] item['DNS Names'] = item['properties']['dnsNames'] item['Expiration Date'] = item['properties']['expirationDate'].split("T")[0] - item['Key Vault Uri'] = item['properties']['vaultUri'] + if item['properties'].get('certVersion'): + item['Certificate Version'] = item['properties']['certVersion'] + else: + item['Certificate Version'] = "" + if item['properties'].get('vaultUri'): + item['Key Vault Uri'] = item['properties']['vaultUri'] + else: + item['Key Vault Uri'] = "" return result if is_list else result[0] From 70f49be6789939ab8c12918ff4b34bf1e2e63426 Mon Sep 17 00:00:00 2001 From: Wenhao Zhang Date: Tue, 18 Jan 2022 11:18:48 +0800 Subject: [PATCH 2/2] Update according to comments --- src/spring-cloud/azext_spring_cloud/_transformers.py | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/src/spring-cloud/azext_spring_cloud/_transformers.py b/src/spring-cloud/azext_spring_cloud/_transformers.py index 47b6767c55e..d33fb5e37bc 100644 --- a/src/spring-cloud/azext_spring_cloud/_transformers.py +++ b/src/spring-cloud/azext_spring_cloud/_transformers.py @@ -88,14 +88,8 @@ def transform_spring_cloud_certificate_output(result): item['Activate Date'] = item['properties']['activateDate'].split("T")[0] item['DNS Names'] = item['properties']['dnsNames'] item['Expiration Date'] = item['properties']['expirationDate'].split("T")[0] - if item['properties'].get('certVersion'): - item['Certificate Version'] = item['properties']['certVersion'] - else: - item['Certificate Version'] = "" - if item['properties'].get('vaultUri'): - item['Key Vault Uri'] = item['properties']['vaultUri'] - else: - item['Key Vault Uri'] = "" + item['Certificate Version'] = item['properties'].get('certVersion', "") + item['Key Vault Uri'] = item['properties'].get('vaultUri', "") return result if is_list else result[0]