From a7ec37dbce6e40181c78688325f7a7425b97b7ba Mon Sep 17 00:00:00 2001 From: Sunil Mohan Adapa Date: Mon, 17 Nov 2025 11:52:04 -0800 Subject: [PATCH] cfg: Drop unused config_dir option Tests: - Unit tests pass. - When file /usr/share/freedombox/freedombox.conf is created, we can see log message 'Configuration loaded from file - /usr/share/freedombox/freedombox.conf' - When running in develop mode, we can see log message 'Configuration loaded from file - /freedombox/plinth/develop.conf' Signed-off-by: Sunil Mohan Adapa Reviewed-by: James Valleroy --- plinth/cfg.py | 2 -- plinth/conftest.py | 6 +++--- plinth/develop.config | 1 - plinth/tests/data/configs/freedombox.config | 1 - plinth/tests/test_cfg.py | 1 - 5 files changed, 3 insertions(+), 8 deletions(-) diff --git a/plinth/cfg.py b/plinth/cfg.py index 0ab90174c..4accf0845 100644 --- a/plinth/cfg.py +++ b/plinth/cfg.py @@ -12,7 +12,6 @@ logger = logging.getLogger(__name__) # [Path] section file_root = '/usr/share/plinth' -config_dir = '/etc/plinth' data_dir = '/var/lib/plinth' custom_static_dir = '/var/www/plinth/custom/static' store_file = data_dir + '/plinth.sqlite3' @@ -111,7 +110,6 @@ def read_file(config_path): config_items = ( ('Path', 'file_root', 'string'), - ('Path', 'config_dir', 'string'), ('Path', 'data_dir', 'string'), ('Path', 'custom_static_dir', 'string'), ('Path', 'store_file', 'string'), diff --git a/plinth/conftest.py b/plinth/conftest.py index a67589b22..e3b77b8f3 100644 --- a/plinth/conftest.py +++ b/plinth/conftest.py @@ -64,9 +64,9 @@ def fixture_load_cfg(): """Load test configuration.""" from plinth import cfg - keys = ('file_root', 'config_dir', 'data_dir', 'custom_static_dir', - 'store_file', 'actions_dir', 'doc_dir', 'server_dir', 'host', - 'port', 'use_x_forwarded_for', 'use_x_forwarded_host', + keys = ('file_root', 'data_dir', 'custom_static_dir', 'store_file', + 'actions_dir', 'doc_dir', 'server_dir', 'host', 'port', + 'use_x_forwarded_for', 'use_x_forwarded_host', 'secure_proxy_ssl_header', 'box_name', 'develop') saved_state = {} for key in keys: diff --git a/plinth/develop.config b/plinth/develop.config index e2a61f89a..b3edf47d9 100644 --- a/plinth/develop.config +++ b/plinth/develop.config @@ -1,5 +1,4 @@ [Path] file_root = %(parent_parent_dir)s -config_dir = %(file_root)s/data/etc/plinth actions_dir = %(file_root)s/actions doc_dir = %(file_root)s/doc diff --git a/plinth/tests/data/configs/freedombox.config b/plinth/tests/data/configs/freedombox.config index db6fc00ff..30cb3d2ee 100644 --- a/plinth/tests/data/configs/freedombox.config +++ b/plinth/tests/data/configs/freedombox.config @@ -1,6 +1,5 @@ [Path] file_root = %(parent_dir)s -config_dir = %(file_root)s/data/etc/plinth data_dir = %(file_root)s/data/var/lib/plinth server_dir = /plinth actions_dir = %(file_root)s/actions diff --git a/plinth/tests/test_cfg.py b/plinth/tests/test_cfg.py index 6c5d81223..feaf7b75a 100644 --- a/plinth/tests/test_cfg.py +++ b/plinth/tests/test_cfg.py @@ -102,7 +102,6 @@ def test_read_config_file_with_missing_options(): def compare_configurations(parser): """Compare two sets of configuration values.""" assert parser.get('Path', 'file_root') == cfg.file_root - assert parser.get('Path', 'config_dir') == cfg.config_dir assert parser.get('Path', 'custom_static_dir') == cfg.custom_static_dir assert parser.get('Path', 'data_dir') == cfg.data_dir assert parser.get('Path', 'store_file') == cfg.store_file