Skip to content
This repository has been archived by the owner on Oct 10, 2020. It is now read-only.

Commit

Permalink
Merge pull request #105 from chuanchang/fix_error_in_convert_size
Browse files Browse the repository at this point in the history
atomic: add missing bytes unit
  • Loading branch information
rhatdan committed Jul 30, 2015
2 parents ed96167 + dbd4059 commit 9186097
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Atomic/atomic.py
Expand Up @@ -26,7 +26,7 @@

def convert_size(size):
if size > 0:
size_name = ("KB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB")
size_name = ("B", "KB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB")
i = int(math.floor(math.log(size, 1000)))
p = math.pow(1000, i)
s = round(size/p, 2)
Expand Down Expand Up @@ -567,14 +567,14 @@ def images(self):
self.d.remove_image(i, force=True)
return

self.writeOut(" %-25s %-19s %.12s %-19s %-10s" %
self.writeOut(" %-35s %-19s %.12s %-19s %-10s" %
("REPOSITORY", "TAG", "IMAGE ID", "CREATED",
"VIRTUAL SIZE"))

for image in self.d.images():
repo, tag = image["RepoTags"][0].split(":")
self.writeOut(
"%s%-25s %-19s %.12s %-19s %-12s" %
"%s%-35s %-19s %.12s %-19s %-12s" %
(self.dangling(repo), repo, tag, image["Id"],
time.strftime("%F %H:%M",
time.localtime(image["Created"])),
Expand Down

0 comments on commit 9186097

Please sign in to comment.