add label variable interpolation in hook context

This commit is contained in:
Codimp 2024-04-29 01:00:07 +02:00
parent 7f735cbe59
commit b36e11d3ca
Signed by untrusted user: codimp
GPG Key ID: E4B0289A04C9CBF6

View File

@ -283,9 +283,14 @@ def run_actions(
'''
add_custom_log_levels()
repository_path = os.path.expanduser(repository['path'])
if 'label' in repository:
repository_label = repository['label']
else:
repository_label = ''
global_arguments = arguments['global']
dry_run_label = ' (dry run; not making any changes)' if global_arguments.dry_run else ''
hook_context = {
'label': repository_label,
'repository': repository_path,
# Deprecated: For backwards compatibility with borgmatic < 1.6.0.
'repositories': ','.join([repo['path'] for repo in config['repositories']]),