Changeset ec4fb42
- Timestamp:
- Nov 30, 2008 9:19:33 AM (16 years ago)
- Branches:
- axis_example, compt_changes, info-ops, master, version-1.30, version-2.00, version-3.01, version-3.02
- Children:
- 7454054
- Parents:
- f0dc2ca
- Location:
- fedd
- Files:
-
- 5 edited
- 8 moved
Legend:
- Unmodified
- Added
- Removed
-
fedd/Makefile
rf0dc2ca rec4fb42 10 10 11 11 ${GENERATED_MODS}: ${WSDL_FILES} 12 /usr/local/bin/wsdl2py --file fedd.wsdl --complexType --output-dir=fedd13 /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 \ 14 14 --types=fedd_services_types --output-dir=fedd 15 15 -
fedd/fedd.py
rf0dc2ca rec4fb42 5 5 from optparse import OptionParser 6 6 7 from fedd. fedd_server import fedd_server, fedd_xmlrpc_handler, fedd_soap_handler8 from fedd. fedd_config_parser import fedd_config_parser9 from fedd. fedd_util import fedd_ssl_context7 from fedd.server import server, xmlrpc_handler, soap_handler 8 from fedd.config_parser import config_parser 9 from fedd.util import fedd_ssl_context 10 10 from fedd.fedd_deter_impl import new_feddservice 11 11 … … 35 35 36 36 servers_active = True # Sub-servers run while this is True 37 servers = [ ] # fedd_server instances instantiated from services37 servers = [ ] # server instances instantiated from services 38 38 servers_lock = Lock() # Lock to manipulate servers from sub-server threads 39 39 … … 101 101 if opts.configfile != None: 102 102 try: 103 config= fedd_config_parser()103 config= config_parser() 104 104 config.read(opts.configfile) 105 except e:106 sys.exit("Cannot parse conf gifile: %s" % e)105 except Exception, e: 106 sys.exit("Cannot parse config file: %s" % e) 107 107 else: 108 108 sys.exit("--configfile is required") … … 163 163 try: 164 164 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)) 166 166 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)) 168 168 else: 169 169 flog.error("Invalid transport specification (%s) in service %s" % \ -
fedd/fedd/access.py
rf0dc2ca rec4fb42 11 11 12 12 from fedd_services import * 13 from fedd_util import *14 from fedd_allocate_project import *15 from fedd_access_project import access_project13 from util import * 14 from allocate_project import allocate_project_local, allocate_project_remote 15 from access_project import access_project 16 16 from fedid import fedid, generate_fedid 17 17 from authorizer import authorizer … … 28 28 fl.addHandler(nullHandler()) 29 29 30 class fedd_access:30 class access: 31 31 """ 32 32 The implementation of access control based on mapping users to projects. … … 68 68 config.add_section("globals") 69 69 else: 70 raise RunTimeError("No config to fedd _access")70 raise RunTimeError("No config to fedd.access") 71 71 72 72 # Create instance attributes from the static lists 73 for a in fedd_access.bool_attrs:73 for a in access.bool_attrs: 74 74 if config.has_option("access", a): 75 75 setattr(self, a, config.get("access", a)) … … 77 77 setattr(self, a, False) 78 78 79 for a in fedd_access.emulab_attrs + fedd_access.id_attrs:79 for a in access.emulab_attrs + access.id_attrs: 80 80 if config.has_option("access", a): 81 81 setattr(self, a, config.get("access",a)) … … 174 174 if not config.has_option("access", "project_allocation_uri"): 175 175 self.allocate_project = \ 176 fedd_allocate_project_local(config, auth)176 allocate_project_local(config, auth) 177 177 else: 178 178 self.allocate_project = \ 179 fedd_allocate_project_remote(config, auth)179 allocate_project_remote(config, auth) 180 180 181 181 # If the project allocator exports services, put them in this object's … … 291 291 Dump the state read from a configuration file. Mostly for debugging. 292 292 """ 293 for a in fedd_access.bool_attrs:293 for a in access.bool_attrs: 294 294 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: 296 296 print "%s: %s" % (a, getattr(self, a)) 297 297 for k, v in self.attrs.iteritems(): -
fedd/fedd/allocate_project.py
rf0dc2ca rec4fb42 10 10 from fedd_services import * 11 11 from fedd_internal_services import * 12 from fedd_util import *12 from util import * 13 13 from fedid import fedid 14 14 from fixed_resource import read_key_db, read_project_db 15 15 from remote_service import xmlrpc_handler, soap_handler, service_caller 16 from service_error import *16 from service_error import service_error 17 17 import logging 18 18 … … 29 29 30 30 31 class fedd_allocate_project_local:31 class allocate_project_local: 32 32 """ 33 33 Allocate projects on this machine in response to an access request. … … 168 168 uid.get('uri', None) 169 169 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"); 172 171 173 172 access = user.get('access', None) … … 175 174 ssh = access[0].get('sshPubkey', None) 176 175 if ssh == None: 177 raise fedd_proj.service_error(fedd_proj.service_error.req,176 raise service_error(service_error.req, 178 177 "No ssh key for user"); 179 178 else: 180 raise fedd_proj.service_error(fedd_proj.service_error.req,179 raise service_error(service_error.req, 181 180 "No access information for project"); 182 181 … … 378 377 return { 'project': req['ReleaseProjectRequestBody']['project']} 379 378 380 class fedd_allocate_project_remote:379 class allocate_project_remote: 381 380 """ 382 381 Allocate projects on a remote machine using the internal SOAP interface … … 426 425 "Bad proxy response") 427 426 428 # back to defining the fedd_allocate_project_remote class427 # back to defining the allocate_project_remote class 429 428 def __init__(self, config, auth=None): 430 429 """ -
fedd/fedd/config_parser.py
rf0dc2ca rec4fb42 3 3 from ConfigParser import * 4 4 5 class fedd_config_parser(SafeConfigParser):5 class config_parser(SafeConfigParser): 6 6 """ 7 7 A SafeConfig parser with a more forgiving get attribute -
fedd/fedd/experiment_control.py
rf0dc2ca rec4fb42 21 21 from fedd_services import * 22 22 from fedd_internal_services import * 23 from fedd_util import *23 from util import * 24 24 from fedid import fedid, generate_fedid 25 25 from remote_service import xmlrpc_handler, soap_handler, service_caller … … 34 34 fl.addHandler(nullHandler()) 35 35 36 class fedd_experiment_control_local:36 class experiment_control_local: 37 37 """ 38 38 Control of experiments that this system can directly access. … … 157 157 Intialize the various attributes, most from the config object 158 158 """ 159 self.thread_with_rv = fedd_experiment_control_local.pooled_thread160 self.thread_pool = fedd_experiment_control_local.thread_pool159 self.thread_with_rv = experiment_control_local.pooled_thread 160 self.thread_pool = experiment_control_local.thread_pool 161 161 162 162 self.cert_file = None -
fedd/fedd/fedd_deter_impl.py
rf0dc2ca rec4fb42 1 1 #!/usr/local/bin/python 2 2 3 from fedd_access import fedd_access4 from fedd_experiment_control import fedd_experiment_control_local5 from fedd_split import fedd_split_local3 from access import access 4 from experiment_control import experiment_control_local 5 from split import split_local 6 6 7 7 from authorizer import authorizer … … 20 20 def __init__(self, config=None): 21 21 """ 22 Initializer. Parses a configuration if one is given. 22 Initializer. Uses the parsed configuration to create appropriate 23 components. 23 24 """ 24 25 self.soap_services = { } … … 32 33 33 34 if config.has_section("access"): 34 self.access = fedd_access(config, self.auth)35 self.access = access(config, self.auth) 35 36 self.soap_services.update(self.access.soap_services) 36 37 self.xmlrpc_services.update(self.access.xmlrpc_services) … … 38 39 if config.has_section("experiment_control"): 39 40 self.experiment = \ 40 fedd_experiment_control_local(config, self.auth)41 experiment_control_local(config, self.auth) 41 42 self.soap_services.update(self.experiment.soap_services) 42 43 self.xmlrpc_services.update(self.experiment.xmlrpc_services) 43 44 44 45 if config.has_section("splitter"): 45 self.splitter = fedd_split_local(config, self.auth)46 self.splitter = split_local(config, self.auth) 46 47 self.soap_services.update(self.splitter.soap_services) 47 48 self.xmlrpc_services.update(self.splitter.xmlrpc_services) -
fedd/fedd/remote_service.py
rf0dc2ca rec4fb42 13 13 from xmlrpclib import ServerProxy, dumps, loads, Fault, Error, Binary 14 14 15 from fedd_util import fedd_ssl_context15 from util import fedd_ssl_context 16 16 from fedid import fedid 17 17 -
fedd/fedd/server.py
rf0dc2ca rec4fb42 24 24 SSL.Connection.clientPostConnectionCheck = None 25 25 26 class fedd_server(ThreadingSSLServer):26 class server(ThreadingSSLServer): 27 27 """ 28 28 Interface the fedd services to the XMLRPC and SOAP interfaces … … 52 52 "(Likely SSL error)") 53 53 54 class fedd_soap_handler(BaseHTTPRequestHandler):54 class soap_handler(BaseHTTPRequestHandler): 55 55 """ 56 56 Standard connection between SOAP and the fedd services in impl. … … 152 152 153 153 154 class fedd_xmlrpc_handler(BaseHTTPRequestHandler):154 class xmlrpc_handler(BaseHTTPRequestHandler): 155 155 """ 156 156 Standard connection between XMLRPC and the fedd services in impl. -
fedd/fedd/split.py
rf0dc2ca rec4fb42 8 8 from fedd_services import * 9 9 from fedd_internal_services import * 10 from fedd_util import *10 from util import * 11 11 from fedid import fedid 12 12 from remote_service import xmlrpc_handler, soap_handler … … 21 21 fl.addHandler(nullHandler()) 22 22 23 class fedd_split_local:23 class split_local: 24 24 def __init__(self, config=None, auth=None): 25 25 """ -
fedd/fedd_client.py
rf0dc2ca rec4fb42 19 19 import xmlrpclib 20 20 21 from fedd. fedd_util import fedd_ssl_context, pack_id, unpack_id21 from fedd.util import fedd_ssl_context, pack_id, unpack_id 22 22 from fedd.fedid import fedid 23 23 from fedd.remote_service import service_caller
Note: See TracChangeset
for help on using the changeset viewer.