mirror of
https://github.com/borgmatic-collective/borgmatic.git
synced 2026-07-22 02:03:01 +02:00
Fix a regression in which the default monitoring verbosity is 0 instead of 1 (#1085).
This commit is contained in:
@@ -1,3 +1,8 @@
|
||||
2.0.5.dev0
|
||||
* #1085: Fix a regression in which the default monitoring verbosity is 0 (warnings only) instead of
|
||||
1 (info about steps borgmatic is taking). This prevented logs from showing up in monitoring
|
||||
services like Healthchecks unless you had an explicit monitoring verbosity set.
|
||||
|
||||
2.0.4
|
||||
* #1072: Fix path rewriting for non-root patterns in the ZFS, Btrfs, and LVM hooks.
|
||||
* #1073: Clarify the documentation about when an "after: error" command hook runs and how it
|
||||
|
||||
@@ -95,7 +95,9 @@ class Monitoring_hooks:
|
||||
self.config_filename = config_filename
|
||||
self.config = config
|
||||
self.dry_run = global_arguments.dry_run
|
||||
self.monitoring_log_level = verbosity_to_log_level(config.get('monitoring_verbosity'))
|
||||
self.monitoring_log_level = verbosity_to_log_level(
|
||||
get_verbosity({config_filename: config}, 'monitoring_verbosity')
|
||||
)
|
||||
self.monitoring_hooks_are_activated = (
|
||||
using_primary_action and self.monitoring_log_level != DISABLED
|
||||
)
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
[project]
|
||||
name = "borgmatic"
|
||||
version = "2.0.4"
|
||||
version = "2.0.5.dev0"
|
||||
authors = [
|
||||
{ name="Dan Helfman", email="witten@torsion.org" },
|
||||
]
|
||||
|
||||
@@ -28,6 +28,7 @@ def test_get_skip_actions_uses_config_and_arguments(config, arguments, expected_
|
||||
|
||||
|
||||
def test_monitoring_hooks_with_monioring_disabled_bails():
|
||||
flexmock(module).should_receive('get_verbosity').and_return(module.logging.INFO)
|
||||
flexmock(module).should_receive('verbosity_to_log_level').and_return(module.DISABLED)
|
||||
flexmock(module.dispatch).should_receive('call_hooks').never()
|
||||
|
||||
@@ -41,6 +42,7 @@ def test_monitoring_hooks_with_monioring_disabled_bails():
|
||||
|
||||
|
||||
def test_monitoring_hooks_with_non_primary_action_bails():
|
||||
flexmock(module).should_receive('get_verbosity').and_return(module.logging.INFO)
|
||||
flexmock(module).should_receive('verbosity_to_log_level').and_return(flexmock())
|
||||
flexmock(module.dispatch).should_receive('call_hooks').never()
|
||||
|
||||
@@ -54,6 +56,7 @@ def test_monitoring_hooks_with_non_primary_action_bails():
|
||||
|
||||
|
||||
def test_monitoring_hooks_pings_monitors():
|
||||
flexmock(module).should_receive('get_verbosity').and_return(module.logging.INFO)
|
||||
flexmock(module).should_receive('verbosity_to_log_level').and_return(flexmock())
|
||||
flexmock(module.dispatch).should_receive('call_hooks').with_args(
|
||||
'initialize_monitor',
|
||||
@@ -117,6 +120,7 @@ def test_monitoring_hooks_pings_monitors():
|
||||
|
||||
|
||||
def test_monitoring_hooks_with_start_ping_error_raises():
|
||||
flexmock(module).should_receive('get_verbosity').and_return(module.logging.INFO)
|
||||
flexmock(module).should_receive('verbosity_to_log_level').and_return(flexmock())
|
||||
flexmock(module.dispatch).should_receive('call_hooks').with_args(
|
||||
'initialize_monitor',
|
||||
@@ -172,6 +176,7 @@ def test_monitoring_hooks_with_start_ping_error_raises():
|
||||
|
||||
|
||||
def test_monitoring_hooks_with_log_ping_error_raises():
|
||||
flexmock(module).should_receive('get_verbosity').and_return(module.logging.INFO)
|
||||
flexmock(module).should_receive('verbosity_to_log_level').and_return(flexmock())
|
||||
flexmock(module.dispatch).should_receive('call_hooks').with_args(
|
||||
'initialize_monitor',
|
||||
@@ -227,6 +232,7 @@ def test_monitoring_hooks_with_log_ping_error_raises():
|
||||
|
||||
|
||||
def test_monitoring_hooks_with_finish_ping_error_raises():
|
||||
flexmock(module).should_receive('get_verbosity').and_return(module.logging.INFO)
|
||||
flexmock(module).should_receive('verbosity_to_log_level').and_return(flexmock())
|
||||
flexmock(module.dispatch).should_receive('call_hooks').with_args(
|
||||
'initialize_monitor',
|
||||
@@ -281,7 +287,8 @@ def test_monitoring_hooks_with_finish_ping_error_raises():
|
||||
pass
|
||||
|
||||
|
||||
def test_monitoring_with_wrapped_code_error_pings_fail():
|
||||
def test_monitoring_hooks_with_wrapped_code_error_pings_fail():
|
||||
flexmock(module).should_receive('get_verbosity').and_return(module.logging.INFO)
|
||||
flexmock(module).should_receive('verbosity_to_log_level').and_return(flexmock())
|
||||
flexmock(module.dispatch).should_receive('call_hooks').with_args(
|
||||
'initialize_monitor',
|
||||
@@ -345,7 +352,8 @@ def test_monitoring_with_wrapped_code_error_pings_fail():
|
||||
raise OSError()
|
||||
|
||||
|
||||
def test_monitoring_with_fail_ping_error_raise_original_error():
|
||||
def test_monitoring_hooks_with_fail_ping_error_raise_original_error():
|
||||
flexmock(module).should_receive('get_verbosity').and_return(module.logging.INFO)
|
||||
flexmock(module).should_receive('verbosity_to_log_level').and_return(flexmock())
|
||||
flexmock(module.dispatch).should_receive('call_hooks').with_args(
|
||||
'initialize_monitor',
|
||||
|
||||
Reference in New Issue
Block a user