VirtualBox

Changeset 61593 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Jun 8, 2016 8:14:11 PM (9 years ago)
Author:
vboxsync
Message:

testmanager: attempt to fix broken testbox list actions. unfortuantely, the scheduling group migration had to go since it's now ambigious wrt multiple scheduling group participation of testboxes.

File:
1 edited

Legend:

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

    r61592 r61593  
    771771        if len(dDataErrors) > 0:
    772772            raise TMInvalidData('TestBoxLogic.addEntry: %s' % (dDataErrors,));
    773         if len(oData.aoInSchedGroups):
    774             sSchedGrps = ', '.join('(%s)' % oCur.idSchedGroup for oCur in oData.aoInSchedGroups);
    775             self._oDb.execute('SELECT   SchedGroupIDs.idSchedGroup\n'
    776                               'FROM     (VALUES ' + sSchedGrps + ' ) AS SchedGroupIDs(idSchedGroup)\n'
    777                               '         LEFT OUTER JOIN SchedGroups\n'
    778                               '                      ON     SchedGroupIDs.idSchedGroup = SchedGroups.idSchedGroup\n'
    779                               '                         AND SchedGroups.tsExpire = \'infinity\'::TIMESTAMP\n'
    780                               'WHERE    SchedGroups.idSchedGroup IS NULL\n');
    781             aaoRows = self._oDb.fetchAll();
    782             if len(aaoRows) > 0:
    783                 raise TMInvalidData('TestBoxLogic.addEntry missing scheduling groups: %s'
    784                                     % (', '.join(str(aoRow[0]) for aoRow in aaoRows),));
     773        if isinstance(oData, TestBoxDataEx):
     774            if len(oData.aoInSchedGroups):
     775                sSchedGrps = ', '.join('(%s)' % oCur.idSchedGroup for oCur in oData.aoInSchedGroups);
     776                self._oDb.execute('SELECT   SchedGroupIDs.idSchedGroup\n'
     777                                  'FROM     (VALUES ' + sSchedGrps + ' ) AS SchedGroupIDs(idSchedGroup)\n'
     778                                  '         LEFT OUTER JOIN SchedGroups\n'
     779                                  '                      ON     SchedGroupIDs.idSchedGroup = SchedGroups.idSchedGroup\n'
     780                                  '                         AND SchedGroups.tsExpire = \'infinity\'::TIMESTAMP\n'
     781                                  'WHERE    SchedGroups.idSchedGroup IS NULL\n');
     782                aaoRows = self._oDb.fetchAll();
     783                if len(aaoRows) > 0:
     784                    raise TMInvalidData('TestBoxLogic.addEntry missing scheduling groups: %s'
     785                                        % (', '.join(str(aoRow[0]) for aoRow in aaoRows),));
    785786        return None;
    786787
     
    827828        Data edit update, web UI is the primary user.
    828829
    829         oData is either TestBoxDataEx or TestBoxData.
     830        oData is either TestBoxDataEx or TestBoxData.  The latter is for enabling
    830831        Returns the new generation ID and effective date.
    831832        """
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