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

Unified Diff: tools/telemetry/telemetry/core/backends/chrome/cros_interface.py

Issue 302163004: telemetry: Robustify CrOSInterface._GetSessionManagerPid(). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/telemetry/telemetry/core/backends/chrome/cros_interface.py
diff --git a/tools/telemetry/telemetry/core/backends/chrome/cros_interface.py b/tools/telemetry/telemetry/core/backends/chrome/cros_interface.py
index b5add7d4e9ffef3f6f57de299a661d5c8c2fa5a2..890e0b15cefdf5d393277c81ea9b0226efea477a 100644
--- a/tools/telemetry/telemetry/core/backends/chrome/cros_interface.py
+++ b/tools/telemetry/telemetry/core/backends/chrome/cros_interface.py
@@ -297,7 +297,8 @@ class CrOSInterface(object):
"""Returns the pid of the session_manager process, given the list of
processes."""
for pid, process, _, _ in procs:
- if process.startswith('/sbin/session_manager '):
+ argv = process.split()
+ if argv and os.path.basename(argv[0]) == 'session_manager':
achuithb 2014/06/02 08:51:20 argv should never be empty, right?
Daniel Erat 2014/06/02 13:38:24 "".split() returns an empty array. i think that a
Daniel Erat 2014/06/02 13:48:17 (although i'm probably being overly paranoid, sinc
return pid
return None
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698