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

Unified Diff: client/common_lib/base_packages.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/bin/job_unittest.py ('k') | client/common_lib/hosts/base_classes.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: client/common_lib/base_packages.py
diff --git a/client/common_lib/base_packages.py b/client/common_lib/base_packages.py
index feb0d315e5d3b8e4f2e74fdb7c823519fcbc6f3f..8a6700454fe3388bd4bb6184944c9b5e645e8afe 100644
--- a/client/common_lib/base_packages.py
+++ b/client/common_lib/base_packages.py
@@ -50,13 +50,15 @@ def repo_run_command(repo, cmd, ignore_status=False):
def check_diskspace(repo, min_free=None):
+ # Note: 1 GB = 10**9 bytes (SI unit).
if not min_free:
min_free = global_config.global_config.get_config_value('PACKAGES',
'minimum_free_space',
type=int)
try:
- df = repo_run_command(repo, 'df -mP . | tail -1').stdout.split()
- free_space_gb = int(df[3])/1000.0
+ df = repo_run_command(repo,
+ 'df -PB %d . | tail -1' % 10**9).stdout.split()
+ free_space_gb = int(df[3])
except Exception, e:
raise error.RepoUnknownError('Unknown Repo Error: %s' % e)
if free_space_gb < min_free:
« no previous file with comments | « client/bin/job_unittest.py ('k') | client/common_lib/hosts/base_classes.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698