Ignore requests to stop services that don't exist on a platform.
Some platforms don't support certain services. For example, parrot
does not have bluetooth and therefore no bluetoothd service. Change
allows system call to upstart ( 'stop <service>' ) to fail gracefully
instead of causing an exception.
BUG=chrome-os-partner:18931
TEST=run power_Consumption on parrot
Change-Id: Iaf0e84dc41615aee5316c7e0fc59ea0ea7329182
Reviewed-on: https://gerrit.chromium.org/gerrit/51254
Reviewed-by: Sameer Nanda <snanda@chromium.org>
Reviewed-by: Mohammed Habibulla <moch@chromium.org>
Commit-Queue: Todd Broch <tbroch@chromium.org>
Tested-by: Todd Broch <tbroch@chromium.org>
(cherry picked from commit 3c89c0984d39e06922da1f29e96688aa2a2e177c)
Reviewed-on: https://gerrit.chromium.org/gerrit/51470
diff --git a/client/cros/service_stopper.py b/client/cros/service_stopper.py
index 1ac5c24..570ef47 100644
--- a/client/cros/service_stopper.py
+++ b/client/cros/service_stopper.py
@@ -42,7 +42,8 @@
for service in self.services_to_stop:
cmd = 'status %s' % service
- is_stopped = utils.system_output(cmd).find('stop/waiting') != -1
+ out = utils.system_output(cmd, ignore_status=True)
+ is_stopped = out.find('start/running') != 0
if is_stopped:
continue
try: