Changeset c5869ef for fedd/federation
- Timestamp:
- May 26, 2010 3:18:49 AM (15 years ago)
- Branches:
- axis_example, compt_changes, info-ops, master, version-3.01, version-3.02
- Children:
- cf00ddd
- Parents:
- fefa026
- Location:
- fedd/federation
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
fedd/federation/emulab_access.py
rfefa026 rc5869ef 1713 1713 debug=self.create_debug, log=alloc_log) 1714 1714 rv = starter(self, ename, proj, user, expfile, tmpdir) 1715 rvtopo = topo.clone() 1716 1715 1717 # Copy the assigned names into the return topology 1716 rvtopo = topo.clone() 1717 for e in [ e for e in rvtopo.elements \ 1718 if isinstance(e, topdl.Computer)]: 1719 for n in e.name: 1720 if n in starter.node: 1721 e.set_attribute('hostname', "%s%s" % \ 1722 (starter.node[n], self.domain)) 1718 embedding = [ ] 1719 for n in starter.node: 1720 embedding.append({ 1721 'toponame': n, 1722 'physname': ["%s%s" % (starter.node[n], self.domain)], 1723 }) 1724 1725 1723 1726 except service_error, e: 1724 1727 err = e … … 1752 1755 'topdldescription': rvtopo.to_dict() 1753 1756 } 1757 'embedding': embedding 1754 1758 } 1755 1759 retval = copy.copy(self.allocation[aid]['started']) -
fedd/federation/experiment_control.py
rfefa026 rc5869ef 1017 1017 self.node = { } 1018 1018 1019 #def make_map(self, resp): 1020 #if 'segmentdescription' in resp and \ 1021 #'topdldescription' in resp['segmentdescription']: 1022 #top = topdl.Topology(\ 1023 #**resp['segmentdescription']['topdldescription']) 1024 #for e in [e for e in top.elements \ 1025 #if isinstance(e, topdl.Computer)]: 1026 #hn = e.get_attribute('hostname') 1027 #if hn: 1028 #for n in e.name: 1029 #self.node[n] = hn 1030 1019 1031 def make_map(self, resp): 1020 if 'segmentdescription' in resp and \ 1021 'topdldescription' in resp['segmentdescription']: 1022 top = topdl.Topology(\ 1023 **resp['segmentdescription']['topdldescription']) 1024 for e in [e for e in top.elements \ 1025 if isinstance(e, topdl.Computer)]: 1026 hn = e.get_attribute('hostname') 1027 if hn: 1028 for n in e.name: 1029 self.node[n] = hn 1032 for e in resp.get('embedding', []): 1033 if 'toponame' in e and 'physname' in e: 1034 self.node[e['toponame']] = e['physname'][0] 1030 1035 1031 1036 def __call__(self, uri, aid, topo, masters, attrs=None, connInfo=None): … … 1226 1231 for s in starters: 1227 1232 node.update(s.node) 1228 # Assign gthe mapping as a hostname attribute1233 # Assign the mapping as a hostname attribute 1229 1234 for e in [ e for e in top.elements \ 1230 1235 if isinstance(e, topdl.Computer)]: -
fedd/federation/protogeni_access.py
rfefa026 rc5869ef 1099 1099 # Copy the assigned names into the return topology 1100 1100 rvtopo = topo.clone() 1101 for e in [ e for e in rvtopo.elements \ 1102 if isinstance(e, topdl.Computer)]: 1103 for n in e.name: 1104 if n in starter.node: 1105 e.set_attribute('hostname', starter.node[n]) 1101 for e in rvtopo.elements: 1102 if isinstance(e, topdl.Computer) and e.get_attribute('testbed'): 1103 myname = e.get_attribute('testbed') 1104 break 1105 else: myname = None 1106 1107 embedding = [ ] 1108 for n in starter.node: 1109 embedding.append({ 1110 'toponame': n, 1111 'physname': ["%s%s" % (starter.node[n], self.domain)], 1112 }) 1113 1106 1114 except service_error, e: 1107 1115 err = e … … 1134 1142 'segmentdescription': { 1135 1143 'topdldescription': rvtopo.to_dict() } 1144 'embedding': embedding, 1136 1145 } 1137 1146 self.write_state()
Note: See TracChangeset
for help on using the changeset viewer.