From 449267025d8bc3d8cbe41538853d6268ff149798 Mon Sep 17 00:00:00 2001 From: wangxiyuan Date: Wed, 29 Apr 2015 09:58:48 +0800 Subject: [PATCH] Fix novaclient connect Now,the project can't be compiled because of the wrong import of novaclient. Change-Id: Icc68b97f630d4afc99790b4ca555447b88d44c76 --- neat/globals/manager.py | 5 +++-- tests/globals/test_manager.py | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/neat/globals/manager.py b/neat/globals/manager.py index 44af1d2..3216e53 100644 --- a/neat/globals/manager.py +++ b/neat/globals/manager.py @@ -74,7 +74,7 @@ from neat.contracts_extra import * import bottle from hashlib import sha1 import novaclient -from novaclient.v2 import client +from novaclient import client import time import subprocess @@ -270,7 +270,8 @@ def init_state(config): """ return {'previous_time': 0, 'db': init_db(config['sql_connection']), - 'nova': client.Client(config['os_admin_user'], + 'nova': client.Client(2, + config['os_admin_user'], config['os_admin_password'], config['os_admin_tenant_name'], config['os_auth_url'], diff --git a/tests/globals/test_manager.py b/tests/globals/test_manager.py index 0264c6e..906da69 100644 --- a/tests/globals/test_manager.py +++ b/tests/globals/test_manager.py @@ -17,7 +17,7 @@ from pyqcy import * import bottle from hashlib import sha1 -from novaclient.v2 import client +from novaclient import client import time import subprocess @@ -195,7 +195,7 @@ class GlobalManager(TestCase): 'compute_hosts': 'host1, host2'} expect(manager).init_db('db').and_return(db).once() expect(client).Client( - 'user', 'password', 'tenant', 'url', + 2, 'user', 'password', 'tenant', 'url', service_type='compute'). \ and_return(nova).once() expect(common).parse_compute_hosts('host1, host2'). \