VirtualBox

Ignore:
Timestamp:
Sep 2, 2022 9:59:17 AM (2 years ago)
Author:
vboxsync
Message:

Validation Kit/testmanager/batch: Added a safe variant for replacing files in maintain_archived_testsets.py [pylint]. bugref:8733

File:
1 edited

Legend:

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

    r96575 r96576  
    107107        """
    108108
     109        fRc = True;
     110
    109111        # Rename the destination file first (if any).
    110112        sDstFileTmp = None;
     
    114116                if not fForce:
    115117                    print('Replace file: Warning: Temporary destination file "%s" already exists, skipping' % (sDstFileTmp,));
    116                     return False;
     118                    fRc = False;
    117119                else:
    118120                    try:
     
    120122                    except Exception as e:
    121123                        print('Replace file: Error deleting old temporary destination file "%s": %s' % (sDstFileTmp, e));
    122                         return False;
     124                        fRc = False;
    123125            try:
    124126                if not fDryRun:
     
    127129                print('Replace file: Error moving old destination file "%s" to temporary file "%s": %s' \
    128130                      % (sDstFile, sDstFileTmp, e));
    129                 return False;
    130 
    131         fRc = True;
     131                fRc = False;
     132
     133        if not fRc:
     134            return False;
    132135
    133136        try:
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