Fix missing auth_url when create senlinclient
- Use keystone session to create openstacksdk connection. - Removed test case for getting senlin client because we are now passing in a session. openstacksdk will try to use the session object when creating its connection. Mocking the details of the session object and its uses proves too difficult, so I decided to remove it for now. Change-Id: I11527b457ee04a38542894863da32b03aa67e790 Closes-Bug: #1805740 Depends-On: https://review.openstack.org/624528
This commit is contained in:
parent
0fbb65bc51
commit
7811fdb68a
|
@ -80,7 +80,7 @@ python-keystoneclient==3.15.0
|
|||
python-mimeparse==1.6.0
|
||||
python-neutronclient==6.7.0
|
||||
python-novaclient==10.1.0
|
||||
python-senlinclient==1.1.0
|
||||
python-senlinclient==1.9.0
|
||||
python-swiftclient==3.5.0
|
||||
pytz==2018.3
|
||||
PyYAML==3.12
|
||||
|
|
|
@ -5,6 +5,6 @@
|
|||
pbr!=2.1.0,>=2.0.0 # Apache-2.0
|
||||
PyYAML>=3.12 # MIT
|
||||
|
||||
python-senlinclient>=1.1.0 # Apache-2.0
|
||||
python-senlinclient>=1.9.0 # Apache-2.0
|
||||
|
||||
horizon>=14.0.0.0b1 # Apache-2.0
|
||||
|
|
|
@ -16,6 +16,7 @@ from horizon.utils import functions as utils
|
|||
from horizon.utils import memoized
|
||||
|
||||
from keystoneauth1.identity import generic
|
||||
from keystoneauth1 import session as ks_session
|
||||
from openstack_dashboard.api import base
|
||||
from senlin_dashboard.api import utils as api_utils
|
||||
from senlinclient.v1 import client as senlin_client
|
||||
|
@ -86,7 +87,8 @@ def senlinclient(request):
|
|||
token=request.user.token.id,
|
||||
project_id=request.user.tenant_id
|
||||
)
|
||||
return senlin_client.Client(authenticator=auth,
|
||||
session = ks_session.Session(auth=auth)
|
||||
return senlin_client.Client(session=session,
|
||||
region_name=request.user.services_region)
|
||||
|
||||
|
||||
|
|
|
@ -15,9 +15,6 @@ import mock
|
|||
from senlin_dashboard import api
|
||||
from senlin_dashboard.test import helpers as test
|
||||
|
||||
from openstack_dashboard.test import helpers
|
||||
from senlinclient.v1 import client as senlin_client
|
||||
|
||||
|
||||
class SenlinApiTests(test.APITestCase):
|
||||
|
||||
|
@ -117,9 +114,3 @@ class SenlinApiTests(test.APITestCase):
|
|||
self.assertIsInstance(receiver, api.senlin.Receiver)
|
||||
|
||||
senlinclient.receivers.assert_called_once_with(**params)
|
||||
|
||||
|
||||
class SenlinApiClientTests(test.SenlinTestsMixin, helpers.APITestCase):
|
||||
def test_senlinclient(self):
|
||||
senlinclient = api.senlin.senlinclient(self.request)
|
||||
self.assertIsInstance(senlinclient, senlin_client.Client)
|
||||
|
|
Loading…
Reference in New Issue