summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZhiQiang Fan <zhiqiang.fan@huawei.com>2015-02-26 10:05:15 +0800
committerZhiQiang Fan <zhiqiang.fan@huawei.com>2015-03-19 21:54:59 +0800
commit7da3b1524536b7cd853b9ea135db248a6fc31e6f (patch)
tree53af64713c4695bdeacae00ac0b3aa93c9ca42e9
parent348ecb0861637da5575b094f8fa3fab1e3770928 (diff)
downloadceilometer-7da3b1524536b7cd853b9ea135db248a6fc31e6f.tar.gz
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
-rw-r--r--ceilometer/nova_client.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/ceilometer/nova_client.py b/ceilometer/nova_client.py
index 9d1ed80f..8b09219a 100644
--- a/ceilometer/nova_client.py
+++ b/ceilometer/nova_client.py
@@ -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,