diff options
| author | bwarsaw | 2001-10-04 14:32:21 +0000 |
|---|---|---|
| committer | bwarsaw | 2001-10-04 14:32:21 +0000 |
| commit | d6e9383eab9364fcdabf718e3290c564883dde3f (patch) | |
| tree | 206e5e0bd6f81587352d30787b5b74608de17ba5 /Mailman/Utils.py | |
| parent | 9b6672583e6e4c022a3e638d4bcd5bec9c7d1a69 (diff) | |
| download | mailman-d6e9383eab9364fcdabf718e3290c564883dde3f.tar.gz mailman-d6e9383eab9364fcdabf718e3290c564883dde3f.tar.zst mailman-d6e9383eab9364fcdabf718e3290c564883dde3f.zip | |
list_exists(): This has to know about config.pck and config.pck.last files.
Diffstat (limited to 'Mailman/Utils.py')
| -rw-r--r-- | Mailman/Utils.py | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/Mailman/Utils.py b/Mailman/Utils.py index 4254870c4..2a2bfc41e 100644 --- a/Mailman/Utils.py +++ b/Mailman/Utils.py @@ -46,11 +46,16 @@ DOT = '.' def list_exists(listname): """Return true iff list `listname' exists.""" - # It is possible that config.db got removed erroneously, in which case we - # can fall back to config.db.last - dbfile = os.path.join(mm_cfg.LIST_DATA_DIR, listname, 'config.db') - lastfile = dbfile + '.last' - return os.path.exists(dbfile) or os.path.exists(lastfile) + # The existance of any of the following file proves the list exists + # <wink>: config.pck, config.pck.last, config.db, config.db.last + # + # The former two are for 2.1alpha3 and beyond, while the latter two are + # for all earlier versions. + for ext in ('.pck', '.pck.last', '.db', '.db.last'): + dbfile = os.path.join(mm_cfg.LIST_DATA_DIR, listname, 'config' + ext) + if os.path.exists(dbfile): + return 1 + return 0 def list_names(): |
