Skip to content

Commit 83ce682

Browse files
author
Matthew Boentoro
committed
{RDBMS} az postgres flexible-server list: adding a null check to see if resource group passed is already null
1 parent d68ba44 commit 83ce682

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/azure-cli/azure/cli/command_modules/rdbms/validators.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -813,8 +813,15 @@ def _pg_storage_type_validator(storage_type, auto_grow, high_availability, geo_r
813813

814814

815815
def check_resource_group(resource_group_name):
816+
# check if rg is already null originally
817+
if (not resource_group_name):
818+
return False
819+
820+
# replace single and double quotes with empty string
816821
resource_group_name = resource_group_name.replace("'", '')
817822
resource_group_name = resource_group_name.replace('"', '')
823+
824+
# check if rg is empty after removing quotes
818825
if (not resource_group_name):
819826
return False
820827
return True

0 commit comments

Comments
 (0)