bug 870168 - make mach handle multiple logged-in users properly r=gps DONTBUILD (NPOTB)
authorNick Hurley <hurley@todesschaf.org>
Wed, 08 May 2013 18:06:17 -0700
changeset 142273 56425c0947591ca8dc5720ffdc4b45e430192748
parent 142272 dac8cb02fd216d408a9da4329b9d0ee1cb940b7a
child 142274 ea059733677c6dcf059def235334045c4783b40b
child 142286 ad46747e8ec467d3e3d7a913b22e0ffd12354466
push id2579
push userakeybl@mozilla.com
push dateMon, 24 Jun 2013 18:52:47 +0000
treeherdermozilla-beta@b69b7de8a05a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgps
bugs870168
milestone23.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
bug 870168 - make mach handle multiple logged-in users properly r=gps DONTBUILD (NPOTB)
python/mozbuild/mozbuild/mach_commands.py
--- a/python/mozbuild/mozbuild/mach_commands.py
+++ b/python/mozbuild/mozbuild/mach_commands.py
@@ -1,14 +1,15 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, # You can obtain one at http://mozilla.org/MPL/2.0/.
 
 from __future__ import print_function, unicode_literals
 
+import getpass
 import logging
 import operator
 import os
 import sys
 import time
 
 from mach.decorators import (
     CommandArgument,
@@ -184,16 +185,19 @@ class Build(MachCommandBase):
             import psutil
         except ImportError:
             return None
 
         for proc in psutil.process_iter():
             if proc.name != 'Finder':
                 continue
 
+            if proc.username != getpass.getuser():
+                continue
+
             # Try to isolate system finder as opposed to other "Finder"
             # processes.
             if not proc.exe.endswith('CoreServices/Finder.app/Contents/MacOS/Finder'):
                 continue
 
             return proc.get_cpu_times()
 
         return None