On Mon, 2011-02-07 at 10:55 -0800, Jongki Suwandi wrote: > Ah, yes, that old confusion. But the problem is df -m reports in > 2**20 blocks. So if we divide that by 1000, the result is not the > right GB (10**9 blocks). Calling df -HmP probably would be another > solution.
Sounds good to me. Could you send a patch doing that, Jongki? Lucas > -Jongki > > On Mon, Feb 7, 2011 at 3:11 AM, Cleber Rosa <cr...@redhat.com> wrote: > > On 02/05/2011 07:22 PM, Jongki Suwandi wrote: > > I noticed Host.check_diskpace() in > > server/hosts/base_classes.py does this: > > > > logging.info('Checking for >= %s GB of space under % > > s on machine %s', > > gb, path, self.hostname) > > df = self.run('df -mP %s | tail -1' % > > path).stdout.split() > > free_space_gb = int(df[3])/1000.0 > > if free_space_gb < gb: > > raise error.AutoservDiskFullHostError(path, gb, > > free_space_gb) > > else: > > logging.info('Found %s GB >= %s GB of space > > under %s on machine %s', > > free_space_gb, gb, path, self.hostname) > > > > I just want to confirm before I change it, but isn't that > > supposed to be 1024 instead of 1000? The difference between > > those two values might not be much, but it could overinflate > > the free space by several gigabytes. > > > > > Jongki, > > This is probably due to the fact that one GB is indeed 10**9 > bytes (and one GiB is 2**30 bytes). > > See: http://en.wikipedia.org/wiki/Gibibyte > > Cheers. > > CR. > > > Thanks, > > -Jongki > > > > _______________________________________________ > > Autotest mailing list > > Autotest@test.kernel.org > > http://test.kernel.org/cgi-bin/mailman/listinfo/autotest > > > > _______________________________________________ > Autotest mailing list > Autotest@test.kernel.org > http://test.kernel.org/cgi-bin/mailman/listinfo/autotest _______________________________________________ Autotest mailing list Autotest@test.kernel.org http://test.kernel.org/cgi-bin/mailman/listinfo/autotest