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

Unified Diff: tools/telemetry/telemetry/util/cloud_storage.py

Issue 412553006: [telemetry] Add util.path module and util.path.FindInstalledWindowsApplication. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix unit test. Created 6 years, 5 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 | « tools/telemetry/telemetry/unittest/system_stub.py ('k') | tools/telemetry/telemetry/util/path.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/telemetry/telemetry/util/cloud_storage.py
diff --git a/tools/telemetry/telemetry/util/cloud_storage.py b/tools/telemetry/telemetry/util/cloud_storage.py
index b7964cec2921f8d732f746e4683a78383566b1a7..af06f3aca98ec241dbe55c430b2a33aca6896f8b 100644
--- a/tools/telemetry/telemetry/util/cloud_storage.py
+++ b/tools/telemetry/telemetry/util/cloud_storage.py
@@ -14,7 +14,7 @@ import tarfile
import urllib2
from telemetry.core.backends.chrome import cros_interface
-from telemetry.core import util
+from telemetry.util import path
PUBLIC_BUCKET = 'chromium-telemetry'
@@ -23,7 +23,7 @@ INTERNAL_BUCKET = 'chrome-telemetry'
_GSUTIL_URL = 'http://storage.googleapis.com/pub/gsutil.tar.gz'
-_DOWNLOAD_PATH = os.path.join(util.GetTelemetryDir(), 'third_party', 'gsutil')
+_DOWNLOAD_PATH = os.path.join(path.GetTelemetryDir(), 'third_party', 'gsutil')
# TODO(tbarzic): A workaround for http://crbug.com/386416 and
# http://crbug.com/359293. See |_RunCommand|.
_CROS_GSUTIL_HOME_WAR = '/home/chromeos-test/'
@@ -62,9 +62,10 @@ class NotFoundError(CloudStorageError):
# TODO(tonyg/dtu): Can this be replaced with distutils.spawn.find_executable()?
def _FindExecutableInPath(relative_executable_path, *extra_search_paths):
- for path in list(extra_search_paths) + os.environ['PATH'].split(os.pathsep):
- executable_path = os.path.join(path, relative_executable_path)
- if os.path.isfile(executable_path) and os.access(executable_path, os.X_OK):
+ search_paths = list(extra_search_paths) + os.environ['PATH'].split(os.pathsep)
+ for search_path in search_paths:
+ executable_path = os.path.join(search_path, relative_executable_path)
+ if path.IsExecutable(executable_path):
return executable_path
return None
« no previous file with comments | « tools/telemetry/telemetry/unittest/system_stub.py ('k') | tools/telemetry/telemetry/util/path.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698