Conversation
jsntcy
commented
Apr 20, 2021
| checks=self.check('numberOfRecordSets', base_record_sets + typed_record_sets)) | ||
| self.cmd('network dns record-set a show -n myrsa -g {rg} --zone-name {zone}', | ||
| checks=self.check('length(arecords)', 2)) | ||
| checks=self.check('length(aRecords)', 2)) |
Member
Author
There was a problem hiding this comment.
Why do we need change arecords to aRecords?
In track 2 SDK, the property arecords in model RecordSet is changed to a_records
- Track 2: https://github.com/Azure/azure-sdk-for-python/blob/master/sdk/network/azure-mgmt-dns/azure/mgmt/dns/v2018_05_01/models/_models_py3.py#L371 (
a_records) - Track 1: https://github.com/Azure/azure-sdk-for-python/blob/release/v3/sdk/network/azure-mgmt-dns/azure/mgmt/dns/v2018_05_01/models/_models_py3.py#L344 (
arecords)
In Azure CLI, we have the following code to do some transformation for the result from SDK.
While code above will call the following code in knack which will get the different output for arecords and a_records.
- For
arecords, the transformation result isarecords. - For
a_records, the transformation result isaRecords.
Not sure if it's by design or a bug and need further investigation.
KEYS_CAMELCASE_PATTERN = re.compile('(?!^)_([a-zA-Z])')
def to_camel_case(s):
return re.sub(KEYS_CAMELCASE_PATTERN, lambda x: x.group(1).upper(), s)https://github.com/microsoft/knack/blob/dev/knack/util.py#L126
@jiasli, any ideas for this behavior from knack?
kairu-ms
reviewed
Apr 21, 2021
src/azure-cli/azure/cli/command_modules/network/tests/hybrid_2018_03_01/test_dns_commands.py
Show resolved
Hide resolved
kairu-ms
approved these changes
Apr 21, 2021
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Changes made for the migration:
RecordSetPaged-->RecordSetListResultdelete--->begin_deletearecords--->a_recordsCloudError--->HttpResponseErrorarecords--->aRecordsTesting Guide
History Notes
[Network] BREAKING CHANGE: az network dns record-set a show: Property
arecordsin output will be changed toaRecords.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.
I adhere to the Error Handling Guidelines.