mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
[proxmox] Use proxmoxer_version instead of server API version (#6980)
* Use proxmoxer_version instead of server API version * Add changelog fragment
This commit is contained in:
parent
f6714edabb
commit
796ad3565e
2 changed files with 4 additions and 2 deletions
2
changelogs/fragments/6980-proxmox-fix-token-auth.yml
Normal file
2
changelogs/fragments/6980-proxmox-fix-token-auth.yml
Normal file
|
@ -0,0 +1,2 @@
|
|||
bugfixes:
|
||||
- proxmox module utils - fix proxmoxer library version check (https://github.com/ansible-collections/community.general/issues/6974, https://github.com/ansible-collections/community.general/issues/6975, https://github.com/ansible-collections/community.general/pull/6980).
|
|
@ -72,8 +72,8 @@ class ProxmoxAnsible(object):
|
|||
module.fail_json(msg=missing_required_lib('proxmoxer'), exception=PROXMOXER_IMP_ERR)
|
||||
|
||||
self.module = module
|
||||
self.proxmox_api = self._connect()
|
||||
self.proxmoxer_version = proxmoxer_version
|
||||
self.proxmox_api = self._connect()
|
||||
# Test token validity
|
||||
try:
|
||||
self.proxmox_api.version.get()
|
||||
|
@ -92,7 +92,7 @@ class ProxmoxAnsible(object):
|
|||
if api_password:
|
||||
auth_args['password'] = api_password
|
||||
else:
|
||||
if self.version() < LooseVersion('1.1.0'):
|
||||
if self.proxmoxer_version < LooseVersion('1.1.0'):
|
||||
self.module.fail_json('Using "token_name" and "token_value" require proxmoxer>=1.1.0')
|
||||
auth_args['token_name'] = api_token_id
|
||||
auth_args['token_value'] = api_token_secret
|
||||
|
|
Loading…
Reference in a new issue