Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

{RDBMS} az postgres flexible-server create/update: modify the error message for _pg_storage_validator #30711

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions src/azure-cli/azure/cli/command_modules/rdbms/validators.py
Original file line number Diff line number Diff line change
Expand Up @@ -389,13 +389,14 @@ def _pg_storage_validator(storage_gb, sku_info, tier, storage_type, iops, throug
if instance is not None:
original_size = instance.storage.storage_size_gb
if original_size > storage_gb:
raise CLIError('Updating storage cannot be smaller than the original storage size {} GiB.'
.format(original_size))
raise CLIError('Decrease of current storage size isn\'t supported. Current storage size is {} GiB \
and you\'re trying to set it to {} GiB.'
.format(original_size, storage_gb))
if not is_ssdv2:
storage_sizes = get_postgres_storage_sizes(sku_info, tier)
if storage_gb not in storage_sizes:
storage_sizes = sorted([int(size) for size in storage_sizes])
raise CLIError('Incorrect value for --storage-size : Allowed values(in GiB) : {}'
raise CLIError('Incorrect value for --storage-size : Allowed values (in GiB) : {}'
.format(storage_sizes))

# ssdv2 range validation
Expand Down
Loading