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

Unified Diff: telemetry/third_party/webpagereplay/adb_install_cert.py

Issue 1856763002: Roll web-page-replay to latest version (Closed) Base URL: https://github.com/catapult-project/catapult@master
Patch Set: Created 4 years, 8 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 | « telemetry/third_party/webpagereplay/README.chromium ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: telemetry/third_party/webpagereplay/adb_install_cert.py
diff --git a/telemetry/third_party/webpagereplay/adb_install_cert.py b/telemetry/third_party/webpagereplay/adb_install_cert.py
index 1b5c8c2542875db8ab5559cf3ec4bcaac762e6d5..dddd559ed4d0fdc9e7acda36ec3daec775ffa7b4 100644
--- a/telemetry/third_party/webpagereplay/adb_install_cert.py
+++ b/telemetry/third_party/webpagereplay/adb_install_cert.py
@@ -32,6 +32,9 @@ class CertRemovalError(Exception):
pass
+class AdbShellError(subprocess.CalledProcessError):
+ pass
+
_ANDROID_M_BUILD_VERSION = 23
@@ -86,8 +89,7 @@ class AndroidCertInstaller(object):
returncode = int(adb_stdout[prefix_pos + len(RETURN_CODE_PREFIX):])
stdout = adb_stdout[:prefix_pos]
if returncode != 0:
- raise subprocess.CalledProcessError(
- cmd=args, returncode=returncode, output=stdout)
+ raise AdbShellError(cmd=args, returncode=returncode, output=stdout)
return stdout
def _adb_su_shell(self, *args):
@@ -144,8 +146,11 @@ class AndroidCertInstaller(object):
self._adb_su_shell('rm', '-f', self.android_cacerts_path)
def _is_cert_installed(self):
- return (self._adb_su_shell('ls', self.android_cacerts_path).strip() ==
- self.android_cacerts_path)
+ try:
+ return (self._adb_su_shell('ls', self.android_cacerts_path).strip() ==
+ self.android_cacerts_path)
+ except AdbShellError:
+ return False
def _generate_reformatted_cert_path(self):
# Determine OpenSSL version, string is of the form
« no previous file with comments | « telemetry/third_party/webpagereplay/README.chromium ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698