Re: [Mailman-Users] Order of operation - config files

Hi, I got it working... <comments below>
From: Beu, Ed (DOA) Sent: Wednesday, May 04, 2016 8:49 AM To: 'mailman-users@python.org' <mailman-users@python.org> Subject: Order of operation - config files
Hello,
We have a test installation of Mailman 2.1.20 (CSW) running on Solaris 10. Production version will be running on CentOS.
Since most of our lists are 'Announcement' type lists, I have put the following in the mm_cfg.py file:
DEFAULT_DEFAULT_MEMBER_MODERATION = Yes
The double DEFAULT_DEFAULT on this variable appears to be the only doubled default in the Defaults.py file. And, using it in the same manner in the MM_CFG.py file appears to be the only way to get it to work when creating a new list.
For the occasional 'discussion' list I have created a config file (discuss.config) to import into the new list to change 'Member Moderation' to No, but it does not take effect.
For example, I'm using this command: .../bin> ./newlist -q testdiscuss ed.beu@alaska.gov<mailto:ed.beu@alaska.gov> 12345678;./config_list -i discuss.config testdiscuss
I change the entry in the MM_CFG.py file to: DEFAULT_DEFAULT_MEMBER_MODERATION = 1 (1 rather than Yes)
used the following statement in my discuss.config file - and it's working now default_member_moderation = 0
Is it not possible to override the mm_cfg.py file entries with a config_list -i command?
apparently the config_list -i does run after mm_cfg.py!!
Thanks in advance for any assistance!
~Ed
Ed Beu , Systems Programmer Enterprise Technology Services Department of Administration 619 E Shipcreek Ave., Ste 232 Anchorage, AK 99501-1677 [ETSLogo]---------------------------------------- *Desk:(907)269-6790 ?Fax: (907)269-6719
- ed.beu@alaska.gov<mailto:ed.beu@alaska.gov> " http://www.doa.alaska.gov/ets/

On 05/04/2016 10:48 AM, Beu, Ed (DOA) wrote:
DEFAULT_DEFAULT_MEMBER_MODERATION = Yes
The double DEFAULT_DEFAULT on this variable appears to be the only doubled default in the Defaults.py file. And, using it in the same manner in the MM_CFG.py file appears to be the only way to get it to work when creating a new list.
That is correct. It is called DEFAULT_DEFAULT_MEMBER_MODERATION because it establishes the new list default for the list attribute default_member_moderation. For all list attributes named xxx which have a default setting in Defaults.py, the Defaults.py setting is called DEFAULT_XXX. For this one, the setting name begins with default... so the Defaults.py default is DEFAULT_DEFAULT...
mm_cfg.py settings are overrides for the Defaults.py settings. Anything defined in mm_cfg.py overrides the definition of the setting with the same name in Defaults.py. Anything defined in mm_cfg.py which is not defined in Defaults.py is not referenced in the code and is therefore meaningless.
For the occasional 'discussion' list I have created a config file (discuss.config) to import into the new list to change 'Member Moderation' to No, but it does not take effect.
For example, I'm using this command: .../bin> ./newlist -q testdiscuss ed.beu@alaska.gov<mailto:ed.beu@alaska.gov> 12345678;./config_list -i discuss.config testdiscuss
I change the entry in the MM_CFG.py file to: DEFAULT_DEFAULT_MEMBER_MODERATION = 1 (1 rather than Yes)
That doesn't matter. Defaults.py defines Yes = yes = On = on = True and those things and also 1 are all equivalent in this respect.
used the following statement in my discuss.config file - and it's working now default_member_moderation = 0
But config_list doesn't define things like Yes, yes, On, on, No, no, Off, off so you can't use them in setting list attributes. You have to use the actual (lower case) list attribute name, not a name from Defaults.py and you have to use values like 0, 1, False or True, not Yes, yes, On, on, No, no, Off or off.
Is it not possible to override the mm_cfg.py file entries with a config_list -i command?
apparently the config_list -i does run after mm_cfg.py!!
The Defaults.py/mm_cfg.py DEFAULT settings set list attributes when a list is created via newlist or the web UI. mm_cfg.py doesn't 'run' at all in the sense that new_list or config_list run. pretty much everything in Mailman imports mm_cfg.py (which in turn imports Defaults.py before setting any of it's overrides. This establishes the site configuration for Mailman.
When you run newlist, it creates the list and the list creation process uses the DEFAULT... settings from Defaults.py/mm_cfg.py in establishing the settings for that list. config_list -i operates on an existing list and sets those list attributes that are in it's input. So yes, config_list -i will set anything in it's input. mm_cfg.py DEFAULT settings do not come into play at this point.
The important thing to note is that once a list is created, changes to DEFAULT... settings in mm_cfg.py will not affect anything on an existing list.
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan
participants (2)
-
Beu, Ed (DOA)
-
Mark Sapiro