from keystoneclient.v3 import client as keystone_client
from novaclient import client as nova_client
-from novaclient import v2 as nova_client_v2
from osm_mon.collector.infra_collectors.base_vim import BaseVimInfraCollector
from osm_mon.collector.metric import Metric
sess = OpenstackUtils.get_session(vim_account)
return keystone_client.Client(session=sess)
- def _build_nova_client(self, vim_account: dict) -> nova_client_v2.Client:
+ def _build_nova_client(self, vim_account: dict) -> nova_client.Client:
sess = OpenstackUtils.get_session(vim_account)
return nova_client.Client("2", session=sess)
user_domain_name = 'Default'
if 'config' in creds:
vim_config = creds['config']
- verify_ssl = False if 'insecure' in vim_config and vim_config['insecure'] else True
+ if 'insecure' in vim_config and vim_config['insecure']:
+ verify_ssl = False
+ if 'ca_cert' in vim_config:
+ verify_ssl = vim_config['ca_cert']
if 'project_domain_name' in vim_config:
project_domain_name = vim_config['project_domain_name']
if 'user_domain_name' in vim_config:
from typing import List
import gnocchiclient.exceptions
-from ceilometerclient.v2 import client as ceilometer_client
+from ceilometerclient import client as ceilometer_client
+from ceilometerclient.exc import HTTPException
from gnocchiclient.v1 import client as gnocchi_client
-from keystoneauth1.exceptions.catalog import EndpointNotFound
from keystoneclient.v3 import client as keystone_client
from neutronclient.v2_0 import client as neutron_client
ceilometer = CeilometerBackend(vim_account)
ceilometer.client.capabilities.get()
return ceilometer
- except EndpointNotFound:
+ except HTTPException:
gnocchi = GnocchiBackend(vim_account)
gnocchi.client.metric.list(limit=1)
return gnocchi
def _build_ceilometer_client(self, vim_account: dict) -> ceilometer_client.Client:
sess = OpenstackUtils.get_session(vim_account)
- return ceilometer_client.Client(session=sess)
+ return ceilometer_client.Client("2", session=sess)
def collect_metric(self, metric_type: MetricType, metric_name: str, resource_id: str, interface_name: str):
if metric_type != MetricType.INSTANCE: