- Timestamp:
- Jun 1, 2009 10:37:59 AM (15 years ago)
- Branches:
- axis_example, compt_changes, info-ops, master, version-1.30, version-2.00, version-3.01, version-3.02
- Children:
- b535e19
- Parents:
- 222290f
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
fedd/federation/experiment_control.py
r222290f rb8a9fb7 165 165 Intialize the various attributes, most from the config object 166 166 """ 167 168 def parse_tarfile_list(tf): 169 """ 170 Parse a tarfile list from the configuration. This is a set of 171 paths and tarfiles separated by spaces. 172 """ 173 rv = [ ] 174 if tf is not None: 175 tl = tf.split() 176 while len(tl) > 1: 177 p, t = tl[0:2] 178 del tl[0:2] 179 rv.append((p, t)) 180 return rv 181 167 182 self.thread_with_rv = experiment_control_local.pooled_thread 168 183 self.thread_pool = experiment_control_local.thread_pool … … 196 211 "experiment_state") 197 212 self.splitter_url = config.get("experiment_control", "splitter_uri") 198 self.fedkit = config.get("experiment_control", "fedkit") 199 self.gatewaykit = config.get("experiment_control", "gatewaykit") 213 self.fedkit = parse_tarfile_list(\ 214 config.get("experiment_control", "fedkit")) 215 self.gatewaykit = parse_tarfile_list(\ 216 config.get("experiment_control", "gatewaykit")) 200 217 accessdb_file = config.get("experiment_control", "accessdb") 201 218 … … 1093 1110 """ 1094 1111 def __init__(self, eid, tmpdir, fedkit, gatewaykit): 1112 def tar_list_to_string(tl): 1113 if tl is None: return None 1114 1115 rv = "" 1116 for t in tl: 1117 rv += " %s PROJDIR/tarfiles/EID/%s" % \ 1118 (t[0], os.path.basename(t[1])) 1119 return rv 1120 1121 1095 1122 self.begin_testbed = re.compile("^#\s+Begin\s+Testbed\s+\((\w+)\)") 1096 1123 self.end_testbed = re.compile("^#\s+End\s+Testbed\s+\((\w+)\)") … … 1114 1141 self.eid = eid 1115 1142 self.tmpdir = tmpdir 1116 self.fedkit = fedkit 1117 self.gatewaykit = gatewaykit 1143 # Convert fedkit and gateway kit (which are lists of tuples) into a 1144 # substituition string. 1145 self.fedkit = tar_list_to_string(fedkit) 1146 self.gatewaykit = tar_list_to_string(gatewaykit) 1118 1147 1119 1148 def __call__(self, line, master, allocated, tbparams): … … 1190 1219 line = re.sub("GWCMDPARAMS", gwcmdparams, line) 1191 1220 line = re.sub("(#\s*)?GWCMD", gwcmd, line) 1221 #These expansions contain EID and PROJDIR. NB these are 1222 # local fedkit and gatewaykit, which are strings. 1223 if self.fedkit: 1224 line = re.sub("FEDKIT", self.fedkit, line) 1225 if self.gatewaykit: 1226 line = re.sub("GATEWAYKIT", self.gatewaykit, line) 1192 1227 line = re.sub("GWCONF", "FEDDIR`hostname`.gw.conf", line) 1193 1228 line = re.sub("PROJDIR", "/proj/%s/" % project, line) … … 1195 1230 line = re.sub("FEDDIR", "/proj/%s/exp/%s/tmp/" % \ 1196 1231 (project, self.eid), line) 1197 if self.fedkit:1198 line = re.sub("FEDKIT", os.path.basename(self.fedkit),1199 line)1200 if self.gatewaykit:1201 line = re.sub("GATEWAYKIT",1202 os.path.basename(self.gatewaykit), line)1203 1232 print >>self.testbed_file, line 1204 1233 return True … … 1730 1759 try: 1731 1760 if self.fedkit: 1732 parse_tarfiles.list.append(self.fedkit) 1761 for t in self.fedkit: 1762 parse_tarfiles.list.append(t[1]) 1733 1763 if self.gatewaykit: 1734 parse_tarfiles.list.append(self.gatewaykit) 1764 for t in self.gatewaykit: 1765 parse_tarfiles.list.append(t[1]) 1735 1766 for t in parse_tarfiles.list: 1736 1767 if not os.path.exists("%s/tarfiles" % tmpdir):
Note: See TracChangeset
for help on using the changeset viewer.