Merge "S2007837: Fixes domain_id parameter in the user find call"

This commit is contained in:
Zuul 2020-11-17 16:51:45 +00:00 committed by Gerrit Code Review
commit 47be5106bd
2 changed files with 4 additions and 4 deletions

View File

@ -164,7 +164,7 @@ class KeystoneClientPlugin(client_plugin.ClientPlugin):
except ks_exceptions.NotFound:
try:
user_obj = self.client().client.users.find(name=user,
domain=domain)
domain_id=domain)
return user_obj.id
except ks_exceptions.NotFound:
pass

View File

@ -887,7 +887,7 @@ class KeystoneClientPluginUserTest(common.HeatTestCase):
self._client.client.users.get,
self.sample_name)
self._client.client.users.find.assert_called_once_with(
domain=None, name=self.sample_name)
domain_id=None, name=self.sample_name)
@mock.patch.object(keystone.KeystoneClientPlugin, 'client')
def test_get_user_id_with_name_and_domain(self, client_keystone):
@ -905,7 +905,7 @@ class KeystoneClientPluginUserTest(common.HeatTestCase):
self._client.client.users.get,
self.sample_name)
self._client.client.users.find.assert_called_once_with(
domain=client_plugin.get_domain_id(self.sample_domain_uuid),
domain_id=client_plugin.get_domain_id(self.sample_domain_uuid),
name=self.sample_name)
@mock.patch.object(keystone.KeystoneClientPlugin, 'client')
@ -929,7 +929,7 @@ class KeystoneClientPluginUserTest(common.HeatTestCase):
self._client.client.users.get,
self.sample_name)
self._client.client.users.find.assert_called_once_with(
domain=None, name=self.sample_name)
domain_id=None, name=self.sample_name)
@mock.patch.object(keystone.KeystoneClientPlugin, 'client')
def test_get_user_id_with_name_and_domain_invalid_input(self,