Add context for various hooks. #469
|
@ -62,6 +62,10 @@ def run_configuration(config_filename, config, arguments):
|
||||||
prune_create_or_check = {'prune', 'create', 'check'}.intersection(arguments)
|
prune_create_or_check = {'prune', 'create', 'check'}.intersection(arguments)
|
||||||
monitoring_log_level = verbosity_to_log_level(global_arguments.monitoring_verbosity)
|
monitoring_log_level = verbosity_to_log_level(global_arguments.monitoring_verbosity)
|
||||||
|
|
||||||
|
hook_context = {
|
||||||
|
'repository': ','.join(location['repositories']),
|
||||||
|
}
|
||||||
|
|
||||||
try:
|
try:
|
||||||
if prune_create_or_check:
|
if prune_create_or_check:
|
||||||
dispatch.call_hooks(
|
dispatch.call_hooks(
|
||||||
|
@ -79,6 +83,7 @@ def run_configuration(config_filename, config, arguments):
|
||||||
config_filename,
|
config_filename,
|
||||||
'pre-prune',
|
'pre-prune',
|
||||||
global_arguments.dry_run,
|
global_arguments.dry_run,
|
||||||
|
**hook_context,
|
||||||
)
|
)
|
||||||
if 'create' in arguments:
|
if 'create' in arguments:
|
||||||
command.execute_hook(
|
command.execute_hook(
|
||||||
|
@ -87,6 +92,7 @@ def run_configuration(config_filename, config, arguments):
|
||||||
config_filename,
|
config_filename,
|
||||||
'pre-backup',
|
'pre-backup',
|
||||||
global_arguments.dry_run,
|
global_arguments.dry_run,
|
||||||
|
**hook_context,
|
||||||
)
|
)
|
||||||
if 'check' in arguments:
|
if 'check' in arguments:
|
||||||
command.execute_hook(
|
command.execute_hook(
|
||||||
|
@ -95,6 +101,7 @@ def run_configuration(config_filename, config, arguments):
|
||||||
config_filename,
|
config_filename,
|
||||||
'pre-check',
|
'pre-check',
|
||||||
global_arguments.dry_run,
|
global_arguments.dry_run,
|
||||||
|
**hook_context,
|
||||||
)
|
)
|
||||||
if 'extract' in arguments:
|
if 'extract' in arguments:
|
||||||
command.execute_hook(
|
command.execute_hook(
|
||||||
|
@ -103,6 +110,7 @@ def run_configuration(config_filename, config, arguments):
|
||||||
config_filename,
|
config_filename,
|
||||||
'pre-extract',
|
'pre-extract',
|
||||||
global_arguments.dry_run,
|
global_arguments.dry_run,
|
||||||
|
**hook_context,
|
||||||
)
|
)
|
||||||
if prune_create_or_check:
|
if prune_create_or_check:
|
||||||
dispatch.call_hooks(
|
dispatch.call_hooks(
|
||||||
|
@ -168,6 +176,7 @@ def run_configuration(config_filename, config, arguments):
|
||||||
config_filename,
|
config_filename,
|
||||||
'post-prune',
|
'post-prune',
|
||||||
global_arguments.dry_run,
|
global_arguments.dry_run,
|
||||||
|
**hook_context,
|
||||||
)
|
)
|
||||||
if 'create' in arguments:
|
if 'create' in arguments:
|
||||||
dispatch.call_hooks(
|
dispatch.call_hooks(
|
||||||
|
@ -184,6 +193,7 @@ def run_configuration(config_filename, config, arguments):
|
||||||
config_filename,
|
config_filename,
|
||||||
'post-backup',
|
'post-backup',
|
||||||
global_arguments.dry_run,
|
global_arguments.dry_run,
|
||||||
|
**hook_context,
|
||||||
)
|
)
|
||||||
if 'check' in arguments:
|
if 'check' in arguments:
|
||||||
command.execute_hook(
|
command.execute_hook(
|
||||||
|
@ -192,6 +202,7 @@ def run_configuration(config_filename, config, arguments):
|
||||||
config_filename,
|
config_filename,
|
||||||
'post-check',
|
'post-check',
|
||||||
global_arguments.dry_run,
|
global_arguments.dry_run,
|
||||||
|
**hook_context,
|
||||||
)
|
)
|
||||||
if 'extract' in arguments:
|
if 'extract' in arguments:
|
||||||
command.execute_hook(
|
command.execute_hook(
|
||||||
|
@ -200,6 +211,7 @@ def run_configuration(config_filename, config, arguments):
|
||||||
config_filename,
|
config_filename,
|
||||||
'post-extract',
|
'post-extract',
|
||||||
global_arguments.dry_run,
|
global_arguments.dry_run,
|
||||||
|
**hook_context,
|
||||||
)
|
)
|
||||||
if prune_create_or_check:
|
if prune_create_or_check:
|
||||||
dispatch.call_hooks(
|
dispatch.call_hooks(
|
||||||
|
|
Loading…
Reference in New Issue