Use local params to limit code changes
@@ -89,20 +89,21 @@ from ansible.module_utils.hashivault import *
@hashiwrapper
def hashivault_write(module):
result = {"changed": False, "rc": 0}
- client = hashivault_auth_client(module.params)
- secret = module.params.get('secret')
+ params = module.params
+ client = hashivault_auth_client(params)
+ secret = params.get('secret')
returned_data = None
if secret.startswith('/'):
secret = secret.lstrip('/')
else:
secret = ('secret/%s' % secret)
- data = module.params.get('data')
+ data = params.get('data')
with warnings.catch_warnings():
warnings.simplefilter("ignore")
changed = True
write_data = data
- if module.params.get('update'):
+ if params.get('update'):
read_data = client.read(secret)
if read_data is None:
read_data = {}
