- Timestamp:
- 02/28/08 23:39:38 (17 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
pykota/trunk/pykota/config.py
r3296 r3349 23 23 """This module defines classes used to parse PyKota configuration files.""" 24 24 25 import sys 25 26 import os 26 27 import tempfile 27 28 import ConfigParser 28 29 30 from pykota.utils import unicodeToDatabase 29 31 from pykota.errors import PyKotaConfigError 30 32 … … 97 99 backendinfo["storagebackend"] = backend 98 100 if backend == "sqlitestorage" : 99 issqlite = 1101 issqlite = True 100 102 backendinfo["storagename"] = self.getGlobalOption("storagename") 101 103 for option in ["storageserver", "storageuser", "storageuserpw"] : 102 104 backendinfo[option] = None 103 105 else : 104 issqlite = 0106 issqlite = False 105 107 for option in ["storageserver", "storagename", "storageuser"] : 106 108 backendinfo[option] = self.getGlobalOption(option) … … 151 153 "usermail", \ 152 154 ] : 153 ldapinfo[option] = self.getGlobalOption(option).strip()155 ldapinfo[option] = unicodeToDatabase(self.getGlobalOption(option).strip()) 154 156 for field in ["newuser", "newgroup"] : 155 157 if ldapinfo[field].lower().startswith('attach(') : … … 160 162 ldapinfo["cacert"] = self.getGlobalOption("cacert", ignore=True) 161 163 if ldapinfo["cacert"] : 162 ldapinfo["cacert"] = ldapinfo["cacert"].strip() 164 ldapinfo["cacert"] = ldapinfo["cacert"].strip().encode(sys.getfilesystemencoding(), "replace") 163 165 if ldapinfo["ldaptls"] : 164 166 if not os.access(ldapinfo["cacert"] or "", os.R_OK) : 165 raise PyKotaConfigError, _("Option ldaptls is set, but certificate %s is not readable.") % str(ldapinfo["cacert"])167 raise PyKotaConfigError, _("Option ldaptls is set, but certificate %s is not readable.") % repr(ldapinfo["cacert"]) 166 168 return ldapinfo 167 169