HewlettPackard / HewlettPackard/hpe3par_python_sdk
This does not do what it is supposed to do, or it is misused in the ansible module.
- Dominant language
- Python
- Stars
- 10
- Forks
- 16
- PR merge metrics
- No merged PRs in 30d
Description
https://github.com/HewlettPackard/hpe3par_python_sdk/blob/874bc326d2a456305fc19da19aeca49627ebf4fd/hpe3par_sdk/client.py#L1585
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)
```
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.