diff --git a/tackerclient/tacker/v1_0/vm/vnf.py b/tackerclient/tacker/v1_0/vm/vnf.py index f7f2443d..3ffa97d7 100644 --- a/tackerclient/tacker/v1_0/vm/vnf.py +++ b/tackerclient/tacker/v1_0/vm/vnf.py @@ -26,7 +26,7 @@ class ListVNF(tackerV10.ListCommand): resource = _VNF list_columns = ['id', 'name', 'description', 'mgmt_url', 'status', - 'vim_id', 'placement_attr'] + 'vim_id', 'placement_attr', 'error_reason'] class ShowVNF(tackerV10.ShowCommand): diff --git a/tackerclient/v1_0/client.py b/tackerclient/v1_0/client.py index 44e562da..8304ad97 100644 --- a/tackerclient/v1_0/client.py +++ b/tackerclient/v1_0/client.py @@ -30,6 +30,7 @@ from tackerclient.i18n import _ _logger = logging.getLogger(__name__) DEFAULT_DESC_LENGTH = 25 +DEFAULT_ERROR_REASON_LENGTH = 100 def exception_handler_v10(status_code, error_content): @@ -390,7 +391,15 @@ class Client(ClientBase): @APIParamsCall def list_vnfs(self, retrieve_all=True, **_params): - return self.list('vnfs', self.vnfs_path, retrieve_all, **_params) + vnfs = self.list('vnfs', self.vnfs_path, retrieve_all, **_params) + for vnf in vnfs['vnfs']: + error_reason = vnf.get('error_reason', None) + if error_reason and \ + len(error_reason) > DEFAULT_ERROR_REASON_LENGTH: + vnf['error_reason'] = error_reason[ + :DEFAULT_ERROR_REASON_LENGTH] + vnf['error_reason'] += '...' + return vnfs @APIParamsCall def show_vnf(self, vnf, **_params):