mirror of
https://kernel.googlesource.com/pub/scm/linux/kernel/git/tglx/remail.git
synced 2024-11-08 05:32:37 +01:00
remail: Make sure list configs inherit global gpg/smime
Per-list config dictionaries were always instantiated with default gpg configuration because global gpg/smime settings were being ignored. This change makes sure that smime and gpg options set on the global level are inherited by list-specific configurations. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
This commit is contained in:
parent
18a16b08fb
commit
5e8939d9a0
1 changed files with 7 additions and 4 deletions
|
@ -263,7 +263,10 @@ list_defaults = {
|
|||
}
|
||||
|
||||
class list_config(object):
|
||||
def __init__(self, name, cfgdict):
|
||||
def __init__(self, name, cfgdict, maincfgdict=None):
|
||||
if maincfgdict is None:
|
||||
maincfgdict = {}
|
||||
|
||||
base = 'base.lists.%s' %name
|
||||
self.base = base
|
||||
self.name = name
|
||||
|
@ -283,8 +286,8 @@ class list_config(object):
|
|||
listid = cfgdict.get('listid', self.listaccount.addr.replace('@', '.'))
|
||||
self.listheaders = build_listheaders(self.listaccount.addr, listid)
|
||||
|
||||
self.smime = smime_config(self.listdir, None)
|
||||
self.gpg = gpg_config(self.listdir, None)
|
||||
self.smime = smime_config(self.listdir, maincfgdict.get('smime', None))
|
||||
self.gpg = gpg_config(self.listdir, maincfgdict.get('gpg', None))
|
||||
|
||||
self.admins = accounts_config(get_mandatory('admins', cfgdict, base),
|
||||
base)
|
||||
|
@ -334,7 +337,7 @@ class main_config(object):
|
|||
# Configure the lists
|
||||
self.lists = []
|
||||
for name, l in cfgdict.get('lists', {}).items():
|
||||
self.lists.append(list_config(name, l))
|
||||
self.lists.append(list_config(name, l, cfgdict))
|
||||
|
||||
def show(self):
|
||||
show_attrs(self, main_defaults, 2)
|
||||
|
|
Loading…
Reference in a new issue