From eefcfe70857f109ea7bcf4138893116a2331c586 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stephan=20Austerm=C3=BChle?= Date: Tue, 20 Dec 2022 15:20:24 +0100 Subject: [PATCH] Ensure compatibility with Python v3.11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Stephan Austermühle --- plugins/module_utils/azure_rm_common.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/plugins/module_utils/azure_rm_common.py b/plugins/module_utils/azure_rm_common.py index 53a50a48e..a19e52d39 100644 --- a/plugins/module_utils/azure_rm_common.py +++ b/plugins/module_utils/azure_rm_common.py @@ -898,7 +898,7 @@ def get_mgmt_svc_client(self, client_type, base_url=None, api_version=None, supp self.log('Getting management service client {0}'.format(client_type.__name__)) self.check_client_version(client_type) - client_argspec = inspect.getargspec(client_type.__init__) + client_argspec = inspect.signature(client_type.__init__) if not base_url: # most things are resource_manager, don't make everyone specify @@ -934,12 +934,12 @@ def get_mgmt_svc_client(self, client_type, base_url=None, api_version=None, supp # unversioned clients won't accept profile; only send it if necessary # 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.parameters: client_kwargs['profile'] = api_profile_dict # If the client doesn't accept api_version, it's unversioned. # If it does, favor explicitly-specified api_version, fall back to api_profile - if 'api_version' in client_argspec.args: + if 'api_version' in client_argspec.parameters: profile_default_version = api_profile_dict.get('default_api_version', None) if api_version or profile_default_version: client_kwargs['api_version'] = api_version or profile_default_version