bin/nova/nova-hypervisor-metrics.py in sensu-plugins-openstack-0.0.4 vs bin/nova/nova-hypervisor-metrics.py in sensu-plugins-openstack-0.0.5
- old
+ new
@@ -9,12 +9,13 @@
from argparse import ArgumentParser
from os import getenv
import socket
import time
-from novaclient.v3 import Client
+from novaclient.client import Client
+NOVA_API_VERSION = '2'
DEFAULT_SCHEME = '{}.nova.hypervisors'.format(socket.gethostname())
METRIC_KEYS = (
'current_workload',
'disk_available_least',
@@ -39,10 +40,10 @@
parser.add_argument('-S', '--service-type', default='compute')
parser.add_argument('-H', '--host')
parser.add_argument('-s', '--scheme', default=DEFAULT_SCHEME)
args = parser.parse_args()
- client = Client(args.user, args.password, args.tenant, args.auth_url, service_type=args.service_type)
+ client = Client(NOVA_API_VERSION, args.user, args.password, args.tenant, args.auth_url, service_type=args.service_type)
if args.host:
hypervisors = client.hypervisors.search(args.host)
else:
hypervisors = client.hypervisors.list()