Fix updating hosts idempotency in purefa_host (#60367)

pull/60544/head
Simon Dodsley 5 years ago committed by ansibot
parent 6915ea96f1
commit 848c945a2c

@ -366,20 +366,22 @@ def make_host(module, array):
def update_host(module, array):
changed = True
if not module.check_mode:
init_changed = vol_changed = pers_changed = pref_changed = False
volumes = array.list_host_connections(module.params['host'])
if module.params['iqn'] or module.params['wwns'] or module.params['nqn']:
changed = _update_host_initiators(module, array)
init_changed = _update_host_initiators(module, array)
if module.params['volume']:
current_vols = [vol['vol'] for vol in volumes]
if not module.params['volume'] in current_vols:
changed = _connect_new_volume(module, array)
vol_changed = _connect_new_volume(module, array)
api_version = array._list_available_rest_versions()
if AC_REQUIRED_API_VERSION in api_version:
if module.params['personality']:
changed = _update_host_personality(module, array)
pers_changed = _update_host_personality(module, array)
if PREFERRED_ARRAY_API_VERSION in api_version:
if module.params['preferred_array']:
changed = _update_preferred_array(module, array)
pref_changed = _update_preferred_array(module, array)
changed = init_changed or vol_changed or pers_changed or pref_changed
module.exit_json(changed=changed)

Loading…
Cancel
Save