Changeset 96567 in vbox for trunk/src/VBox/ValidationKit/testmanager
- Timestamp:
- Sep 1, 2022 3:39:51 PM (2 years ago)
- svn:sync-xref-src-repo-rev:
- 153442
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/ValidationKit/testmanager/batch/maintain_archived_testsets.py
r96566 r96567 60 60 from common import utils; 61 61 from testmanager import config; 62 from testmanager.core.db import TMDatabaseConnection;63 from testmanager.core.testset import TestSetData, TestSetLogic;64 65 62 66 63 … … 82 79 self.sTempDir = oOptions.sTempDir; 83 80 if not self.sTempDir: 84 self.sTempDir = '/tmp'; ## @todo Make this more flexible.81 self.sTempDir = tempfile.gettempdir(); 85 82 #self.oTestSetLogic = TestSetLogic(TMDatabaseConnection(self.dprint if self.fVerbose else None)); 86 83 #self.oTestSetLogic = TestSetLogic(TMDatabaseConnection(None)); … … 109 106 """ 110 107 108 _ = idTestSet 109 111 110 sSrcZipFileAbs = os.path.join(sCurDir, sFile); 112 111 print('Processing ZIP archive "%s" ...' % (sSrcZipFileAbs)); 113 112 114 sDstZipFileAbs = os.path.join(self.sTempDir, next(tempfile._get_candidate_names()) + ".zip"); 113 with tempfile.NamedTemporaryFile(dir=self.sTempDir, delete=False) as tmpfile: 114 sDstZipFileAbs = tmpfile.name 115 115 self.dprint('Using temporary ZIP archive "%s"' % (sDstZipFileAbs)); 116 116 … … 190 190 return (None, 'Error opening "%s": %s' % (sSrcZipFileAbs, oXcpt1), None); 191 191 if not os.path.exists(sFile): 192 return (None, 'File "%s" not found. [%s , %s]' % (sSrcZipFileAbs, sFile), None);192 return (None, 'File "%s" not found. [%s]' % (sSrcZipFileAbs, sFile), None); 193 193 return (None, 'Error opening "%s" inside "%s": %s' % (sSrcZipFileAbs, sFile, oXcpt1), None); 194 194 except Exception as oXcpt2:
Note:
See TracChangeset
for help on using the changeset viewer.