Changeset 70508 in vbox for trunk/src/VBox/ValidationKit
- Timestamp:
- Jan 10, 2018 11:21:09 AM (7 years ago)
- Location:
- trunk/src/VBox/ValidationKit/testdriver
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/ValidationKit/testdriver/base.py
r69571 r70508 1080 1080 self.aoTasks[0].waitForTask(cMsTimeout); 1081 1081 return True; 1082 except Exception ,oXcpt:1082 except Exception as oXcpt: 1083 1083 reporter.log("waitForTasksSleepWorker: %s" % (str(oXcpt),)); 1084 1084 return False; … … 1444 1444 oFile = utils.openNoInherit(sFull, "rb"); 1445 1445 oFile.close(); 1446 except Exception ,oXcpt:1446 except Exception as oXcpt: 1447 1447 reporter.error('The file resource "%s" cannot be accessed: %s' % (sFull, oXcpt)); 1448 1448 return False; … … 1614 1614 raise InvalidOption('unknown option: %s' % (asArgs[iArg])) 1615 1615 iArg = iNext; 1616 except QuietInvalidOption ,oXcpt:1616 except QuietInvalidOption as oXcpt: 1617 1617 return rtexitcode.RTEXITCODE_SYNTAX; 1618 except InvalidOption ,oXcpt:1618 except InvalidOption as oXcpt: 1619 1619 reporter.error(oXcpt.str()); 1620 1620 return rtexitcode.RTEXITCODE_SYNTAX; -
trunk/src/VBox/ValidationKit/testdriver/reporter.py
r69444 r70508 432 432 """Ends and completes the log files.""" 433 433 try: sTsIso = self.fnGetIsoTimestamp(); 434 except Exception ,oXcpt:434 except Exception as oXcpt: 435 435 sTsIso = str(oXcpt); 436 436 … … 522 522 try: 523 523 oDstFile = utils.openNoInherit(sDstFilename, 'w'); 524 except Exception ,oXcpt:524 except Exception as oXcpt: 525 525 self.log(0, 'error opening %s: %s' % (sDstFilename, oXcpt), sCaller, sTsPrf); 526 526 else: … … 528 528 try: 529 529 abBuf = oSrcFile.read(65536); 530 except Exception ,oXcpt:530 except Exception as oXcpt: 531 531 fRc = False; 532 532 self.log(0, 'error reading %s: %s' % (sSrcFilename, oXcpt), sCaller, sTsPrf); … … 534 534 try: 535 535 oDstFile.write(abBuf); 536 except Exception ,oXcpt:536 except Exception as oXcpt: 537 537 fRc = False; 538 538 self.log(0, 'error writing %s: %s' % (sDstFilename, oXcpt), sCaller, sTsPrf); … … 562 562 try: 563 563 oDstFile = utils.openNoInherit(sDstFilename, 'w'); 564 except Exception ,oXcpt:564 except Exception as oXcpt: 565 565 self.log(0, 'error opening %s: %s' % (sDstFilename, oXcpt), sCaller, sTsPrf); 566 566 else: 567 567 try: 568 568 oDstFile.write(sLog); 569 except Exception ,oXcpt:569 except Exception as oXcpt: 570 570 fRc = False; 571 571 self.log(0, 'error writing %s: %s' % (sDstFilename, oXcpt), sCaller, sTsPrf); … … 719 719 try: 720 720 sRspBody = oResponse.read(); 721 except httplib.IncompleteRead ,oXcpt:721 except httplib.IncompleteRead as oXcpt: 722 722 self._writeOutput('%s: %s: Warning: httplib.IncompleteRead: %s [expected %s, got %s]' 723 723 % (utils.getTimePrefix(), sOperation, oXcpt, oXcpt.expected, len(oXcpt.partial),)); … … 861 861 self._writeOutput('_xmlDoFlush: Failed - we should abort the test, really.'); 862 862 return (None, True); 863 except Exception ,oXcpt:863 except Exception as oXcpt: 864 864 if not fDtor: 865 865 logXcpt('warning: exception during XML_RESULTS request'); … … 1423 1423 try: 1424 1424 oSrcFile = utils.openNoInherit(sFilename, 'rb'); 1425 except IOError ,oXcpt:1425 except IOError as oXcpt: 1426 1426 if oXcpt.errno != errno.ENOENT: 1427 1427 logXcpt('addLogFile(%s,%s,%s)' % (sFilename, sDescription, sKind)); … … 1624 1624 try: 1625 1625 oSrcFile = utils.openNoInherit(sFilename, 'r'); 1626 except IOError ,oXcpt:1626 except IOError as oXcpt: 1627 1627 if oXcpt.errno != errno.ENOENT: 1628 1628 logXcpt('addSubXmlFile(%s)' % (sFilename,)); -
trunk/src/VBox/ValidationKit/testdriver/txsclient.py
r69111 r70508 1773 1773 try: 1774 1774 (oClientSocket, tClientAddr) = oSocket.accept(); 1775 except socket.error ,e:1775 except socket.error as e: 1776 1776 if not self.__isInProgressXcpt(e): 1777 1777 raise; … … 1781 1781 try: 1782 1782 select.select([oSocket, oWakeupR], [], [oSocket, oWakeupR], cMsTimeout / 1000.0); 1783 except socket.error ,e:1783 except socket.error as e: 1784 1784 if e[0] != errno.EBADF or not self.fConnectCanceled: 1785 1785 raise; … … 1792 1792 try: 1793 1793 (oClientSocket, tClientAddr) = oSocket.accept(); 1794 except socket.error ,e:1794 except socket.error as e: 1795 1795 if not self.__isInProgressXcpt(e): 1796 1796 if e[0] != errno.EBADF or not self.fConnectCanceled: … … 1825 1825 oSocket.connect((self.sHostname, self.uPort)); 1826 1826 rc = True; 1827 except socket.error ,e:1827 except socket.error as e: 1828 1828 iRc = e[0]; 1829 1829 if self.__isInProgressXcpt(e): … … 1836 1836 iRc = oSocket.getsockopt(socket.SOL_SOCKET, socket.SO_ERROR); 1837 1837 rc = iRc == 0; 1838 except socket.error ,e:1838 except socket.error as e: 1839 1839 iRc = e[0]; 1840 1840 except: … … 1956 1956 if cbSent == len(abBuf): 1957 1957 return True; 1958 except Exception ,oXcpt:1958 except Exception as oXcpt: 1959 1959 if not self.__isWouldBlockXcpt(oXcpt): 1960 1960 reporter.errorXcpt('TranportTcp.sendBytes: %s bytes' % (len(abBuf))); … … 1988 1988 if cbSent == len(abBuf): 1989 1989 return True; 1990 except Exception ,oXcpt:1990 except Exception as oXcpt: 1991 1991 if not self.__isWouldBlockXcpt(oXcpt): 1992 1992 reporter.errorXcpt('TranportTcp.sendBytes: %s bytes' % (len(abBuf))); … … 2013 2013 if abBuf: 2014 2014 self.abReadAhead.extend(array.array('B', abBuf)); 2015 except Exception ,oXcpt:2015 except Exception as oXcpt: 2016 2016 if not self.__isWouldBlockXcpt(oXcpt): 2017 2017 reporter.errorXcpt('TranportTcp.recvBytes: 0/%s bytes' % (cb,)); … … 2056 2056 self.abReadAhead.extend(array.array('B', abBuf)); 2057 2057 2058 except Exception ,oXcpt:2058 except Exception as oXcpt: 2059 2059 reporter.log('recv => exception %s' % (oXcpt,)); 2060 2060 if not self.__isWouldBlockXcpt(oXcpt): -
trunk/src/VBox/ValidationKit/testdriver/vbox.py
r70504 r70508 561 561 oSrcParent.registerCallback(oRet); 562 562 return oRet; 563 except Exception ,oXcpt:563 except Exception as oXcpt: 564 564 if fMustSucceed or ComError.notEqual(oXcpt, ComError.E_UNEXPECTED): 565 565 reporter.errorXcpt('%s::registerCallback(%s)%s' % (sSrcParentNm, oRet, sLogSuffix)); … … 580 580 try: 581 581 oEventSrc.registerListener(oListener, [vboxcon.VBoxEventType_Any], not fPassive); 582 except Exception ,oXcpt:582 except Exception as oXcpt: 583 583 if fMustSucceed or ComError.notEqual(oXcpt, ComError.E_UNEXPECTED): 584 584 reporter.errorXcpt('%s::eventSource.registerListener(%s) failed%s' \ … … 2456 2456 else: 2457 2457 iCurPid = iOrgPid = oVM.sessionPid; 2458 except Exception ,oXcpt:2458 except Exception as oXcpt: 2459 2459 if ComError.notEqual(oXcpt, ComError.E_ACCESSDENIED): 2460 2460 reporter.logXcpt(); … … 2476 2476 sCurName = oVM.sessionName if self.fpApiVer >= 5.0 else oVM.sessionType; 2477 2477 iCurPid = oVM.sessionPID if self.fpApiVer >= 4.2 else oVM.sessionPid; 2478 except Exception ,oXcpt:2478 except Exception as oXcpt: 2479 2479 if ComError.notEqual(oXcpt, ComError.E_ACCESSDENIED): 2480 2480 reporter.logXcpt(); -
trunk/src/VBox/ValidationKit/testdriver/vboxwrappers.py
r70490 r70508 610 610 try: 611 611 eState = self.o.machine.state; 612 except Exception ,oXcpt:612 except Exception as oXcpt: 613 613 if vbox.ComError.notEqual(oXcpt, vbox.ComError.E_UNEXPECTED): 614 614 reporter.logXcpt(); … … 745 745 try: 746 746 eState = self.o.machine.state; 747 except Exception ,oXcpt:747 except Exception as oXcpt: 748 748 if vbox.ComError.notEqual(oXcpt, vbox.ComError.E_UNEXPECTED): 749 749 reporter.logXcpt(); … … 1761 1761 else: 1762 1762 oImage = self.oVBox.openDVDImage(sFullName, ""); 1763 except vbox.ComException ,oXcpt:1763 except vbox.ComException as oXcpt: 1764 1764 if oXcpt.errno != -1: 1765 1765 reporter.errorXcpt('failed to open DVD image "%s" xxx' % (sFullName)); … … 2680 2680 if uPid != os.getpid() and uPid != 0xffffffff: 2681 2681 self.uPid = uPid; 2682 except Exception ,oXcpt:2682 except Exception as oXcpt: 2683 2683 if vbox.ComError.equal(oXcpt, vbox.ComError.E_UNEXPECTED): 2684 2684 try: … … 2751 2751 try: 2752 2752 oConsole = self.o.console; 2753 except Exception ,oXcpt:2753 except Exception as oXcpt: 2754 2754 if fMustSucceed or vbox.ComError.notEqual(oXcpt, vbox.ComError.E_UNEXPECTED): 2755 2755 reporter.errorXcpt('Failed to get ISession::console for "%s"' % (self.sName, ));
Note:
See TracChangeset
for help on using the changeset viewer.