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

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

Issue 1150723006: [telemetry] Don't prepend python when running gsutil on POSIX. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 7 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 | « no previous file | no next file » | 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 a40b524b6f5aeb4af2fbcfae6477aa1cfa20a60f..3e8163abc62f42c60f714fca6e34f0506f8ff478 100644
--- a/tools/telemetry/telemetry/util/cloud_storage.py
+++ b/tools/telemetry/telemetry/util/cloud_storage.py
@@ -135,9 +135,15 @@ def _RunCommand(args):
gsutil_env = os.environ.copy()
gsutil_env['HOME'] = _CROS_GSUTIL_HOME_WAR
- gsutil = subprocess.Popen([sys.executable, gsutil_path] + args,
- stdout=subprocess.PIPE, stderr=subprocess.PIPE,
- env=gsutil_env)
+ if os.name == 'nt':
+ # If Windows, prepend python. Python scripts aren't directly executable.
+ args = [sys.executable, gsutil_path] + args
+ else:
+ # Don't do it on POSIX, in case someone is using a shell script to redirect.
+ args = [gsutil_path] + args
+
+ gsutil = subprocess.Popen(args, stdout=subprocess.PIPE,
+ stderr=subprocess.PIPE, env=gsutil_env)
stdout, stderr = gsutil.communicate()
if gsutil.returncode:
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698