Skip to content

Commit 4c2eb2b

Browse files
author
M V P Nitesh
committed
Show neutron tags in OSC network show
Now tag information of the network is displayed when the user tries to see the network details using the command openstack network show <net-id> Change-Id: I587d2bca37b8dbef4400db3d8ace3c81d87e2db3 Closes-Bug: #1695783
1 parent 7653cff commit 4c2eb2b

3 files changed

Lines changed: 10 additions & 0 deletions

File tree

openstackclient/network/v2/network.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ def _format_router_external(item):
3939
'is_router_external': _format_router_external,
4040
'availability_zones': utils.format_list,
4141
'availability_zone_hints': utils.format_list,
42+
'tags': utils.format_list,
4243
}
4344

4445

@@ -55,6 +56,7 @@ def _get_columns_network(item):
5556
'ipv4_address_scope_id': 'ipv4_address_scope',
5657
'ipv6_address_scope_id': 'ipv6_address_scope',
5758
'tenant_id': 'project_id',
59+
'tags': 'tags',
5860
}
5961
return sdk_utils.get_osc_show_columns_for_sdk_resource(item, column_map)
6062

openstackclient/tests/unit/network/v2/fakes.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -346,6 +346,7 @@ def create_one_network(attrs=None):
346346
'availability_zone_hints': [],
347347
'is_default': False,
348348
'port_security_enabled': True,
349+
'tags': ['test'],
349350
'qos_policy_id': 'qos-policy-id-' + uuid.uuid4().hex,
350351
'ipv4_address_scope': 'ipv4' + uuid.uuid4().hex,
351352
'ipv6_address_scope': 'ipv6' + uuid.uuid4().hex,
@@ -365,6 +366,7 @@ def create_one_network(attrs=None):
365366
network_attrs['port_security_enabled']
366367
network.subnet_ids = network_attrs['subnets']
367368
network.is_shared = network_attrs['shared']
369+
network.is_tags = network_attrs['tags']
368370
network.provider_network_type = \
369371
network_attrs['provider:network_type']
370372
network.provider_physical_network = \

openstackclient/tests/unit/network/v2/test_network.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ class TestCreateNetworkIdentityV3(TestNetwork):
7575
'shared',
7676
'status',
7777
'subnets',
78+
'tags',
7879
)
7980

8081
data = (
@@ -97,6 +98,7 @@ class TestCreateNetworkIdentityV3(TestNetwork):
9798
_network.shared,
9899
_network.status,
99100
utils.format_list(_network.subnets),
101+
utils.format_list(_network.tags),
100102
)
101103

102104
def setUp(self):
@@ -255,6 +257,7 @@ class TestCreateNetworkIdentityV2(TestNetwork):
255257
'shared',
256258
'status',
257259
'subnets',
260+
'tags',
258261
)
259262

260263
data = (
@@ -277,6 +280,7 @@ class TestCreateNetworkIdentityV2(TestNetwork):
277280
_network.shared,
278281
_network.status,
279282
utils.format_list(_network.subnets),
283+
utils.format_list(_network.tags),
280284
)
281285

282286
def setUp(self):
@@ -932,6 +936,7 @@ class TestShowNetwork(TestNetwork):
932936
'shared',
933937
'status',
934938
'subnets',
939+
'tags',
935940
)
936941

937942
data = (
@@ -954,6 +959,7 @@ class TestShowNetwork(TestNetwork):
954959
_network.shared,
955960
_network.status,
956961
utils.format_list(_network.subnets),
962+
utils.format_list(_network.tags),
957963
)
958964

959965
def setUp(self):

0 commit comments

Comments
 (0)