-
Notifications
You must be signed in to change notification settings - Fork 3.2k
update pipeline #18238
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
update pipeline #18238
Conversation
| if not config.http_logging_policy: | ||
| config.http_logging_policy = kwargs.get('http_logging_policy', ARMHttpLoggingPolicy(**kwargs)) |
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.
These lines are unnecessary as the client will always have http_logging_policy configured:
Line 59 in 28545a0
| self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs) |
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.
We need it because in your test case, you use the azure.core.configure which does not honor http_logging_policy.
w/o it will fail the tests.
| ) | ||
| kwargs["policies"] = self._default_policies(**kwargs) | ||
| per_call_policies = kwargs.get('per_call_policies', []) | ||
| per_call_policies.append(ARMAutoResourceProviderRegistrationPolicy()) |
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.
In azure-core, per_call_policies can be a list or object:
azure-sdk-for-python/sdk/core/azure-core/azure/core/_pipeline_client.py
Lines 125 to 129 in 6edb999
| if isinstance(per_call_policies, Iterable): | |
| for policy in per_call_policies: | |
| policies.append(policy) | |
| else: | |
| policies.append(per_call_policies) |
But here it can only be a list. Passing per_call_policies as an object causes failure in the append method.
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.
Good catch.
|
/check-enforcer evaluate |
|
/check-enforcer reset |
| if isinstance(per_call_policies, Iterable): | ||
| per_call_policies.append(AsyncARMAutoResourceProviderRegistrationPolicy()) |
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.
append will fail if per_call_policies is a tuple, instead of a list:
AttributeError: 'tuple' object has no attribute 'append'
No description provided.