forked from borgmatic-collective/borgmatic
Compare commits
2 Commits
23efbb8df3
...
79e4e089ee
| Author | SHA1 | Date | |
|---|---|---|---|
| 79e4e089ee | |||
| d2714cb706 |
2
NEWS
2
NEWS
@@ -16,6 +16,8 @@
|
||||
https://torsion.org/borgmatic/docs/how-to/backup-your-databases/#containers
|
||||
* #1037: Fix an error with the "extract" action when both a remote repository and a
|
||||
"working_directory" are used.
|
||||
* #1044: Fix an error in the systemd credential hook when the credential name contains a "."
|
||||
character.
|
||||
|
||||
1.9.14
|
||||
* #409: With the PagerDuty monitoring hook, send borgmatic logs to PagerDuty so they show up in the
|
||||
|
||||
@@ -5,7 +5,7 @@ import re
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
CREDENTIAL_NAME_PATTERN = re.compile(r'^\w+$')
|
||||
CREDENTIAL_NAME_PATTERN = re.compile(r'^[\w.-]+$')
|
||||
|
||||
|
||||
def load_credential(hook_config, config, credential_parameters):
|
||||
|
||||
@@ -42,12 +42,12 @@ def test_load_credential_reads_named_credential_from_file():
|
||||
'/var'
|
||||
)
|
||||
credential_stream = io.StringIO('password')
|
||||
credential_stream.name = '/var/mycredential'
|
||||
credential_stream.name = '/var/borgmatic.pw'
|
||||
builtins = flexmock(sys.modules['builtins'])
|
||||
builtins.should_receive('open').with_args('/var/mycredential').and_return(credential_stream)
|
||||
builtins.should_receive('open').with_args('/var/borgmatic.pw').and_return(credential_stream)
|
||||
|
||||
assert (
|
||||
module.load_credential(hook_config={}, config={}, credential_parameters=('mycredential',))
|
||||
module.load_credential(hook_config={}, config={}, credential_parameters=('borgmatic.pw',))
|
||||
== 'password'
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user