# Path: neutron_taas/common/constants.py
# TAAS = 'TAAS'
# VLAN_RANGE = '0-4095'
# 
# Path: neutron_taas/common/utils.py
# def get_list_from_ranges_str(ranges_str):
# def get_ranges_str_from_list(ranges):
# 
# Path: neutron_taas/services/taas/agents/extensions/taas.py
# LOG = logging.getLogger(__name__)
# OPTS = [
#     cfg.IntOpt(
#         'taas_agent_periodic_interval',
#         default=5,
#         help=_('Seconds between periodic task runs')
#     )
# ]
# class TaasAgentDriver(object):
# class TaasAgentExtension(l2_extension.L2AgentExtension):
#     def initialize(self):
#     def consume_api(self, agent_api):
#     def create_tap_service(self, tap_service):
#     def create_tap_flow(self, tap_flow):
#     def delete_tap_service(self, tap_service):
#     def delete_tap_flow(self, tap_flow):
#     def initialize(self, connection, driver_type):
#     def consume_api(self, agent_api):
#     def handle_port(self, context, port):
#     def delete_port(self, context, port):
# 
# Path: neutron_taas/services/taas/drivers/linux/sriov_nic_exceptions.py
# class SriovNicSwitchDriverInvocationError(qexception.Invalid):
# class PciDeviceNotFoundById(qexception.NotFound):
# class PciSlotNotFound(qexception.NotFound):
# 
# Path: neutron_taas/services/taas/drivers/linux/sriov_nic_utils.py
# LOG = logging.getLogger(__name__)
#         VIRTFN_RE = re.compile(r"virtfn(\d+)")
# class SriovNicUtils(object):
#     def __init__(self):
#     def execute_sysfs_command(self, command, ts_port_params,
#                               src_port_params,
#                               common_vlans_ranges_str,
#                               vf_to_vf_all_vlans, direction):
#     def _get_sysfs_netdev_path(self, pci_addr, pf_interface):
#     def get_ifname_by_pci_address(self, pci_addr, pf_interface=False):
#     def get_mac_by_pci_address(self, pci_addr, pf_interface=False):
#     def get_vf_num_by_pci_address(self, pci_addr):
#     def get_net_name_by_vf_pci_address(self, vfaddress, pf_interface=False):
#     def get_sriov_port_params(self, sriov_port):


from neutron.conf.agent import common
from neutron_taas.common import constants as taas_consts
from neutron_taas.common import utils as common_utils
from neutron_taas.services.taas.agents.extensions import taas as taas_base
from neutron_taas.services.taas.drivers.linux import sriov_nic_exceptions \
    as taas_exc
from neutron_taas.services.taas.drivers.linux import sriov_nic_utils \
    as sriov_utils
from oslo_config import cfg
from oslo_log import log as logging
from oslo_utils import excutils
import threading
                                                           src_port_params,
                                                           taas_consts.
                                                           VLAN_RANGE,
                                                           False,
                                                           'BOTH')
                except Exception:
                    LOG.error("TaaS error in invoking execute_sysfs_command")
                    with excutils.save_and_reraise_exception():
                        raise taas_exc.SriovNicSwitchDriverInvocationError(
                            ts_pf_dev=ts_port_params['pf_device'],
                            ts_vf_index=ts_port_params['vf_index'],
                            source_vf_index=src_port_params['vf_index'],
                            common_vlans_rng_str=taas_consts.VLAN_RANGE,
                            vf_to_vf_all_vlans=vf_to_vf_all_vlans,
                            direction=direction)

                if common_vlans_rng_str:
                    try:
                        LOG.info("TaaS invoking execute_sysfs_command")
                        self.sriov_utils.execute_sysfs_command(
                            'add',
                            ts_port_params,
                            src_port_params,
                            common_vlans_rng_str,
                            False,
                            'BOTH')
                    except Exception:
                        LOG.error("TaaS error in invoking "
                                  "execute_sysfs_command")
                        with excutils.save_and_reraise_exception():

