Merge "Add Docstrings to validate_replicas_by_tier"

This commit is contained in:
Zuul 2018-01-19 19:23:16 +00:00 committed by Gerrit Code Review
commit e317c45ff1

View File

@ -648,6 +648,14 @@ def dispersion_report(builder, search_filter=None,
def validate_replicas_by_tier(replicas, replicas_by_tier):
"""
Validate the sum of the replicas at each tier.
The sum of the replicas at each tier should be less than or very close to
the upper limit indicated by replicas
:param replicas: float,the upper limit of replicas
:param replicas_by_tier: defaultdict,the replicas by tier
"""
tiers = ['cluster', 'regions', 'zones', 'servers', 'devices']
for i, tier_name in enumerate(tiers):
replicas_at_tier = sum(replicas_by_tier[t] for t in