Relax rules for the redis prefix

If we run 2 instances with the 'integration' server_env, we want 2
the ability to use different prefixes.
This commit is contained in:
Guewen Baconnier
2016-10-25 13:26:26 +02:00
parent 6eb25377fb
commit 202d37f08b
+4 -5
View File
@@ -98,11 +98,10 @@ class CloudPlatform(models.AbstractModel):
assert os.environ.get('ODOO_SESSION_REDIS_HOST')
assert os.environ.get('ODOO_SESSION_REDIS_PREFIX')
prefix = os.environ['ODOO_SESSION_REDIS_PREFIX']
if environment_name in ('prod', 'integration', 'test'):
assert re.match(r'[a-z]+-odoo-%s' % (environment_name,), prefix), (
"ODOO_SESSION_REDIS_PREFIX should match '<client>-odoo-%s', "
"we got: '%s'" % (environment_name, prefix)
)
assert re.match(r'[a-z]+-odoo-[a-z]+', prefix), (
"ODOO_SESSION_REDIS_PREFIX should match '<client>-odoo-<env>'"
", we got: '%s'" % (prefix,)
)
@api.model
def check(self):