Changeset d3c8759 for fedd/federation
- Timestamp:
- May 25, 2010 11:15:55 AM (15 years ago)
- Branches:
- axis_example, compt_changes, info-ops, master, version-3.01, version-3.02
- Children:
- f038da1
- Parents:
- da2208a
- Location:
- fedd/federation
- Files:
-
- 15 edited
Legend:
- Unmodified
- Added
- Removed
-
fedd/federation/allocate_project.py
rda2208a rd3c8759 102 102 try: 103 103 read_simple_accessdb(access_db, self.auth, 'allocate') 104 except IOError, e:104 except EnvironmentError, e: 105 105 raise service_error(service_error.internal, 106 106 "Error reading accessDB %s: %s" % (access_db, e)) … … 132 132 self.log.debug("[allocation]: Read state from %s" % \ 133 133 self.state_filename) 134 except IOError, e:134 except EnvironmentError, e: 135 135 self.log.warning(("[allocation]: No saved state: " +\ 136 136 "Can't open %s: %s") % (self.state_filename, e)) … … 154 154 f = open(self.state_filename, 'w') 155 155 pickle.dump(self.state, f) 156 except IOError, e:156 except EnvironmentError, e: 157 157 self.log.error("Can't write file %s: %s" % \ 158 158 (self.state_filename, e)) … … 195 195 try: 196 196 dnull = open("/dev/null", "w") 197 except IOError:197 except EnvironmentError: 198 198 self.log.warn("[run_cmd]: failed to open /dev/null for redirect") 199 199 dnull = None -
fedd/federation/deter_impl.py
rda2208a rd3c8759 64 64 try: 65 65 read_simple_accessdb(access_db, self.auth) 66 except IOError, e:66 except EnvironmentError, e: 67 67 raise RuntimeError( 68 68 "Error reading accessDB %s: %s" % (access_db, e)) -
fedd/federation/deter_internal_access.py
rda2208a rd3c8759 220 220 f = open(self.state_filename, 'w') 221 221 pickle.dump(self.state, f) 222 except IOError, e:222 except EnvironmentError, e: 223 223 self.log.error("Can't write file %s: %s" % \ 224 224 (self.state_filename, e)) … … 241 241 self.log.debug("[read_state]: Read state from %s" % \ 242 242 self.state_filename) 243 except IOError, e:243 except EnvironmentError, e: 244 244 self.log.warning(("[read_state]: No saved state: " +\ 245 245 "Can't open %s: %s") % (self.state_filename, e)) … … 422 422 print >>f, alloc_cert 423 423 f.close() 424 except IOError, e:424 except EnvironmentError, e: 425 425 raise service_error(service_error.internal, 426 426 "Can't open %s/%s : %s" % (self.certdir, aid, e)) -
fedd/federation/dragon_access.py
rda2208a rd3c8759 219 219 f = open(self.state_filename, 'w') 220 220 pickle.dump(self.state, f) 221 except IOError, e:221 except EnvironmentError, e: 222 222 self.log.error("Can't write file %s: %s" % \ 223 223 (self.state_filename, e)) … … 240 240 self.log.debug("[read_state]: Read state from %s" % \ 241 241 self.state_filename) 242 except IOError, e:242 except EnvironmentError, e: 243 243 self.log.warning(("[read_state]: No saved state: " +\ 244 244 "Can't open %s: %s") % (self.state_filename, e)) … … 414 414 print >>f, alloc_cert 415 415 f.close() 416 except IOError, e:416 except EnvironmentError, e: 417 417 raise service_error(service_error.internal, 418 418 "Can't open %s/%s : %s" % (self.certdir, aid, e)) … … 711 711 call(cmd, cwd=self.cli_dir, stdout=f, stderr=f, close_fds=True) 712 712 f.close() 713 except IOError, e:713 except EnvironmentError, e: 714 714 raise service_error(service_error.internal, 715 715 "Failed to open /dev/null: %s" % e) -
fedd/federation/emulab_access.py
rda2208a rd3c8759 335 335 f = open(self.state_filename, 'w') 336 336 pickle.dump(self.state, f) 337 except IOError, e:337 except EnvironmentError, e: 338 338 self.log.error("Can't write file %s: %s" % \ 339 339 (self.state_filename, e)) … … 362 362 self.log.debug("[read_state]: Read state from %s" % \ 363 363 self.state_filename) 364 except IOError, e:364 except EnvironmentError, e: 365 365 self.log.warning(("[read_state]: No saved state: " +\ 366 366 "Can't open %s: %s") % (self.state_filename, e)) … … 566 566 cf = open(conffilename, "w") 567 567 os.chmod(conffilename, stat.S_IRUSR | stat.S_IWUSR) 568 except IOError, e:568 except EnvironmentError, e: 569 569 raise service_error(service_error.internal, 570 570 "Cannot create user configuration data") … … 572 572 try: 573 573 dev_null = open("/dev/null", "a") 574 except IOError, e:574 except EnvironmentError, e: 575 575 self.log.error("export_userconf: can't open /dev/null: %s" % e) 576 576 … … 908 908 print >>f, alloc_cert 909 909 f.close() 910 except IOError, e:910 except EnvironmentError, e: 911 911 raise service_error(service_error.internal, 912 912 "Can't open %s/%s : %s" % (self.certdir, aid, e)) … … 1186 1186 (lproj, leid, secretkey_base) 1187 1187 f.close() 1188 except IOError, e:1188 except EnvironmentError, e: 1189 1189 raise service_error(service_error.internal, 1190 1190 "Can't write protal config %s: %s" % (cfn, e)) … … 1212 1212 print >>f, "SEERBase: True" 1213 1213 f.close() 1214 except IOError, e:1214 except EnvironmentError, e: 1215 1215 raise service_error(service_error.internal, 1216 1216 "Cannot write client.conf: %s" %s) … … 1364 1364 print >>f, expfile 1365 1365 f.close() 1366 except IOError:1366 except EnvironmentError: 1367 1367 raise service_error(service_error.internal, 1368 1368 "Cannot write experiment file %s: %s" % (expfn,e)) … … 1482 1482 get_url(u, tn, tmpdir, "userconf") 1483 1483 self.log.debug("Got userconf info: %s" % u) 1484 except IOError, e:1484 except EnvironmentError, e: 1485 1485 raise service_error(service.error.internal, 1486 1486 "Cannot create temp file for " + … … 1603 1603 softdir = "%s/software" % tmpdir 1604 1604 os.mkdir(softdir) 1605 except IOError:1605 except EnvironmentError: 1606 1606 raise service_error(service_error.internal, "Cannot create tmp dir") 1607 1607 -
fedd/federation/experiment_control.py
rda2208a rd3c8759 321 321 self.ssh_pubkey = f.read() 322 322 f.close() 323 except IOError:323 except EnvironmentError: 324 324 raise service_error(service_error.internal, 325 325 "Cannot read sshpubkey") … … 402 402 f = open(self.state_filename, 'w') 403 403 pickle.dump(self.state, f) 404 except IOError, e:404 except EnvironmentError, e: 405 405 self.log.error("Can't write file %s: %s" % \ 406 406 (self.state_filename, e)) … … 452 452 self.log.debug("[read_state]: Read state from %s" % \ 453 453 self.state_filename) 454 except IOError, e:454 except EnvironmentError, e: 455 455 self.log.warning("[read_state]: No saved state: Can't open %s: %s"\ 456 456 % (self.state_filename, e)) … … 528 528 self.log.warn("[experiment_control] Error parsing access " +\ 529 529 "db %s at line %d" % (accessdb_file, lineno)) 530 except IOError:530 except EnvironmentError: 531 531 raise service_error(service_error.internal, 532 532 ("Error opening/reading %s as experiment " +\ … … 560 560 self.log.warn("[read_mapdb] Ignored bad line (%d) in " +\ 561 561 "map db: %s %s" % (lineno, line, e)) 562 except IOError, e:562 except EnvironmentError, e: 563 563 self.log.warning("[read_mapdb]: No saved map database: Can't " +\ 564 564 "open %s: %s" % (file, e)) … … 571 571 self.log.debug("[read_store]: Read store from %s" % \ 572 572 self.store_filename) 573 except IOError, e:573 except EnvironmentError, e: 574 574 self.log.warning("[read_store]: No saved store: Can't open %s: %s"\ 575 575 % (self.state_filename, e)) … … 602 602 try: 603 603 self.synch_store.save(self.store_filename) 604 except IOError, e:604 except EnvironmentError, e: 605 605 self.log.error("Can't write file %s: %s" % \ 606 606 (self.store_filename, e)) … … 622 622 try: 623 623 trace = open("/dev/null", "w") 624 except IOError:624 except EnvironmentError: 625 625 raise service_error(service_error.internal, 626 626 "Cannot open /dev/null??"); … … 748 748 df, dotname = tempfile.mkstemp() 749 749 dotfile = os.fdopen(df, 'w') 750 except IOError:750 except EnvironmentError: 751 751 raise service_error(service_error.internal, 752 752 "Failed to open file in genviz") … … 754 754 try: 755 755 dnull = open('/dev/null', 'w') 756 except IOError:756 except EnvironmentError: 757 757 service_error(service_error.internal, 758 758 "Failed to open /dev/null in genviz") … … 773 773 raise service_error(service_error.internal, 774 774 "Single endpoint link in vtopo") 775 except IOError:775 except EnvironmentError: 776 776 raise service_error(service_error.internal, "Cannot write dot file") 777 777 … … 1454 1454 try: 1455 1455 os.makedirs(softdir) 1456 except IOError, e:1456 except EnvironmentError, e: 1457 1457 raise service_error( 1458 1458 "Cannot create software directory: %s" % e) … … 1520 1520 try: 1521 1521 tmpdir = tempfile.mkdtemp(prefix="split-") 1522 except IOError:1522 except EnvironmentError: 1523 1523 raise service_error(service_error.internal, "Cannot create tmp dir") 1524 1524 … … 1607 1607 tmpdir = tempfile.mkdtemp(prefix="split-") 1608 1608 os.mkdir(tmpdir+"/keys") 1609 except IOError:1609 except EnvironmentError: 1610 1610 raise service_error(service_error.internal, "Cannot create tmp dir") 1611 1611 … … 1635 1635 f.write(file_content) 1636 1636 f.close() 1637 except IOError:1637 except EnvironmentError: 1638 1638 raise service_error(service_error.internal, 1639 1639 "Cannot write temp experiment description") … … 1748 1748 f.write('\n'.join(hosts)) 1749 1749 f.close() 1750 except IOError, e:1750 except EnvironmentError, e: 1751 1751 raise service_error(service_error.internal, 1752 1752 "Cannot write hosts file: %s" % e) … … 1756 1756 copy_file("%s" % gw_secretkey, "%s/%s" % \ 1757 1757 (configdir, gw_secretkey_base)) 1758 except IOError, e:1758 except EnvironmentError, e: 1759 1759 raise service_error(service_error.internal, 1760 1760 "Cannot copy keyfiles: %s" % e) -
fedd/federation/fedid.py
rda2208a rd3c8759 170 170 else: 171 171 return (None, None) 172 except IOError, e:172 except EnvironmentError, e: 173 173 raise e 174 174 finally: -
fedd/federation/local_emulab_segment.py
rda2208a rd3c8759 42 42 try: 43 43 dnull = open("/dev/null", "w") 44 except IOError:44 except EnvironmentError: 45 45 self.log.debug("[cmd_with_timeout]: failed to open /dev/null " + \ 46 46 "for redirect") … … 107 107 try: 108 108 dev_null = open("/dev/null", "a") 109 except IOError, e:109 except EnvironmentError, e: 110 110 self.log.error("[get_state]: can't open /dev/null: %s" %e) 111 111 … … 149 149 try: 150 150 dev_null = open("/dev/null", "a") 151 except IOError, e:151 except EnvironmentError, e: 152 152 self.log.error("[get_state]: can't open /dev/null: %s" %e) 153 153 … … 225 225 print >>f, self.null 226 226 f.close() 227 except IOError, e:227 except EnvironmentError, e: 228 228 raise service_error(service_error.internal, 229 229 "Cannot stage null.tcl: %s" % e.strerror) … … 266 266 self.copy_file("%s/%s" % (lsoftdir, f), 267 267 "%s/%s" % (softdir, f)) 268 except IOError, e:268 except EnvironmentError, e: 269 269 self.log.error("Error copying file: %s" %e) 270 270 return False -
fedd/federation/ns2topdl.py
rda2208a rd3c8759 55 55 try: 56 56 read_simple_accessdb(access_db, self.auth, 'ns2topdl') 57 except IOError, e:57 except EnvironmentError, e: 58 58 raise service_error(service_error.internal, 59 59 "Error reading accessDB %s: %s" % (access_db, e)) … … 86 86 try: 87 87 tmpdir = tempfile.mkdtemp(prefix="ns2topdl-") 88 except IOError:88 except EnvironmentError: 89 89 raise service_error(service_error.internal, "Cannot create tmp dir") 90 90 … … 108 108 f.write(file_content) 109 109 f.close() 110 except IOError:110 except EnvironmentError: 111 111 raise service_error(service_error.internal, 112 112 "Cannot write temp experiment description") -
fedd/federation/protogeni_access.py
rda2208a rd3c8759 261 261 f = open(self.state_filename, 'w') 262 262 pickle.dump(self.state, f) 263 except IOError, e:263 except EnvironmentError, e: 264 264 self.log.error("Can't write file %s: %s" % \ 265 265 (self.state_filename, e)) … … 282 282 self.log.debug("[read_state]: Read state from %s" % \ 283 283 self.state_filename) 284 except IOError, e:284 except EnvironmentError, e: 285 285 self.log.warning(("[read_state]: No saved state: " +\ 286 286 "Can't open %s: %s") % (self.state_filename, e)) … … 437 437 cf = open(conffilename, "w") 438 438 os.chmod(conffilename, stat.S_IRUSR | stat.S_IWUSR) 439 except IOError, e:439 except EnvironmentError, e: 440 440 raise service_error(service_error.internal, 441 441 "Cannot create user configuration data") … … 443 443 try: 444 444 dev_null = open("/dev/null", "a") 445 except IOError, e:445 except EnvironmentError, e: 446 446 self.log.error("export_userconf: can't open /dev/null: %s" % e) 447 447 … … 596 596 print >>f, alloc_cert 597 597 f.close() 598 except IOError, e:598 except EnvironmentError, e: 599 599 raise service_error(service_error.internal, 600 600 "Can't open %s/%s : %s" % (self.certdir, aid, e)) … … 827 827 secretkey_base 828 828 f.close() 829 except IOError, e:829 except EnvironmentError, e: 830 830 raise service_error(service_error.internal, 831 831 "Can't write protal config %s: %s" % (cfn, e)) … … 841 841 print >>f, "ExperimentID: %s" % mexp 842 842 f.close() 843 except IOError, e:843 except EnvironmentError, e: 844 844 raise service_error(service_error.internal, 845 845 "Can't write seer.conf: %s" %e) … … 858 858 # print >>f, "ExperimentID: %s/%s" % (mproj, meid) 859 859 f.close() 860 except IOError, e:860 except EnvironmentError, e: 861 861 raise service_error(service_error.internal, 862 862 "Cannot write client.conf: %s" %s) … … 971 971 tmpdir = tempfile.mkdtemp(prefix="access-") 972 972 softdir = "%s/software" % tmpdir 973 except IOError:973 except EnvironmentError: 974 974 raise service_error(service_error.internal, "Cannot create tmp dir") 975 975 … … 1044 1044 tf.close() 1045 1045 get_url(u, tn, tmpdir, "userconf") 1046 except IOError, e:1046 except EnvironmentError, e: 1047 1047 raise service_error(service.error.internal, 1048 1048 "Cannot create temp file for " + -
fedd/federation/proxy_emulab_segment.py
rda2208a rd3c8759 45 45 try: 46 46 dev_null = open("/dev/null", "a") 47 except IOError, e:47 except EnvironmentError, e: 48 48 self.log.error("[get_state]: can't open /dev/null: %s" %e) 49 49 … … 92 92 try: 93 93 dev_null = open("/dev/null", "a") 94 except IOError, e:94 except EnvironmentError, e: 95 95 self.log.error("[get_mapping]: can't open /dev/null: %s" %e) 96 96 … … 172 172 print >>f, self.null 173 173 f.close() 174 except IOError, e:174 except EnvironmentError, e: 175 175 raise service_error(service_error.internal, 176 176 "Cannot stage tarfile/rpm: %s" % e.strerror) … … 200 200 sf, scriptname = tempfile.mkstemp() 201 201 scriptfile = os.fdopen(sf, 'w') 202 except IOError:202 except EnvironmentError: 203 203 return False 204 204 -
fedd/federation/proxy_protogeni_segment.py
rda2208a rd3c8759 262 262 secretkey_base 263 263 f.close() 264 except IOError, e:264 except EnvironmentError, e: 265 265 raise service_error(service_error.internal, 266 266 "Can't write protal config %s: %s" % (cfn, e)) … … 280 280 print >>f, "SEERBase: True" 281 281 f.close() 282 except IOError, e:282 except EnvironmentError, e: 283 283 raise service_error(service_error.internal, 284 284 "Cannot write client.conf: %s" %s) … … 499 499 sf, scriptname = tempfile.mkstemp() 500 500 scriptfile = os.fdopen(sf, 'w') 501 except IOError:501 except EnvironmentError: 502 502 return False 503 503 -
fedd/federation/proxy_segment.py
rda2208a rd3c8759 38 38 try: 39 39 dnull = open("/dev/null", "w") 40 except IOError:40 except EnvironmentError: 41 41 self.log.debug("[ssh_file]: failed to open " + \ 42 42 "/dev/null for redirect") … … 64 64 try: 65 65 dnull = open("/dev/null", "w") 66 except IOError:66 except EnvironmentError: 67 67 self.log.debug("[ssh_cmd]: failed to open /dev/null " + \ 68 68 "for redirect") -
fedd/federation/server.py
rda2208a rd3c8759 145 145 f = open(fname, "rb") 146 146 size = os.path.getsize(fname) 147 except IOError, e:147 except EnvironmentError, e: 148 148 code = 404 149 149 size = 0 -
fedd/federation/util.py
rda2208a rd3c8759 165 165 def copy_file(src, dest, size=1024): 166 166 """ 167 Exceedingly simple file copy. Throws an IOError if there's a problem.167 Exceedingly simple file copy. Throws an EnvironmentError if there's a problem. 168 168 """ 169 169 s = open(src,'r') … … 203 203 lf.close() 204 204 ok = True 205 except IOError, e:205 except EnvironmentError, e: 206 206 failed_excpetion = e 207 207 retries += 1
Note: See TracChangeset
for help on using the changeset viewer.