# Path: neutron_taas/common/constants.py
# TAAS = 'TAAS'
# VLAN_RANGE = '0-4095'
# 
# Path: neutron_taas/common/utils.py
# def get_list_from_ranges_str(ranges_str):
# def get_ranges_str_from_list(ranges):
# 
# Path: neutron_taas/services/taas/agents/extensions/taas.py
# LOG = logging.getLogger(__name__)
# OPTS = [
#     cfg.IntOpt(
#         'taas_agent_periodic_interval',
#         default=5,
#         help=_('Seconds between periodic task runs')
#     )
# ]
# class TaasAgentDriver(object):
# class TaasAgentExtension(l2_extension.L2AgentExtension):
#     def initialize(self):
#     def consume_api(self, agent_api):
#     def create_tap_service(self, tap_service):
#     def create_tap_flow(self, tap_flow):
#     def delete_tap_service(self, tap_service):
#     def delete_tap_flow(self, tap_flow):
#     def initialize(self, connection, driver_type):
#     def consume_api(self, agent_api):
#     def handle_port(self, context, port):
#     def delete_port(self, context, port):
# 
# Path: neutron_taas/services/taas/drivers/linux/sriov_nic_exceptions.py
# class SriovNicSwitchDriverInvocationError(qexception.Invalid):
# class PciDeviceNotFoundById(qexception.NotFound):
# class PciSlotNotFound(qexception.NotFound):
# 
# Path: neutron_taas/services/taas/drivers/linux/sriov_nic_utils.py
# LOG = logging.getLogger(__name__)
#         VIRTFN_RE = re.compile(r"virtfn(\d+)")
# class SriovNicUtils(object):
#     def __init__(self):
#     def execute_sysfs_command(self, command, ts_port_params,
#                               src_port_params,
#                               common_vlans_ranges_str,
#                               vf_to_vf_all_vlans, direction):
#     def _get_sysfs_netdev_path(self, pci_addr, pf_interface):
#     def get_ifname_by_pci_address(self, pci_addr, pf_interface=False):
#     def get_mac_by_pci_address(self, pci_addr, pf_interface=False):
#     def get_vf_num_by_pci_address(self, pci_addr):
#     def get_net_name_by_vf_pci_address(self, vfaddress, pf_interface=False):
#     def get_sriov_port_params(self, sriov_port):


# Path: neutron_taas/services/taas/drivers/linux/sriov_nic_taas.py
from neutron.conf.agent import common
from neutron_taas.common import constants as taas_consts
from neutron_taas.common import utils as common_utils
from neutron_taas.services.taas.agents.extensions import taas as taas_base
from neutron_taas.services.taas.drivers.linux import sriov_nic_exceptions \
    as taas_exc
from neutron_taas.services.taas.drivers.linux import sriov_nic_utils \
    as sriov_utils
from oslo_config import cfg
from oslo_log import log as logging
from oslo_utils import excutils
import threading

                                                           src_port_params,
                                                           taas_consts.
                                                           VLAN_RANGE,
                                                           False,
                                                           'BOTH')
                except Exception:
                    LOG.error("TaaS error in invoking execute_sysfs_command")
                    with excutils.save_and_reraise_exception():
                        raise taas_exc.SriovNicSwitchDriverInvocationError(
                            ts_pf_dev=ts_port_params['pf_device'],
                            ts_vf_index=ts_port_params['vf_index'],
                            source_vf_index=src_port_params['vf_index'],
                            common_vlans_rng_str=taas_consts.VLAN_RANGE,
                            vf_to_vf_all_vlans=vf_to_vf_all_vlans,
                            direction=direction)

                if common_vlans_rng_str:
                    try:
                        LOG.info("TaaS invoking execute_sysfs_command")
                        self.sriov_utils.execute_sysfs_command(
                            'add',
                            ts_port_params,
                            src_port_params,
                            common_vlans_rng_str,
                            False,
                            'BOTH')
                    except Exception:
                        LOG.error("TaaS error in invoking "
                                  "execute_sysfs_command")
                        with excutils.save_and_reraise_exception():

                            raise taas_exc.SriovNicSwitchDriverInvocationError(