-
Notifications
You must be signed in to change notification settings - Fork 3.3k
[ARM] az deployment: Fix the bug of 'bytes' object has no attribute 'get' for error handling in retry cases
#21220
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
Conversation
|
ARM |
| def on_request(self, request): | ||
| http_request = request.http_request | ||
| if (getattr(http_request, 'data', {}) or {}).get('properties', {}).get('template'): | ||
| request_data = getattr(http_request, 'data', {}) or {} |
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.
@zhoxing-ms, have we run all tests impacted by this logic?
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.
It mainly runs the tests that affects the scope of resource group. The logic of other scopes (such as: tenant sub mg) calling this policy is the same, so the scope of resource group can basically cover all use cases~
|
The purpose and logic of It seems
done in Also, The name We need better comments! |
In fact, it's technically feasible. I've tried it and it works fine. I guess this may be a decision in code design. Maybe this splicing is not appropriate to put it in the serialization logic in code design.
I agree! It will be converted to bytes in the subsequent step of |
Issue: #19743
Description
This error
bytes' object has no attribute 'get'is due to the bug ofJsonCTemplatePolicyin the retry operation.In the case of retry, because the first request has been processed and converted the type of
request.http_request.datafrom string to bytes code link , so there is no need to processrequest.http_request.dataagain during retry,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.
I adhere to the Error Handling Guidelines.