qubesutils.py: fix get_disk_usage hidden exception

This commit is contained in:
Wojciech Zygmunt Porczyk 2014-04-30 13:30:02 +02:00
parent 14f3094036
commit 1840420331

View File

@ -39,6 +39,8 @@ import xen.lowlevel.xc
import xen.lowlevel.xl
import xen.lowlevel.xs
BLKSIZE = 512
def mbytes_to_kmg(size):
if size > 1024:
return "%d GiB" % (size/1024)
@ -88,7 +90,7 @@ def parse_size(size):
def get_disk_usage_one(st):
try:
return st.st_blocks * BLKSIZE
except:
except AttributeError:
return st.st_size
def get_disk_usage(path):