Migrate from keystoneclient to keystoneauth
Change-Id: I2adc735492cecf0d6319c8e0659241af6a7a8a20 Implements: blueprint switch-to-keystoneauth
This commit is contained in:
parent
97e3e46d3e
commit
6a158197bc
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
||||
|
@ -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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user