Changeset ec4fb42


Ignore:
Timestamp:
Nov 30, 2008 9:19:33 AM (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:
7454054
Parents:
f0dc2ca
Message:

Clean up some names that start with fedd_ that are ugly with the new package
structure. A couple other bugs cleaned up, too.

Location:
fedd
Files:
5 edited
8 moved

Legend:

Unmodified
Added
Removed
  • fedd/Makefile

    rf0dc2ca rec4fb42  
    1010
    1111${GENERATED_MODS}:      ${WSDL_FILES}
    12         /usr/local/bin/wsdl2py --file fedd.wsdl --complexType --output-dir=fedd
    13         /usr/local/bin/wsdl2py --file fedd_internal.wsdl --complexType \
     12        wsdl2py --file fedd.wsdl --complexType --output-dir=fedd
     13        wsdl2py --file fedd_internal.wsdl --complexType \
    1414                --types=fedd_services_types --output-dir=fedd
    1515
  • fedd/fedd.py

    rf0dc2ca rec4fb42  
    55from optparse import OptionParser
    66
    7 from fedd.fedd_server import fedd_server, fedd_xmlrpc_handler, fedd_soap_handler
    8 from fedd.fedd_config_parser import fedd_config_parser
    9 from fedd.fedd_util import fedd_ssl_context
     7from fedd.server import server, xmlrpc_handler, soap_handler
     8from fedd.config_parser import config_parser
     9from fedd.util import fedd_ssl_context
    1010from fedd.fedd_deter_impl import new_feddservice
    1111
     
    3535
    3636servers_active = True       # Sub-servers run while this is True
    37 servers = [ ]               # fedd_server instances instantiated from services
     37servers = [ ]               # server instances instantiated from services
    3838servers_lock = Lock()       # Lock to manipulate servers from sub-server threads
    3939
     
    101101if opts.configfile != None:
    102102    try:
    103         config= fedd_config_parser()
     103        config= config_parser()
    104104        config.read(opts.configfile)
    105     except e:
    106         sys.exit("Cannot parse confgi file: %s" % e)
     105    except Exception, e:
     106        sys.exit("Cannot parse config file: %s" % e)
    107107else:
    108108    sys.exit("--configfile is required")
     
    163163    try:
    164164        if t == 'soap':
    165             servers.append(fedd_server((h, p), fedd_soap_handler, ctx, impl))
     165            servers.append(server((h, p), soap_handler, ctx, impl))
    166166        elif t == 'xmlrpc':
    167             servers.append(fedd_server((h, p), fedd_xmlrpc_handler, ctx, impl))
     167            servers.append(server((h, p), xmlrpc_handler, ctx, impl))
    168168        else:
    169169            flog.error("Invalid transport specification (%s) in service %s" % \
  • fedd/fedd/access.py

    rf0dc2ca rec4fb42  
    1111
    1212from fedd_services import *
    13 from fedd_util import *
    14 from fedd_allocate_project import *
    15 from fedd_access_project import access_project
     13from util import *
     14from allocate_project import allocate_project_local, allocate_project_remote
     15from access_project import access_project
    1616from fedid import fedid, generate_fedid
    1717from authorizer import authorizer
     
    2828fl.addHandler(nullHandler())
    2929
    30 class fedd_access:
     30class access:
    3131    """
    3232    The implementation of access control based on mapping users to projects.
     
    6868                config.add_section("globals")
    6969        else:
    70             raise RunTimeError("No config to fedd_access")
     70            raise RunTimeError("No config to fedd.access")
    7171
    7272        # Create instance attributes from the static lists
    73         for a in fedd_access.bool_attrs:
     73        for a in access.bool_attrs:
    7474            if config.has_option("access", a):
    7575                setattr(self, a, config.get("access", a))
     
    7777                setattr(self, a, False)
    7878
    79         for a in fedd_access.emulab_attrs + fedd_access.id_attrs:
     79        for a in access.emulab_attrs + access.id_attrs:
    8080            if config.has_option("access", a):
    8181                setattr(self, a, config.get("access",a))
     
    174174        if not config.has_option("access", "project_allocation_uri"):
    175175            self.allocate_project = \
    176                 fedd_allocate_project_local(config, auth)
     176                allocate_project_local(config, auth)
    177177        else:
    178178            self.allocate_project = \
    179                 fedd_allocate_project_remote(config, auth)
     179                allocate_project_remote(config, auth)
    180180
    181181        # If the project allocator exports services, put them in this object's
     
    291291        Dump the state read from a configuration file.  Mostly for debugging.
    292292        """
    293         for a in fedd_access.bool_attrs:
     293        for a in access.bool_attrs:
    294294            print "%s: %s" % (a, getattr(self, a ))
    295         for a in fedd_access.emulab_attrs + fedd_access.id_attrs:
     295        for a in access.emulab_attrs + access.id_attrs:
    296296            print "%s: %s" % (a, getattr(self, a))
    297297        for k, v in self.attrs.iteritems():
  • fedd/fedd/allocate_project.py

    rf0dc2ca rec4fb42  
    1010from fedd_services import *
    1111from fedd_internal_services import *
    12 from fedd_util import *
     12from util import *
    1313from fedid import fedid
    1414from fixed_resource import read_key_db, read_project_db
    1515from remote_service import xmlrpc_handler, soap_handler, service_caller
    16 from service_error import *
     16from service_error import service_error
    1717import logging
    1818
     
    2929
    3030
    31 class fedd_allocate_project_local:
     31class allocate_project_local:
    3232    """
    3333    Allocate projects on this machine in response to an access request.
     
    168168                        uid.get('uri', None)
    169169                if uname == None:
    170                     raise fedd_proj.service_error(fedd_proj.service_error.req,
    171                             "No ID for user");
     170                    raise service_error(service_error.req, "No ID for user");
    172171
    173172            access = user.get('access', None)
     
    175174                ssh = access[0].get('sshPubkey', None)
    176175                if ssh == None:
    177                     raise fedd_proj.service_error(fedd_proj.service_error.req,
     176                    raise service_error(service_error.req,
    178177                            "No ssh key for user");
    179178        else:
    180             raise fedd_proj.service_error(fedd_proj.service_error.req,
     179            raise service_error(service_error.req,
    181180                    "No access information for project");
    182181
     
    378377        return { 'project': req['ReleaseProjectRequestBody']['project']}
    379378
    380 class fedd_allocate_project_remote:
     379class allocate_project_remote:
    381380    """
    382381    Allocate projects on a remote machine using the internal SOAP interface
     
    426425                        "Bad proxy response")
    427426
    428     # back to defining the fedd_allocate_project_remote class
     427    # back to defining the allocate_project_remote class
    429428    def __init__(self, config, auth=None):
    430429        """
  • fedd/fedd/config_parser.py

    rf0dc2ca rec4fb42  
    33from ConfigParser import *
    44
    5 class fedd_config_parser(SafeConfigParser):
     5class config_parser(SafeConfigParser):
    66    """
    77    A SafeConfig parser with a more forgiving get attribute
  • fedd/fedd/experiment_control.py

    rf0dc2ca rec4fb42  
    2121from fedd_services import *
    2222from fedd_internal_services import *
    23 from fedd_util import *
     23from util import *
    2424from fedid import fedid, generate_fedid
    2525from remote_service import xmlrpc_handler, soap_handler, service_caller
     
    3434fl.addHandler(nullHandler())
    3535
    36 class fedd_experiment_control_local:
     36class experiment_control_local:
    3737    """
    3838    Control of experiments that this system can directly access.
     
    157157        Intialize the various attributes, most from the config object
    158158        """
    159         self.thread_with_rv = fedd_experiment_control_local.pooled_thread
    160         self.thread_pool = fedd_experiment_control_local.thread_pool
     159        self.thread_with_rv = experiment_control_local.pooled_thread
     160        self.thread_pool = experiment_control_local.thread_pool
    161161
    162162        self.cert_file = None
  • fedd/fedd/fedd_deter_impl.py

    rf0dc2ca rec4fb42  
    11#!/usr/local/bin/python
    22
    3 from fedd_access import fedd_access
    4 from fedd_experiment_control import fedd_experiment_control_local
    5 from fedd_split import fedd_split_local
     3from access import access
     4from experiment_control import experiment_control_local
     5from split import split_local
    66
    77from authorizer import authorizer
     
    2020    def __init__(self, config=None):
    2121        """
    22         Initializer.  Parses a configuration if one is given.
     22        Initializer.  Uses the parsed configuration to create appropriate
     23        components.
    2324        """
    2425        self.soap_services = { }
     
    3233
    3334            if config.has_section("access"):
    34                 self.access = fedd_access(config, self.auth)
     35                self.access = access(config, self.auth)
    3536                self.soap_services.update(self.access.soap_services)
    3637                self.xmlrpc_services.update(self.access.xmlrpc_services)
     
    3839            if config.has_section("experiment_control"):
    3940                self.experiment = \
    40                         fedd_experiment_control_local(config, self.auth)
     41                        experiment_control_local(config, self.auth)
    4142                self.soap_services.update(self.experiment.soap_services)
    4243                self.xmlrpc_services.update(self.experiment.xmlrpc_services)
    4344
    4445            if config.has_section("splitter"):
    45                 self.splitter = fedd_split_local(config, self.auth)
     46                self.splitter = split_local(config, self.auth)
    4647                self.soap_services.update(self.splitter.soap_services)
    4748                self.xmlrpc_services.update(self.splitter.xmlrpc_services)
  • fedd/fedd/remote_service.py

    rf0dc2ca rec4fb42  
    1313from xmlrpclib import ServerProxy, dumps, loads, Fault, Error, Binary
    1414
    15 from fedd_util import fedd_ssl_context
     15from util import fedd_ssl_context
    1616from fedid import fedid
    1717
  • fedd/fedd/server.py

    rf0dc2ca rec4fb42  
    2424SSL.Connection.clientPostConnectionCheck = None
    2525
    26 class fedd_server(ThreadingSSLServer):
     26class server(ThreadingSSLServer):
    2727    """
    2828    Interface the fedd services to the XMLRPC and SOAP interfaces
     
    5252                    "(Likely SSL error)")
    5353
    54 class fedd_soap_handler(BaseHTTPRequestHandler):
     54class soap_handler(BaseHTTPRequestHandler):
    5555    """
    5656    Standard connection between SOAP and the fedd services in impl.
     
    152152
    153153
    154 class fedd_xmlrpc_handler(BaseHTTPRequestHandler):
     154class xmlrpc_handler(BaseHTTPRequestHandler):
    155155    """
    156156    Standard connection between XMLRPC and the fedd services in impl.
  • fedd/fedd/split.py

    rf0dc2ca rec4fb42  
    88from fedd_services import *
    99from fedd_internal_services import *
    10 from fedd_util import *
     10from util import *
    1111from fedid import fedid
    1212from remote_service import xmlrpc_handler, soap_handler
     
    2121fl.addHandler(nullHandler())
    2222
    23 class fedd_split_local:
     23class split_local:
    2424    def __init__(self, config=None, auth=None):
    2525        """
  • fedd/fedd_client.py

    rf0dc2ca rec4fb42  
    1919import xmlrpclib
    2020
    21 from fedd.fedd_util import fedd_ssl_context, pack_id, unpack_id
     21from fedd.util import fedd_ssl_context, pack_id, unpack_id
    2222from fedd.fedid import fedid
    2323from fedd.remote_service import service_caller
Note: See TracChangeset for help on using the changeset viewer.