| """Build step class for stopping reproxy.""" |
| |
| from __future__ import absolute_import |
| import logging |
| |
| from helpers import rbe_utils |
| from slave import base_step |
| |
| |
| class ReproxyStopStep(base_step.BaseStep): |
| """Build step class for stoping the remote execution reproxy.""" |
| |
| def __init__(self, **kwargs): |
| """Creates a ReproxyStopStep instance. |
| |
| Args: |
| **kwargs: Any additional args to pass to BaseStep. |
| """ |
| super().__init__(name='reproxy stop', **kwargs) |
| |
| def run(self): |
| """Stops the reproxy process. |
| |
| Stops reproxy via the bootstrap control binary. This also generates |
| the rbe_metrics.txt file. |
| |
| Returns: |
| True always. Don't fail the build if reproxy fails to stop. |
| """ |
| |
| if not rbe_utils.is_installed(): |
| return True |
| |
| retcode, _, _ = rbe_utils.stop_reproxy(self) |
| if retcode != 0: |
| logging.error('reproxy failed to stop') |
| |
| return True |