Caution
Buildbot no longer supports Python 2.7 on the Buildbot master.
2.5.13.8. MessageFormatterMissingWorkers¶
This formatter is used to format messages in WorkerMissingGenerator.
It formats a message using the Jinja2 templating language and picks the template either from a string or from a file.
The constructor to that class takes the same arguments as MessageFormatter, minus wantLogs, wantProperties, wantSteps.
template_dirThe directory that is used to look for the various templates.
template_filenameThis is the name of the file in the
template_dirdirectory that will be used to generate the body of the mail. It defaults todefault_mail.txt.templateIf this parameter is set, this parameter indicates the content of the template used to generate the body of the mail as string.
template_typeThis indicates the type of the generated template. Use either ‘plain’ (the default) or ‘html’.
subject_filenameThis is the name of the file in the
template_dirdirectory that contains the content of the subject of the mail.subjectAlternatively, this is the content of the subject of the mail as string.
ctxThis is an extension of the standard context that will be given to the templates. Use this to add content to the templates that is otherwise not available.
Alternatively, you can subclass MessageFormatter and override the
buildAdditionalContextin order to grab more context from the data API.-
buildbot.reporters.message.buildAdditionalContext(master, ctx) - Parameters
master – the master object
ctx – the context dictionary to enhance
- Returns
optionally deferred
default implementation will add
self.ctxinto the current template context
-
The default ctx for the missing worker email is made of:
buildbot_titleThe Buildbot title as per
c['title']from themaster.cfgbuildbot_urlThe Buildbot title as per
c['title']from themaster.cfgworkerThe worker object as defined in the REST api plus two attributes:
notifyList of emails to be notified for this worker.
last_connectionString describing the approximate the time of last connection for this worker.