X Tutup
Skip to content

Commit a8f4bcb

Browse files
Zuulopenstack-gerrit
authored andcommitted
Merge "Improved display of vnfPkgId for v2 Tacker"
2 parents 4513d1d + 0a8dced commit a8f4bcb

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

tackerclient/osc/v1/vnflcm/vnflcm.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,7 @@
3131
('vnfProvider', 'VNF Provider', tacker_osc_utils.LIST_BOTH),
3232
('vnfSoftwareVersion', 'VNF Software Version', tacker_osc_utils.LIST_BOTH),
3333
('vnfProductName', 'VNF Product Name', tacker_osc_utils.LIST_BOTH),
34-
('vnfdId', 'VNFD ID', tacker_osc_utils.LIST_BOTH),
35-
('vnfPkgId', 'VNF Package ID', tacker_osc_utils.LIST_BOTH)
34+
('vnfdId', 'VNFD ID', tacker_osc_utils.LIST_BOTH)
3635
)
3736

3837
LOG = logging.getLogger(__name__)
@@ -68,8 +67,7 @@ def _get_columns(vnflcm_obj, action=None):
6867
'vnfdVersion': 'VNFD Version',
6968
'instantiationState': 'Instantiation State',
7069
'_links': 'Links',
71-
'vnfConfigurableProperties': 'VNF Configurable Properties',
72-
'vnfPkgId': 'VNF Package ID',
70+
'vnfConfigurableProperties': 'VNF Configurable Properties'
7371
}
7472
if action == 'show':
7573
if vnflcm_obj['instantiationState'] == 'INSTANTIATED':
@@ -80,6 +78,12 @@ def _get_columns(vnflcm_obj, action=None):
8078
{'vimConnectionInfo': 'VIM Connection Info',
8179
'_links': 'Links'}
8280
)
81+
# Note: To prevent it from appearing in the v2 API output,
82+
# the 'VNF Package ID' will be output only if the vnfPkgId exists.
83+
if 'vnfPkgId' in vnflcm_obj:
84+
column_map.update(
85+
{'vnfPkgId': 'VNF Package ID'}
86+
)
8387
return sdk_utils.get_osc_show_columns_for_sdk_resource(vnflcm_obj,
8488
column_map)
8589

tackerclient/tests/unit/osc/v1/test_vnflcm.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ def _get_columns_vnflcm(action='create'):
5656
if action == 'list':
5757
columns = [ele for ele in columns if ele not in
5858
['VNFD Version', 'VNF Instance Description',
59-
'VNF Configurable Properties']]
59+
'VNF Configurable Properties', 'VNF Package ID']]
6060
columns.remove('Links')
6161
return columns
6262

0 commit comments

Comments
 (0)
X Tutup