""" Get component information using OpenStack Neutron API clients """

import logging

log = logging.getLogger("zen.OpenStackModelerPluginNeutron")

import json
import os
import re

from twisted.internet.defer import inlineCallbacks, returnValue

from ZenPacks.zenoss.OpenStackInfrastructure.utils import add_local_lib_path, zenpack_path

add_local_lib_path()

from apiclients.neutronapiclient import NeutronAPIClient


class OpenStackInfrastructureNeutron:
    def __init__(self, username=None, password=None, auth_url=None, project_id=None, region_name=None):

        self.username = username
        self.password = password
        self.auth_url = auth_url
        self.project_id = project_id
        self.region_name = region_name

    @inlineCallbacks
    def collect(self):
from twisted.internet.defer import inlineCallbacks

from zope.component import adapts
from zope.interface import implements

from Products.DataCollector.plugins.DataMaps import ObjectMap
from Products.ZenEvents import ZenEventClasses
from Products.ZenUtils.Utils import prepId

from ZenPacks.zenoss.PythonCollector.datasources.PythonDataSource import (
    PythonDataSource, PythonDataSourcePlugin, PythonDataSourceInfo,
    IPythonDataSourceInfo)

from ZenPacks.zenoss.OpenStackInfrastructure.apiclients.exceptions import APIClientError
from ZenPacks.zenoss.OpenStackInfrastructure.utils import result_errmsg, add_local_lib_path
add_local_lib_path()

from apiclients.txapiclient import NeutronClient


class NeutronAgentStatusDataSource(PythonDataSource):
    '''
    Datasource used to check the status of Neutron Agents via the neutron API
    '''

    ZENPACKID = 'ZenPacks.zenoss.OpenStackInfrastructure.'

    sourcetypes = ('OpenStack Neutron Agent Status', )
    sourcetype = sourcetypes[0]

    # RRDDataSource