Show
Ignore:
Timestamp:
02/17/03 23:06:07 (22 years ago)
Author:
jalet
Message:

Storage backend now supports admin and user passwords (untested)

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • pykota/trunk/pykota/storage.py

    r791 r800  
    1515# 
    1616# $Log$ 
     17# Revision 1.8  2003/02/17 22:05:50  jalet 
     18# Storage backend now supports admin and user passwords (untested) 
     19# 
    1720# Revision 1.7  2003/02/10 12:07:31  jalet 
    1821# Now repykota should output the recorded total page number for each printer too. 
     
    109112    """Returns a connection handle to the appropriate Quota Storage Database.""" 
    110113    (backend, host, database, admin, user) = config.getStorageBackend() 
     114    backendinfo = config.getStorageBackend() 
     115    backend = backendinfo["storagebackend"] 
    111116    try : 
    112117        if not backend.isalpha() : 
     
    117122        raise PyKotaStorageError, _("Unsupported quota storage backend %s") % backend 
    118123    else :     
    119         return getattr(storagebackend, "Storage")(host, database, (asadmin and admin) or user) 
     124        host = backendinfo["storageserver"] 
     125        database = backendinfo["storagename"] 
     126        admin = backendinfo["storageadmin"] 
     127        user = backendinfo["storageuser"] 
     128        adminpw = backendinfo["storageadminpw"] 
     129        userpw = backendinfo["storageuserpw"] 
     130        if asadmin : 
     131            return getattr(storagebackend, "Storage")(host, database, admin, adminpw) 
     132        else :     
     133            return getattr(storagebackend, "Storage")(host, database, user, userpw) 
    120134