storage/file: gracefully handle not mounted pool

Fixes QubesOS/qubes-issues#4668
このコミットが含まれているのは:
Marek Marczykowski-Górecki 2019-02-19 15:22:47 +01:00
コミット 318ed439ff
この署名に対応する既知のキーがデータベースに存在しません
GPGキーID: 063938BA42CFA724

ファイルの表示

@ -155,13 +155,19 @@ class FilePool(qubes.storage.Pool):
@property
def size(self):
try:
statvfs = os.statvfs(self.dir_path)
return statvfs.f_frsize * statvfs.f_blocks
except FileNotFoundError:
return 0
@property
def usage(self):
try:
statvfs = os.statvfs(self.dir_path)
return statvfs.f_frsize * (statvfs.f_blocks - statvfs.f_bfree)
except FileNotFoundError:
return 0
def included_in(self, app):
''' Check if there is pool containing this one - either as a