Changeset 6e33086 for fedd/federation/emulab_access.py
- Timestamp:
- Nov 28, 2011 7:34:11 PM (12 years ago)
- Branches:
- compt_changes, info-ops, master
- Children:
- ec3aa4d
- Parents:
- 45e880d
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
fedd/federation/emulab_access.py
r45e880d r6e33086 101 101 self.start_segment = proxy_emulab_segment.start_segment 102 102 self.stop_segment = proxy_emulab_segment.stop_segment 103 self.info_segment = proxy_emulab_segment.info_segment 103 104 elif self.access_type == 'local_emulab': 104 105 self.start_segment = local_emulab_segment.start_segment 105 106 self.stop_segment = local_emulab_segment.stop_segment 107 self.info_segment = local_emulab_segment.info_segment 106 108 else: 107 109 self.start_segment = None 108 110 self.stop_segment = None 111 self.info_segment = None 109 112 110 113 self.restricted = [ ] … … 181 184 'TerminateSegment': soap_handler("TerminateSegment", 182 185 self.TerminateSegment), 186 'InfoSegment': soap_handler("InfoSegment", self.InfoSegment), 183 187 } 184 188 self.xmlrpc_services = {\ … … 190 194 'TerminateSegment': xmlrpc_handler('TerminateSegment', 191 195 self.TerminateSegment), 196 'InfoSegment': xmlrpc_handler("InfoSegment", self.InfoSegment), 192 197 } 193 198 … … 1011 1016 return (ename, proj, user, pubkey_base, secretkey_base, alloc_log) 1012 1017 1013 def finalize_experiment(self, starter, topo, aid, alloc_id, proof): 1014 """ 1015 Store key bits of experiment state in the global repository, including 1016 the response that may need to be replayed, and return the response. 1017 """ 1018 i = 0 1019 t = topo.clone() 1018 def decorate_topology(self, info, t): 1019 """ 1020 Copy the physical mapping and status onto the topology. Used by 1021 StartSegment and InfoSegment 1022 """ 1023 def add_new(ann, attr): 1024 for a in ann: 1025 if a not in attr: attr.append(a) 1026 1020 1027 # Copy the assigned names into the return topology 1021 1028 for e in t.elements: 1022 1029 if isinstance(e, topdl.Computer): 1023 1030 if not self.create_debug: 1024 if e.name in starter.node:1025 e.localname.append("%s%s" % \1026 (starter.node[e.name][0], self.domain))1027 e.status = starter.node[e.name][1]1031 if e.name in info.node: 1032 add_new(("%s%s" % (info.node[e.name][0], self.domain),), 1033 e.localname) 1034 e.status = info.node[e.name][1] 1028 1035 else: 1029 1036 # Simple debugging assignment 1030 e.localname.append("node%d%s" % (i, self.domain))1037 add_new(("node%d%s" % (i, self.domain),), e.localname) 1031 1038 e.status = 'active' 1032 e.operation.extend(('testop1', 'testop2'))1039 add_new(('testop1', 'testop2'), e.operation) 1033 1040 i += 1 1034 1041 1042 1043 def finalize_experiment(self, starter, topo, aid, alloc_id, proof): 1044 """ 1045 Store key bits of experiment state in the global repository, including 1046 the response that may need to be replayed, and return the response. 1047 """ 1048 i = 0 1049 t = topo.clone() 1050 self.decorate_topology(starter, t) 1035 1051 # Grab the log (this is some anal locking, but better safe than 1036 1052 # sorry) … … 1246 1262 info = self.info_segment(keyfile=self.ssh_privkey_file, 1247 1263 debug=self.create_debug, boss=self.boss, cert=self.xmlrpc_cert) 1248 info(self, user, proj, ename, gid, nonce) 1264 info(self, user, proj, ename) 1265 self.decorate_topology(info, topo) 1249 1266 return { 1250 1267 'allocID': req['allocID'], 1251 'experimentdescription' { 'topdldescription' : topo.to_dict() }, 1268 'segmentdescription': 1269 { 'topdldescription' : topo.to_dict() }, 1252 1270 'proof': proof.to_dict(), 1253 1271 } 1254
Note: See TracChangeset
for help on using the changeset viewer.