Consider settings custom exceptions for reporting 62/117662/1
authormorganrol <morgan.richomme@orange.com>
Wed, 10 Feb 2021 09:16:59 +0000 (10:16 +0100)
committermorganrol <morgan.richomme@orange.com>
Wed, 10 Feb 2021 09:17:06 +0000 (10:17 +0100)
Issue-ID: TEST-303

Signed-off-by: morganrol <morgan.richomme@orange.com>
Change-Id: Ia94f963cc145f154756e2765e7a8a5883ceb3188

src/onaptests/steps/reports_collection.py

index 4e19012..34b28af 100644 (file)
@@ -4,7 +4,7 @@ from enum import Enum
 from typing import List
 from jinja2 import Environment, FileSystemLoader, select_autoescape
 from onapsdk.configuration import settings
-
+from onapsdk.exceptions import SettingsError
 
 class ReportStepStatus(Enum):
     """Enum which stores steps execution statuses."""
@@ -63,12 +63,12 @@ class ReportsCollection:
         usecase = settings.SERVICE_NAME
         try:
             details = settings.SERVICE_DETAILS
-        except (KeyError, AttributeError):
+        except (KeyError, AttributeError, SettingsError):
             details = ""
 
         try:
             components = settings.SERVICE_COMPONENTS
-        except (KeyError, AttributeError):
+        except (KeyError, AttributeError, SettingsError):
             components = ""
 
         jinja_env = Environment(