def _delete_resource(self, neutron_client, resource_type, resource):
        resource_id = resource['id']
        if resource_type == 'port':
            if resource.get('device_owner', '') == 'network:router_interface':
                body = {'port_id': resource_id}
                neutron_client.remove_interface_router(resource['device_id'],
                                                       body)
                return
        function = getattr(neutron_client, 'delete_%s' % resource_type)
        if callable(function):
            function(resource_id)
dataset/ETHPy150Open openstack/python-neutronclient/neutronclient/neutron/v2_0/purge.py/Purge._delete_resource/original