diff options
| author | bwarsaw | 2002-03-05 16:18:48 +0000 |
|---|---|---|
| committer | bwarsaw | 2002-03-05 16:18:48 +0000 |
| commit | 297bca1d7a7028ad528b016f53a0dd9e84ffe529 (patch) | |
| tree | 6fddd084cf6a8157f70c2911963679a3bed8d1c3 /Mailman/MailList.py | |
| parent | b8929fb81816b2c82fb58d5b12b3922c8ff4fd59 (diff) | |
| download | mailman-297bca1d7a7028ad528b016f53a0dd9e84ffe529.tar.gz mailman-297bca1d7a7028ad528b016f53a0dd9e84ffe529.tar.zst mailman-297bca1d7a7028ad528b016f53a0dd9e84ffe529.zip | |
Patches to help localize where file system layout decisions are made.
- use fullpath() instead of _full_path directly
- Don't os.path.join() up the list path, instead use
Site.get_listpath()
Diffstat (limited to 'Mailman/MailList.py')
| -rw-r--r-- | Mailman/MailList.py | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/Mailman/MailList.py b/Mailman/MailList.py index b174f1064..89d1b6b12 100644 --- a/Mailman/MailList.py +++ b/Mailman/MailList.py @@ -66,6 +66,7 @@ from Mailman import MemberAdaptor from Mailman.OldStyleMemberships import OldStyleMemberships from Mailman import Message from Mailman import Pending +from Mailman import Site from Mailman.i18n import _ from Mailman.Logging.Syslog import syslog @@ -102,7 +103,7 @@ class MailList(MailCommandHandler, HTMLFormatter, Deliverer, ListAdmin, # This extension mechanism allows list-specific overrides of any # method (well, except __init__(), InitTempVars(), and InitVars() # I think). - filename = os.path.join(self._full_path, 'extend.py') + filename = os.path.join(self.fullpath(), 'extend.py') dict = {} try: execfile(filename, dict) @@ -223,7 +224,7 @@ class MailList(MailCommandHandler, HTMLFormatter, Deliverer, ListAdmin, withlogging = mm_cfg.LIST_LOCK_DEBUGGING) self._internal_name = name if name: - self._full_path = os.path.join(mm_cfg.LIST_DATA_DIR, name) + self._full_path = Site.get_listpath(name) else: self._full_path = None # Only one level of mixin inheritance allowed @@ -388,13 +389,8 @@ class MailList(MailCommandHandler, HTMLFormatter, Deliverer, ListAdmin, if Utils.list_exists(name): raise Errors.MMListAlreadyExistsError, name Utils.ValidateEmail(admin) - omask = os.umask(0) - try: - os.makedirs(os.path.join(mm_cfg.LIST_DATA_DIR, name), 02775) - finally: - os.umask(omask) - self._full_path = os.path.join(mm_cfg.LIST_DATA_DIR, name) self._internal_name = name + self._full_path = Site.get_listpath(name, create=1) # Don't use Lock() since that tries to load the non-existant config.pck self.__lock.lock() self.InitVars(name, admin, crypted_password) @@ -415,7 +411,7 @@ class MailList(MailCommandHandler, HTMLFormatter, Deliverer, ListAdmin, # we never rotate unless the we've successfully written the temp file. # We use pickle now because marshal is not guaranteed to be compatible # between Python versions. - fname = os.path.join(self._full_path, 'config.pck') + fname = os.path.join(self.fullpath(), 'config.pck') fname_tmp = fname + '.tmp.%s.%d' % (socket.gethostname(), os.getpid()) fname_last = fname + '.last' fp = None |
