From edda38b3ef9c79ad9bc8af243707521c8f37557e Mon Sep 17 00:00:00 2001 From: KevinMidboe Date: Sat, 18 Feb 2017 11:41:00 +0100 Subject: [PATCH] Changed print statement and error return statement --- status/diskusage.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/status/diskusage.py b/status/diskusage.py index b27fe02..2c219d7 100755 --- a/status/diskusage.py +++ b/status/diskusage.py @@ -3,7 +3,7 @@ # @Author: KevinMidboe # @Date: 2017-01-28 10:54:06 # @Last Modified by: KevinMidboe -# @Last Modified time: 2017-02-18 11:39:00 +# @Last Modified time: 2017-02-18 11:40:34 # f_avail = free blocks avail to non sudo # frsize = fundamental file sys byte size @@ -26,13 +26,12 @@ def diskUsage(rootPath=None): if rootPath == None: rootPath = '/' if not path.isdir(rootPath): - return {"Error": "Directory does not exist."} + return {"errors": "Directory does not exist."} s = statvfs(rootPath) byteLeft = s.f_bavail * s.f_frsize byteTotal = s.f_blocks * s.f_frsize byteUsed = byteTotal-byteLeft - print(byteLeft, byteTotal, byteUsed) return { 'left': sizeof(byteLeft), 'used': sizeof(byteUsed), 'total': sizeof(byteTotal) } if __name__=="__main__":