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

Unified Diff: tools/telemetry/catapult_base/dependency_manager/cloud_storage_info.py

Issue 1416703003: [Android] Add a configurable environment for devil/. (RELAND 2) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 5 years 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 | « build/java_apk.gypi ('k') | tools/telemetry/telemetry/internal/platform/android_device.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/telemetry/catapult_base/dependency_manager/cloud_storage_info.py
diff --git a/tools/telemetry/catapult_base/dependency_manager/cloud_storage_info.py b/tools/telemetry/catapult_base/dependency_manager/cloud_storage_info.py
index 880cfe25de8206c1b1eea2fa605dd71a78009674..1e1c1d55a612238d69d0a02df171fc8c0e16034e 100644
--- a/tools/telemetry/catapult_base/dependency_manager/cloud_storage_info.py
+++ b/tools/telemetry/catapult_base/dependency_manager/cloud_storage_info.py
@@ -2,6 +2,7 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
+import errno
import logging
import os
import stat
@@ -63,7 +64,13 @@ class CloudStorageInfo(object):
download_dir = os.path.dirname(self._download_path)
if not os.path.exists(download_dir):
- os.makedirs(download_dir)
+ try:
+ os.makedirs(download_dir)
+ except OSError as e:
+ # The logic above is racy, and os.makedirs will raise an OSError if
+ # the directory exists.
+ if e.errno != errno.EEXIST:
+ raise
dependency_path = self._download_path
cloud_storage.GetIfHashChanged(
« no previous file with comments | « build/java_apk.gypi ('k') | tools/telemetry/telemetry/internal/platform/android_device.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698