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

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

Issue 1240703003: Extension profile generator + benchmark for startup with profile. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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
Index: tools/telemetry/catapult_base/cloud_storage.py
diff --git a/tools/telemetry/catapult_base/cloud_storage.py b/tools/telemetry/catapult_base/cloud_storage.py
index 6963da6acf0ce2a1fa7338772f11a0d70aba076c..62faa67445a7d0a45ae4aa39c352507f9faf1c77 100644
--- a/tools/telemetry/catapult_base/cloud_storage.py
+++ b/tools/telemetry/catapult_base/cloud_storage.py
@@ -203,10 +203,14 @@ def Copy(bucket_from, bucket_to, remote_path_from, remote_path_to):
_RunCommand(['cp', url1, url2])
-def Delete(bucket, remote_path):
+def Delete(bucket, remote_path, recursive=False):
erikchen 2015/07/14 23:36:15 If you do a zip upload, you won't need to add this
sydli 2015/07/15 22:56:24 Done.
url = 'gs://%s/%s' % (bucket, remote_path)
+ command_and_args = ['rm']
+ if recursive:
+ command_and_args += ['-r']
+ command_and_args += [url]
logging.info('Deleting %s' % url)
- _RunCommand(['rm', url])
+ _RunCommand(command_and_args)
def Get(bucket, remote_path, local_path):
@@ -219,7 +223,8 @@ def Get(bucket, remote_path, local_path):
_RunCommand(['cp', url, local_path])
-def Insert(bucket, remote_path, local_path, publicly_readable=False):
+def Insert(bucket, remote_path, local_path, recursive=False,
+ publicly_readable=False):
""" Upload file in |local_path| to cloud storage.
Args:
bucket: the google cloud storage bucket name.
@@ -234,6 +239,8 @@ def Insert(bucket, remote_path, local_path, publicly_readable=False):
url = 'gs://%s/%s' % (bucket, remote_path)
command_and_args = ['cp']
extra_info = ''
+ if recursive:
+ command_and_args += ['-r']
if publicly_readable:
command_and_args += ['-a', 'public-read']
extra_info = ' (publicly readable)'

Powered by Google App Engine
This is Rietveld 408576698