Fix for vnfd-delete with vnfd-name as arg

When deleting a vnfd using vnfd-name as argument it returns
'descripton' string, if db has multiple entries with same name.
This patch fix this problem by checking the existence of key
'description' in 'vnfd' dict.

Change-Id: I3c350ec1b563b1933df93106717f373afc368146
Closes-Bug: #1508174
This commit is contained in:
Bharath Thiruveedula
2015-10-21 07:26:35 +05:30
parent fed4a776dd
commit 24c84e54d9

View File

@@ -417,7 +417,8 @@ class Client(ClientBase):
retrieve_all,
**_params)
for vnfd in vnfds_dict['vnfds']:
if len(vnfd['description']) > DEFAULT_DESC_LENGTH:
if 'description' in vnfd.keys() and \
len(vnfd['description']) > DEFAULT_DESC_LENGTH:
vnfd['description'] = vnfd['description'][:DEFAULT_DESC_LENGTH]
vnfd['description'] += '...'
return vnfds_dict