drop deprecated novaclient.v1_1

novaclient.v1_1 has been deprecated and moved to v2 since v2.21.0,
a warning message will be printed if we still use it:

  UserWarning: Module novaclient.v1_1 is deprecated (taken as a
  basis for novaclient.v2). The preferable way to get client class
  or object you can find in novaclient.client module.

This patch uses novaclient.client.Client and specifies version=2
to replace old novaclient.v1_1.client.Client

Change-Id: I0155caaa63b670f9b37c91e2297bd6b988784bf7
This commit is contained in:
ZhiQiang Fan 2015-02-26 10:05:15 +08:00
parent 348ecb0861
commit 7da3b15245

View File

@ -14,7 +14,7 @@
import functools
import novaclient
from novaclient.v1_1 import client as nova_client
from novaclient import client as nova_client
from oslo_config import cfg
from ceilometer.openstack.common import log
@ -61,6 +61,7 @@ class Client(object):
conf = cfg.CONF.service_credentials
tenant = conf.os_tenant_id or conf.os_tenant_name
self.nova_client = nova_client.Client(
version=2,
username=conf.os_username,
api_key=conf.os_password,
project_id=tenant,