Handle InternalServerError on files_make_public_t
This commit is contained in:
parent
8faa6c7384
commit
226b7f71a6
@ -565,17 +565,21 @@ def files_make_public_t():
|
|||||||
variation_t = next((item for item in f['variations'] \
|
variation_t = next((item for item in f['variations'] \
|
||||||
if item['size'] == 't'), None)
|
if item['size'] == 't'), None)
|
||||||
if variation_t:
|
if variation_t:
|
||||||
storage = GoogleCloudStorageBucket(str(f['project']))
|
try:
|
||||||
blob = storage.Get(variation_t['file_path'], to_dict=False)
|
storage = GoogleCloudStorageBucket(str(f['project']))
|
||||||
if blob:
|
blob = storage.Get(variation_t['file_path'], to_dict=False)
|
||||||
try:
|
if blob:
|
||||||
print("Making blob public: {0}".format(blob.path))
|
try:
|
||||||
blob.make_public()
|
print("Making blob public: {0}".format(blob.path))
|
||||||
except InternalServerError:
|
blob.make_public()
|
||||||
print("Internal Server Error")
|
except InternalServerError:
|
||||||
except Exception:
|
print("Internal Server Error")
|
||||||
pass
|
except Exception:
|
||||||
|
pass
|
||||||
|
except InternalServerError:
|
||||||
|
print("Internal Server Error")
|
||||||
|
except Exception:
|
||||||
|
pass
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
manager.run()
|
manager.run()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user