VirtualBox

Ignore:
Timestamp:
Oct 12, 2022 4:52:24 PM (2 years ago)
Author:
vboxsync
Message:

Validation Kit/partial-db-dump.py: Bail out when loading a ZIP dump file failed.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/ValidationKit/testmanager/db/partial-db-dump.py

    r97120 r97121  
    263263        """ Does the loading of the dumped data into the database. """
    264264
    265         oZipFile = zipfile.ZipFile(self.oConfig.sFilename, 'r');
     265        try:
     266            oZipFile = zipfile.ZipFile(self.oConfig.sFilename, 'r');
     267        except:
     268            print('error: Dump file "%s" cannot be opened! Use "-f <file>" to specify a file.' % (self.oConfig.sFilename,));
     269            return 1;
    266270
    267271        asTablesInLoadOrder = [
     
    310314                print('error: Table %s has %u rows which is more than %u - refusing to delete and load.'
    311315                      % (sTable, cRows, cMaxRows,));
    312                 print('info:  Please drop and recreate the database before loading!')
     316                print('info:  Please drop and recreate the database before loading!');
    313317                return 1;
    314318
     
    387391if __name__ == '__main__':
    388392    sys.exit(PartialDbDump().main());
    389 
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