diff --git a/tacker/nfvo/drivers/vim/openstack_driver.py b/tacker/nfvo/drivers/vim/openstack_driver.py index dbb919ffe..e86a045a5 100644 --- a/tacker/nfvo/drivers/vim/openstack_driver.py +++ b/tacker/nfvo/drivers/vim/openstack_driver.py @@ -17,11 +17,11 @@ import os import six +from keystoneauth1 import exceptions from keystoneauth1 import identity +from keystoneauth1.identity import v2 +from keystoneauth1.identity import v3 from keystoneauth1 import session -from keystoneclient.auth.identity import v2 -from keystoneclient.auth.identity import v3 -from keystoneclient import exceptions from neutronclient.common import exceptions as nc_exceptions from neutronclient.v2_0 import client as neutron_client from oslo_config import cfg diff --git a/tacker/tests/functional/keystone.py b/tacker/tests/functional/keystone.py index 4fe21155b..ad8fb0c4a 100644 --- a/tacker/tests/functional/keystone.py +++ b/tacker/tests/functional/keystone.py @@ -14,10 +14,10 @@ # License for the specific language governing permissions and limitations # under the License. -from keystoneclient.auth import identity +from keystoneauth1 import exceptions +from keystoneauth1.identity import v3 +from keystoneauth1 import session from keystoneclient import client -from keystoneclient import exceptions -from keystoneclient import session from oslo_config import cfg from oslo_log import log as logging @@ -36,7 +36,7 @@ class Keystone(object): def get_version(self, base_url=None): try: keystone_client = client.Client(auth_url=base_url) - except exceptions.ConnectionRefused: + except exceptions.ConnectionError: raise return keystone_client.version @@ -49,7 +49,7 @@ class Keystone(object): def initialize_client(self, version, **kwargs): from keystoneclient.v3 import client - auth_plugin = identity.v3.Password(**kwargs) + auth_plugin = v3.Password(**kwargs) ses = self.get_session(auth_plugin=auth_plugin) cli = client.Client(session=ses) return cli diff --git a/tacker/tests/unit/vm/nfvo/drivers/vim/test_openstack_driver.py b/tacker/tests/unit/vm/nfvo/drivers/vim/test_openstack_driver.py index 960daba11..f851ade50 100644 --- a/tacker/tests/unit/vm/nfvo/drivers/vim/test_openstack_driver.py +++ b/tacker/tests/unit/vm/nfvo/drivers/vim/test_openstack_driver.py @@ -13,7 +13,7 @@ # License for the specific language governing permissions and limitations # under the License. -from keystoneclient import exceptions +from keystoneauth1 import exceptions import mock from oslo_config import cfg diff --git a/tacker/vnfm/keystone.py b/tacker/vnfm/keystone.py index c0da001cd..347cfc170 100644 --- a/tacker/vnfm/keystone.py +++ b/tacker/vnfm/keystone.py @@ -17,10 +17,10 @@ import os from cryptography import fernet -from keystoneclient.auth import identity +from keystoneauth1 import exceptions +from keystoneauth1 import identity +from keystoneauth1 import session from keystoneclient import client -from keystoneclient import exceptions -from keystoneclient import session from oslo_config import cfg from oslo_log import log as logging @@ -39,7 +39,7 @@ class Keystone(object): def get_version(self, base_url=None): try: keystone_client = client.Client(auth_url=base_url) - except exceptions.ConnectionRefused: + except exceptions.ConnectionError: raise return keystone_client.version