Changeset 2729e48 for fedd/fedd.py


Ignore:
Timestamp:
Nov 29, 2008 11:31:03 PM (15 years ago)
Author:
Ted Faber <faber@…>
Branches:
axis_example, compt_changes, info-ops, master, version-1.30, version-2.00, version-3.01, version-3.02
Children:
2dd442f
Parents:
0a20ef8
Message:

Move things around to make a python module encapsulation easier. More to do,
but this mostly works.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • fedd/fedd.py

    r0a20ef8 r2729e48  
    11#!/usr/local/bin/python
    22
    3 import sys
     3import os,sys
    44
    55from optparse import OptionParser
    66
    7 from fedd_server import fedd_server, fedd_xmlrpc_handler, fedd_soap_handler
    8 from fedd_config_parser import fedd_config_parser
    9 from fedd_util import fedd_ssl_context
    10 from fedd_deter_impl import new_feddservice
     7from fedd.fedd_server import fedd_server, fedd_xmlrpc_handler, fedd_soap_handler
     8from fedd.fedd_config_parser import fedd_config_parser
     9from fedd.fedd_util import fedd_ssl_context
     10from fedd.fedd_deter_impl import new_feddservice
    1111
    1212from threading import *
     
    115115    sys.exit("Error configuring fedd: %s" % str)
    116116
    117 if impl.cert_file == None:
     117if impl.cert_file:
     118    if not os.access(impl.cert_file, os.R_OK):
     119        sys.exit("Cannot read certificate file: %s" % impl.cert_file)
     120else:
    118121    sys.exit("Must supply certificate file (probably in config)")
     122
     123if impl.trusted_certs:
     124    if not os.access(impl.trusted_certs, os.R_OK):
     125        sys.exit("Cannot read trusted certificate file: %s" % \
     126                impl.trusted_certs)
    119127
    120128# Create the SSL credentials
     
    124132        ctx = fedd_ssl_context(impl.cert_file, impl.trusted_certs,
    125133                password=impl.cert_pwd)
    126     except SSL.SSLError, e:
     134    except Exception, e:
    127135        if str(e) != "bad decrypt" or impl.cert_pwd != None:
    128136            raise
Note: See TracChangeset for help on using the changeset viewer.