summaryrefslogtreecommitdiff
path: root/openstackclient
diff options
context:
space:
mode:
authorJude Job <judeopenstack@gmail.com>2015-12-29 17:23:42 +0530
committerSteve Martinelli <stevemar@ca.ibm.com>2015-12-31 02:11:39 -0500
commit66931c6931ee39cc58159d3823b46ad225f39ec8 (patch)
treee0c720f0ac37fd059895553e896195dc74a54b3f /openstackclient
parent9f2ed6b03a1fdc1036aa8f8e3ea7b673a10da328 (diff)
downloadpython-openstackclient-66931c6931ee39cc58159d3823b46ad225f39ec8.tar.gz
Enabling domain lookup for project set v3 command
Currently the domain option for `project set` attempts to set a new domain that owns the project. This is actually an action that is denied by keystone server. Instead, the domain option should be used as a lookup, to find projects that exist in the non-default domain. Co-Authored-By: Steve Martinelli <stevemar@ca.ibm.com> Closes-Bug: #1524456 Change-Id: I30a3812184fe262667e09baa106d2275c2cbb981
Diffstat (limited to 'openstackclient')
-rw-r--r--openstackclient/identity/v3/project.py8
-rw-r--r--openstackclient/tests/identity/v3/test_project.py5
2 files changed, 2 insertions, 11 deletions
diff --git a/openstackclient/identity/v3/project.py b/openstackclient/identity/v3/project.py
index f87105dd..22745aa4 100644
--- a/openstackclient/identity/v3/project.py
+++ b/openstackclient/identity/v3/project.py
@@ -283,16 +283,12 @@ class SetProject(command.Command):
and not parsed_args.disable):
return
- project = utils.find_resource(
- identity_client.projects,
- parsed_args.project,
- )
+ project = common.find_project(identity_client, parsed_args.project,
+ parsed_args.domain)
kwargs = {}
if parsed_args.name:
kwargs['name'] = parsed_args.name
- if parsed_args.domain:
- kwargs['domain'] = parsed_args.domain
if parsed_args.description:
kwargs['description'] = parsed_args.description
if parsed_args.enable:
diff --git a/openstackclient/tests/identity/v3/test_project.py b/openstackclient/tests/identity/v3/test_project.py
index 946bbdcd..991bae8b 100644
--- a/openstackclient/tests/identity/v3/test_project.py
+++ b/openstackclient/tests/identity/v3/test_project.py
@@ -636,7 +636,6 @@ class TestProjectSet(TestProject):
# Set expected values
kwargs = {
'name': 'qwerty',
- 'domain': identity_fakes.domain_id,
}
# ProjectManager.update(project, name=, domain=, description=,
# enabled=, **kwargs)
@@ -665,7 +664,6 @@ class TestProjectSet(TestProject):
# Set expected values
kwargs = {
- 'domain': identity_fakes.domain_id,
'description': 'new desc',
}
self.projects_mock.update.assert_called_with(
@@ -692,7 +690,6 @@ class TestProjectSet(TestProject):
# Set expected values
kwargs = {
- 'domain': identity_fakes.domain_id,
'enabled': True,
}
self.projects_mock.update.assert_called_with(
@@ -719,7 +716,6 @@ class TestProjectSet(TestProject):
# Set expected values
kwargs = {
- 'domain': identity_fakes.domain_id,
'enabled': False,
}
self.projects_mock.update.assert_called_with(
@@ -746,7 +742,6 @@ class TestProjectSet(TestProject):
# Set expected values
kwargs = {
- 'domain': identity_fakes.domain_id,
'fee': 'fi',
'fo': 'fum',
}