|
hosts = self.client.queryHost(iqns, wwns)['members'] |
This will return wwn's that exist on the storage, regardless of if they are already used in another host or not. Which means when you are trying to add WWNs to an existing host, ansible will complain that "they are already part of another host" when they are not. Add something like this:
hosts = self.client.queryHost(iqns, wwns)['members']
for host in [x for x in hosts if x.get('name',None)]:
host_list.append(Host(host))
return host_list
Or fix the ansible module:
https://github.com/HewlettPackard/hpe3par_ansible_module/blob/master/Modules/hpe3par_host.py#L622-L627
This should become:
host_list = client_obj.queryHost(wwns=wwn_list)
for host_obj in host_list:
host_name_3par = host_obj.name
if host_name_3par:
if host_name == host_name_3par:
wwn_same_host.append(wwn)
else:
wwn_other_host.append(wwn)
hpe3par_python_sdk/hpe3par_sdk/client.py
Line 1585 in 874bc32
This will return wwn's that exist on the storage, regardless of if they are already used in another host or not. Which means when you are trying to add WWNs to an existing host, ansible will complain that "they are already part of another host" when they are not. Add something like this:
Or fix the ansible module:
https://github.com/HewlettPackard/hpe3par_ansible_module/blob/master/Modules/hpe3par_host.py#L622-L627
This should become: