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:
Janet Yu 2015-12-08 21:05:46 -08:00
parent e3c558d391
commit b73715a36b
4 changed files with 8 additions and 7 deletions

View File

@ -180,7 +180,8 @@ class NSXClient(object):
Get all logical resources created by OpenStack Get all logical resources created by OpenStack
""" """
os_resources = [r for r in resources if 'tags' in r 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 return os_resources
def get_logical_switches(self): def get_logical_switches(self):

View File

@ -91,12 +91,12 @@ def check_and_truncate(display_name):
def build_v3_tags_payload(logical_entity): def build_v3_tags_payload(logical_entity):
""" """
Construct the tags payload that will be pushed to NSX-v3 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> os-neutron-id:<resource-id>
""" """
return [{"scope": "os-neutron-id", return [{"scope": "os-neutron-id",
"tag": logical_entity.get("id", "")}, "tag": logical_entity.get("id", "")},
{"scope": "os-tid", {"scope": "os-project-id",
"tag": logical_entity.get("tenant_id", "")}, "tag": logical_entity.get("tenant_id", "")},
{"scope": "os-api-version", {"scope": "os-api-version",
"tag": version.version_info.release_string()}] "tag": version.version_info.release_string()}]

View File

@ -353,7 +353,7 @@ class TestNsxV3Utils(NsxV3PluginTestCaseMixin):
{'id': 'fake_id', {'id': 'fake_id',
'tenant_id': 'fake_tenant_id'}) 'tenant_id': 'fake_tenant_id'})
expected = [{'scope': 'os-neutron-id', 'tag': 'fake_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', {'scope': 'os-api-version',
'tag': version.version_info.release_string()}] 'tag': version.version_info.release_string()}]
self.assertEqual(expected, result) self.assertEqual(expected, result)

View File

@ -53,7 +53,7 @@ class TestSwitchingProfileTestCase(nsxlib_testcase.NsxClientTestCase):
tags = [ tags = [
{ {
'scope': 'os-tid', 'scope': 'os-project-id',
'tag': 'tenant-1' 'tag': 'tenant-1'
}, },
{ {
@ -79,7 +79,7 @@ class TestSwitchingProfileTestCase(nsxlib_testcase.NsxClientTestCase):
tags = [ tags = [
{ {
'scope': 'os-tid', 'scope': 'os-project-id',
'tag': 'tenant-1' 'tag': 'tenant-1'
}, },
{ {
@ -109,7 +109,7 @@ class TestSwitchingProfileTestCase(nsxlib_testcase.NsxClientTestCase):
tags = [ tags = [
{ {
'scope': 'os-tid', 'scope': 'os-project-id',
'tag': 'tenant-1' 'tag': 'tenant-1'
}, },
{ {