mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-08 14:22:46 +00:00
fixed passing non-default base_url from explicitly set cloud_environment (#40225)
This commit is contained in:
committed by
Yunge Zhu
parent
edb1735ca0
commit
c29fe66edf
@@ -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:
|
||||||
|
|||||||
Reference in New Issue
Block a user