Move Proxmox HAS_PROXMOXER check into module_utils. (#4030) (#4046)

* Move Proxmox `HAS_PROXMOXER` check into `module_utils`.

* Fix tests.

* Fix typo.

* Update changelog entry.

(cherry picked from commit 761fbe4fa3)

Co-authored-by: Markus Reiter <me@reitermark.us>
This commit is contained in:
patchback[bot] 2022-01-16 20:28:26 +01:00 committed by GitHub
parent a477044fb7
commit 9e6df4f1c9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 16 additions and 24 deletions

View file

@ -68,6 +68,9 @@ def ansible_to_proxmox_bool(value):
class ProxmoxAnsible(object):
"""Base class for Proxmox modules"""
def __init__(self, module):
if not HAS_PROXMOXER:
module.fail_json(msg=missing_required_lib('proxmoxer'), exception=PROXMOXER_IMP_ERR)
self.module = module
self.proxmox_api = self._connect()
# Test token validity