diff --git a/bin/swift-recon b/bin/swift-recon index bd2a896eda..4750ea0649 100755 --- a/bin/swift-recon +++ b/bin/swift-recon @@ -88,7 +88,8 @@ def scout_quarantine(host): base_url = "http://%s:%s/recon/" % (host[0], host[1]) url, content, status = scout(base_url, "quarantined") return url, content, status - + + def get_ringmd5(ringfile): stats = {} matches = 0 @@ -208,8 +209,8 @@ def load_check(): else: print "Error: No hosts available or returned valid information." print "=" * 79 - - + + def quarantine_check(): objq = {} conq = {} @@ -230,7 +231,7 @@ def quarantine_check(): high = max(stats[item].values()) total = sum(stats[item].values()) average = total / len(stats[item]) - print "[Quarantined %s] lowest: %d, highest: %d, avg: %d, total: %d" % \ + print "[Quarantined %s] low: %d, high: %d, avg: %d, total: %d" % \ (item, low, high, average, total) else: print "Error: No hosts available or returned valid information." @@ -317,7 +318,7 @@ def main(): args.add_option('--swiftdir', default="/etc/swift", help="Default = /etc/swift") options, arguments = args.parse_args() - + if len(sys.argv) <= 1: args.print_help() diff --git a/swift/common/middleware/recon.py b/swift/common/middleware/recon.py index fc12059eb9..70fee447e6 100644 --- a/swift/common/middleware/recon.py +++ b/swift/common/middleware/recon.py @@ -162,7 +162,9 @@ class ReconMiddleware(object): for qtype in qcounts: qtgt = os.path.join(self.devices, device, qdir, qtype) if os.path.exists(qtgt): - qcounts[qtype] += os.lstat(qtgt).st_nlink + linkcount = os.lstat(qtgt).st_nlink + if linkcount > 2: + qcounts[qtype] += linkcount-2 return qcounts def GET(self, req):