{RDBMS} az postgres flexible-server identity remove: assign the correct identity type on remove#31586
Conversation
…ct identity type on remove
️✔️AzureCLI-FullTest
|
️✔️AzureCLI-BreakingChangeTest
|
|
The git hooks are available for azure-cli and azure-cli-extensions repos. They could help you run required checks before creating the PR. Please sync the latest code with latest dev branch (for azure-cli) or main branch (for azure-cli-extensions). pip install azdev --upgrade
azdev setup -c <your azure-cli repo path> -r <your azure-cli-extensions repo path>
|
There was a problem hiding this comment.
Pull Request Overview
This PR updates the identity removal logic for az postgres flexible-server to assign the correct identity type based on whether a system-assigned identity is present along with user-assigned identities.
- Refactored the condition checks to distinguish between the presence and absence of system-assigned identities.
- Updated the parameters assignment to set identity types as "SystemAssigned", "None", or "SystemAssigned,UserAssigned" accordingly.
Comments suppressed due to low confidence (1)
src/azure-cli/azure/cli/command_modules/rdbms/flexible_server_custom_postgres.py:1064
- [nitpick] The comment appears to have extra indentation; please align it with the 4-space indentation standard used throughout the code.
# if there are no user-assigned identities or all user-assigned identities are already removed
| for identity in identities: | ||
| identities_map[identity] = None | ||
|
|
||
| system_assigned_identity = instance.identity and instance.identity.additional_properties['principalId'] != None |
There was a problem hiding this comment.
Consider using 'is not None' instead of '!= None' for better readability and to follow Python best practices.
| system_assigned_identity = instance.identity and instance.identity.additional_properties['principalId'] != None | |
| system_assigned_identity = instance.identity and instance.identity.additional_properties['principalId'] is not None |
|
Thank you for your contribution! We will review the pull request and get back to you soon. |
|
@evelyn-ys do you mind reviewing this PR? |
Related command
az postgres flexible-server identity remove
Description
Assign the correct identity type on remove
Testing Guide
Manual testing
History Notes
{RDBMS}
az postgres flexible-server identity remove: assign the correct identity type on removeThis checklist is used to make sure that common guidelines for a pull request are followed.
The PR title and description has followed the guideline in Submitting Pull Requests.
I adhere to the Command Guidelines.
I adhere to the Error Handling Guidelines.