Skip to content

Commit

Permalink
Swift same by-pass structured store location
Browse files Browse the repository at this point in the history
  • Loading branch information
yvaucher committed Feb 25, 2020
1 parent 6f66af9 commit feb737c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,10 @@ Besides, the attachment location should be set to `swift` (this is
automatically done by the `install` methods of the `cloud_platform` module).
* `ir.config_parameter` `ir_attachment.location`: `swift`

Structure of container name is checked against environment.
It is possible to by-pass this behavior by using the following environment variable:
`SWIFT_WRITE_CONTAINER_UNSTRUCTURED`.

### Sessions in Redis

* prod:
Expand Down
7 changes: 7 additions & 0 deletions cloud_platform/models/cloud_platform.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,13 @@ def _check_swift(self, environment_name):
)
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 SWIFT_WRITE_CONTAINER_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', "
Expand Down

0 comments on commit feb737c

Please sign in to comment.