Skip to content

Commit e758252

Browse files
mattboentoroMatthew Boentoro
andauthored
{RDBMS} az postgres flexible-server list: adding a null check to see if resource group passed is already null (#30304)
Co-authored-by: Matthew Boentoro <[email protected]>
1 parent 5f63260 commit e758252

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
@@ -824,8 +824,15 @@ def _pg_storage_type_validator(storage_type, auto_grow, high_availability, geo_r
824824

825825

826826
def check_resource_group(resource_group_name):
827+
# check if rg is already null originally
828+
if (not resource_group_name):
829+
return False
830+
831+
# replace single and double quotes with empty string
827832
resource_group_name = resource_group_name.replace("'", '')
828833
resource_group_name = resource_group_name.replace('"', '')
834+
835+
# check if rg is empty after removing quotes
829836
if (not resource_group_name):
830837
return False
831838
return True

0 commit comments

Comments
 (0)