Skip to content

Commit 1d7a13a

Browse files
Zuulopenstack-gerrit
authored andcommitted
Merge "vpnaas: show external_vx_ip for vpn service show"
2 parents 636ac76 + b2107dc commit 1d7a13a

File tree

3 files changed

+16
-4
lines changed

3 files changed

+16
-4
lines changed

neutronclient/osc/v2/vpnaas/vpnservice.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@
3636
('status', 'Status', column_util.LIST_BOTH),
3737
('description', 'Description', column_util.LIST_LONG_ONLY),
3838
('project_id', 'Project', column_util.LIST_LONG_ONLY),
39+
('external_v4_ip', 'Ext v4 IP', column_util.LIST_LONG_ONLY),
40+
('external_v6_ip', 'Ext v6 IP', column_util.LIST_LONG_ONLY),
3941
)
4042

4143
_attr_map_dict = {
@@ -48,6 +50,8 @@
4850
'status': 'Status',
4951
'description': 'Description',
5052
'project_id': 'Project',
53+
'external_v4_ip': 'Ext v4 IP',
54+
'external_v6_ip': 'Ext v6 IP',
5155
}
5256

5357

@@ -135,8 +139,7 @@ def take_action(self, parsed_args):
135139
attrs['router_id'] = _router_id
136140
obj = client.create_vpn_service(**attrs)
137141
display_columns, columns = utils.get_osc_show_columns_for_sdk_resource(
138-
obj, _attr_map_dict, ['location', 'tenant_id', 'external_v4_ip',
139-
'external_v6_ip'])
142+
obj, _attr_map_dict, ['location', 'tenant_id'])
140143
data = utils.get_dict_properties(obj, columns)
141144
return display_columns, data
142145

@@ -244,7 +247,6 @@ def take_action(self, parsed_args):
244247
ignore_missing=False)['id']
245248
obj = client.get_vpn_service(vpn_id)
246249
display_columns, columns = utils.get_osc_show_columns_for_sdk_resource(
247-
obj, _attr_map_dict, ['location', 'tenant_id', 'external_v4_ip',
248-
'external_v6_ip'])
250+
obj, _attr_map_dict, ['location', 'tenant_id'])
249251
data = utils.get_dict_properties(obj, columns)
250252
return (display_columns, data)

neutronclient/tests/unit/osc/v2/vpnaas/fakes.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,8 @@ def __init__(self):
125125
('status', 'ACTIVE'),
126126
('description', 'my-desc-' + uuid.uuid4().hex),
127127
('project_id', 'project-id-' + uuid.uuid4().hex),
128+
('external_v4_ip', '192.0.2.42'),
129+
('external_v6_ip', '2001:0db8:207a:4a3a:053b:6fab:7df9:1afd'),
128130
))
129131

130132

neutronclient/tests/unit/osc/v2/vpnaas/test_vpnservice.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,10 +106,14 @@ def _mock_vpnservice(*args, **kwargs):
106106
'Status',
107107
'Description',
108108
'Project',
109+
'Ext v4 IP',
110+
'Ext v6 IP',
109111
)
110112
self.data = _generate_data()
111113
self.ordered_headers = (
112114
'Description',
115+
'Ext v4 IP',
116+
'Ext v6 IP',
113117
'Flavor',
114118
'ID',
115119
'Name',
@@ -121,6 +125,8 @@ def _mock_vpnservice(*args, **kwargs):
121125
)
122126
self.ordered_data = (
123127
_vpnservice['description'],
128+
_vpnservice['external_v4_ip'],
129+
_vpnservice['external_v6_ip'],
124130
_vpnservice['flavor_id'],
125131
_vpnservice['id'],
126132
_vpnservice['name'],
@@ -132,6 +138,8 @@ def _mock_vpnservice(*args, **kwargs):
132138
)
133139
self.ordered_columns = (
134140
'description',
141+
'external_v4_ip',
142+
'external_v6_ip',
135143
'flavor_id',
136144
'id',
137145
'name',

0 commit comments

Comments
 (0)