Return whether if a cloud storage file exists.
(cloud_storage_file_path, ignore_errors=False)
| 1046 | delay=DEFAULT_FAIL_WAIT, |
| 1047 | function='google_cloud_utils.storage.exists') |
| 1048 | def exists(cloud_storage_file_path, ignore_errors=False): |
| 1049 | """Return whether if a cloud storage file exists.""" |
| 1050 | try: |
| 1051 | return bool(_provider().get(cloud_storage_file_path)) |
| 1052 | except HttpError: |
| 1053 | if not ignore_errors: |
| 1054 | logs.error('Failed when trying to find cloud storage file %s.' % |
| 1055 | cloud_storage_file_path) |
| 1056 | |
| 1057 | return False |
| 1058 | |
| 1059 | |
| 1060 | @retry.wrap( |