Skip to content

Commit a88288e

Browse files
style
1 parent 6a346cc commit a88288e

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

src/azure-cli/azure/cli/command_modules/appconfig/_kv_import_helpers.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -567,6 +567,7 @@ def __read_kv_from_file(
567567
key_values.append(KeyValue(key=k, value=v))
568568
return key_values
569569

570+
570571
def flatten_config_data(config_data, format_, content_type, prefix_to_add="", depth=None, separator=None):
571572
"""
572573
Flatten configuration data into a dictionary of key-value pairs.
@@ -741,6 +742,7 @@ def __read_kv_from_app_service(
741742
except Exception as exception:
742743
raise CLIError("Failed to read key-values from appservice.\n" + str(exception))
743744

745+
744746
def __read_kv_from_kubernetes_configmap(
745747
cmd,
746748
aks_cluster,
@@ -785,7 +787,7 @@ def __read_kv_from_kubernetes_configmap(
785787
# Execute the command on the cluster
786788
result = aks_runcommand(cmd, aks_client, aks_cluster["resource_group"], aks_cluster["name"], command_string=command)
787789

788-
if hasattr(result, 'logs') and result.logs:
790+
if hasattr(result, 'logs') and result.logs:
789791
if not hasattr(result, 'exit_code') or result.exit_code != 0:
790792
raise AzureResponseError(f"{result.logs.strip()}")
791793

@@ -811,6 +813,7 @@ def __read_kv_from_kubernetes_configmap(
811813
f"Failed to read key-values from ConfigMap '{configmap_name}' in namespace '{namespace}'.\n{str(exception)}"
812814
)
813815

816+
814817
def __extract_kv_from_configmap_data(configmap_data, content_type, prefix_to_add="", format_=None, depth=None, separator=None):
815818
"""
816819
Helper function to extract key-value pairs from ConfigMap data.
@@ -851,7 +854,7 @@ def __extract_kv_from_configmap_data(configmap_data, content_type, prefix_to_add
851854
f'Value "{value}" for key "{key}" is not a well formatted YAML data.'
852855
)
853856
continue
854-
elif format_ == "properties":
857+
else:
855858
try:
856859
import io
857860
value = javaproperties.load(io.StringIO(value))
@@ -892,6 +895,7 @@ def __extract_kv_from_configmap_data(configmap_data, content_type, prefix_to_add
892895

893896
return key_values
894897

898+
895899
def __validate_import_keyvault_ref(kv):
896900
if kv and validate_import_key(kv.key):
897901
try:

src/azure-cli/azure/cli/command_modules/appconfig/_validators.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,7 @@ def validate_appservice_name_or_id(cmd, namespace):
149149
else:
150150
namespace.appservice_account = parse_resource_id(namespace.appservice_account)
151151

152+
152153
def validate_aks_cluster_name_or_id(cmd, namespace):
153154
from azure.cli.core.commands.client_factory import get_subscription_id
154155
from azure.mgmt.core.tools import is_valid_resource_id, parse_resource_id

0 commit comments

Comments
 (0)