From ed23c0e7bd149a98891b9607e64f71790d5a5ca8 Mon Sep 17 00:00:00 2001 From: dharmendra Date: Thu, 5 Jul 2018 08:53:39 +0000 Subject: [PATCH] Fix: Tackerclient failed to handle yaml load error. While onboarding a vnfd with infected vnfd file, yaml.load() raised exception. Due to which instead of giving meaningful error message, tackerclient raised traces with TypeError. Fixing this issue with proper error handling. Change-Id: I7a4150a898fcf99d8ffbc97e16da6a219cade93d Closes-Bug: #1780214 --- tackerclient/osc/v1/vnfm/vnfd.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tackerclient/osc/v1/vnfm/vnfd.py b/tackerclient/osc/v1/vnfm/vnfd.py index 2d2bc850..76b1182e 100644 --- a/tackerclient/osc/v1/vnfm/vnfd.py +++ b/tackerclient/osc/v1/vnfm/vnfd.py @@ -77,7 +77,8 @@ class CreateVNFD(command.ShowOne): try: vnfd = yaml.load(vnfd, Loader=yaml.SafeLoader) except yaml.YAMLError as e: - raise exceptions.InvalidInput(e) + msg = _("yaml failed to load vnfd file. %s") % e + raise exceptions.InvalidInput(msg) if not vnfd: raise exceptions.InvalidInput("vnfd file is empty") body[_VNFD]['attributes'] = {'vnfd': vnfd}