from airflow import DAG
from airflow.decorators import task
-from osm_mon.core.common_db import CommonDbClient
-from osm_mon.core.config import Config
-from osm_mon.sdnc_connectors.onos import OnosInfraCollector
+from osm_ngsa.osm_mon.core.common_db import CommonDbClient
+from osm_ngsa.osm_mon.core.config import Config
+from osm_ngsa.osm_mon.sdnc_connectors.onos import OnosInfraCollector
from prometheus_client import CollectorRegistry, Gauge, push_to_gateway
from airflow import DAG
from airflow.decorators import task
-from osm_mon.core.common_db import CommonDbClient
-from osm_mon.core.config import Config
-from osm_mon.vim_connectors.azure import AzureCollector
-from osm_mon.vim_connectors.gcp import GcpCollector
-from osm_mon.vim_connectors.openstack import OpenStackCollector
+from osm_ngsa.osm_mon.core.common_db import CommonDbClient
+from osm_ngsa.osm_mon.core.config import Config
+from osm_ngsa.osm_mon.vim_connectors.azure import AzureCollector
+from osm_ngsa.osm_mon.vim_connectors.gcp import GcpCollector
+from osm_ngsa.osm_mon.vim_connectors.openstack import OpenStackCollector
from prometheus_client import CollectorRegistry, Gauge, push_to_gateway
from airflow import DAG
from airflow.decorators import task
-from osm_mon.core.common_db import CommonDbClient
-from osm_mon.core.config import Config
-from osm_mon.vim_connectors.azure import AzureCollector
-from osm_mon.vim_connectors.gcp import GcpCollector
-from osm_mon.vim_connectors.openstack import OpenStackCollector
+from osm_ngsa.osm_mon.core.common_db import CommonDbClient
+from osm_ngsa.osm_mon.core.config import Config
+from osm_ngsa.osm_mon.vim_connectors.azure import AzureCollector
+from osm_ngsa.osm_mon.vim_connectors.gcp import GcpCollector
+from osm_ngsa.osm_mon.vim_connectors.openstack import OpenStackCollector
from prometheus_client import CollectorRegistry, Gauge, push_to_gateway
from airflow import DAG
from airflow.decorators import task
-from osm_mon.core.common_db import CommonDbClient
-from osm_mon.core.config import Config
-from osm_mon.vim_connectors.azure import AzureCollector
-from osm_mon.vim_connectors.gcp import GcpCollector
-from osm_mon.vim_connectors.openstack import OpenStackCollector
+from osm_ngsa.osm_mon.core.common_db import CommonDbClient
+from osm_ngsa.osm_mon.core.config import Config
+from osm_ngsa.osm_mon.vim_connectors.azure import AzureCollector
+from osm_ngsa.osm_mon.vim_connectors.gcp import GcpCollector
+from osm_ngsa.osm_mon.vim_connectors.openstack import OpenStackCollector
from prometheus_client import CollectorRegistry, Gauge, push_to_gateway
import logging
from airflow.decorators import dag, task
-from osm_mon.core.common_db import CommonDbClient
-from osm_mon.core.config import Config
+from osm_ngsa.osm_mon.core.common_db import CommonDbClient
+from osm_ngsa.osm_mon.core.config import Config
from prometheus_client import CollectorRegistry, Gauge, push_to_gateway
from airflow.decorators import dag, task
from airflow.operators.python import get_current_context
-from osm_mon.core.common_db import CommonDbClient
-from osm_mon.core.config import Config
-from osm_mon.core.message_bus_client import MessageBusClient
+from osm_ngsa.osm_mon.core.common_db import CommonDbClient
+from osm_ngsa.osm_mon.core.config import Config
+from osm_ngsa.osm_mon.core.message_bus_client import MessageBusClient
# Logging
logger = logging.getLogger("airflow.task")
from airflow.decorators import dag, task
from airflow.operators.python import get_current_context
-from osm_mon.core.common_db import CommonDbClient
-from osm_mon.core.config import Config
-from osm_mon.core.message_bus_client import MessageBusClient
+from osm_ngsa.osm_mon.core.common_db import CommonDbClient
+from osm_ngsa.osm_mon.core.config import Config
+from osm_ngsa.osm_mon.core.message_bus_client import MessageBusClient
# Logging
logger = logging.getLogger("airflow.task")
from airflow.decorators import dag, task
from airflow.operators.python import get_current_context
-from osm_mon.core.common_db import CommonDbClient
-from osm_mon.core.config import Config
+from osm_ngsa.osm_mon.core.common_db import CommonDbClient
+from osm_ngsa.osm_mon.core.config import Config
import requests
from requests.exceptions import ConnectionError, RequestException
from airflow.decorators import dag, task
from airflow.operators.python import get_current_context
-from osm_mon.core.common_db import CommonDbClient
-from osm_mon.core.config import Config
-from osm_mon.core.message_bus_client import MessageBusClient
+from osm_ngsa.osm_mon.core.common_db import CommonDbClient
+from osm_ngsa.osm_mon.core.config import Config
+from osm_ngsa.osm_mon.core.message_bus_client import MessageBusClient
# Logging
logger = logging.getLogger("airflow.task")
# limitations under the License.
#######################################################################################
from osm_common import dbmemory, dbmongo
-from osm_mon.core.config import Config
+from osm_ngsa.osm_mon.core.config import Config
class CommonDbClient:
from typing import Callable, List
from osm_common import msgkafka, msglocal
-from osm_mon.core.config import Config
+from osm_ngsa.osm_mon.core.config import Config
class MessageBusClient:
import logging
from typing import Dict
-from osm_mon.sdnc_connectors.base_sdnc import SDNCConnector
+from osm_ngsa.osm_mon.sdnc_connectors.base_sdnc import SDNCConnector
import requests
from requests.auth import HTTPBasicAuth
from azure.mgmt.compute import ComputeManagementClient
from azure.mgmt.monitor import MonitorManagementClient
from azure.profiles import ProfileDefinition
-from osm_mon.vim_connectors.base_vim import VIMConnector
+from osm_ngsa.osm_mon.vim_connectors.base_vim import VIMConnector
log = logging.getLogger(__name__)
from google.cloud import monitoring_v3
from google.oauth2 import service_account
import googleapiclient.discovery
-from osm_mon.vim_connectors.base_vim import VIMConnector
+from osm_ngsa.osm_mon.vim_connectors.base_vim import VIMConnector
log = logging.getLogger(__name__)
from keystoneauth1.identity import v3
from keystoneclient.v3 import client as keystone_client
from novaclient import client as nova_client
-from osm_mon.vim_connectors.base_vim import VIMConnector
-from osm_mon.vim_connectors.vrops_helper import vROPS_Helper
+from osm_ngsa.osm_mon.vim_connectors.base_vim import VIMConnector
+from osm_ngsa.osm_mon.vim_connectors.vrops_helper import vROPS_Helper
from prometheus_api_client import PrometheusConnect as prometheus_client
log = logging.getLogger(__name__)
keystone = keystone_client.Client(session=self.vim_session)
# Obtain the service catalog from OpenStack
service_catalog = keystone.services.list()
- log.debug(f"Openstack service catalog: {service_catalog}")
+ log.info(f"Openstack service catalog: {service_catalog}")
# Convert into a dictionary
services = {service.name: service.type for service in service_catalog}
- log.debug(f"Openstack services: {services}")
+ log.info(f"Openstack services: {services}")
if "prometheus" in services:
log.debug("Using Prometheus backend")
return "prometheus"
def _get_backend(self, vim_account: dict, vim_session: object):
openstack_metrics_backend = self._determine_backend()
- log.debug(f"openstack_metrics_backend: {openstack_metrics_backend}")
+ log.info(f"openstack_metrics_backend: {openstack_metrics_backend}")
# Priority 1. If prometheus-config, use Prometheus backend
log.debug(f"vim_account: {vim_account}")
if vim_account.get("prometheus-config"):
try:
tsbd = PrometheusTSBDBackend(vim_account)
- log.debug("Using prometheustsbd backend to collect metric")
+ log.info("Using prometheustsbd backend to collect metric")
return tsbd
except Exception as e:
log.error(f"Can't create prometheus client, {e}")
log.debug(f"vim_type: {vim_type}")
if vim_type == "vio" and "vrops_site" in vim_config:
try:
- log.debug("Using vROPS backend to collect metric")
+ log.info("Using vROPS backend to collect metric")
vrops = VropsBackend(vim_account)
return vrops
except Exception as e:
try:
gnocchi = GnocchiBackend(vim_account, vim_session)
gnocchi.client.metric.list(limit=1)
- log.debug("Using gnocchi backend to collect metric")
+ log.info("Using gnocchi backend to collect metric")
return gnocchi
except (gnocchiclient.exceptions.ClientException, EndpointNotFound) as e:
log.warning(f"Gnocchi not available: {e}")
try:
ceilometer = CeilometerBackend(vim_account, vim_session)
ceilometer.client.capabilities.get()
- log.debug("Using ceilometer backend to collect metric")
+ log.info("Using ceilometer backend to collect metric")
return ceilometer
except (HTTPException, EndpointNotFound) as e:
log.warning(f"Ceilometer not available: {e}")
pylint
skip_install = true
commands =
- pylint -E src setup.py --disable=E0401 --disable=E1111
+ pylint -E src setup.py
[testenv:pylint-webhook]