Limit description length in vnfd-list
Change-Id: I2d8ce85edeca1a76525e8bb2c9cb20f2ff913539 Closes-Bug: #1501482
This commit is contained in:
parent
27c0176640
commit
9a389194fb
@ -30,6 +30,7 @@ from tackerclient.i18n import _
|
|||||||
|
|
||||||
|
|
||||||
_logger = logging.getLogger(__name__)
|
_logger = logging.getLogger(__name__)
|
||||||
|
DEFAULT_DESC_LENGTH = 25
|
||||||
|
|
||||||
|
|
||||||
def exception_handler_v10(status_code, error_content):
|
def exception_handler_v10(status_code, error_content):
|
||||||
@ -411,10 +412,15 @@ class Client(ClientBase):
|
|||||||
|
|
||||||
@APIParamsCall
|
@APIParamsCall
|
||||||
def list_vnfds(self, retrieve_all=True, **_params):
|
def list_vnfds(self, retrieve_all=True, **_params):
|
||||||
return self.list(self._VNFD + 's',
|
vnfds_dict = self.list(self._VNFD + 's',
|
||||||
self.vnfds_path,
|
self.vnfds_path,
|
||||||
retrieve_all,
|
retrieve_all,
|
||||||
**_params)
|
**_params)
|
||||||
|
for vnfd in vnfds_dict['vnfds']:
|
||||||
|
if len(vnfd['description']) > DEFAULT_DESC_LENGTH:
|
||||||
|
vnfd['description'] = vnfd['description'][:DEFAULT_DESC_LENGTH]
|
||||||
|
vnfd['description'] += '...'
|
||||||
|
return vnfds_dict
|
||||||
|
|
||||||
@APIParamsCall
|
@APIParamsCall
|
||||||
def show_vnfd(self, vnfd, **_params):
|
def show_vnfd(self, vnfd, **_params):
|
||||||
|
Loading…
Reference in New Issue
Block a user