diff options
author | Simon Dodsley <simon@purestorage.com> | 2019-12-17 07:46:10 -0800 |
---|---|---|
committer | ansibot <ansibot@users.noreply.github.com> | 2019-12-17 10:46:10 -0500 |
commit | 42144204f3ba83c4ce68c049a34fb15554718057 (patch) | |
tree | efc1ca851890d8b8e111b8dbc8216bbad7874e3d | |
parent | 9b85a51c64a687f8db4a9bfe3fea0f62f5f65af2 (diff) | |
download | ansible-42144204f3ba83c4ce68c049a34fb15554718057.tar.gz |
Fix purefa_host preferred array connection logic (#65917)
-rw-r--r-- | lib/ansible/modules/storage/purestorage/purefa_host.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/ansible/modules/storage/purestorage/purefa_host.py b/lib/ansible/modules/storage/purestorage/purefa_host.py index 3b0e471633..6d11211247 100644 --- a/lib/ansible/modules/storage/purestorage/purefa_host.py +++ b/lib/ansible/modules/storage/purestorage/purefa_host.py @@ -452,12 +452,13 @@ def main(): if not all_connected_arrays: module.fail_json(msg='No target arrays connected to source array. Setting preferred arrays not possible.') else: - current_arrays = [] + current_arrays = [array.get()['array_name']] for current_array in range(0, len(all_connected_arrays)): - current_arrays.append(all_connected_arrays[current_array]['array_name']) + if all_connected_arrays[current_array]['type'] == "sync-replication": + current_arrays.append(all_connected_arrays[current_array]['array_name']) for array_to_connect in range(0, len(module.params['preferred_array'])): if module.params['preferred_array'][array_to_connect] not in current_arrays: - module.fail_json(msg='Array {0} not in existing array connections.'.format(module.params['preferred_array'][array_to_connect])) + module.fail_json(msg='Array {0} is not a synchronously connected array.'.format(module.params['preferred_array'][array_to_connect])) except Exception: module.fail_json(msg='Failed to get existing array connections.') |