Ignore:
Timestamp:
Nov 30, 2008 5:38:16 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:
05191a6
Parents:
edbc841
Message:

Two changes. Get allow_any_CA checking to work (i.e., self signed certs or
certs signed by an unknown entity) and put more of the ZSI-dependent stuff into
the hidden parts or remote_services. Now those routines will find all the
relevant classes and part names from the naming conventions.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • fedd/fedd_client.py

    redbc841 rf069052  
    44import os
    55import pwd
    6 
    7 from fedd.fedd_services import *
    8 from fedd.fedd_internal_services import *
    96
    107from fedd import fedid, service_error
     
    177174        Specialize the class for the pre method
    178175        """
    179         self.RequestMessage = globals()["%sRequestMessage" % pre]
    180         self.ResponseMessage = globals()["%sResponseMessage" % pre]
    181176        self.RequestBody="%sRequestBody" % pre
    182177        self.ResponseBody="%sResponseBody" % pre
    183178        self.method = pre
    184179
    185         method_call = getattr(feddServiceLocator().getfeddPortType(),
    186                 self.method, None)
    187         if method_call:
    188             # The pre method is a fedd external service
    189             self.caller = service_caller(self.method, 'getfeddPortType',
    190                     feddServiceLocator, self.RequestMessage, self.RequestBody)
    191         else:
    192             # The pre method is a fedd internal service
    193             self.caller = service_caller(self.method,
    194                     'getfeddInternalPortType', feddInternalServiceLocator,
    195                     self.RequestMessage, self.RequestBody)
    196 
     180        self.caller = service_caller(self.method)
    197181        self.RPCException = fedd_rpc.RPCException
    198182
     
    255239            try:
    256240                context = fedd_ssl_context(cert, trusted)
    257             except SSL.SSLError, e:
     241            except Exception, e:
    258242                # Yes, doing this on message type is not ideal.  The string
    259243                # comes from OpenSSL, so check there is this stops working.
     
    343327        (opts, args) = parser.parse_args()
    344328
    345         if opts.trusted != None:
     329        if opts.trusted:
    346330            if ( not os.access(opts.trusted, os.R_OK) ) :
    347331                sys.exit("Cannot read trusted certificates (%s)" % opts.trusted)
    348         else:
    349             parser.error("--trusted is required")
    350332
    351333        if opts.debug > 0: opts.tracefile=sys.stderr
     
    411393        (opts, args) = parser.parse_args()
    412394
    413         if opts.trusted != None:
     395        if opts.trusted:
    414396            if ( not os.access(opts.trusted, os.R_OK) ) :
    415397                sys.exit("Cannot read trusted certificates (%s)" % opts.trusted)
    416         else:
    417             parser.error("--trusted is required")
    418398
    419399        if opts.debug > 0: opts.tracefile=sys.stderr
     
    471451        (opts, args) = parser.parse_args()
    472452
    473         if opts.trusted != None:
     453        if opts.trusted:
    474454            if ( not os.access(opts.trusted, os.R_OK) ) :
    475455                sys.exit("Cannot read trusted certificates (%s)" % opts.trusted)
    476         else:
    477             parser.error("--trusted is required")
    478456
    479457        if not opts.project :
     
    568546        (opts, args) = parser.parse_args()
    569547
    570         if opts.trusted != None:
     548        if opts.trusted:
    571549            if ( not os.access(opts.trusted, os.R_OK) ) :
    572550                sys.exit("Cannot read trusted certificates (%s)" % opts.trusted)
    573         else:
    574             parser.error("--trusted is required")
    575551
    576552        if opts.debug > 0: opts.tracefile=sys.stderr
     
    674650            parser.error("--testbed is required")
    675651
    676         if opts.trusted != None:
     652        if opts.trusted:
    677653            if ( not os.access(opts.trusted, os.R_OK) ) :
    678654                sys.exit("Cannot read trusted certificates (%s)" % opts.trusted)
    679         else:
    680             parser.error("--trusted is required")
    681655
    682656        if opts.debug > 0: opts.tracefile=sys.stderr
Note: See TracChangeset for help on using the changeset viewer.