Fix bug in service_stopper. introduced bug into the
service stopper logic where is_stopped was always true.

For example the most likely upstart status strings will create the
following values for is_stopped:

out_arr = ['tcsd start/running, process 507',
	   'tcsd stop/waiting',
           'status: Unknown job: tcsd_bogus'
for out in out_arr:
  is_stopped = 'start/running' not in out
  print is_stopped

>>> False
>>> True
>>> True

Previous change incorrectly assummed find would return 0 for a match
and 1 for not but it should have instead key'd off -1 for no match.

TEST=hardware_TPMCheck passes

Reviewed-by: Scott Zawalski <>
Commit-Queue: Todd Broch <>
Tested-by: Todd Broch <>
(cherry picked from commit 7d6386a862470be63bc607fcc0c0eb2b288923df)

Change-Id: Ib554b4d44602ca4456d21b782237b4cff386cff2
Reviewed-by: Scott Zawalski <>
Tested-by: Scott Zawalski <>
diff --git a/client/cros/ b/client/cros/
index 570ef47..0593bc9 100644
--- a/client/cros/
+++ b/client/cros/
@@ -43,7 +43,7 @@
         for service in self.services_to_stop:
             cmd = 'status %s' % service
             out = utils.system_output(cmd, ignore_status=True)
-            is_stopped = out.find('start/running') != 0
+            is_stopped = 'start/running' not in out
             if is_stopped: