Ignore:
Timestamp:
Oct 9, 2008 2:08:28 PM (16 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:
0b466d1
Parents:
11a08b0
Message:

clean up and add some docs

File:
1 edited

Legend:

Unmodified
Added
Removed
  • fedd/fedd_access.py

    r11a08b0 r0ea11af  
    2424import logging
    2525
     26
     27# Make log messages disappear if noone configures a fedd logger
    2628class nullHandler(logging.Handler):
    2729    def emit(self, record): pass
     
    9597                self.dynamic_projects_cert_pwd)
    9698
    97 
    98         if config.dynamic_projects_url == None:
    99             self.allocate_project = \
    100                 fedd_allocate_project_local(config.dynamic_projects,
    101                         config.dynamic_projects_url, proj_certs)
    102         else:
    103             self.allocate_project = \
    104                 fedd_allocate_project_remote(config.dynamic_projects,
    105                         config.dynamic_projects_url, proj_certs)
    106 
    107         self.soap_handlers = {\
     99        self.soap_services = {\
    108100            'RequestAccess': make_soap_handler(\
    109101                RequestAccessRequestMessage.typecode,\
     
    111103                "RequestAccessResponseBody")\
    112104            }
    113         self.xmlrpc_handlers =  {\
     105        self.xmlrpc_services =  {\
    114106            'RequestAccess': make_xmlrpc_handler(\
    115107                self.RequestAccess, "RequestAccessResponseBody")\
    116108            }
     109
     110
     111        if config.dynamic_projects_url == None:
     112            self.allocate_project = \
     113                fedd_allocate_project_local(config.dynamic_projects,
     114                        config.dynamic_projects_url, proj_certs)
     115        else:
     116            self.allocate_project = \
     117                fedd_allocate_project_remote(config.dynamic_projects,
     118                        config.dynamic_projects_url, proj_certs)
     119
     120        # If the project allocator exports services, put them in this object's
     121        # maps so that classes that instantiate this can call the services.
     122        self.soap_services.update(self.allocate_project.soap_services)
     123        self.xmlrpc_services.update(self.allocate_project.xmlrpc_services)
    117124
    118125    def dump_state(self):
     
    393400
    394401    def RequestAccess(self, req, fid):
    395 
     402        """
     403        Handle the access request.  Proxy if not for us.
     404
     405        Parse out the fields and make the allocations or rejections if for us,
     406        otherwise, assuming we're willing to proxy, proxy the request out.
     407        """
     408
     409        # The dance to get into the request body
    396410        if req.has_key('RequestAccessRequestBody'):
    397411            req = req['RequestAccessRequestBody']
     
    488502   
    489503    def get_soap_services(self):
    490         return self.soap_handlers
     504        return self.soap_services
    491505
    492506    def get_xmlrpc_services(self):
    493         return self.xmlrpc_handlers
    494 
     507        return self.xmlrpc_services
     508
Note: See TracChangeset for help on using the changeset viewer.