Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
msyyc committed Jul 7, 2021
1 parent f7e7407 commit 8bbbf97
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion autorest/codegen/templates/config.py.jinja2
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,6 @@ class {{ code_model.class_name }}Configuration(Configuration):
if self.credential and not self.authentication_policy:
{% set credential_default_policy_type = ("Async" if (async_mode and code_model.options['credential_default_policy_type_has_async_version']) else "") + code_model.options['credential_default_policy_type'] %}
{% set credential_param_type = ("'" + code_model.options['credential_key_header_name'] + "', ") if code_model.options['credential_key_header_name'] else ("*self.credential_scopes, " if "ARMChallengeAuthenticationPolicy" in credential_default_policy_type else "") %}
{% set policy_source = "" if "ARMChallengeAuthenticationPolicy" in credential_default_policy_type else "policies."}
{% set policy_source = "" if "ARMChallengeAuthenticationPolicy" in credential_default_policy_type else "policies." %}
self.authentication_policy = {{ policy_source }}{{ credential_default_policy_type }}(self.credential, {{ credential_param_type if credential_param_type }}**kwargs)
{% endif %}
2 changes: 1 addition & 1 deletion autorest/multiapi/templates/multiapi_config.py.jinja2
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,6 @@ class {{ code_model.service_client.name }}Configuration(Configuration):
if self.credential and not self.authentication_policy:
{% set credential_default_policy_type = ("Async" if (async_mode and code_model.config.credential_default_policy_type_has_async_version) else "") + code_model.config.credential_default_policy_type %}
{% set credential_param_type = ("'" + code_model.config.credential_key_header_name + "', ") if code_model.config.credential_key_header_name else ("*self.credential_scopes, " if "ARMChallengeAuthenticationPolicy" in credential_default_policy_type else "") %}
{% set policy_source = "" if "ARMChallengeAuthenticationPolicy" in credential_default_policy_type else "policies."}
{% set policy_source = "" if "ARMChallengeAuthenticationPolicy" in credential_default_policy_type else "policies." %}
self.authentication_policy ={{ policy_source }}{{ credential_default_policy_type }}(self.credential, {{ credential_param_type if credential_param_type }}**kwargs)
{% endif %}

0 comments on commit 8bbbf97

Please sign in to comment.