mirror of
https://github.com/borgmatic-collective/borgmatic.git
synced 2026-07-31 13:43:02 +02:00
Treat configuration file permissions issues as errors instead of warnings.
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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',
|
||||
),
|
||||
),
|
||||
|
||||
@@ -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():
|
||||
|
||||
Reference in New Issue
Block a user