weaver.notify
Module Contents
- weaver.notify.resolve_email_template(job: weaver.datatype.Job, settings: weaver.typedefs.SettingsType) mako.template.Template [source]
Finds the most appropriate Mako Template email notification file based on configuration and Job context.
The example template is used by default ONLY if the template directory was not overridden. If overridden, failing to match any of the template file locations will raise to report the issue instead of silently using the default.
- Raises:
IOError – If the template directory was configured explicitly, but cannot be resolved, or if any of the possible combinations of template file names cannot be resolved under that directory.
- Returns:
Matched template instance based on resolution order as described in the documentation.
- weaver.notify.notify_job_email(job: weaver.datatype.Job, to_email_recipient: str, container: weaver.typedefs.AnySettingsContainer) None [source]
Send email notification of a Job status.
- weaver.notify.get_crypto_key(settings: weaver.typedefs.SettingsType, salt: bytes, rounds: int) bytes [source]
Get the cryptographic key used for encoding and decoding the email.
- weaver.notify.map_job_subscribers(job_body: weaver.typedefs.JSON, settings: weaver.typedefs.SettingsType) weaver.typedefs.ExecutionSubscribers | None [source]
Converts the Job subscribers definition submitted at execution into a mapping for later reference.
The returned contents must be sorted in the relevant Job object. For backward compatibility,
notification_email
directly provided at the root will be used if corresponding definitions were not provided for the corresponding subscriber email fields.
- weaver.notify.send_job_notification_email(job: weaver.datatype.Job, task_logger: logging.Logger, settings: weaver.typedefs.SettingsType) None [source]
Sends a notification email about the execution status for the subscriber if requested during Job submission.
- weaver.notify.send_job_callback_request(job: weaver.datatype.Job, task_logger: logging.Logger, settings: weaver.typedefs.SettingsType) None [source]
Send a callback request about the execution status for the subscriber if requested at Job execution.
- weaver.notify.notify_job_subscribers(job: weaver.datatype.Job, task_logger: logging.Logger, settings: weaver.typedefs.SettingsType) None [source]
Send notifications to all requested Job subscribers according to its current status.
All notification operations must be implemented as non-raising. In case of error, the Job logs will be updated with relevant error details and resume execution.