Index: tools/telemetry/telemetry/page/page_set_archive_info.py |
diff --git a/tools/telemetry/telemetry/page/page_set_archive_info.py b/tools/telemetry/telemetry/page/page_set_archive_info.py |
index c9a7959f589e752768d820f9263055dca7359dad..a93f33eb32c2ce68982200d299208698402a3b40 100644 |
--- a/tools/telemetry/telemetry/page/page_set_archive_info.py |
+++ b/tools/telemetry/telemetry/page/page_set_archive_info.py |
@@ -8,6 +8,7 @@ import os |
import re |
import shutil |
+from telemetry.core.backends.chrome import cros_interface |
from telemetry.page import cloud_storage |
@@ -22,16 +23,28 @@ class PageSetArchiveInfo(object): |
# Download all .wpr files. |
if not ignore_archive: |
+ # TODO(tbarzic): Remove this once http://crbug.com/351143 is diagnosed. |
+ log_cloud_storage_exception = cros_interface.IsRunningOnCrosDevice() |
for archive_path in data['archives']: |
archive_path = self._WprFileNameToPath(archive_path) |
try: |
cloud_storage.GetIfChanged(archive_path) |
- except (cloud_storage.CredentialsError, cloud_storage.PermissionError): |
+ except (cloud_storage.CredentialsError, |
+ cloud_storage.PermissionError) as e: |
if os.path.exists(archive_path): |
# If the archive exists, assume the user recorded their own and |
# simply warn. |
logging.warning('Need credentials to update WPR archive: %s', |
archive_path) |
+ elif log_cloud_storage_exception: |
+ # Log access errors only once, as they should stay the same in other |
+ # iterations. |
+ log_cloud_storage_exception = False |
+ logging.warning('Error getting WPR archive %s: %s ' % |
+ (archive_path, str(e))) |
+ logging.info( |
+ 'HOME: "%s"; USER: "%s"' % |
+ (os.environ.get('HOME', ''), os.environ.get('USER', ''))) |
# Map from the relative path (as it appears in the metadata file) of the |
# .wpr file to a list of page names it supports. |
@@ -53,6 +66,9 @@ class PageSetArchiveInfo(object): |
with open(file_path, 'r') as f: |
data = json.load(f) |
return cls(file_path, data, ignore_archive=ignore_archive) |
+ # TODO(tbarzic): Remove this once http://crbug.com/351143 is diagnosed. |
+ if cros_interface.IsRunningOnCrosDevice(): |
+ logging.warning('Page set archives not found: %s' % file_path) |
return cls(file_path, {'archives': {}}, ignore_archive=ignore_archive) |
def WprFilePathForPage(self, page): |