Fix Hashi login method for approles
Moves Hashi Vault client login to use `auth.approle.login` as current method is being deprecated in the next release. ``` DeprecationWarning: Call to deprecated function 'auth_approle'. This method will be removed in version '0.12.0' Please use the 'login' method on the 'hvac.api.auth_methods.approle' class moving forward. client.auth_approle(vault_role_id, vault_secret_id) ``` Change-Id: Ie5c1ebe99c8508336cc10944fdaa742ad7d1d85e
This commit is contained in:
parent
b0dc2423bc
commit
3300815529
@ -55,7 +55,8 @@ def hashicorp_vault_client(vault_namespace, vault_addr, vault_role_id,
|
|||||||
namespace=vault_namespace)
|
namespace=vault_namespace)
|
||||||
else:
|
else:
|
||||||
client = hvac.Client(url=vault_addr, namespace=vault_namespace)
|
client = hvac.Client(url=vault_addr, namespace=vault_namespace)
|
||||||
client.auth_approle(vault_role_id, vault_secret_id)
|
client.auth.approle.login(role_id=vault_role_id,
|
||||||
|
secret_id=vault_secret_id)
|
||||||
|
|
||||||
if not client.is_authenticated():
|
if not client.is_authenticated():
|
||||||
print('Failed to authenticate to vault')
|
print('Failed to authenticate to vault')
|
||||||
|
Loading…
x
Reference in New Issue
Block a user