Conversation
️✔️AzureCLI-FullTest
|
|
Hi @jiasli, |
️✔️AzureCLI-BreakingChangeTest
|
|
Thank you for your contribution! We will review the pull request and get back to you soon. |
|
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>
|
| scope=scope or ('/subscriptions/' + definitions_client._config.subscription_id))) | ||
| role_dics = {i.id: worker.get_role_property(i, 'role_name') for i in role_defs} | ||
| for i in results: | ||
| if not i.get('roleDefinitionName'): |
There was a problem hiding this comment.
It is not possible for a roleAssignment object to have roleDefinitionName property: https://learn.microsoft.com/en-us/rest/api/authorization/role-assignments/list-for-scope, so this statement is unnecessary.
| role_dics = {i.id: worker.get_role_property(i, 'role_name') for i in role_defs} | ||
| for i in results: | ||
| if not i.get('roleDefinitionName'): | ||
| if role_dics.get(worker.get_role_property(i, 'roleDefinitionId')): |
There was a problem hiding this comment.
A RoleAssignment object must have roleDefinitionId property: https://learn.microsoft.com/en-us/rest/api/authorization/role-assignments/list-for-scope, so this statement is also unnecessary.
| principals = _get_object_stubs(graph_client, principal_ids) | ||
| principal_dics = {i[ID]: _get_displayable_name(i) for i in principals} | ||
|
|
||
| for i in [r for r in results if not r.get('principalName')]: |
There was a problem hiding this comment.
It is not possible for a roleAssignment object to have principalName property: https://learn.microsoft.com/en-us/rest/api/authorization/role-assignments/list-for-scope, so this statement is unnecessary.
| return get_member_group_func(identifier, body) | ||
|
|
||
|
|
||
| class RoleApiHelper: |
There was a problem hiding this comment.
Why not just rename the MultiAPIAdaptor toRoleApiHelper and update related code? custom.py has already been a bit large
Related command
az roleDescription
As Azure Stack support has been removed (#31307),
rolemodule'sMultiAPIAdaptoris no longer needed.This PR refactors
MultiAPIAdaptorintoRoleApiHelperand removes code for supporting old API versions.