Changeset 9c3e77f
- Timestamp:
- Apr 13, 2012 6:08:12 PM (13 years ago)
- Branches:
- compt_changes, master
- Children:
- 934dd99
- Parents:
- 66795cf0
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
fedd/federation/emulab_access.py
r66795cf0 r9c3e77f 11 11 import subprocess 12 12 import traceback 13 import socket 13 14 14 15 from threading import * … … 89 90 self.portal_startcommand = config.get("access", "portal_startcommand") 90 91 self.node_startcommand = config.get("access", "node_startcommand") 92 93 self.uri = 'https://%s:%d' % (socket.getfqdn(), 94 self.get_port(config.get("globals", "services", "23235"))) 91 95 92 96 self.federation_software = self.software_list(self.federation_software) … … 172 176 self.call_SetValue = service_caller('SetValue') 173 177 self.call_GetValue = service_caller('GetValue', log=self.log) 178 179 @staticmethod 180 def get_port(ps): 181 ''' 182 Take a fedd service string and return the first port. Used in 183 creating the testbed uri identifier. 184 ''' 185 p = ps.split(',') 186 smallport = p[0].split(':') 187 try: 188 rv = int(smallport[0]) 189 except ValueError: 190 rv = 23235 191 return rv 174 192 175 193 @staticmethod … … 818 836 the response that may need to be replayed, and return the response. 819 837 """ 838 def get_localnames(t): 839 names = [ ] 840 for e in t.elements: 841 if isinstance(e, topdl.Computer): 842 n = e.get_attribute('testbed') 843 if n is not None and n not in names: 844 names.append(n) 845 return names 820 846 i = 0 821 847 t = topo.clone() … … 824 850 # sorry) 825 851 self.state_lock.acquire() 852 # Put information about this testbed into the topdl 853 tb = topdl.Testbed(self.uri, "deter", 854 localname=get_localnames(t), 855 attribute=[ 856 { 857 'attribute': 'project', 858 'value': self.allocation[aid]['project'] 859 }, 860 { 861 'attribute': 'experiment', 862 'value': self.allocation[aid]['experiment'] 863 }]) 864 t.elements.append(tb) 826 865 logv = "".join(self.allocation[aid]['log']) 827 866 # It's possible that the StartSegment call gets retried (!).
Note: See TracChangeset
for help on using the changeset viewer.