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

Unified Diff: tools/telemetry/third_party/gsutilz/gslib/commands/rb.py

Issue 1376593003: Roll gsutil version to 4.15. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 3 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/third_party/gsutilz/gslib/commands/rb.py
diff --git a/tools/telemetry/third_party/gsutilz/gslib/commands/rb.py b/tools/telemetry/third_party/gsutilz/gslib/commands/rb.py
index 9dbc7d6235dc3eb56d629708f6640d942a20fb7d..68938961bd9b039d270ba0d338d6b600a36e052d 100644
--- a/tools/telemetry/third_party/gsutilz/gslib/commands/rb.py
+++ b/tools/telemetry/third_party/gsutilz/gslib/commands/rb.py
@@ -102,10 +102,14 @@ class RbCommand(Command):
# with -f option if a non-existent URL listed, permission denial happens
# while listing, etc.
try:
- # Need to materialize iterator results into a list to catch exceptions.
+ # Materialize iterator results into a list to catch exceptions.
# Since this is listing buckets this list shouldn't be too large to fit
# in memory at once.
- blrs = list(self.WildcardIterator(url_str).IterBuckets())
+ # Also, avoid listing all fields to avoid performing unnecessary bucket
+ # metadata GETs. These would also be problematic when billing is
+ # disabled, as deletes are allowed but GetBucket is not.
+ blrs = list(
+ self.WildcardIterator(url_str).IterBuckets(bucket_fields=['id']))
except: # pylint: disable=bare-except
some_failed = True
if self.continue_on_error:
@@ -118,6 +122,7 @@ class RbCommand(Command):
try:
self.gsutil_api.DeleteBucket(url.bucket_name, provider=url.scheme)
except NotEmptyException as e:
+ some_failed = True
if self.continue_on_error:
continue
elif 'VersionedBucketNotEmpty' in e.reason:
@@ -128,6 +133,7 @@ class RbCommand(Command):
else:
raise
except: # pylint: disable=bare-except
+ some_failed = True
if not self.continue_on_error:
raise
did_some_work = True

Powered by Google App Engine
This is Rietveld 408576698