Changeset 1da6a23 for fedd/federation/access.py
- Timestamp:
- Sep 4, 2009 5:04:07 PM (15 years ago)
- Branches:
- axis_example, compt_changes, info-ops, master, version-2.00, version-3.01, version-3.02
- Children:
- 5ae3857
- Parents:
- f5ae004
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
fedd/federation/access.py
rf5ae004 r1da6a23 10 10 from threading import * 11 11 import subprocess 12 import signal 12 13 import time 13 14 … … 1110 1111 1111 1112 seer_out = False 1113 client_out = False 1112 1114 for p in [ e for e in topo.elements \ 1113 1115 if isinstance(e, topdl.Computer) and e.get_attribute('portal')]: … … 1120 1122 mproj, meid = mexp.split("/", 1) 1121 1123 mdomain = e.get_attribute('masterdomain') 1124 muser = e.get_attribute('masteruser') or 'root' 1125 smbshare = e.get_attribute('smbshare') or 'USERS' 1122 1126 scriptdir = e.get_attribute('scriptdir') 1123 1127 active = e.get_attribute('active') … … 1136 1140 rdomain = seg.get_attribute('domain') 1137 1141 cfn = "%s/%s.%s.%s%s.gw.conf" % \ 1138 (tmpdir, myname, leid, lproj, ldomain) 1142 (tmpdir, myname.lower(), leid.lower(), 1143 lproj.lower(), ldomain.lower()) 1144 tunnelconfig = self.attrs.has_key('TunnelCfg') 1139 1145 try: 1140 1146 f = open(cfn, "w") 1141 1147 print >>f, "Active: %s" % active 1148 print >>f, "TunnelCfg: %s" % tunnelconfig 1142 1149 print >>f, "BossName: boss" 1143 1150 print >>f, "FsName: fs" … … 1155 1162 print >>f, "Peer: %s.%s.%s%s" % \ 1156 1163 (peer.lower(), reid.lower(), rproj.lower(), rdomain) 1164 print >>f, "RemoteScriptDir: %s" % scriptdir 1157 1165 print >>f, "Pubkeys: /proj/%s/exp/%s/tmp/%s" % \ 1158 1166 (lproj, leid, pubkey_base) 1159 print >>f, "Privkey : /proj/%s/exp/%s/tmp/%s" % \1167 print >>f, "Privkeys: /proj/%s/exp/%s/tmp/%s" % \ 1160 1168 (lproj, leid, secretkey_base) 1161 1169 f.close() … … 1179 1187 seer_out = True 1180 1188 1181 1182 def generate_client_conf(self, user, proj, eid, tmpdir): 1183 try: 1184 f = open("%s/client.conf" % tmpdir, "w") 1185 if self.attrs.has_key('SMBshare'): 1186 print >>f, "SMBshare: %s" % self.attrs['SMBshare'] 1187 print >>f, "ProjectUser: %s" % user 1188 print >>f, "ProjectName: %s" % proj 1189 print >>f, "ExperimentID: %s/%s" % (proj, eid) 1190 f.close() 1191 except IOError, e: 1192 raise service_error(service_error.internal, 1193 "Cannot write client.conf: %s" %s) 1189 if not client_out and type in ('control', 'both'): 1190 try: 1191 f = open("%s/client.conf" % tmpdir, "w") 1192 print >>f, "ControlGateway: %s.%s.%s%s" % \ 1193 (myname.lower(), leid.lower(), lproj.lower(), 1194 ldomain.lower()) 1195 print >>f, "SMBshare: %s" % smbshare 1196 print >>f, "ProjectUser: %s" % muser 1197 print >>f, "ProjectName: %s" % mproj 1198 print >>f, "ExperimentID: %s/%s" % (mproj, meid) 1199 f.close() 1200 except IOError, e: 1201 raise service_error(service_error.internal, 1202 "Cannot write client.conf: %s" %s) 1203 client_out = True 1204 1205 1194 1206 1195 1207 def generate_ns2(self, topo, expfn, softdir, master): … … 1214 1226 s.location = re.sub("^.*/", softdir, s.location) 1215 1227 1216 1217 1228 # Customize the ns2 output for local portal commands and images 1218 1229 filters = [] … … 1340 1351 self.generate_ns2(topo, expfile, 1341 1352 "/proj/%s/software/%s/" % (proj, ename), master) 1342 self.generate_client_conf(user, proj, ename, tmpdir)1343 1353 starter = self.start_segment(keyfile=self.ssh_privkey_file, debug=False) 1344 1354 starter(self, ename, proj, user, expfile, tmpdir)
Note: See TracChangeset
for help on using the changeset viewer.