From 12f874534925b52f9d1c91580794eb9e5e9a4589 Mon Sep 17 00:00:00 2001 From: vxlinux Date: Fri, 19 Jan 2018 16:54:26 +0800 Subject: [PATCH] Add Docstrings to validate_replicas_by_tier New common functions should have Docstrings Change-Id: Icbb3cdf38509fd6d034cbb2271786559780a7b68 --- swift/common/ring/utils.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/swift/common/ring/utils.py b/swift/common/ring/utils.py index 807b033669..2822ff18e8 100644 --- a/swift/common/ring/utils.py +++ b/swift/common/ring/utils.py @@ -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