-
Notifications
You must be signed in to change notification settings - Fork 3.3k
{POSTGRESQL} az postgres flexible-server create/upgrade: Update warning for restricted operation
#32699
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
{POSTGRESQL} az postgres flexible-server create/upgrade: Update warning for restricted operation
#32699
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -55,8 +55,9 @@ def _postgres_parse_list_capability(result, is_offer_restriction_check_required= | |||||
| geo_backup = [feature for feature in supported_features if feature.name == "GeoBackup"] | ||||||
| autonomous_tuning = [feature for feature in supported_features if feature.name == "IndexTuning"] | ||||||
|
|
||||||
| # Update once capability calls are corrected for each command | ||||||
| if restricted == "Enabled" and not is_offer_restriction_check_required: | ||||||
| raise InvalidArgumentValueError("The location is restricted for provisioning of flexible servers. Please try using another region.") | ||||||
| raise InvalidArgumentValueError("The location is restricted from performing this operation.") | ||||||
|
||||||
| raise InvalidArgumentValueError("The location is restricted from performing this operation.") | |
| raise InvalidArgumentValueError("This operation is restricted in the selected location.") |
Copilot
AI
Jan 26, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These two conditions have overlapping logic. When restricted == "Enabled", the first condition (line 59) will raise an error with the message "The location is restricted from performing this operation." However, if that error is not raised (e.g., due to is_offer_restriction_check_required being True), the second condition (line 62) will also be true since "Enabled" != "Disabled", causing it to raise a different error with the message "No available SKUs in this location."
This creates inconsistent behavior where the same state (restricted == "Enabled") can result in different error messages depending on the value of is_offer_restriction_check_required. Consider using elif for the second condition to prevent this overlap, or adjust the logic to handle the "Enabled" state more explicitly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This TODO comment is vague and lacks an actionable plan. It's unclear what "capability calls are corrected for each command" means or what the expected outcome would be. Consider either:
Vague TODO comments tend to accumulate technical debt without providing clear guidance for future maintainers.