Skip to content

Commit 1b076d0

Browse files
committed
fix enablement behavior
1 parent a99c032 commit 1b076d0

File tree

2 files changed

+6
-8
lines changed

2 files changed

+6
-8
lines changed

src/azure-cli/azure/cli/command_modules/acs/_params.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1291,7 +1291,7 @@ def _get_container_storage_enum_type(choices):
12911291

12921292
class AzureContainerStorageAction(argparse.Action):
12931293
def __call__(self, parser, namespace, values, option_string=None):
1294-
if values is None:
1294+
if values in [[], None]:
12951295
# When used as a flag without value, set as True
12961296
setattr(namespace, self.dest, True)
12971297
return

src/azure-cli/azure/cli/command_modules/acs/managed_cluster_decorator.py

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6898,13 +6898,14 @@ def set_up_azure_container_storage(self, mc: ManagedCluster) -> ManagedCluster:
68986898
"""
68996899
self._ensure_mc(mc)
69006900

6901-
if self.context.raw_param.get("enable_azure_container_storage") is not None:
6902-
self.context.set_intermediate("enable_azure_container_storage", True, overwrite_exists=True)
6901+
enable_azure_container_storage_param = self.context.raw_param.get("enable_azure_container_storage")
6902+
if enable_azure_container_storage_param:
6903+
self.context.set_intermediate("enable_azure_container_storage", enable_azure_container_storage_param, overwrite_exists=True)
69036904
container_storage_version = self.context.raw_param.get("container_storage_version")
69046905

69056906
if container_storage_version is not None and container_storage_version == CONST_ACSTOR_VERSION_V1:
69066907
# read the azure container storage values passed
6907-
pool_type = self.context.raw_param.get("enable_azure_container_storage")
6908+
pool_type = enable_azure_container_storage_param
69086909
enable_azure_container_storage = pool_type is not None
69096910
ephemeral_disk_volume_type = self.context.raw_param.get("ephemeral_disk_volume_type")
69106911
ephemeral_disk_nvme_perf_tier = self.context.raw_param.get("ephemeral_disk_nvme_perf_tier")
@@ -6998,7 +6999,6 @@ def set_up_azure_container_storage(self, mc: ManagedCluster) -> ManagedCluster:
69986999
overwrite_exists=True
69997000
)
70007001
else:
7001-
enable_azure_container_storage = self.context.raw_param.get("enable_azure_container_storage")
70027002
storage_pool_name = self.context.raw_param.get("storage_pool_name")
70037003
pool_sku = self.context.raw_param.get("storage_pool_sku")
70047004
pool_option = self.context.raw_param.get("storage_pool_option")
@@ -7008,7 +7008,7 @@ def set_up_azure_container_storage(self, mc: ManagedCluster) -> ManagedCluster:
70087008
validate_enable_azure_container_storage_params,
70097009
)
70107010
validate_enable_azure_container_storage_params(
7011-
enable_azure_container_storage,
7011+
enable_azure_container_storage_param,
70127012
False,
70137013
False,
70147014
False,
@@ -9307,8 +9307,6 @@ def update_azure_container_storage(self, mc: ManagedCluster) -> ManagedCluster:
93079307
self.context.set_intermediate("enable_azure_container_storage", enable_azure_container_storage_param, overwrite_exists=True)
93089308
self.context.set_intermediate("disable_azure_container_storage", disable_azure_container_storage_param, overwrite_exists=True)
93099309
self.context.set_intermediate("is_extension_installed", is_extension_installed, overwrite_exists=True)
9310-
self.context.set_intermediate("is_ephemeralDisk_enabled", is_ephemeralDisk_enabled, overwrite_exists=True)
9311-
self.context.set_intermediate("is_elasticSan_enabled", is_elasticSan_enabled, overwrite_exists=True)
93129310

93139311
return mc
93149312

0 commit comments

Comments
 (0)