From 24c84e54d9a598e6deaecd3dd076982a0d5b87cd Mon Sep 17 00:00:00 2001 From: Bharath Thiruveedula Date: Wed, 21 Oct 2015 07:26:35 +0530 Subject: [PATCH] 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 --- tackerclient/v1_0/client.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tackerclient/v1_0/client.py b/tackerclient/v1_0/client.py index 13beb850..f7017500 100644 --- a/tackerclient/v1_0/client.py +++ b/tackerclient/v1_0/client.py @@ -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