| OLD | NEW |
| 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 Loading... |
| 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)) |
| OLD | NEW |