diff --git a/functional/tests/network/v2/test_network_rbac.py b/functional/tests/network/v2/test_network_rbac.py index e7e358583d..1dbc246bf2 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) diff --git a/openstackclient/network/v2/network_rbac.py b/openstackclient/network/v2/network_rbac.py index f4dfd4e734..bb29579f95 100644 --- a/openstackclient/network/v2/network_rbac.py +++ b/openstackclient/network/v2/network_rbac.py @@ -33,7 +33,7 @@ def _get_columns(item): columns.append('project_id') if 'target_tenant' in columns: columns.remove('target_tenant') - columns.append('target_project') + columns.append('target_project_id') return tuple(sorted(columns)) diff --git a/openstackclient/tests/network/v2/fakes.py b/openstackclient/tests/network/v2/fakes.py index 9182fe553c..ec329f4d0f 100644 --- a/openstackclient/tests/network/v2/fakes.py +++ b/openstackclient/tests/network/v2/fakes.py @@ -520,7 +520,7 @@ class FakeNetworkRBAC(object): loaded=True) # Set attributes with special mapping in OpenStack SDK. rbac.project_id = rbac_attrs['tenant_id'] - rbac.target_project = rbac_attrs['target_tenant'] + rbac.target_project_id = rbac_attrs['target_tenant'] return rbac @staticmethod diff --git a/openstackclient/tests/network/v2/test_network_rbac.py b/openstackclient/tests/network/v2/test_network_rbac.py index 6255ada706..9250e91b9e 100644 --- a/openstackclient/tests/network/v2/test_network_rbac.py +++ b/openstackclient/tests/network/v2/test_network_rbac.py @@ -49,7 +49,7 @@ class TestCreateNetworkRBAC(TestNetworkRBAC): 'object_id', 'object_type', 'project_id', - 'target_project', + 'target_project_id', ) data = [ @@ -383,7 +383,7 @@ class TestShowNetworkRBAC(TestNetworkRBAC): 'object_id', 'object_type', 'project_id', - 'target_project', + 'target_project_id', ) data = [