account for parent/.. hardlinks

This commit is contained in:
Florian Hines 2011-08-12 16:29:13 -05:00
parent 44803a835d
commit dcd39d098f
2 changed files with 9 additions and 6 deletions

View File

@ -89,6 +89,7 @@ def scout_quarantine(host):
url, content, status = scout(base_url, "quarantined")
return url, content, status
def get_ringmd5(ringfile):
stats = {}
matches = 0
@ -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."

View File

@ -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):