-
Notifications
You must be signed in to change notification settings - Fork 3.3k
[RBAC] BREAKING CHANGE: fix issue #11883 az role assignment create scope default to subscription if empty #11977
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
Changes from all commits
3faa696
0e905dc
5fa7cf9
e4ac08b
f6ced7f
06b67c0
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 |
|---|---|---|
|
|
@@ -91,6 +91,18 @@ def process_assignment_namespace(cmd, namespace): # pylint: disable=unused-argu | |
| if namespace.scope and resource_group and getattr(resource_group, 'is_default', None): | ||
| namespace.resource_group_name = None # drop configured defaults | ||
|
|
||
| if not namespace.scope and not namespace.resource_group_name: | ||
| raise CLIError('usage error: please specify at least one of "--scope" and "--resource-group".') | ||
|
|
||
|
|
||
| def process_list_assignment_namespace(cmd, namespace): # pylint: disable=unused-argument | ||
| resource_group = namespace.resource_group_name | ||
| if namespace.scope and resource_group and getattr(resource_group, 'is_default', None): | ||
| namespace.resource_group_name = None # drop configured defaults | ||
|
Comment on lines
+99
to
+101
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is a duplicate of L90-L92. I'd suggested to extract it to a function like |
||
|
|
||
| if not namespace.show_all and not namespace.scope and not namespace.resource_group_name: | ||
| raise CLIError('usage error: please specify at least one of "--all", "--scope" and "--resource-group".') | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We usually use single quotes in error messages.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I searched similar error message in our code base, seems we usually use nothing in such case. The error message will be
Comment on lines
+103
to
+104
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why the behavior of Also, it is also a breaking change to force one of |
||
|
|
||
|
|
||
| def process_msi_namespace(cmd, namespace): | ||
| get_default_location_from_resource_group(cmd, namespace) | ||
|
|
||
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.
Please follow the history convention like: