def get_object_ring(self, policy_idx, swift_dir):
        """
        Get the ring object to use to handle a request based on its policy.

        An index of None will be treated as 0.

        :param policy_idx: policy index as defined in swift.conf
        :param swift_dir: swift_dir used by the caller
        :returns: appropriate ring object
        """
        policy = self.get_by_index(policy_idx)
        if not policy:
            raise PolicyError(policy_idx % "No policy with index %s")
        if not policy.object_ring:
            policy.load_ring(swift_dir)
        return policy.object_ring
dataset/ETHPy150Open openstack/swift/swift/common/storage_policy.py/StoragePolicyCollection.get_object_ring/swapped operands of `%`