Bug 1524150 - [mozdevice] remove -s <serialno> from ADBProcess-based error messages, r=gbrown.
authorBob Clary <bclary@bclary.com>
Thu, 31 Jan 2019 20:35:56 -0800
changeset 456395 3feead6581fcbfdcd9e82e0c2efc978486268dc9
parent 456394 cc31e621f479b1d45d21df05030ec73ea6254884
child 456396 dd571576b11bea63719d7f178d4ea5e19305d196
push id19
push usermdeboer@mozilla.com
push dateFri, 01 Feb 2019 10:05:45 +0000
reviewersgbrown
bugs1524150
milestone67.0a1
Bug 1524150 - [mozdevice] remove -s <serialno> from ADBProcess-based error messages, r=gbrown.
testing/mozbase/mozdevice/mozdevice/adb.py
testing/mozbase/mozdevice/setup.py
--- a/testing/mozbase/mozdevice/mozdevice/adb.py
+++ b/testing/mozbase/mozdevice/mozdevice/adb.py
@@ -41,18 +41,22 @@ class ADBProcess(object):
         if not self.stdout_file or self.stdout_file.closed:
             content = ""
         else:
             self.stdout_file.seek(0, os.SEEK_SET)
             content = self.stdout_file.read().rstrip()
         return content
 
     def __str__(self):
+        # Remove -s <serialno> from the error message to allow bug suggestions
+        # to be independent of the individual failing device.
+        arg_string = ' '.join(self.args)
+        arg_string = re.sub(' -s \w+', '', arg_string)
         return ('args: %s, exitcode: %s, stdout: %s' % (
-            ' '.join(self.args), self.exitcode, self.stdout))
+            arg_string, self.exitcode, self.stdout))
 
 # ADBError, ADBRootError, and ADBTimeoutError are treated
 # differently in order that unhandled ADBRootErrors and
 # ADBTimeoutErrors can be handled distinctly from ADBErrors.
 
 
 class ADBError(Exception):
     """ADBError is raised in situations where a command executed on a
--- a/testing/mozbase/mozdevice/setup.py
+++ b/testing/mozbase/mozdevice/setup.py
@@ -3,17 +3,17 @@
 # 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 absolute_import
 
 from setuptools import setup
 
 PACKAGE_NAME = 'mozdevice'
-PACKAGE_VERSION = '2.0'
+PACKAGE_VERSION = '2.0.1'
 
 deps = ['mozlog >= 3.0']
 
 setup(name=PACKAGE_NAME,
       version=PACKAGE_VERSION,
       description="Mozilla-authored device management",
       long_description="see https://firefox-source-docs.mozilla.org/mozbase/index.html",
       classifiers=['Programming Language :: Python :: 2.7',