Changeset 697 for pykota/trunk/pykota/storage.py
- Timestamp:
- 02/05/03 23:02:22 (21 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
pykota/trunk/pykota/storage.py
r695 r697 15 15 # 16 16 # $Log$ 17 # Revision 1.2 2003/02/05 22:02:22 jalet 18 # __import__ statement didn't work as expected 19 # 17 20 # Revision 1.1 2003/02/05 21:28:17 jalet 18 21 # Initial import into CVS … … 34 37 (backend, host, database, admin, user) = config.getStorageBackend() 35 38 try : 36 module = __import__("pykota.storages." + backend.lower()) 39 if not isalpha(backend) : 40 # don't trust user input 41 raise ImportError 42 exec "from pykota.storages import %s as storagebackend" % backend.lower() 37 43 except ImportError : 38 44 raise PyKotaStorageError, "Unsupported quota storage backend %s" % backend 39 45 else : 40 return getattr( module, "Storage")(host, database, (asadmin and admin) or user)46 return getattr(storagebackend, "Storage")(host, database, (asadmin and admin) or user)