Changeset 05191a6 for fedd/fedd/split.py
- Timestamp:
- Dec 1, 2008 3:07:40 PM (15 years ago)
- Branches:
- axis_example, compt_changes, info-ops, master, version-1.30, version-2.00, version-3.01, version-3.02
- Children:
- f816079
- Parents:
- f069052
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
fedd/fedd/split.py
rf069052 r05191a6 10 10 from remote_service import xmlrpc_handler, soap_handler 11 11 from service_error import * 12 from authorizer import authorizer 12 13 13 14 … … 23 24 Intialize the various attributes, most from the config object 24 25 """ 25 if config.has_section("splitter"): 26 self.debug = config.getboolean("splitter", "debug") 27 self.muxmax = config.getint("splitter", "muxmax", 3) 28 self.tclsh = config.get("splitter", "tclsh", 29 "/usr/local/bin/otclsh") 30 self.tcl_splitter = config.get("splitter", "tcl_splitter", 31 "/usr/testbed/lib/ns2ir/parse.tcl") 32 else: 33 self.debug = False 34 self.muxmax = 3 35 self.tclsh = "/usr/local/bin/otclsh" 36 self.tcl_splitter = "/usr/testbed/lib/ns2ir/parse.tcl" 26 self.debug = config.getboolean("splitter", "debug") 27 self.muxmax = config.getint("splitter", "muxmax", 3) 28 self.tclsh = config.get("splitter", "tclsh", 29 "/usr/local/bin/otclsh") 30 self.tcl_splitter = config.get("splitter", "tcl_splitter", 31 "/usr/testbed/lib/ns2ir/parse.tcl") 32 access_db = config.get("splitter", "access_db", None) 33 allow_any = config.getboolean("splitter", "allow_any", False) 37 34 38 35 self.log = logging.getLogger("fedd.splitter") … … 41 38 42 39 set_log_level(config, "splitter", self.log) 40 41 if auth: 42 self.auth= auth 43 else: 44 self.auth = authorizer() 45 self.log.warning("[splitter] No authorizer passed in, " +\ 46 "using local one") 47 48 if access_db and allow_any: 49 raise service_error(service_error.internal, 50 "Cannot specify both an access database and allow_any " +\ 51 "for splitter") 52 53 if access_db: 54 try: 55 read_simple_accessdb(access_db, self.auth, 'split') 56 except IOError, e: 57 raise service_error(service_error.internal, 58 "Error reading accessDB %s: %s" % (access_db, e)) 59 except ValueError: 60 raise service_error(service_error.internal, "%s" % e) 61 elif allow_any: 62 auth.set_global_attribute("split") 63 64 43 65 # Dispatch tables 44 66 self.soap_services = {\ … … 60 82 to instantiate them and start it all up. 61 83 """ 84 85 if not self.auth.check_attribute(fid, 'split'): 86 raise service_error(service_error.access, "Access Denied") 87 62 88 try: 63 89 tmpdir = tempfile.mkdtemp(prefix="split-")
Note: See TracChangeset
for help on using the changeset viewer.