Fix another warning from LVM about leaked file descriptors, this time when calling "lvcreate" from a command hook (#1230).

This commit is contained in:
Dan Helfman
2026-01-16 12:04:32 -08:00
parent 5c55402021
commit f73a79d647
3 changed files with 8 additions and 0 deletions
+2
View File
@@ -33,6 +33,8 @@
* #1224: When running an "extract" check with the "--progress" flag, show file extraction progress.
* #1225: Improve performance and greatly reduce memory usage during pre-backup safety validation on
large filesystems.
* #1230: Fix another warning from LVM about leaked file descriptors, this time when calling
"lvcreate" from a command hook.
* #1234: Fix for the ntfy monitoring hook erroring on emojis in the "title" option.
* When syslog verbosity is enabled, log to systemd's journal (if present) with
structured data. See the documentation for more information:
+1
View File
@@ -179,6 +179,7 @@ def execute_hooks(command_hooks, umask, working_directory, dry_run, **context):
shell=True,
environment=make_environment(os.environ),
working_directory=working_directory,
close_fds=True,
)
finally:
if original_umask:
+5
View File
@@ -204,6 +204,7 @@ def test_execute_hooks_invokes_each_hook_and_command():
shell=True,
environment={},
working_directory=None,
close_fds=True,
).once()
module.execute_hooks(
@@ -229,6 +230,7 @@ def test_execute_hooks_with_umask_sets_that_umask():
shell=True,
environment={},
working_directory=None,
close_fds=True,
)
module.execute_hooks(
@@ -252,6 +254,7 @@ def test_execute_hooks_with_working_directory_executes_command_with_it():
shell=True,
environment={},
working_directory='/working',
close_fds=True,
)
module.execute_hooks(
@@ -296,6 +299,7 @@ def test_execute_hooks_with_error_logs_as_error():
shell=True,
environment={},
working_directory=None,
close_fds=True,
).once()
module.execute_hooks(
@@ -340,6 +344,7 @@ def test_execute_hooks_without_commands_to_run_does_not_raise():
shell=True,
environment={},
working_directory=None,
close_fds=True,
).once()
module.execute_hooks(