mirror of
https://github.com/camptocamp/odoo-cloud-platform.git
synced 2026-06-23 18:04:34 +00:00
Abstract install method
This commit is contained in:
committed by
Guewen Baconnier
co-authored by
Guewen Baconnier
parent
66748534f6
commit
1548fd674a
@@ -61,6 +61,18 @@ class CloudPlatform(models.AbstractModel):
|
||||
self.env['ir.attachment'].sudo().force_storage()
|
||||
_logger.info('cloud platform configured for exoscale')
|
||||
|
||||
@api.model
|
||||
def install(self, platform_kind):
|
||||
params = self.env['ir.config_parameter'].sudo()
|
||||
params.set_param('cloud.platform.kind', platform_kind)
|
||||
environment = config['running_env']
|
||||
configs = self._config_by_server_env(environment)
|
||||
params.set_param('ir_attachment.location', configs.filestore)
|
||||
self.check()
|
||||
if configs.filestore in [FilestoreKind.swift, FilestoreKind.s3]:
|
||||
self.env['ir.attachment'].sudo().force_storage()
|
||||
_logger.info('cloud platform configured for {}'.format(platform_kind))
|
||||
|
||||
@api.model
|
||||
def _check_swift(self, environment_name):
|
||||
params = self.env['ir.config_parameter'].sudo()
|
||||
|
||||
@@ -6,4 +6,4 @@ def install_exoscale(ctx):
|
||||
|
||||
|
||||
def install_ovh(ctx):
|
||||
ctx.env['cloud.platform'].install_ovh()
|
||||
ctx.env['cloud.platform'].install('ovh')
|
||||
|
||||
Reference in New Issue
Block a user