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

Side by Side Diff: slave/skia_slave_scripts/check_buildslave_host_disk_usage.py

Issue 344183004: Use new common utils where possible. (Closed) Base URL: https://skia.googlesource.com/buildbot.git@master
Patch Set: rebase Created 6 years, 5 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 unified diff | Download patch
OLDNEW
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # Copyright (c) 2014 The Chromium Authors. All rights reserved. 2 # Copyright (c) 2014 The Chromium Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be 3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file. 4 # found in the LICENSE file.
5 5
6 6
7 """Verify that the buildslave host machines are under a disk usage threshold.""" 7 """Verify that the buildslave host machines are under a disk usage threshold."""
8 8
9 9
10 import re 10 import re
11 import sys 11 import sys
12 12
13 from build_step import BuildStep, BuildStepWarning, BuildStepFailure 13 from build_step import BuildStep, BuildStepWarning, BuildStepFailure
14 from utils import misc 14 from py.utils import misc
15 15
16 sys.path.append(misc.BUILDBOT_PATH) 16 sys.path.append(misc.BUILDBOT_PATH)
17 17
18 from scripts import run_cmd 18 from scripts import run_cmd
19 19
20 20
21 MAX_DISK_USAGE_PERCENT = 90 21 MAX_DISK_USAGE_PERCENT = 90
22 22
23 23
24 def get_disk_usage_percent(stdout): 24 def get_disk_usage_percent(stdout):
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 raise BuildStepFailure('Some hosts are over threshold.') 74 raise BuildStepFailure('Some hosts are over threshold.')
75 75
76 if failed: 76 if failed:
77 # TODO(borenet): Make sure that we can log in to all hosts, then make this 77 # TODO(borenet): Make sure that we can log in to all hosts, then make this
78 # an error. 78 # an error.
79 raise BuildStepWarning('Could not log in to some hosts.') 79 raise BuildStepWarning('Could not log in to some hosts.')
80 80
81 81
82 if '__main__' == __name__: 82 if '__main__' == __name__:
83 sys.exit(BuildStep.RunBuildStep(CheckSlaveHostsDiskUsage)) 83 sys.exit(BuildStep.RunBuildStep(CheckSlaveHostsDiskUsage))
OLDNEW
« no previous file with comments | « slave/skia_slave_scripts/build_step.py ('k') | slave/skia_slave_scripts/check_for_regressions.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698