返回介绍

2.5.14.8. MessageFormatterMissingWorkers

发布于 2023-09-20 23:50:39 字数 2650 浏览 0 评论 0 收藏 0

Caution

Buildbot no longer supports Python 2.7 on the Buildbot master.

2.5.14.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, want_logs, want_logs_content, wantProperties, want_properties, wantSteps, want_steps.

template

The content of the template used to generate the body of the mail as string.

template_type

This indicates the type of the generated template. Use either ‘plain’ (the default) or ‘html’.

subject

The content of the subject of the mail as string.

ctx

This 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 buildAdditionalContext in 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

The default implementation will add self.ctx into the current template context

The default ctx for the missing worker email is made of:

buildbot_title

The title of the Buildbot instance as per c['title'] from the master.cfg

buildbot_url

The URL of the Buildbot instance as per c['buildbotURL'] from the master.cfg

worker

The worker object as defined in the REST api plus two attributes:

notify

List of emails to be notified for this worker.

last_connection

String describing the approximate time of last connection for this worker.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文