Changeset b6a6206 for fedd/federation
- Timestamp:
- Oct 6, 2011 3:58:02 PM (13 years ago)
- Branches:
- compt_changes, info-ops, master
- Children:
- 3df9b33
- Parents:
- 2933343 (diff), f3898f7 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - Location:
- fedd/federation
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
fedd/federation/emulab_access.py
r2933343 rb6a6206 934 934 vchars_re = '[^' + string.ascii_letters + string.digits + '-]' 935 935 936 self.state_lock.acquire() 937 if aid in self.allocation: 938 proj = self.allocation[aid].get('project', None) 939 if not proj: 940 proj = self.allocation[aid].get('sproject', None) 941 self.state_lock.release() 942 943 if not proj: 944 raise service_error(service_error.internal, 945 "Can't find project for %s" %aid) 946 936 947 for a in attrs: 937 948 if a['attribute'] in configs: … … 951 962 ename = a['value'] 952 963 953 # Names longer than the emulab max are discarder 954 if ename and len(ename) <= self.max_name_len: 964 # Names longer than the emulab max are discarded 965 # Projects with a group require nonce experiment names as well 966 if ename and len(ename) <= self.max_name_len and '/' not in proj: 955 967 # Clean up the experiment name so that emulab will accept it. 956 968 ename = re.sub(vchars_re, '-', ename) … … 973 985 self.state_lock.acquire() 974 986 if aid in self.allocation: 975 proj = self.allocation[aid].get('project', None)976 if not proj:977 proj = self.allocation[aid].get('sproject', None)978 987 user = self.allocation[aid].get('user', None) 979 988 self.allocation[aid]['experiment'] = ename … … 992 1001 self.write_state() 993 1002 self.state_lock.release() 994 995 if not proj:996 raise service_error(service_error.internal,997 "Can't find project for %s" %aid)998 1003 999 1004 if not user: … … 1092 1097 certfile, tmpdir) 1093 1098 1099 if '/' in proj: proj, gid = proj.split('/') 1100 else: gid = None 1101 1102 1094 1103 # Set up userconf and seer if needed 1095 1104 self.configure_userconf(services, tmpdir) … … 1109 1118 debug=self.create_debug, log=alloc_log, boss=self.boss, 1110 1119 cert=self.xmlrpc_cert) 1111 rv = starter(self, ename, proj, user, expfile, tmpdir )1120 rv = starter(self, ename, proj, user, expfile, tmpdir, gid=gid) 1112 1121 except service_error, e: 1113 1122 err = e … … 1161 1170 raise service_error(service_error.internal, 1162 1171 "Can't find project for %s" % aid) 1172 else: 1173 if '/' in proj: proj, gid = proj.split('/') 1174 else: gid = None 1163 1175 1164 1176 if not user: … … 1170 1182 stopper = self.stop_segment(keyfile=self.ssh_privkey_file, 1171 1183 debug=self.create_debug, boss=self.boss, cert=self.xmlrpc_cert) 1172 stopper(self, user, proj, ename )1184 stopper(self, user, proj, ename, gid) 1173 1185 return { 'allocID': req['allocID'], 'proof': proof.to_dict() } -
fedd/federation/emulab_segment.py
r2933343 rb6a6206 93 93 return state 94 94 95 def make_null_experiment(self, pid, eid, tmpdir ):95 def make_null_experiment(self, pid, eid, tmpdir, gid=None): 96 96 """ 97 97 Create a null copy of the experiment so that we capture any logs there … … 115 115 'wait': True 116 116 } 117 if gid is not None: 118 params['group'] = gid 117 119 if self.log: 118 120 self.log.info("[make_null_experiment]: Creating experiment") -
fedd/federation/local_emulab_segment.py
r2933343 rb6a6206 58 58 return True 59 59 60 def __call__(self, parent, eid, pid, user, tclfile, tmpdir, timeout=0): 60 def __call__(self, parent, eid, pid, user, tclfile, tmpdir, timeout=0, 61 gid=None): 61 62 """ 62 63 Start a sub-experiment on a federant. … … 70 71 71 72 if state == 'none': 72 if not self.make_null_experiment(pid, eid, tmpdir ):73 if not self.make_null_experiment(pid, eid, tmpdir, gid): 73 74 return False 74 75 … … 102 103 emulab_segment.__init__(self, boss=boss, cert=cert) 103 104 104 def __call__(self, parent, user, pid, eid ):105 def __call__(self, parent, user, pid, eid, gid=None): 105 106 """ 106 107 Stop a sub experiment by calling swapexp on the federant 107 108 """ 109 108 110 self.log.info("[stop_segment]: Stopping %s" % eid) 109 111 rv = False -
fedd/federation/proxy_emulab_segment.py
r2933343 rb6a6206 158 158 159 159 160 def make_null_experiment(self, user, host, pid, eid, tmpdir ):160 def make_null_experiment(self, user, host, pid, eid, tmpdir, gid=None): 161 161 """ 162 162 Create a null copy of the experiment so that we capture any logs there … … 164 164 startexp 165 165 """ 166 167 if gid is not None: gparam = '-g %s' % gid 168 else: gparam = '' 169 166 170 try: 167 171 f = open("%s/null.tcl" % tmpdir, "w") … … 179 183 if not self.ssh_cmd(user, host, 180 184 ("/usr/testbed/bin/startexp -i -f -w -p %s " + 181 "-e %s null.tcl") % (pid, eid), "startexp",185 "-e %s %s null.tcl") % (pid, eid, gparam), "startexp", 182 186 timeout=60 * 10): 183 187 return False … … 276 280 277 281 278 def __call__(self, parent, eid, pid, user, tclfile, tmpdir, timeout=0): 282 def __call__(self, parent, eid, pid, user, tclfile, tmpdir, timeout=0, 283 gid=None): 279 284 """ 280 285 Start a sub-experiment on a federant. … … 294 299 # Put a dummy in place to capture logs, and establish an experiment 295 300 # directory. 296 if not self.make_null_experiment(user, host, pid, eid, tmpdir ):301 if not self.make_null_experiment(user, host, pid, eid, tmpdir, gid): 297 302 return False 298 303 … … 325 330 proxy_segment.__init__(self, log=log, keyfile=keyfile, debug=debug) 326 331 327 def __call__(self, parent, user, pid, eid ):332 def __call__(self, parent, user, pid, eid, gid=None): 328 333 """ 329 334 Stop a sub experiment by calling swapexp on the federant
Note: See TracChangeset
for help on using the changeset viewer.