'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'

def get_object_ring(self, policy_idx, swift_dir):

    policy = self.get_by_index(policy_idx)
    if (not policy):
        raise PolicyError(('No    policy    with    index    %s' % policy_idx))
    if (not policy.object_ring):
        policy.load_ring(swift_dir)
    return policy.object_ring
