VirtualBox

Changeset 92980 in vbox


Ignore:
Timestamp:
Dec 16, 2021 12:47:18 PM (3 years ago)
Author:
vboxsync
Message:

Validation Kit/testdriver: Handle error cases in addTestMachine() where either the API has not been initialized yet or the VM has not been found.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/ValidationKit/testdriver/vbox.py

    r92978 r92980  
    26212621        Adds an already existing (that is, configured) test VM to the
    26222622        test VM list.
     2623
     2624        Returns the VM object on success, None if failed.
    26232625        """
    26242626        # find + add the VM to the list.
     2627        oVM = None;
    26252628        try:
    26262629            if self.fpApiVer >= 4.0:
     
    26302633        except:
    26312634            reporter.errorXcpt('could not find vm "%s"' % (sNameOrId,));
    2632             return None;
    2633 
    2634         self.aoVMs.append(oVM);
    2635         if not fQuiet:
    2636             reporter.log('Added "%s" with name "%s"' % (oVM.id, sNameOrId));
    2637             self.logVmInfo(oVM);
     2635
     2636        if oVM:
     2637            self.aoVMs.append(oVM);
     2638            if not fQuiet:
     2639                reporter.log('Added "%s" with name "%s"' % (oVM.id, sNameOrId));
     2640                self.logVmInfo(oVM);
    26382641        return oVM;
    26392642
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