Swift same by-pass structured store location

This commit is contained in:
Yannick Vaucher
2019-12-05 15:56:54 +01:00
parent 7be1cebeeb
commit 5d830362a1
2 changed files with 11 additions and 0 deletions
+7
View File
@@ -112,6 +112,13 @@ class CloudPlatform(models.AbstractModel):
)
prod_container = bool(re.match(r'[a-z0-9-]+-odoo-prod',
container_name))
# A bucket name is defined under the following format
# <client>-odoo-<env>
#
# Use AWS_BUCKETNAME_UNSTRUCTURED to by-pass check on bucket name
# structure
if os.environ.get('SWIFT_WRITE_CONTAINER_UNSTRUCTURED'):
return
if environment_name == 'prod':
assert prod_container, (
"SWIFT_WRITE_CONTAINER should match '<client>-odoo-prod', "