blob: b5a2246f02a9cde95619a69955c91154cdc9f9d2 [file] [log] [blame]
okozachenkof787cdc2021-05-04 11:46:54 +03001from oslo_config import cfg
2from staffeln.i18n import _
3
4notify_group = cfg.OptGroup(
5 "notification",
6 title="Notification options",
okozachenko24bfc9e2021-05-04 15:20:11 +03007 help=_("Options under this group are used to define notification settings."),
okozachenkof787cdc2021-05-04 11:46:54 +03008)
9
10email_opts = [
okozachenkof787cdc2021-05-04 11:46:54 +030011 cfg.ListOpt(
12 "receiver",
13 default=[],
Susanta Gautam77398c22021-05-07 20:50:23 +054514 help=_(
15 "The receivers of the bakcup result by email."
16 "A list of addresses to receive backup result emails to. A bare"
17 " string will be treated as a list with 1 address."
18 ),
okozachenkof787cdc2021-05-04 11:46:54 +030019 ),
20 cfg.StrOpt(
ricoline6e56e12023-01-31 12:45:59 +080021 "project_receiver_domain",
22 help=_(
23 "The project receiver domain that will be combine with project "
24 "name as project report receive target email address. "
25 "Format: $(project_name)@project_receiver_domain"
26 ),
27 ),
28 cfg.StrOpt(
okozachenkof787cdc2021-05-04 11:46:54 +030029 "sender_email",
Susanta Gautam77398c22021-05-07 20:50:23 +054530 help=_(
31 "Log in on an SMTP server that requires authentication."
32 "The user name to authenticate with."
33 ),
okozachenkof787cdc2021-05-04 11:46:54 +030034 ),
Susanta Gautam77398c22021-05-07 20:50:23 +054535 # We can remove the sender password as we are using postfix to send mail and we won't be authenticating.
okozachenkof787cdc2021-05-04 11:46:54 +030036 cfg.StrOpt(
37 "sender_pwd",
Susanta Gautam77398c22021-05-07 20:50:23 +054538 help=_(
39 "Log in on an SMTP server that requires authentication."
40 "The password for the authentication."
41 ),
okozachenkof787cdc2021-05-04 11:46:54 +030042 ),
43 cfg.StrOpt(
44 "smtp_server_domain",
Susanta Gautam77398c22021-05-07 20:50:23 +054545 default="localhost",
okozachenkof787cdc2021-05-04 11:46:54 +030046 help=_("the name of the remote host to which to connect"),
47 ),
48 cfg.StrOpt(
49 "smtp_server_port",
Susanta Gautam77398c22021-05-07 20:50:23 +054550 default="25",
okozachenkof787cdc2021-05-04 11:46:54 +030051 help=_("the port to which to connect"),
52 ),
53]
54
55
56def register_opts(conf):
57 conf.register_group(notify_group)
58 conf.register_opts(email_opts, group=notify_group)
59
60
61def list_opts():
62 return {notify_group: email_opts}