Function
insistent_bucket_create
(conn, bucket_name, *args, **kwargs)
Source from the content-addressed store, hash-verified
| 183 | |
| 184 | |
| 185 | def insistent_bucket_create(conn, bucket_name, *args, **kwargs): |
| 186 | while True: |
| 187 | try: |
| 188 | bucket = conn.create_bucket(bucket_name, *args, **kwargs) |
| 189 | except boto.exception.S3CreateError as e: |
| 190 | if e.status == 409: |
| 191 | # Conflict; bucket already created -- probably means |
| 192 | # the prior delete did not process just yet. |
| 193 | continue |
| 194 | |
| 195 | raise |
| 196 | |
| 197 | return bucket |
| 198 | |
| 199 | |
| 200 | class FreshBucket(object): |
Tested by
no test coverage detected