From ea75b7596605a2bb7e5f51aa39ca6e5a962c59db Mon Sep 17 00:00:00 2001 From: morganrol Date: Wed, 21 Apr 2021 14:45:24 +0200 Subject: [EXCEPTIONS] Distinguish onaptests and onapsdk exception there is no error_message method on onapsdk exception as a consequence we may raise a new excpetion when catching sdk exception leading to the non generation of the report Issue-ID: TEST-332 Signed-off-by: morganrol Change-Id: I42d1413ef142e29eeafdfe701f136ae45b097de4 (cherry picked from commit 0a9bc9eba1ada15ec1a2934f3baa465804f20e76) --- src/onaptests/scenario/cds_blueprint_enrichment.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/onaptests/scenario/cds_blueprint_enrichment.py') diff --git a/src/onaptests/scenario/cds_blueprint_enrichment.py b/src/onaptests/scenario/cds_blueprint_enrichment.py index c1df63e..3354ee1 100644 --- a/src/onaptests/scenario/cds_blueprint_enrichment.py +++ b/src/onaptests/scenario/cds_blueprint_enrichment.py @@ -35,10 +35,14 @@ class CDSBlueprintEnrichment(testcase.TestCase): try: self.test.execute() self.result = 100 - except (OnapTestException, SDKException) as exc: + except OnapTestException as exc: self.result = 0 self.__logger.error(exc.error_message) - self.stop_time = time.time() + except SDKException: + self.result = 0 + self.__logger.error("SDK Exception") + finally: + self.stop_time = time.time() def clean(self): """Clean Additional resources if needed.""" -- cgit 1.2.3-korg