From 7a2483c47ea1053ad6a8fc59fd25274ef712be5e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Moser?= Date: Tue, 13 Aug 2019 19:27:18 +0200 Subject: [PATCH] purefa_phonehome: implement check mode support (#57585) --- .../modules/storage/purestorage/purefa_phonehome.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/ansible/modules/storage/purestorage/purefa_phonehome.py b/lib/ansible/modules/storage/purestorage/purefa_phonehome.py index 0b4a80a411c..d788d0d4642 100644 --- a/lib/ansible/modules/storage/purestorage/purefa_phonehome.py +++ b/lib/ansible/modules/storage/purestorage/purefa_phonehome.py @@ -56,7 +56,8 @@ def enable_ph(module, array): changed = False if array.get_phonehome()['phonehome'] != 'enabled': try: - array.enable_phonehome() + if not module.check_mode: + array.enable_phonehome() changed = True except Exception: module.fail_json(msg='Enabling Phonehome failed') @@ -68,7 +69,8 @@ def disable_ph(module, array): changed = False if array.get_phonehome()['phonehome'] == 'enabled': try: - array.disable_phonehome() + if not module.check_mode: + array.disable_phonehome() changed = True except Exception: module.fail_json(msg='Disabling Remote Assist failed') @@ -82,7 +84,7 @@ def main(): )) module = AnsibleModule(argument_spec, - supports_check_mode=False) + supports_check_mode=True) array = get_system(module)