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 <http://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 <http://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
[email protected]
http://test.kernel.org/cgi-bin/mailman/listinfo/autotest

_______________________________________________
Autotest mailing list
[email protected]
http://test.kernel.org/cgi-bin/mailman/listinfo/autotest

Reply via email to