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

Ensure trailing slash on base_url #984

Merged
merged 1 commit into from
Nov 30, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions plugins/module_utils/azure_rm_common.py
Original file line number Diff line number Diff line change
Expand Up @@ -876,6 +876,12 @@ def get_mgmt_svc_client(self, client_type, base_url=None, api_version=None, supp
# most things are resource_manager, don't make everyone specify
base_url = self.azure_auth._cloud_environment.endpoints.resource_manager

# https://github.com/Azure/msrestazure-for-python/pull/169
# China's base_url doesn't end in a trailing slash, though others do,
# and we need a trailing slash when generating credential_scopes below.
if not base_url.endswith("/"):
base_url += "/"

mgmt_subscription_id = self.azure_auth.subscription_id
if self.module.params.get('subscription_id'):
mgmt_subscription_id = self.module.params.get('subscription_id')
Expand Down