Skip to content
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

{DNS} Migrate to track 2 #17787

Merged
merged 1 commit into from
Apr 21, 2021
Merged

{DNS} Migrate to track 2 #17787

merged 1 commit into from
Apr 21, 2021

Conversation

jsntcy
Copy link
Member

@jsntcy jsntcy commented Apr 20, 2021

Description
Changes made for the migration:

  • Model: RecordSetPaged --> RecordSetListResult
  • Method: delete ---> begin_delete
  • Property: arecords ---> a_records
  • Exception: CloudError ---> HttpResponseError
  • Property in test checker: arecords ---> aRecords

Testing Guide

History Notes

[Network] BREAKING CHANGE: az network dns record-set a show: Property arecords in output will be changed to aRecords.


This checklist is used to make sure that common guidelines for a pull request are followed.

@jsntcy jsntcy requested review from kairu-ms and msyyc as code owners April 20, 2021 15:21
@@ -128,7 +129,7 @@ def test_dns(self, resource_group):
self.cmd('network dns zone show -n {zone} -g {rg}',
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))
Copy link
Member Author

@jsntcy jsntcy Apr 20, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we need change arecords to aRecords?

In track 2 SDK, the property arecords in model RecordSet is changed to a_records

In Azure CLI, we have the following code to do some transformation for the result from SDK.

result = todict(result, AzCliCommandInvoker.remove_additional_prop_layer)

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 is arecords.
  • For a_records, the transformation result is aRecords.

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?

@jsntcy jsntcy requested a review from 00Kai0 April 20, 2021 16:04
@yonzhan yonzhan requested a review from jiasli April 20, 2021 22:32
@yonzhan yonzhan added this to the S186 milestone Apr 20, 2021
@jsntcy jsntcy merged commit 821ccb0 into Azure:dev Apr 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants