Fix delete_path in webpages_playback.py
authorrmistry <rmistry@google.com>
Wed, 3 Feb 2016 13:58:31 +0000 (05:58 -0800)
committerCommit bot <commit-bot@chromium.org>
Wed, 3 Feb 2016 13:58:31 +0000 (05:58 -0800)
BUG=skia:3751
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1662673003

# Trybots do not exercise this code.
NOTRY=true

Review URL: https://codereview.chromium.org/1662673003

tools/skp/webpages_playback.py

index 257fcf4..1284a54 100644 (file)
@@ -495,7 +495,9 @@ class GoogleStorageDataStore(DataStore):
   def does_storage_object_exist(self, *args):
     return self.gs.does_storage_object_exist(self._bucket, *args)
   def delete_path(self, path):
-    return self.gs.delete_file(self._bucket, path)
+    _, files = self.gs.list_bucket_contents(self._bucket, subdir=path)
+    for f in files:
+      self.gs.delete_file(self._bucket, posixpath.join(path, f))
   def download_file(self, *args):
     self.gs.download_file(self._bucket, *args)
   def upload_dir_contents(self, source_dir, **kwargs):