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 compatibility with Python v3.11 #1050

Closed
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: 3 additions & 3 deletions plugins/module_utils/azure_rm_common.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down