'Raises PortInUse for ports assigned for device purposes.'

def check_not_in_use(self, context):

    core_plugin = directory.get_plugin()
    self._port = core_plugin.get_port(context, self.port_id)
    if self._port['device_id']:
        raise n_exc.PortInUse(net_id=self._port['network_id'], port_id=self._port['id'], device_id=self._port['device_id'])
