Changeset 1785 for pykota/trunk/pykota/config.py
- Timestamp:
- 10/06/04 12:05:47 (20 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
pykota/trunk/pykota/config.py
r1757 r1785 22 22 # 23 23 # $Log$ 24 # Revision 1.53 2004/10/06 10:05:47 jalet 25 # Minor changes to allow any PyKota administrator to launch enhanced versions 26 # of the commands, and not only the root user. 27 # 24 28 # Revision 1.52 2004/09/29 20:20:52 jalet 25 29 # Added the winbind_separator directive to pykota.conf to allow the admin to … … 237 241 def __init__(self, directory) : 238 242 """Reads and checks the configuration file.""" 243 self.isAdmin = 0 244 self.directory = directory 239 245 self.filename = os.path.join(directory, "pykota.conf") 240 246 if not os.path.isfile(self.filename) : … … 286 292 backendinfo["storageadminpw"] = None 287 293 adminconf = ConfigParser.ConfigParser() 288 adminconf.read(["/etc/pykota/pykotadmin.conf"]) 294 filename = os.path.join(self.directory, "pykotadmin.conf") 295 adminconf.read([filename]) 289 296 if adminconf.sections() : # were we able to read the file ? 290 297 try : 291 298 backendinfo["storageadmin"] = adminconf.get("global", "storageadmin", raw=1) 292 299 except (ConfigParser.NoSectionError, ConfigParser.NoOptionError) : 293 raise PyKotaConfigError, _("Option %s not found in section global of %s") % ("storageadmin", "/etc/pykota/pykotadmin.conf") 300 raise PyKotaConfigError, _("Option %s not found in section global of %s") % ("storageadmin", filename) 301 else : 302 self.isAdmin = 1 # We are a PyKota administrator 294 303 try : 295 304 backendinfo["storageadminpw"] = adminconf.get("global", "storageadminpw", raw=1)