Fixed project creation with Keystone v3

The current behavior for Rally users and Keystone v3 allows only to
create test projects for the users only in "default" domain.
Such behavior leads to authentication errors for the Rally users if the
admin specifies project_domain_name with other value rather than
"default". This fix resolve this bug.

Signe-ooff-by: Anton Kremenetsky <akremenetsky@dev.rtsoft.ru>

Change-Id: Ia2207f0b6a32da2ece6aaef64fd3227e16fb25ec
Closes-Bug: #1680837
(cherry picked from commit 412e35a292)
This commit is contained in:
Anton Kremenetsky 2017-04-07 16:01:15 +03:00 committed by Andrey Kurilin
parent 714f0b3a53
commit 530803f45c
2 changed files with 6 additions and 3 deletions

View File

@ -231,7 +231,8 @@ class UnifiedKeystoneV3Service(keystone_common.UnifiedKeystoneMixin,
:param project_name: Name of project to be created.
:param domain_name: Name or id of domain where to create project,
"""
project = self._impl.create_project(project_name)
project = self._impl.create_project(project_name,
domain_name=domain_name)
return self._unify_project(project)
def update_project(self, project_id, name=None, enabled=None,

View File

@ -402,12 +402,14 @@ class UnifiedKeystoneV3ServiceTestCase(test.TestCase):
mock_unified_keystone_v3_service__unify_project):
mock_unify_project = mock_unified_keystone_v3_service__unify_project
name = "name"
domain = "domain"
self.assertEqual(mock_unify_project.return_value,
self.service.create_project(name))
self.service.create_project(name, domain_name=domain))
mock_unify_project.assert_called_once_with(
self.service._impl.create_project.return_value)
self.service._impl.create_project.assert_called_once_with(name)
self.service._impl.create_project.assert_called_once_with(
name, domain_name=domain)
def test_update_project(self):
project_id = "fake_id"