Merge "Show "target_project_id" attribute properly for network rbac object"
This commit is contained in:
commit
6dd3f45e39
@ -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)
|
||||
|
@ -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))
|
||||
|
||||
|
||||
|
@ -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
|
||||
|
@ -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 = [
|
||||
|
Loading…
Reference in New Issue
Block a user