1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

fixed passing non-default base_url from explicitly set cloud_environment (#40225)

This commit is contained in:
Timur Evdokimov 2018-06-07 08:53:05 +02:00 committed by Yunge Zhu
parent edb1735ca0
commit c29fe66edf

View file

@ -926,6 +926,10 @@ class AzureRMModuleBase(object):
client_argspec = inspect.getargspec(client_type.__init__) client_argspec = inspect.getargspec(client_type.__init__)
if not base_url:
# most things are resource_manager, don't make everyone specify
base_url = self._cloud_environment.endpoints.resource_manager
client_kwargs = dict(credentials=self.azure_credentials, subscription_id=self.subscription_id, base_url=base_url) client_kwargs = dict(credentials=self.azure_credentials, subscription_id=self.subscription_id, base_url=base_url)
api_profile_dict = {} api_profile_dict = {}
@ -933,10 +937,6 @@ class AzureRMModuleBase(object):
if self.api_profile: if self.api_profile:
api_profile_dict = self.get_api_profile(client_type.__name__, self.api_profile) api_profile_dict = self.get_api_profile(client_type.__name__, self.api_profile)
if not base_url:
# most things are resource_manager, don't make everyone specify
base_url = self._cloud_environment.endpoints.resource_manager
# unversioned clients won't accept profile; only send it if necessary # unversioned clients won't accept profile; only send it if necessary
# clients without a version specified in the profile will use the default # clients without a version specified in the profile will use the default
if api_profile_dict and 'profile' in client_argspec.args: if api_profile_dict and 'profile' in client_argspec.args: