sys.exit(0)
for nodename, basedir in nodedirs:
- files = len(os.listdir(os.path.join(basedir, "storage")))
- if os.path.exists(os.path.join(basedir, "storage", "incoming")):
+ files = len(os.listdir(os.path.join(basedir, "storage", "shares")))
+ if os.path.exists(os.path.join(basedir, "storage", "shares", "incoming")):
files -= 1 # the 'incoming' directory doesn't count
print "%s.value %d" % (nodename, files)
for nodename, basedir in nodedirs:
files = 0
shares = 0
- for f in os.listdir(os.path.join(basedir, "storage")):
+ for f in os.listdir(os.path.join(basedir, "storage", "shares")):
if f == "incoming":
continue
files += 1
- filedir = os.path.join(basedir, "storage", f)
+ filedir = os.path.join(basedir, "storage", "shares", f)
shares += len(os.listdir(filedir))
if files:
shares_per_file = 1.0 * shares / files