Changeset 815cd26
- Timestamp:
- May 25, 2012 10:24:56 AM (12 years ago)
- Branches:
- compt_changes, master
- Children:
- 17c2f7b
- Parents:
- 5ae9d94
- Location:
- fedd/federation
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
fedd/federation/emulab_access.py
r5ae9d94 r815cd26 656 656 self.log.debug("Retrieving %s" % s) 657 657 try: 658 get_url(s, certfile, softdir )658 get_url(s, certfile, softdir, log=self.log) 659 659 except: 660 660 t, v, st = sys.exc_info() … … 700 700 self.log.debug("Retrieving %s from %s" % \ 701 701 (a['attribute'], a['value'])) 702 get_url(a['value'], certfile, tmpdir )702 get_url(a['value'], certfile, tmpdir, log=self.log) 703 703 except: 704 704 t, v, st = sys.exc_info() -
fedd/federation/util.py
r5ae9d94 r815cd26 204 204 d.close() 205 205 206 def get_url(url, cf, destdir, fn=None, max_retries=5 ):206 def get_url(url, cf, destdir, fn=None, max_retries=5, log=None): 207 207 """ 208 208 Get data from a federated data store. This presents the client cert/fedid … … 217 217 while not ok and retries < 5: 218 218 try: 219 if log: 220 log.debug('Creating HTTPSConnection') 219 221 conn = httplib.HTTPSConnection(po.hostname, port=po.port, 220 cert_file=cf, key_file=cf )222 cert_file=cf, key_file=cf, timeout=30) 221 223 conn.putrequest('GET', po.path) 222 224 conn.endheaders() 225 if log: 226 log.debug('Connecting') 223 227 response = conn.getresponse() 228 if log: 229 log.debug('Connected') 224 230 225 231 lf = open("%s/%s" % (destdir, fn), "w") 232 if log: 233 log.debug('initial read') 226 234 buf = response.read(4096) 227 235 while buf: 228 236 lf.write(buf) 237 if log: 238 log.debug('loop read') 229 239 buf = response.read(4096) 230 240 lf.close()
Note: See TracChangeset
for help on using the changeset viewer.