mirror of
https://github.com/borgmatic-collective/borgmatic.git
synced 2026-08-01 14:13:01 +02:00
When both "encryption_passcommand" and "encryption_passphrase" are configured, prefer "encryption_passphrase" even if it's an empty value (#987).
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
1.9.10.dev0
|
||||
* #987: Fix a "list" action error when the "encryption_passcommand" option is set.
|
||||
* #987: When both "encryption_passcommand" and "encryption_passphrase" are configured, prefer
|
||||
"encryption_passphrase" even if it's an empty value.
|
||||
|
||||
1.9.9
|
||||
* #635: Log the repository path or label on every relevant log message, not just some logs.
|
||||
|
||||
@@ -47,4 +47,4 @@ def get_passphrase_from_passcommand(config):
|
||||
passphrase = config.get('encryption_passphrase')
|
||||
working_directory = borgmatic.config.paths.get_working_directory(config)
|
||||
|
||||
return run_passcommand(passcommand, bool(passphrase), working_directory)
|
||||
return run_passcommand(passcommand, bool(passphrase is not None), working_directory)
|
||||
|
||||
@@ -53,3 +53,19 @@ def test_get_passphrase_from_passcommand_with_configured_passphrase_and_passcomm
|
||||
)
|
||||
is None
|
||||
)
|
||||
|
||||
|
||||
def test_get_passphrase_from_passcommand_with_configured_blank_passphrase_and_passcommand_detects_passphrase():
|
||||
flexmock(module.borgmatic.config.paths).should_receive('get_working_directory').and_return(
|
||||
'/working'
|
||||
)
|
||||
flexmock(module).should_receive('run_passcommand').with_args(
|
||||
'command', True, '/working'
|
||||
).and_return(None).once()
|
||||
|
||||
assert (
|
||||
module.get_passphrase_from_passcommand(
|
||||
{'encryption_passphrase': '', 'encryption_passcommand': 'command'},
|
||||
)
|
||||
is None
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user