Skip to content

Commit

Permalink
adding self.hvac import to make hvac available to other modules
Browse files Browse the repository at this point in the history
  • Loading branch information
mathijswesterhof committed Jul 22, 2023
1 parent 6b53701 commit 94bca51
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion plugins/module_utils/_hashi_vault_common.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ class HashiVaultHelper():
def __init__(self):
try:
import hvac
self.hvac = hvac
except ImportError as e:
from ansible.module_utils.basic import missing_required_lib
raise HashiVaultHVACError(error=str(e), msg=missing_required_lib('hvac'))
Expand Down Expand Up @@ -96,7 +97,7 @@ def get_vault_client(
if key in self.STRINGIFY_CANDIDATES:
kwargs[key] = self._stringify(kwargs[key])

client = hvac.Client(**kwargs)
client = self.hvac.Client(**kwargs)

# logout to prevent accidental use of inferred tokens
# https://github.com/ansible-collections/community.hashi_vault/issues/13
Expand Down

0 comments on commit 94bca51

Please sign in to comment.