VirtualBox

Changeset 83418 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Mar 25, 2020 4:39:08 PM (5 years ago)
Author:
vboxsync
Message:

TestManager/webui: The partial DB dump needs a user unique temporary file too.

Location:
trunk/src/VBox/ValidationKit/testmanager
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/ValidationKit/testmanager/config.py

    r83415 r83418  
    9090## File on the build binary share that can be used to check that it's mounted.
    9191g_ksBuildBinRootFile    = 'builds.txt'
    92 ## Template for paratial database dump files.  One argument: UID
    93 g_ksTmDbDumpFileTemplate = '/var/tmp/tm-partial-db-dump-for-%u.zip'
     92## Template for paratial database dump output files.  One argument: UID
     93g_ksTmDbDumpOutFileTmpl = '/var/tmp/tm-partial-db-dump-for-%u.zip'
     94## Template for paratial database dump temporary files.  One argument: UID
     95g_ksTmDbDumpTmpFileTmpl = '/var/tmp/tm-partial-db-dump-for-%u.pgtxt'
    9496## @}
    9597
  • trunk/src/VBox/ValidationKit/testmanager/webui/wuiadmin.py

    r83415 r83418  
    483483        oFile    = None;
    484484        oNow     = datetime.datetime.utcnow();
    485         sTmpFile = config.g_ksTmDbDumpFileTemplate % (self._oCurUser.uid,);
     485        sOutFile = config.g_ksTmDbDumpOutFileTmpl % (self._oCurUser.uid,);
     486        sTmpFile = config.g_ksTmDbDumpTmpFileTmpl % (self._oCurUser.uid,);
    486487        sScript  = os.path.join(config.g_ksTestManagerDir, 'db', 'partial-db-dump.py');
    487488        try:
    488             (iExitCode, sStdOut, sStdErr) = utils.processOutputUnchecked([sScript, '--days-to-dump', str(cDaysBack),
    489                                                                           '-f', sTmpFile,]);
     489            (iExitCode, sStdOut, sStdErr) = utils.processOutputUnchecked([ sScript,
     490                                                                           '--days-to-dump', str(cDaysBack),
     491                                                                           '-f', sOutFile,
     492                                                                           '-t', sTmpFile,
     493                                                                           ]);
    490494            if iExitCode != 0:
    491495                raise Exception('iExitCode=%s\n--- stderr ---\n%s\n--- stdout ---\n%s' % (iExitCode, sStdOut, sStdErr,));
     
    494498            # Open and send the dump.
    495499            #
    496             oFile = open(sTmpFile, 'rb');
     500            oFile = open(sOutFile, 'rb');
    497501            cbFile = os.fstat(oFile.fileno()).st_size;
    498502
     
    513517                try:    oFile.close();
    514518                except: pass;
     519            utils.noxcptDeleteFile(sOutFile);
    515520            utils.noxcptDeleteFile(sTmpFile);
    516521        return self.ksDispatchRcAllDone;
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette