Add tag support for vpn-related objects

Tag appendixes in describe operations are already implemented.

Change-Id: Ia05e6b400a5675bdab3f8dbcc6c834e543824f9b
This commit is contained in:
Feodor Tersin 2015-06-29 17:52:50 +03:00
parent f64151e821
commit bac2ad9de1
2 changed files with 10 additions and 4 deletions

View File

@ -31,6 +31,7 @@ RESOURCE_TYPES = {
'ami': 'image',
'aki': 'image',
'ari': 'image',
'cgw': 'customer-gateway',
'i': 'instance',
'igw': 'internet-gateway',
'eni': 'network-interface',
@ -38,8 +39,10 @@ RESOURCE_TYPES = {
'snap': 'snapshot',
'subnet': 'subnet',
'sg': 'security-group',
'vgw': 'vpn-gateway',
'vol': 'volume',
'vpc': 'vpc',
'vpn': 'vpn-connection',
}

View File

@ -55,9 +55,9 @@ class TagTestCase(base.ApiTestCase):
# NOTE(ft): check a tag can be created for all valid resource types
resource_ids = [fakes.random_ec2_id(r_t)
for r_t in ['dopt', 'ami', 'aki', 'ari', 'i', 'igw',
'eni', 'rtb', 'snap', 'subnet', 'sg',
'vol', 'vpc']]
for r_t in ['dopt', 'ami', 'aki', 'ari', 'cgw', 'i',
'igw', 'eni', 'rtb', 'snap', 'subnet',
'sg', 'vgw', 'vol', 'vpc', 'vpn']]
self.assertEqual(len(resource_ids), len(tag_api.RESOURCE_TYPES))
params = {'ResourceId.%s' % num: r_id
@ -183,6 +183,7 @@ class TagTestCase(base.ApiTestCase):
('ami', 'image'),
('aki', 'image'),
('ari', 'image'),
('cgw', 'customer-gateway'),
('i', 'instance'),
('igw', 'internet-gateway'),
('eni', 'network-interface'),
@ -190,8 +191,10 @@ class TagTestCase(base.ApiTestCase):
('snap', 'snapshot'),
('subnet', 'subnet'),
('sg', 'security-group'),
('vgw', 'vpn-gateway'),
('vol', 'volume'),
('vpc', 'vpc')]:
('vpc', 'vpc'),
('vpn', 'vpn-connection')]:
item_id = fakes.random_ec2_id(r_id)
self.db_api.get_tags.return_value = [{'item_id': item_id,
'key': 'fake-key',