mirror of
https://github.com/freeipa/ansible-freeipa.git
synced 2026-07-28 10:24:47 +00:00
Modified return value for ipavault module.
The ipavault module was returning a single string value when retrieving data. To keep consistency with other modules, it should return a dict with the `data` variable in it. This change modifies the result of ipavault to be a dict and also fixes relevant tests, examples and documentation.
This commit is contained in:
@@ -303,10 +303,15 @@ EXAMPLES = """
|
||||
"""
|
||||
|
||||
RETURN = """
|
||||
data:
|
||||
description: The vault data.
|
||||
returned: If state is retrieved.
|
||||
type: string
|
||||
vault:
|
||||
description: Vault dict with archived data.
|
||||
returned: If state is `retrieved`.
|
||||
type: dict
|
||||
options:
|
||||
data:
|
||||
description: The vault data.
|
||||
returned: always
|
||||
type: string
|
||||
"""
|
||||
|
||||
import os
|
||||
@@ -910,9 +915,11 @@ def main():
|
||||
if 'result' not in result:
|
||||
raise Exception("No result obtained.")
|
||||
if 'data' in result['result']:
|
||||
exit_args['data'] = result['result']['data']
|
||||
data_return = exit_args.setdefault('vault', {})
|
||||
data_return['data'] = result['result']['data']
|
||||
elif 'vault_data' in result['result']:
|
||||
exit_args['data'] = result['result']['vault_data']
|
||||
data_return = exit_args.setdefault('vault', {})
|
||||
data_return['data'] = result['result']['vault_data']
|
||||
else:
|
||||
raise Exception("No data retrieved.")
|
||||
changed = False
|
||||
|
||||
Reference in New Issue
Block a user