From 0ceb717cae8da219016b6afd1c25382d4fb538fc Mon Sep 17 00:00:00 2001 From: SerJ Date: Thu, 24 May 2018 00:59:49 +0300 Subject: [PATCH] Fixed `'HashiVault' object has no attribute 'verify'"}` (#36513) --- lib/ansible/plugins/lookup/hashi_vault.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/ansible/plugins/lookup/hashi_vault.py b/lib/ansible/plugins/lookup/hashi_vault.py index b9f2004eb8..24bad88dfc 100644 --- a/lib/ansible/plugins/lookup/hashi_vault.py +++ b/lib/ansible/plugins/lookup/hashi_vault.py @@ -122,6 +122,8 @@ class HashiVault: else: self.secret_field = '' + self.verify = self.boolean_or_cacert(kwargs.get('validate_certs', True), kwargs.get('cacert', '')) + # If a particular backend is asked for (and its method exists) we call it, otherwise drop through to using # token auth. This means if a particular auth backend is requested and a token is also given, then we # ignore the token and attempt authentication against the specified backend. @@ -150,8 +152,6 @@ class HashiVault: if self.token is None: raise AnsibleError("No Vault Token specified") - self.verify = self.boolean_or_cacert(kwargs.get('validate_certs', True), kwargs.get('cacert', '')) - self.client = hvac.Client(url=self.url, token=self.token, verify=self.verify) if not self.client.is_authenticated():