Rename os-tid tag to os-project-id
Align name of tenant/project id tag with how it appears in Horizon and vCenter. Change-Id: I5cf79b41e0830d22f8fab78c4e04f54a56b0bbe8
This commit is contained in:
parent
e3c558d391
commit
b73715a36b
@ -180,7 +180,8 @@ class NSXClient(object):
|
||||
Get all logical resources created by OpenStack
|
||||
"""
|
||||
os_resources = [r for r in resources if 'tags' in r
|
||||
for tag in r['tags'] if 'os-tid' in tag.values()]
|
||||
for tag in r['tags']
|
||||
if 'os-project-id' in tag.values()]
|
||||
return os_resources
|
||||
|
||||
def get_logical_switches(self):
|
||||
|
@ -91,12 +91,12 @@ def check_and_truncate(display_name):
|
||||
def build_v3_tags_payload(logical_entity):
|
||||
"""
|
||||
Construct the tags payload that will be pushed to NSX-v3
|
||||
Add os-tid:<tenant-id>, os-api-version:<neutron-api-version>,
|
||||
Add os-project-id:<tenant-id>, os-api-version:<neutron-api-version>,
|
||||
os-neutron-id:<resource-id>
|
||||
"""
|
||||
return [{"scope": "os-neutron-id",
|
||||
"tag": logical_entity.get("id", "")},
|
||||
{"scope": "os-tid",
|
||||
{"scope": "os-project-id",
|
||||
"tag": logical_entity.get("tenant_id", "")},
|
||||
{"scope": "os-api-version",
|
||||
"tag": version.version_info.release_string()}]
|
||||
|
@ -353,7 +353,7 @@ class TestNsxV3Utils(NsxV3PluginTestCaseMixin):
|
||||
{'id': 'fake_id',
|
||||
'tenant_id': 'fake_tenant_id'})
|
||||
expected = [{'scope': 'os-neutron-id', 'tag': 'fake_id'},
|
||||
{'scope': 'os-tid', 'tag': 'fake_tenant_id'},
|
||||
{'scope': 'os-project-id', 'tag': 'fake_tenant_id'},
|
||||
{'scope': 'os-api-version',
|
||||
'tag': version.version_info.release_string()}]
|
||||
self.assertEqual(expected, result)
|
||||
|
@ -53,7 +53,7 @@ class TestSwitchingProfileTestCase(nsxlib_testcase.NsxClientTestCase):
|
||||
|
||||
tags = [
|
||||
{
|
||||
'scope': 'os-tid',
|
||||
'scope': 'os-project-id',
|
||||
'tag': 'tenant-1'
|
||||
},
|
||||
{
|
||||
@ -79,7 +79,7 @@ class TestSwitchingProfileTestCase(nsxlib_testcase.NsxClientTestCase):
|
||||
|
||||
tags = [
|
||||
{
|
||||
'scope': 'os-tid',
|
||||
'scope': 'os-project-id',
|
||||
'tag': 'tenant-1'
|
||||
},
|
||||
{
|
||||
@ -109,7 +109,7 @@ class TestSwitchingProfileTestCase(nsxlib_testcase.NsxClientTestCase):
|
||||
|
||||
tags = [
|
||||
{
|
||||
'scope': 'os-tid',
|
||||
'scope': 'os-project-id',
|
||||
'tag': 'tenant-1'
|
||||
},
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user