Skip to content

Commit 85f0255

Browse files
committed
fix error when no storage option is set during enablement
1 parent df958f8 commit 85f0255

File tree

1 file changed

+7
-4
lines changed
  • src/azure-cli/azure/cli/command_modules/acs/azurecontainerstorage

1 file changed

+7
-4
lines changed

src/azure-cli/azure/cli/command_modules/acs/azurecontainerstorage/acstor_ops.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -701,14 +701,17 @@ def perform_azure_container_storage_update(
701701
if not delete_extension:
702702
config_settings = []
703703

704-
if storage_options_to_remove and CONST_STORAGE_POOL_TYPE_EPHEMERAL_DISK in storage_options_to_remove:
704+
storage_options_to_add = storage_options_to_add if isinstance(storage_options_to_add, (list, str)) else []
705+
storage_options_to_remove = storage_options_to_remove if isinstance(storage_options_to_remove, (list, str)) else []
706+
707+
if CONST_STORAGE_POOL_TYPE_EPHEMERAL_DISK in storage_options_to_remove:
705708
config_settings.append({"csiDriverConfigs.local-csi-driver.enabled": "False"})
706-
elif storage_options_to_add and CONST_STORAGE_POOL_TYPE_EPHEMERAL_DISK in storage_options_to_add:
709+
elif CONST_STORAGE_POOL_TYPE_EPHEMERAL_DISK in storage_options_to_add:
707710
config_settings.append({"csiDriverConfigs.local-csi-driver.enabled": "True"})
708711

709-
if storage_options_to_remove and CONST_STORAGE_POOL_TYPE_ELASTIC_SAN in storage_options_to_remove:
712+
if CONST_STORAGE_POOL_TYPE_ELASTIC_SAN in storage_options_to_remove:
710713
config_settings.append({"csiDriverConfigs.azuresan-csi-driver.enabled": "False"})
711-
elif storage_options_to_add and CONST_STORAGE_POOL_TYPE_ELASTIC_SAN in storage_options_to_add:
714+
elif CONST_STORAGE_POOL_TYPE_ELASTIC_SAN in storage_options_to_add:
712715
config_settings.append({"csiDriverConfigs.azuresan-csi-driver.enabled": "True"})
713716

714717
try:

0 commit comments

Comments
 (0)