Files
swift/test/unit/common/ring
vxlinux a1ae142d5b Merge repeat code for rebalance
There are three similar code segments in rebalance process as follows:

    tiers = ['cluster', 'regions', 'zones', 'servers', 'devices']
    for i, tier_name in enumerate(tiers):
        replicas_at_tier = sum(weighted_replicas_by_tier[t] for t in
                               weighted_replicas_by_tier if len(t) == i)
        if abs(self.replicas - replicas_at_tier) > 1e-10:
            raise exceptions.RingValidationError(
                '%s != %s at tier %s' % (
                    replicas_at_tier, self.replicas, tier_name))

I think we can encapsulate this code segment to a private function and
replace those code segments with a function call

Change-Id: I89439286b211f2c5ef19deffa77c202f48f07cf8
2018-01-15 11:45:00 +00:00
..
2010-07-12 17:03:45 -05:00