From 1c566c6259ecaa404a3ee3df97f0f2164ed08fac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sybren=20A=2E=20St=C3=BCvel?= Date: Tue, 6 Jun 2017 16:35:14 +0200 Subject: [PATCH] Fixed bug in GoogleCloudStorageBlob.exists() --- pillar/api/file_storage_backends/gcs.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pillar/api/file_storage_backends/gcs.py b/pillar/api/file_storage_backends/gcs.py index 06845156..68702358 100644 --- a/pillar/api/file_storage_backends/gcs.py +++ b/pillar/api/file_storage_backends/gcs.py @@ -182,7 +182,10 @@ class GoogleCloudStorageBlob(Blob): def exists(self) -> bool: # Reload to get the actual file properties from Google. - self.gblob.reload() + try: + self.gblob.reload() + except NotFound: + return False return self.gblob.exists()