def delete_cleaning_ports(self, task):
    'Deletes the neutron port created for booting the ramdisk.\n\n        :param task: a TaskManager instance.\n        '
    neutron_client = _build_client(task.context.auth_token)
    macs = [p.address for p in task.ports]
    params = {'network_id': CONF.neutron.cleaning_network_uuid}
    try:
        ports = neutron_client.list_ports(**params)
    except neutron_client_exc.ConnectionFailed as e:
        msg = (_('Could not get cleaning network vif for %(node)s from Neutron, possible network issue. %(exc)s') % {'node': task.node.uuid, 'exc': e})
        LOG.exception(msg)
        raise exception.NodeCleaningFailure(msg)
    for neutron_port in ports.get('ports', []):
        if (neutron_port.get('mac_address') in macs):
            try:
                neutron_client.delete_port(neutron_port.get('id'))
            except neutron_client_exc.ConnectionFailed as e:
                msg = (_('Could not remove cleaning ports on network %(net)s from %(node)s, possible network issue. %(exc)s') % {'net': CONF.neutron.cleaning_network_uuid, 'node': task.node.uuid, 'exc': e})
                LOG.exception(msg)
                raise exception.NodeCleaningFailure(msg)
Deletes the neutron port created for booting the ramdisk.

:param task: a TaskManager instance.
def delete_cleaning_ports(self, task):
    'Deletes the neutron port created for booting the ramdisk.\n\n        :param task: a TaskManager instance.\n        '
    neutron_client = _build_client(task.context.auth_token)
    macs = [p.address for p in task.ports]
    params = {'network_id': CONF.neutron.cleaning_network_uuid}
    try:
        ports = neutron_client.list_ports(**params)
    except neutron_client_exc.ConnectionFailed as e:
        msg = (_('Could not get cleaning network vif for %(node)s from Neutron, possible network issue. %(exc)s') % {'node': task.node.uuid, 'exc': e})
        LOG.exception(msg)
        raise exception.NodeCleaningFailure(msg)
    for neutron_port in ports.get('ports', []):
        if (neutron_port.get('mac_address') in macs):
            try:
                neutron_client.delete_port(neutron_port.get('id'))
            except neutron_client_exc.ConnectionFailed as e:
                msg = (_('Could not remove cleaning ports on network %(net)s from %(node)s, possible network issue. %(exc)s') % {'net': CONF.neutron.cleaning_network_uuid, 'node': task.node.uuid, 'exc': e})
                LOG.exception(msg)
                raise exception.NodeCleaningFailure(msg)