Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(209)

Unified Diff: client/common_lib/hosts/base_classes.py

Issue 6539001: Merge remote branch 'cros/upstream' into master. (Closed) Base URL: ssh://git@gitrw.chromium.org:9222/autotest.git@master
Patch Set: patch Created 9 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « client/common_lib/base_packages.py ('k') | client/tests/bash_shared_mapping/bash_shared_mapping.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: client/common_lib/hosts/base_classes.py
diff --git a/client/common_lib/hosts/base_classes.py b/client/common_lib/hosts/base_classes.py
index 0b6ce0cb993b13d26af86a2f54f1f68d7c844208..e0c240f24b6bd1fdec6274c09dae26bcc8831a99 100644
--- a/client/common_lib/hosts/base_classes.py
+++ b/client/common_lib/hosts/base_classes.py
@@ -228,10 +228,11 @@ class Host(object):
def check_diskspace(self, path, gb):
+ # Note: 1 GB = 10**9 bytes (SI unit).
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
+ df = self.run('df -PB %d %s | tail -1' % (10**9, path)).stdout.split()
+ free_space_gb = int(df[3])
if free_space_gb < gb:
raise error.AutoservDiskFullHostError(path, gb, free_space_gb)
else:
« no previous file with comments | « client/common_lib/base_packages.py ('k') | client/tests/bash_shared_mapping/bash_shared_mapping.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698