account for parent/.. hardlinks
This commit is contained in:
parent
44803a835d
commit
dcd39d098f
@ -88,7 +88,8 @@ def scout_quarantine(host):
|
|||||||
base_url = "http://%s:%s/recon/" % (host[0], host[1])
|
base_url = "http://%s:%s/recon/" % (host[0], host[1])
|
||||||
url, content, status = scout(base_url, "quarantined")
|
url, content, status = scout(base_url, "quarantined")
|
||||||
return url, content, status
|
return url, content, status
|
||||||
|
|
||||||
|
|
||||||
def get_ringmd5(ringfile):
|
def get_ringmd5(ringfile):
|
||||||
stats = {}
|
stats = {}
|
||||||
matches = 0
|
matches = 0
|
||||||
@ -208,8 +209,8 @@ def load_check():
|
|||||||
else:
|
else:
|
||||||
print "Error: No hosts available or returned valid information."
|
print "Error: No hosts available or returned valid information."
|
||||||
print "=" * 79
|
print "=" * 79
|
||||||
|
|
||||||
|
|
||||||
def quarantine_check():
|
def quarantine_check():
|
||||||
objq = {}
|
objq = {}
|
||||||
conq = {}
|
conq = {}
|
||||||
@ -230,7 +231,7 @@ def quarantine_check():
|
|||||||
high = max(stats[item].values())
|
high = max(stats[item].values())
|
||||||
total = sum(stats[item].values())
|
total = sum(stats[item].values())
|
||||||
average = total / len(stats[item])
|
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)
|
(item, low, high, average, total)
|
||||||
else:
|
else:
|
||||||
print "Error: No hosts available or returned valid information."
|
print "Error: No hosts available or returned valid information."
|
||||||
@ -317,7 +318,7 @@ def main():
|
|||||||
args.add_option('--swiftdir', default="/etc/swift",
|
args.add_option('--swiftdir', default="/etc/swift",
|
||||||
help="Default = /etc/swift")
|
help="Default = /etc/swift")
|
||||||
options, arguments = args.parse_args()
|
options, arguments = args.parse_args()
|
||||||
|
|
||||||
if len(sys.argv) <= 1:
|
if len(sys.argv) <= 1:
|
||||||
args.print_help()
|
args.print_help()
|
||||||
|
|
||||||
|
@ -162,7 +162,9 @@ class ReconMiddleware(object):
|
|||||||
for qtype in qcounts:
|
for qtype in qcounts:
|
||||||
qtgt = os.path.join(self.devices, device, qdir, qtype)
|
qtgt = os.path.join(self.devices, device, qdir, qtype)
|
||||||
if os.path.exists(qtgt):
|
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
|
return qcounts
|
||||||
|
|
||||||
def GET(self, req):
|
def GET(self, req):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user