Changeset 7206e5a for fedd/federation/client_lib.py
- Timestamp:
- Sep 23, 2010 5:44:47 PM (14 years ago)
- Branches:
- axis_example, compt_changes, info-ops, master
- Children:
- 835cf55
- Parents:
- 09b1e9d
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
fedd/federation/client_lib.py
r09b1e9d r7206e5a 80 80 self.errstr = errstr 81 81 82 class CertificateMismatchError(RuntimeError): pass 83 82 84 83 85 def get_user_cert(): … … 97 99 if os.path.isfile("%s/%s" % (dir,p))]: 98 100 f = open(fn, 'r') 99 rv.append( join(f))101 rv.append(f.read()) 100 102 f.close() 101 103 return rv … … 138 140 return (cert, fid, url) 139 141 140 def save_certfile(out_certfile, ea ):142 def save_certfile(out_certfile, ea, check_cert=None): 141 143 """ 142 144 if the experiment authority section in ea has a certificate and the 143 145 out_certfile parameter has a place to put it, save the cert to the file. 144 EnvronnemtError s can come from the file operations. 146 EnvronmentError s can come from the file operations. If check_cert is 147 given, the certificate in ea is compared with it and if they are not equal, 148 a CertificateMismatchError is raised. 145 149 """ 146 150 if out_certfile and ea and 'X509' in ea: 151 out_cert = ea['X509'] 152 if check_cert and check_cert != out_cert: 153 raise CertificateMismatchError() 147 154 f = open(out_certfile, "w") 148 print >>f, ea['X509']155 f.write(out_cert) 149 156 f.close() 150 157
Note: See TracChangeset
for help on using the changeset viewer.