Move list config into "config" and don't config lists when absent
This commit is contained in:
parent
848c98c456
commit
2e612837c7
@ -3,12 +3,14 @@
|
||||
"""
|
||||
Update Mailman 2 lists via a json API of the form:
|
||||
{
|
||||
"LIST": {
|
||||
"real_name": "REAL_NAME",
|
||||
"moderator": ["ADDRESS", ...],
|
||||
"subject_prefix": "PREFIX",
|
||||
"reply_to_address": "REPLY_TO_ADDRESS",
|
||||
"members": ["ADDRESS", ...]
|
||||
LIST: {
|
||||
"config"?: {
|
||||
"real_name": REAL_NAME,
|
||||
"moderator": [ADDRESS, ...],
|
||||
"subject_prefix": PREFIX,
|
||||
"reply_to_address": REPLY_TO_ADDRESS,
|
||||
}
|
||||
"members": [ADDRESS, ...]
|
||||
},
|
||||
...
|
||||
}
|
||||
@ -161,14 +163,11 @@ def main(
|
||||
else:
|
||||
list_manager.newlist(urlhost, emailhost, admin)
|
||||
|
||||
if "config" in props:
|
||||
print(f"Configuring/syncing {list_name}...")
|
||||
list_manager.config_list(
|
||||
emailhost,
|
||||
props["real_name"],
|
||||
props["moderator"],
|
||||
props["subject_prefix"],
|
||||
props["reply_to_address"],
|
||||
)
|
||||
list_manager.config_list(emailhost, **props["config"])
|
||||
else:
|
||||
print("Not configuring {list_name}, as it has no config section")
|
||||
list_manager.sync_members(props["members"])
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user