From 507f89e6939b7e24b13a452d89ea4ca33cd815b5 Mon Sep 17 00:00:00 2001 From: Simon Dodsley Date: Mon, 31 Dec 2018 04:22:13 -0500 Subject: [PATCH] Pure Storage facts fix (#50349) * Add module for Pure Storage FlashBlade to manage directory services * Fix facts not correctly passing into ansible_facts dict --- changelogs/fragments/pure_facts_fix.yaml | 3 +++ lib/ansible/modules/storage/purestorage/purefa_facts.py | 4 +--- lib/ansible/modules/storage/purestorage/purefb_facts.py | 4 +--- 3 files changed, 5 insertions(+), 6 deletions(-) create mode 100644 changelogs/fragments/pure_facts_fix.yaml diff --git a/changelogs/fragments/pure_facts_fix.yaml b/changelogs/fragments/pure_facts_fix.yaml new file mode 100644 index 0000000000..4f61b1bcde --- /dev/null +++ b/changelogs/fragments/pure_facts_fix.yaml @@ -0,0 +1,3 @@ +--- +bugfixes: +- purefa_facts and purefb_facts now correctly adds facts into main ansible_fact dictionary (https://github.com/ansible/ansible/pull/50349) diff --git a/lib/ansible/modules/storage/purestorage/purefa_facts.py b/lib/ansible/modules/storage/purestorage/purefa_facts.py index 9f8a6a15b6..f5be249804 100644 --- a/lib/ansible/modules/storage/purestorage/purefa_facts.py +++ b/lib/ansible/modules/storage/purestorage/purefa_facts.py @@ -675,9 +675,7 @@ def main(): if 'offload' in subset or 'all' in subset: facts['offload'] = generate_offload_dict(array) - result = dict(ansible_purefa_facts=facts,) - - module.exit_json(**result) + module.exit_json(ansible_facts={'ansible_purefa_facts': facts}) if __name__ == '__main__': diff --git a/lib/ansible/modules/storage/purestorage/purefb_facts.py b/lib/ansible/modules/storage/purestorage/purefb_facts.py index 5186961e0a..038131e66e 100644 --- a/lib/ansible/modules/storage/purestorage/purefb_facts.py +++ b/lib/ansible/modules/storage/purestorage/purefb_facts.py @@ -643,9 +643,7 @@ def main(): if 'snapshots' in subset or 'all' in subset: facts['snapshots'] = generate_snap_dict(blade) - result = dict(ansible_purefb_facts=facts,) - - module.exit_json(**result) + module.exit_json(ansible_facts={'ansible_purefb_facts': facts}) if __name__ == '__main__':