blob: 42daefe60cd29df42a2ba3d8b246699b1bd4477e [file] [log] [blame]
okozachenkof787cdc2021-05-04 11:46:54 +03001from oslo_config import cfg
2from staffeln.i18n import _
3
okozachenko24bfc9e2021-05-04 15:20:11 +03004
okozachenkof787cdc2021-05-04 11:46:54 +03005notify_group = cfg.OptGroup(
6 "notification",
7 title="Notification options",
okozachenko24bfc9e2021-05-04 15:20:11 +03008 help=_("Options under this group are used to define notification settings."),
okozachenkof787cdc2021-05-04 11:46:54 +03009)
10
11email_opts = [
12 cfg.StrOpt(
13 "template",
okozachenko301d50b2021-05-05 10:35:15 +030014 default="<h3>\${CONTENT}</h3>",
okozachenkof787cdc2021-05-04 11:46:54 +030015 help=_("This html template is used to email the backup result."),
16 ),
17 cfg.ListOpt(
18 "receiver",
19 default=[],
20 help=_("The receivers of the bakcup result by email."
21 "A list of addresses to receive backup result emails to. A bare"
22 " string will be treated as a list with 1 address."),
23 ),
24 cfg.StrOpt(
25 "sender_email",
26 help=_("Log in on an SMTP server that requires authentication."
27 "The user name to authenticate with."
28 ),
29 ),
30 cfg.StrOpt(
31 "sender_pwd",
32 help=_("Log in on an SMTP server that requires authentication."
33 "The password for the authentication."
34 ),
35 ),
36 cfg.StrOpt(
37 "smtp_server_domain",
38 default="smtp.gmail.com",
39 help=_("the name of the remote host to which to connect"),
40 ),
41 cfg.StrOpt(
42 "smtp_server_port",
43 default="587",
44 help=_("the port to which to connect"),
45 ),
46]
47
48
49def register_opts(conf):
50 conf.register_group(notify_group)
51 conf.register_opts(email_opts, group=notify_group)
52
53
54def list_opts():
55 return {notify_group: email_opts}