def ex_iterate_ptr_records(self, device):
        """
        Return a generator to iterate over existing PTR Records.

        The ``device`` should be an instance of one of these:
            :class:`libcloud.compute.base.Node`
            :class:`libcloud.loadbalancer.base.LoadBalancer`

        And it needs to have the following ``extra`` fields set:
            service_name - the service catalog name for the device
            uri - the URI pointing to the GET endpoint for the device

        Those are automatically set for you if you got the device from
        the Rackspace driver for that service.

        For example:
            server = rs_compute.ex_get_node_details(id)
            ptr_iter = rs_dns.ex_list_ptr_records(server)

            loadbalancer = rs_lbs.get_balancer(id)
            ptr_iter = rs_dns.ex_list_ptr_records(loadbalancer)

        Note: the Rackspace DNS API docs indicate that the device 'href' is
        optional, but testing does not bear this out. It throws a
        400 Bad Request error if you do not pass in the 'href' from
        the server or loadbalancer.  So ``device`` is required.

        :param device: the device that owns the IP
        :rtype: ``generator`` of :class:`RackspacePTRRecord`
        """
        _check_ptr_extra_fields(device)
        params = {'href': device.extra['uri']}

        service_name = device.extra['service_name']

        # without a valid context, the 404 on empty list will blow up
        # in the error-handling code
        self.connection.set_context({'resource': 'ptr_records'})
        try:
            response = self.connection.request(
                action=(service_name) % '/rdns/%s', params=params).object
            records = response['records']
            link = dict(rel=service_name, **params)
            for item in records:
                record = self._to_ptr_record(data=item, link=link)
                yield record
        except BaseHTTPError as exc:
            # 404 just means empty list
            if exc.code == 404:
                return
            raise
dataset/ETHPy150Open apache/libcloud/libcloud/dns/drivers/rackspace.py/RackspaceDNSDriver.ex_iterate_ptr_records/swapped operands of `%`