- Timestamp:
- Feb 13, 2010 2:43:33 PM (15 years ago)
- Branches:
- axis_example, compt_changes, info-ops, master, version-3.01, version-3.02
- Children:
- d87778f
- Parents:
- fe28bb2
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
fedd/federation/emulab_access.py
rfe28bb2 r94a00cb 1239 1239 if s.get("name", "") == 'userconfig' \ 1240 1240 and s.get('visibility',"") == 'import': 1241 1242 # Collect ther server and certificate info. 1241 1243 u = s.get('server', None) 1242 print "url %s" % u1243 1244 for a in s.get('fedAttr', []): 1244 1245 if a.get('attribute',"") == 'cert': … … 1248 1249 cert = None 1249 1250 1250 if not cert: 1251 if cert: 1252 # Make a temporary certificate file for get_url. The 1253 # finally clause removes it whether something goes 1254 # wrong (including an exception from get_url) or not. 1255 try: 1256 tfos, tn = tempfile.mkstemp(suffix=".pem") 1257 tf = os.fdopen(tfos, 'w') 1258 print >>tf, cert 1259 tf.close() 1260 get_url(u, tn, tmpdir, "userconf") 1261 except IOError, e: 1262 raise service_error(service.error.internal, 1263 "Cannot create temp file for " + 1264 "userconfig certificates: %s e") 1265 finally: 1266 if tn: os.remove(tn) 1267 else: 1251 1268 raise service_error(service_error.req, 1252 1269 "No certificate for retreiving userconfig") 1253 try:1254 tfos, tn = tempfile.mkstemp(suffix=".pem")1255 tf = os.fdopen(tfos, 'w')1256 print >>tf, cert1257 tf.close()1258 print "tn %s" % tn1259 get_url(u, tn, tmpdir, "userconf")1260 except IOError, e:1261 raise service_error(service.error.internal,1262 "Cannot create temp file for " +1263 "userconfig certificates: %s e")1264 finally:1265 if tn: os.remove(tn)1266 1270 break 1267 1271
Note: See TracChangeset
for help on using the changeset viewer.