Maintainers
+Maintainers
This module is maintained by the OCA.
diff --git a/fs_storage/tests/test_fs_storage.py b/fs_storage/tests/test_fs_storage.py
index 0b7d8086b9..3aff1f85bd 100644
--- a/fs_storage/tests/test_fs_storage.py
+++ b/fs_storage/tests/test_fs_storage.py
@@ -1,7 +1,6 @@
# Copyright 2023 ACSONE SA/NV (http://acsone.eu).
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html).
import warnings
-from unittest import mock
from odoo.exceptions import ValidationError
from odoo.tests import Form
@@ -70,7 +69,12 @@ def test_ensure_one_fs_by_record(self):
for i in range(4):
backend_ids.append(
self.backend.create(
- {"name": f"name{i}", "directory_path": f"{i}", "code": f"code{i}"}
+ {
+ "name": f"name{i}",
+ "directory_path": f"{i}",
+ "code": f"code{i}",
+ "protocol": "odoofs",
+ }
).id
)
records = self.backend.browse(backend_ids)
@@ -133,25 +137,6 @@ def test_interface_values(self):
# this is still true after saving
self.assertEqual(new_storage.options_protocol, protocol)
- def test_options_env(self):
- self.backend.json_options = {"key": {"sub_key": "$KEY_VAR"}}
- eval_json_options = {"key": {"sub_key": "TEST"}}
- options = self.backend._get_fs_options()
- self.assertDictEqual(options, self.backend.json_options)
- self.backend.eval_options_from_env = True
- with mock.patch.dict("os.environ", {"KEY_VAR": "TEST"}):
- options = self.backend._get_fs_options()
- self.assertDictEqual(options, eval_json_options)
- with self.assertLogs(level="WARNING") as log:
- options = self.backend._get_fs_options()
- self.assertIn(
- (
- f"Environment variable KEY_VAR is not set for "
- f"fs_storage {self.backend.display_name}."
- ),
- log.output[0],
- )
-
def test_no_create_in_safe_eval(self):
# check that we can't create a file in safe_eval
with self.assertRaisesRegex(
diff --git a/fs_storage/views/fs_storage_view.xml b/fs_storage/views/fs_storage_view.xml
index 712bb2a656..b6bec33dd6 100644
--- a/fs_storage/views/fs_storage_view.xml
+++ b/fs_storage/views/fs_storage_view.xml
@@ -35,7 +35,6 @@
Filesystem Storage Backend - Server Environment
+ + +Glue module to make Server Environment features available for the Filesystem Storage Backend addon.
+Table of contents
+-
+
- Usage + +
- Bug Tracker +
- Credits + +
Usage
+Configuration
+When you create a new backend, you must specify the following:
+-
+
- Resolve env vars. This options resolves the protocol options values starting +with $ from environment variables +
Server Environment
+To ease the management of the filesystem storages configuration accross the different +environments, the configuration of the filesystem storages can be defined in +environment files or directly in the main configuration file. For example, the +configuration of a filesystem storage with the code fsprod can be provided in the +main configuration file as follows:
++[fs_storage.fsprod] +protocol=s3 +options={"endpoint_url": "https://my_s3_server/", "key": "KEY", "secret": "SECRET"} +directory_path=my_bucket ++
To work, a storage.backend record must exist with the code fsprod into the database. +In your configuration section, you can specify the value for the following fields:
+-
+
- protocol +
- options +
- directory_path +
Bug Tracker
+Bugs are tracked on GitHub Issues. +In case of trouble, please check there if your issue has already been reported. +If you spotted it first, help us to smash it by providing a detailed and welcomed +feedback.
+Do not contact contributors directly about support or help with technical issues.
+Credits
+Authors
+-
+
- ACSONE SA/NV +
Contributors
+-
+
- Laurent Mignon <laurent.mignon@acsone.eu> +
- Sébastien BEAU <sebastien.beau@akretion.com> +
- Maksym Yankin <maksym.yankin@camptocamp.com> +
Maintainers
+This module is maintained by the OCA.
+ +
+
+OCA, or the Odoo Community Association, is a nonprofit organization whose +mission is to support the collaborative development of Odoo features and +promote its widespread use.
+This module is part of the OCA/storage project on GitHub.
+You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
+



