Improved display of vnfPkgId for v2 Tacker
This patch fixes the output of v2 Tacker so that vnfPkgId of VnfInstance that are only used in v1 Tacker are not displayed as CLI output. This is because it is confusing for v2 users that unused vnfPkgId (VNF Package ID) is always displayed as empty. The vnfPkgId (VNF Package ID) remain displayed in the v1 Tacker CLI output. Change-Id: I4adea34e9c2c7fc51e087d2a00f47db77d67fe4a
This commit is contained in:
@@ -31,8 +31,7 @@ _attr_map = (
|
|||||||
('vnfProvider', 'VNF Provider', tacker_osc_utils.LIST_BOTH),
|
('vnfProvider', 'VNF Provider', tacker_osc_utils.LIST_BOTH),
|
||||||
('vnfSoftwareVersion', 'VNF Software Version', tacker_osc_utils.LIST_BOTH),
|
('vnfSoftwareVersion', 'VNF Software Version', tacker_osc_utils.LIST_BOTH),
|
||||||
('vnfProductName', 'VNF Product Name', tacker_osc_utils.LIST_BOTH),
|
('vnfProductName', 'VNF Product Name', tacker_osc_utils.LIST_BOTH),
|
||||||
('vnfdId', 'VNFD ID', tacker_osc_utils.LIST_BOTH),
|
('vnfdId', 'VNFD ID', tacker_osc_utils.LIST_BOTH)
|
||||||
('vnfPkgId', 'VNF Package ID', tacker_osc_utils.LIST_BOTH)
|
|
||||||
)
|
)
|
||||||
|
|
||||||
LOG = logging.getLogger(__name__)
|
LOG = logging.getLogger(__name__)
|
||||||
@@ -68,8 +67,7 @@ def _get_columns(vnflcm_obj, action=None):
|
|||||||
'vnfdVersion': 'VNFD Version',
|
'vnfdVersion': 'VNFD Version',
|
||||||
'instantiationState': 'Instantiation State',
|
'instantiationState': 'Instantiation State',
|
||||||
'_links': 'Links',
|
'_links': 'Links',
|
||||||
'vnfConfigurableProperties': 'VNF Configurable Properties',
|
'vnfConfigurableProperties': 'VNF Configurable Properties'
|
||||||
'vnfPkgId': 'VNF Package ID',
|
|
||||||
}
|
}
|
||||||
if action == 'show':
|
if action == 'show':
|
||||||
if vnflcm_obj['instantiationState'] == 'INSTANTIATED':
|
if vnflcm_obj['instantiationState'] == 'INSTANTIATED':
|
||||||
@@ -80,6 +78,12 @@ def _get_columns(vnflcm_obj, action=None):
|
|||||||
{'vimConnectionInfo': 'VIM Connection Info',
|
{'vimConnectionInfo': 'VIM Connection Info',
|
||||||
'_links': 'Links'}
|
'_links': 'Links'}
|
||||||
)
|
)
|
||||||
|
# Note: To prevent it from appearing in the v2 API output,
|
||||||
|
# the 'VNF Package ID' will be output only if the vnfPkgId exists.
|
||||||
|
if 'vnfPkgId' in vnflcm_obj:
|
||||||
|
column_map.update(
|
||||||
|
{'vnfPkgId': 'VNF Package ID'}
|
||||||
|
)
|
||||||
return sdk_utils.get_osc_show_columns_for_sdk_resource(vnflcm_obj,
|
return sdk_utils.get_osc_show_columns_for_sdk_resource(vnflcm_obj,
|
||||||
column_map)
|
column_map)
|
||||||
|
|
||||||
|
@@ -56,7 +56,7 @@ def _get_columns_vnflcm(action='create'):
|
|||||||
if action == 'list':
|
if action == 'list':
|
||||||
columns = [ele for ele in columns if ele not in
|
columns = [ele for ele in columns if ele not in
|
||||||
['VNFD Version', 'VNF Instance Description',
|
['VNFD Version', 'VNF Instance Description',
|
||||||
'VNF Configurable Properties']]
|
'VNF Configurable Properties', 'VNF Package ID']]
|
||||||
columns.remove('Links')
|
columns.remove('Links')
|
||||||
return columns
|
return columns
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user