Fixes data type bug in get-user call
Also fixes an authentication problem preventing rd-client calls from finding their service endpoint and issuing calls. Partially addresses bug #1132975 Change-Id: Iae2badda67793f30d957e414ee87d32853ef3d8e
This commit is contained in:
@@ -251,7 +251,7 @@ class ServiceCatalog(object):
|
|||||||
if service.get("type") != self.service_type:
|
if service.get("type") != self.service_type:
|
||||||
continue
|
continue
|
||||||
|
|
||||||
if (self.service_name and self.service_type == 'reddwarf' and
|
if (self.service_name and self.service_type == 'database' and
|
||||||
service.get('name') != self.service_name):
|
service.get('name') != self.service_name):
|
||||||
continue
|
continue
|
||||||
|
|
||||||
|
@@ -86,9 +86,7 @@ class Users(base.ManagerWithFind):
|
|||||||
"""
|
"""
|
||||||
username = quote(user)
|
username = quote(user)
|
||||||
url = "/instances/%s/users/%s" % (instance_id, username)
|
url = "/instances/%s/users/%s" % (instance_id, username)
|
||||||
resp, body = self.api.client.get(url)
|
return self._get(url, "user")
|
||||||
check_for_exceptions(resp, body)
|
|
||||||
return self.resource_class(self, body)
|
|
||||||
|
|
||||||
def list_access(self, instance, user):
|
def list_access(self, instance, user):
|
||||||
"""Show all databases the given user has access to. """
|
"""Show all databases the given user has access to. """
|
||||||
|
@@ -400,7 +400,7 @@ class ServiceCatalogTest(TestCase):
|
|||||||
scObj.catalog[scObj.root_key]['serviceCatalog'] = [service1]
|
scObj.catalog[scObj.root_key]['serviceCatalog'] = [service1]
|
||||||
self.assertRaises(exceptions.EndpointNotFound, scObj._url_for)
|
self.assertRaises(exceptions.EndpointNotFound, scObj._url_for)
|
||||||
|
|
||||||
scObj.service_type = "reddwarf"
|
scObj.service_type = "database"
|
||||||
scObj.service_name = "no_match"
|
scObj.service_name = "no_match"
|
||||||
self.assertRaises(exceptions.EndpointNotFound, scObj._url_for)
|
self.assertRaises(exceptions.EndpointNotFound, scObj._url_for)
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user