|
7 | 7 | from mailman.testing.documentation import dump_json
|
8 | 8 | import os
|
9 | 9 |
|
10 |
| -hostname="lists.boost.org" |
11 |
| -port_number="8001" |
12 |
| -rest_user="restadmin" |
13 |
| -rest_password=os.environ['REST_PASSWORD'] |
| 10 | +hostname = "lists.boost.org" |
| 11 | +port_number = "8001" |
| 12 | +rest_user = "restadmin" |
| 13 | +rest_password = os.environ["REST_PASSWORD"] |
14 | 14 |
|
15 | 15 | if not rest_password:
|
16 | 16 | print("please set rest_password. Exiting.")
|
17 | 17 | exit(1)
|
18 | 18 |
|
19 |
| -urls={} |
20 |
| -urls["boost"]=f"http://{hostname}:{port_number}/3.1/lists/boost@{hostname}/config" |
21 |
| -urls["Boost-announce"]=f"http://{hostname}:{port_number}/3.1/lists/boost-announce@{hostname}/config" |
22 |
| -urls["Boost-users"]=f"http://{hostname}:{port_number}/3.1/lists/boost-users@{hostname}/config" |
23 |
| -settings={} |
24 |
| -settings["boost"]=dict(default_nonmember_action='reject', convert_html_to_plaintext='True', filter_content='True', dmarc_mitigate_action='munge_from', reply_goes_to_list='point_to_list', subject_prefix='[boost] ') |
25 |
| -settings["Boost-announce"]=dict(default_nonmember_action='reject', convert_html_to_plaintext='True', filter_content='True', dmarc_mitigate_action='munge_from', reply_goes_to_list='point_to_list', subject_prefix='[Boost-announce] ') |
26 |
| -settings["Boost-users"]=dict(default_nonmember_action='reject', convert_html_to_plaintext='True', filter_content='True', dmarc_mitigate_action='munge_from', reply_goes_to_list='point_to_list', subject_prefix='[Boost-users] ') |
| 19 | +urls = {} |
| 20 | +urls["boost"] = f"http://{hostname}:{port_number}/3.1/lists/boost@{hostname}/config" |
| 21 | +urls["Boost-announce"] = ( |
| 22 | + f"http://{hostname}:{port_number}/3.1/lists/boost-announce@{hostname}/config" |
| 23 | +) |
| 24 | +urls["Boost-users"] = ( |
| 25 | + f"http://{hostname}:{port_number}/3.1/lists/boost-users@{hostname}/config" |
| 26 | +) |
| 27 | +settings = {} |
| 28 | +settings["boost"] = dict( |
| 29 | + default_nonmember_action="reject", |
| 30 | + convert_html_to_plaintext="True", |
| 31 | + filter_content="True", |
| 32 | + dmarc_mitigate_action="munge_from", |
| 33 | + reply_goes_to_list="point_to_list", |
| 34 | + subject_prefix="[boost] ", |
| 35 | +) |
| 36 | +settings["Boost-announce"] = dict( |
| 37 | + default_nonmember_action="reject", |
| 38 | + convert_html_to_plaintext="True", |
| 39 | + filter_content="True", |
| 40 | + dmarc_mitigate_action="munge_from", |
| 41 | + reply_goes_to_list="point_to_list", |
| 42 | + subject_prefix="[Boost-announce] ", |
| 43 | +) |
| 44 | +settings["Boost-users"] = dict( |
| 45 | + default_nonmember_action="reject", |
| 46 | + convert_html_to_plaintext="True", |
| 47 | + filter_content="True", |
| 48 | + dmarc_mitigate_action="munge_from", |
| 49 | + reply_goes_to_list="point_to_list", |
| 50 | + subject_prefix="[Boost-users] ", |
| 51 | +) |
27 | 52 |
|
28 | 53 | for listname, request_url in urls.items():
|
29 | 54 | print(f"listname is {listname} and request_url is {request_url}")
|
30 | 55 | print("running dump_json")
|
31 |
| - dump_json(request_url, settings[listname], 'PATCH', username=rest_user, password=rest_password) |
| 56 | + dump_json( |
| 57 | + request_url, |
| 58 | + settings[listname], |
| 59 | + "PATCH", |
| 60 | + username=rest_user, |
| 61 | + password=rest_password, |
| 62 | + ) |
0 commit comments