From 7f93d8cc888b5397614b52ebd26ffc742d6f7072 Mon Sep 17 00:00:00 2001 From: Huanxuan Ao Date: Thu, 4 Aug 2016 11:20:44 +0800 Subject: Show "target_project_id" attribute properly for network rbac object According to the code in SDK: https://github.com/openstack/python-openstacksdk/blob/master/openstack/network/v2/rbac_policy.py#L34 we can see the conlumn of "target_tenant" should be "targer_project_id" but not "target_project". It is the reason why could not show the "target_project" in OSC, so this patch fix it. Before this change: (openstack) network rbac show b74fd644-e057-4d44-8ae1-7ca9967ea1e1 +----------------+--------------------------------------+ | Field | Value | +----------------+--------------------------------------+ | action | access_as_shared | | id | b74fd644-e057-4d44-8ae1-7ca9967ea1e1 | | object_id | 8735b57f-606a-4f65-9902-2052a6d2a66d | | object_type | network | | project_id | 01c0ba43101b4080a52a5f79a55c56ff | | target_project | | +----------------+--------------------------------------+ After this change: (openstack) network rbac show b74fd644-e057-4d44-8ae1-7ca9967ea1e1 +-------------------+--------------------------------------+ | Field | Value | +-------------------+--------------------------------------+ | action | access_as_shared | | id | b74fd644-e057-4d44-8ae1-7ca9967ea1e1 | | object_id | 8735b57f-606a-4f65-9902-2052a6d2a66d | | object_type | network | | project_id | 01c0ba43101b4080a52a5f79a55c56ff | | target_project_id | c7ab4d2ea9e1487095a8ca24ea44ef38 | +-------------------+--------------------------------------+ Change-Id: I53df127bfc3e43288c6afecdf872e6101b94a658 Closes-Bug: #1608903 --- functional/tests/network/v2/test_network_rbac.py | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) (limited to 'functional/tests') diff --git a/functional/tests/network/v2/test_network_rbac.py b/functional/tests/network/v2/test_network_rbac.py index e7e35858..1dbc246b 100644 --- a/functional/tests/network/v2/test_network_rbac.py +++ b/functional/tests/network/v2/test_network_rbac.py @@ -12,8 +12,6 @@ import uuid -import testtools - from functional.common import test @@ -57,18 +55,13 @@ class NetworkRBACTests(test.TestCase): raw_output = self.openstack('network rbac show ' + self.ID + opts) self.assertEqual(self.ID + "\n", raw_output) - # TODO(Huanxuan Ao): This test can pass after bug - # https://bugs.launchpad.net/python-openstackclient/+bug/1608903 fixed. - @testtools.skip( - 'Skip because of the bug ' - 'https://bugs.launchpad.net/python-openstackclient/+bug/1608903') def test_network_rbac_set(self): opts = self.get_opts(self.FIELDS) project_id = self.openstack( 'project create ' + self.PROJECT_NAME + opts) self.openstack('network rbac set ' + self.ID + ' --target-project ' + self.PROJECT_NAME) - opts = self.get_opts(['target_project']) + opts = self.get_opts(['target_project_id']) raw_output_rbac = self.openstack('network rbac show ' + self.ID + opts) raw_output_project = self.openstack( 'project delete ' + self.PROJECT_NAME) -- cgit v1.2.1