Skip to content

Commit

Permalink
Fix rounding issue in required disk space message.
Browse files Browse the repository at this point in the history
  • Loading branch information
megaumi committed Mar 17, 2015
1 parent fefb6a7 commit 6ea8a6c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import time
import random
import logging
import math
from optparse import OptionParser,OptionGroup,SUPPRESS_HELP
import rpm

Expand Down Expand Up @@ -501,7 +502,7 @@ def errorSummary(self, errstring):
p = re.compile('needs (\d+)(K|M)B on the (\S+) filesystem')
disk = {}
for m in p.finditer(errstring):
size_in_mb = int(m.group(1)) if m.group(2) == 'M' else round(int(m.group(1))/1024.0, 3)
size_in_mb = int(m.group(1)) if m.group(2) == 'M' else math.ceil(int(m.group(1))/1024.0)
if m.group(3) not in disk:
disk[m.group(3)] = size_in_mb
if disk[m.group(3)] < size_in_mb:
Expand Down

0 comments on commit 6ea8a6c

Please sign in to comment.