Add AWS_BUCKETNAME_UNSTRUCTURED to by-pass check

Curently the name of the bucket is cross checked with the
running environment. In rare case you can have a bucket name
that doesn't match the structure <project>-odoo-<env> in place.
This commit is contained in:
Yannick Vaucher
2020-02-25 16:28:35 +01:00
parent d6b0c59488
commit 6f66af94ab
2 changed files with 11 additions and 0 deletions
+7
View File
@@ -166,6 +166,13 @@ class CloudPlatform(models.AbstractModel):
"If you don't actually need a bucket, change the"
" 'ir_attachment.location' parameter."
)
# 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('AWS_BUCKETNAME_UNSTRUCTURED'):
return
prod_bucket = bool(re.match(r'[a-z-0-9]+-odoo-prod', bucket_name))
if environment_name == 'prod':
assert prod_bucket, (