-
Notifications
You must be signed in to change notification settings - Fork 3.3k
[BACKUP] Fix #14976: KeyError fixed and help text improved #15718
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
[BACKUP] Fix #14976: KeyError fixed and help text improved #15718
Conversation
|
Thank you for your contribution akshayneema! We will review the pull request and get back to you soon. |
|
hi @fengzhou-msft could you help to review? |
|
|
||
| protectable_item_type_map = {'SQLDatabase': 'SQLDataBase', | ||
| 'HANADataBase': 'SAPHanaDatabase', | ||
| 'SAPHanaDatabase': 'SAPHanaDatabase', |
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 looks like a breaking change. If someone has used HANADataBase as protectable item type in their script, it will start failing. Better to keep the older one and add another entry to the map
| return AzureVmWorkloadSQLDatabaseProtectedItem() | ||
|
|
||
|
|
||
| def _check_map(key, key_value_map): |
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.
Use better naming conventions.
| if item_type_map.get(item_type) is not None: | ||
| return item_type_map[item_type] | ||
| error_text = item_type + " is an invalid argument. " + str(list(item_type_map.keys())) + " are the allowed values." | ||
| raise CLIError(error_text) |
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 use InvalidArgumentValueError for better error classification. @houk-ms for awareness.
Description
Added checks wherever KeyError was happening and raised customized error messages according to the situation. Did some improvements in the help text for a clearer understanding of the user.
Testing Guide
History Notes
[Component Name 1] BREAKING CHANGE: az command a: Make some customer-facing breaking change.
[Component Name 2] az command b: Add some customer-facing feature.
This 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.