Merge pull request #357 from FirmlyReality/master

Fix 2 bugs in imagemgr
This commit is contained in:
Yujian Zhu 2018-11-22 00:02:50 +08:00 committed by GitHub
commit 621cf632d1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -387,10 +387,10 @@ class ImageMgr():
if imagename == "base" and imagetype == "base": if imagename == "base" and imagetype == "base":
return 0 return 0
if imagetype == "private": if imagetype == "private":
imgpath = self.imgpath + "private/" + user + "/" imgpath = self.imgpath + "private/" + imageowner + "/"
else: else:
imgpath = self.imgpath + "public/" + imageowner + "/" imgpath = self.imgpath + "public/" + imageowner + "/"
return os.stat(os.path.join(imgpath, imagename)).st_size // (1024*1024) return os.stat(os.path.join(imgpath, imagename+".tz")).st_size // (1024*1024)
def format_size(self, size_in_byte): def format_size(self, size_in_byte):