Update Nova client initialization according to 7.0.0 version
python-novaclient was updated and now newest version contains bug in username-password auth. Switching to session-based auth will allow to fix it (and also its openstack way to use shared session) Change-Id: If48f8f96843023f4f36e737cd818761db9184884 Closes-bug:1653693
This commit is contained in:
parent
6bea467740
commit
e71059ac4d
|
@ -18,6 +18,9 @@ import logging
|
||||||
import os
|
import os
|
||||||
import time
|
import time
|
||||||
|
|
||||||
|
from keystoneauth1.identity import V2Password
|
||||||
|
from keystoneauth1.session import Session as KeystoneSession
|
||||||
|
|
||||||
import fuel_health.common.utils.data_utils as data_utils
|
import fuel_health.common.utils.data_utils as data_utils
|
||||||
|
|
||||||
LOG = logging.getLogger(__name__)
|
LOG = logging.getLogger(__name__)
|
||||||
|
@ -94,6 +97,8 @@ class OfficialClientManager(fuel_health.manager.Manager):
|
||||||
self.clients_initialized = False
|
self.clients_initialized = False
|
||||||
self.traceback = ''
|
self.traceback = ''
|
||||||
self.keystone_error_message = None
|
self.keystone_error_message = None
|
||||||
|
|
||||||
|
self._keystone_session = None
|
||||||
self.compute_client = self._get_compute_client()
|
self.compute_client = self._get_compute_client()
|
||||||
try:
|
try:
|
||||||
self.identity_client = self._get_identity_client()
|
self.identity_client = self._get_identity_client()
|
||||||
|
@ -141,32 +146,22 @@ class OfficialClientManager(fuel_health.manager.Manager):
|
||||||
'murano_art_client'
|
'murano_art_client'
|
||||||
]
|
]
|
||||||
|
|
||||||
def _get_compute_client(self, username=None, password=None,
|
@property
|
||||||
tenant_name=None):
|
def keystone_session(self):
|
||||||
if not username:
|
if not self._keystone_session:
|
||||||
username = self.config.identity.admin_username
|
auth = V2Password(
|
||||||
if not password:
|
auth_url=self.config.identity.uri,
|
||||||
password = self.config.identity.admin_password
|
username=self.config.identity.admin_username,
|
||||||
if not tenant_name:
|
password=self.config.identity.admin_password,
|
||||||
tenant_name = self.config.identity.admin_tenant_name
|
tenant_name=self.config.identity.admin_tenant_name)
|
||||||
|
|
||||||
if None in (username, password, tenant_name):
|
self._keystone_session = KeystoneSession(auth=auth, verify=False)
|
||||||
msg = ("Missing required credentials for identity client. "
|
return self._keystone_session
|
||||||
"username: {username}, password: {password}, "
|
|
||||||
"tenant_name: {tenant_name}").format(
|
|
||||||
username=username,
|
|
||||||
password=password,
|
|
||||||
tenant_name=tenant_name, )
|
|
||||||
raise exceptions.InvalidConfiguration(msg)
|
|
||||||
|
|
||||||
auth_url = self.config.identity.uri
|
def _get_compute_client(self):
|
||||||
|
|
||||||
client_args = (username, password, tenant_name, auth_url)
|
|
||||||
|
|
||||||
# Create our default Nova client to use in testing
|
|
||||||
service_type = self.config.compute.catalog_type
|
service_type = self.config.compute.catalog_type
|
||||||
return novaclient.client.Client(self.NOVACLIENT_VERSION,
|
return novaclient.client.Client(self.NOVACLIENT_VERSION,
|
||||||
*client_args,
|
session=self.keystone_session,
|
||||||
service_type=service_type,
|
service_type=service_type,
|
||||||
no_cache=True,
|
no_cache=True,
|
||||||
insecure=True,
|
insecure=True,
|
||||||
|
|
|
@ -5,7 +5,7 @@ python-cinderclient>=1.6.0,!=1.7.0,!=1.7.1 # Apache-2.0
|
||||||
python-ceilometerclient>=2.5.0 # Apache-2.0
|
python-ceilometerclient>=2.5.0 # Apache-2.0
|
||||||
python-keystoneclient>=2.0.0,!=2.1.0 # Apache-2.0
|
python-keystoneclient>=2.0.0,!=2.1.0 # Apache-2.0
|
||||||
python-muranoclient>=0.8.2 # Apache-2.0
|
python-muranoclient>=0.8.2 # Apache-2.0
|
||||||
python-novaclient>=2.29.0,!=2.33.0 # Apache-2.0
|
python-novaclient>=7.0 # Apache-2.0
|
||||||
python-neutronclient>=5.1.0 # Apache-2.0
|
python-neutronclient>=5.1.0 # Apache-2.0
|
||||||
python-heatclient>=1.4.0 # Apache-2.0
|
python-heatclient>=1.4.0 # Apache-2.0
|
||||||
python-glanceclient>=2.3.0,!=2.4.0 # Apache-2.0
|
python-glanceclient>=2.3.0,!=2.4.0 # Apache-2.0
|
||||||
|
@ -25,7 +25,7 @@ amqp>=1.4.0,<2.0 # LGPL
|
||||||
anyjson>=0.3.3 # BSD
|
anyjson>=0.3.3 # BSD
|
||||||
gevent
|
gevent
|
||||||
keystonemiddleware>=4.0.0,!=4.1.0,!=4.5.0 # Apache-2.0
|
keystonemiddleware>=4.0.0,!=4.1.0,!=4.5.0 # Apache-2.0
|
||||||
kombu>=3.0.25,!=4.0.0 # BSD
|
kombu>=3.0.25,<4.0.0 # BSD
|
||||||
oslo.serialization>=1.10.0 # Apache-2.0
|
oslo.serialization>=1.10.0 # Apache-2.0
|
||||||
oslo.utils>=3.16.0 # Apache-2.0
|
oslo.utils>=3.16.0 # Apache-2.0
|
||||||
pecan>=1.0.0,!=1.0.2,!=1.0.3,!=1.0.4 # BSD
|
pecan>=1.0.0,!=1.0.2,!=1.0.3,!=1.0.4 # BSD
|
||||||
|
|
Loading…
Reference in New Issue