def destroy(self):
    if (not TrafficClass.tc_ops):
        LOG.info('TC not initialized, skip destroying existing qos classes')
        return
    LOG.info('destroying existing leaf qos classes')
    p_qids = set()
    for intf in [self._uplink, self._downlink]:
        qid_list = TrafficClass.read_all_classes(intf)
        for qid_tuple in qid_list:
            (qid, pqid) = qid_tuple
            if (self._start_idx <= qid < (self._max_idx - 1)):
                LOG.info('Attempting to delete class idx %d', qid)
                TrafficClass.delete_class(intf, qid)
            if (self._start_idx <= pqid < (self._max_idx - 1)):
                p_qids.add((intf, pqid))
    LOG.info('destroying existing parent classes')
    for p_qid_tuple in p_qids:
        (intf, pqid) = p_qid_tuple
        LOG.info('Attempting to delete parent class idx %d', pqid)
        TrafficClass.delete_class(intf, pqid, skip_filter=True)
    LOG.info('destroying All qos classes: done')
def destroy(self):
    if (not TrafficClass.tc_ops):
        LOG.info('TC not initialized, skip destroying existing qos classes')
        return
    LOG.info('destroying existing leaf qos classes')
    p_qids = set()
    for intf in [self._uplink, self._downlink]:
        qid_list = TrafficClass.read_all_classes(intf)
        for qid_tuple in qid_list:
            (qid, pqid) = qid_tuple
            if (self._start_idx <= qid < (self._max_idx - 1)):
                LOG.info('Attempting to delete class idx %d', qid)
                TrafficClass.delete_class(intf, qid)
            if (self._start_idx <= pqid < (self._max_idx - 1)):
                p_qids.add((intf, pqid))
    LOG.info('destroying existing parent classes')
    for p_qid_tuple in p_qids:
        (intf, pqid) = p_qid_tuple
        LOG.info('Attempting to delete parent class idx %d', pqid)
        TrafficClass.delete_class(intf, pqid, skip_filter=True)
    LOG.info('destroying All qos classes: done')