Skip to content

This does not do what it is supposed to do, or it is misused in the ansible module. #33

@VortexUK

Description

@VortexUK

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions