[Mpuls-commits] r4033 - in base/trunk: . mpulsweb/lib

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Tue Oct 26 18:56:00 CEST 2010


Author: bh
Date: 2010-10-26 18:55:59 +0200 (Tue, 26 Oct 2010)
New Revision: 4033

Modified:
   base/trunk/ChangeLog
   base/trunk/mpulsweb/lib/security.py
Log:
* mpulsweb/lib/security.py (load_db_mapping_from_file):
Removed. Not used anywhere anymore in mpuls 2.
(NEW_DBS): Removed.  Also not needed anymore because it was
initialized by load_db_mapping_from_file.
(getDbName): Adapt to removal of NEW_DBS.


Modified: base/trunk/ChangeLog
===================================================================
--- base/trunk/ChangeLog	2010-10-26 16:28:37 UTC (rev 4032)
+++ base/trunk/ChangeLog	2010-10-26 16:55:59 UTC (rev 4033)
@@ -1,3 +1,11 @@
+2010-10-26  Bernhard Herzog  <bh at intevation.de>
+
+	* mpulsweb/lib/security.py (load_db_mapping_from_file):
+	Removed. Not used anywhere anymore in mpuls 2.
+	(NEW_DBS): Removed.  Also not needed anymore because it was
+	initialized by load_db_mapping_from_file.
+	(getDbName): Adapt to removal of NEW_DBS.
+
 2010-10-26  Torsten Irlaender <torsten at intevation.de>
 
 	* mpulsweb/public/styles/screen.css: Added more styles for select

Modified: base/trunk/mpulsweb/lib/security.py
===================================================================
--- base/trunk/mpulsweb/lib/security.py	2010-10-26 16:28:37 UTC (rev 4032)
+++ base/trunk/mpulsweb/lib/security.py	2010-10-26 16:55:59 UTC (rev 4033)
@@ -55,8 +55,6 @@
 
 log = logging.getLogger(__name__)
 
-# maps new FKZs to old
-NEW_DBS = {}
 
 check_re = re.compile(r"^[a-z_0-9]+$")
 
@@ -202,30 +200,7 @@
     env = request.environ
     return "%s" % env.get('HTTP_USER_AGENT', '')
 
-def load_db_mapping_from_file(fname):
-    if os.path.isfile(fname):
-        global NEW_DBS
-        f = None
-        try:
-            f = open(fname, "r")
-            for line in f:
-                line = line.strip()
-                if not line or line.startswith("#"):
-                    continue
-                parts = line.split(';')
-                if len(parts) > 1:
-                    NEW_DBS[parts[0]] = parts[1]
-        finally:
-            if f:
-                try:
-                    f.close()
-                except StandardError:
-                    log.exception("Exception while closing db mapping file %r",
-                                  fname)
-    else:
-        log.warning("No file mapping file found named: %r", fname)
 
-
 def get_dbname_from_http_header():
     """Return the KA-specific part of the DB-name set in HTTP-Header fields.
 
@@ -298,7 +273,7 @@
         log.info("Could not determine database name from configuration file")
         raise RuntimeError("Could not determine database name")
 
-    return NEW_DBS.get(dbname, dbname)
+    return dbname
 
 
 def get_kaname_from_http_header():



More information about the Mpuls-commits mailing list