Treat configuration file permissions issues as errors instead of warnings.

This commit is contained in:
Dan Helfman
2025-09-19 10:31:31 -07:00
parent a388b17271
commit a0e2a98735
3 changed files with 5 additions and 4 deletions
+1
View File
@@ -17,6 +17,7 @@
support the "bootstrap" action.
* #1136: For all database hooks, record metadata about the dumps contained within an archive.
* #1139: Set "borgmatic" as the user agent when connecting to monitoring services.
* Treat configuration file permissions issues as errors instead of warnings.
* When running tests, use Ruff for faster and more comprehensive code linting and formatting,
replacing Flake8, Black, isort, etc.
* Switch from pipx to uv for installing development tools, and added tox-uv for speeding up test
+2 -2
View File
@@ -663,8 +663,8 @@ def load_configurations(config_filenames, arguments, overrides=None, resolve_env
[
logging.makeLogRecord(
dict(
levelno=logging.WARNING,
levelname='WARNING',
levelno=logging.CRITICAL,
levelname='CRITICAL',
msg=f'{config_filename}: Insufficient permissions to read configuration file',
),
),
+2 -2
View File
@@ -1695,7 +1695,7 @@ def test_load_configurations_collects_parsed_configurations_and_logs(resolve_env
assert set(logs) >= set(test_expected_logs + other_expected_logs)
def test_load_configurations_logs_warning_for_permission_error():
def test_load_configurations_logs_error_for_permission_error():
flexmock(module.validate).should_receive('parse_configuration').and_raise(PermissionError)
configs, config_paths, logs = tuple(
@@ -1704,7 +1704,7 @@ def test_load_configurations_logs_warning_for_permission_error():
assert configs == {}
assert config_paths == []
assert max(log.levelno for log in logs) == logging.WARNING
assert max(log.levelno for log in logs) == logging.CRITICAL
def test_load_configurations_logs_critical_for_parse_error():