Changeset 72ed6e4 for fedd/fedd.py
- Timestamp:
- Oct 20, 2008 1:33:21 PM (15 years ago)
- Branches:
- axis_example, compt_changes, info-ops, master, version-1.30, version-2.00, version-3.01, version-3.02
- Children:
- f4f4117
- Parents:
- 4700b3b
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
fedd/fedd.py
r4700b3b r72ed6e4 23 23 from time import sleep 24 24 import logging 25 from ConfigParser import * 25 26 26 27 # The SSL server here is based on the implementation described at … … 29 30 # Turn off the matching of hostname to certificate ID 30 31 SSL.Connection.clientPostConnectionCheck = None 32 33 class fedd_config_parser(SafeConfigParser): 34 """ 35 A SafeConfig parser with a more forgiving get attribute 36 """ 37 def get(self, sect, opt, default=None): 38 """ 39 This returns the requested option or a given default. 40 41 It's more like getattr than get. 42 """ 43 if self.has_option(sect, opt): 44 return SafeConfigParser.get(self, sect, opt) 45 else: 46 return default 31 47 32 48 class fedd_server(ThreadingSSLServer): … … 302 318 flog.addHandler(fh) 303 319 320 321 304 322 # Initialize the implementation 305 323 if opts.configfile != None: 306 324 try: 307 impl = new_feddservice(opts.configfile) 308 except RuntimeError, e: 309 str = getattr(e, 'desc', None) or getattr(e,'message', None) or \ 310 "No message" 311 sys.exit("Error configuring fedd: %s" % str) 325 config= fedd_config_parser() 326 config.read(opts.configfile) 327 except e: 328 sys.exit("Cannot parse confgi file: %s" % e) 312 329 else: 313 330 sys.exit("--configfile is required") 331 332 try: 333 impl = new_feddservice(config) 334 except RuntimeError, e: 335 str = getattr(e, 'desc', None) or getattr(e,'message', None) or \ 336 "No message" 337 sys.exit("Error configuring fedd: %s" % str) 314 338 315 339 if impl.cert_file == None:
Note: See TracChangeset
for help on using the changeset viewer.