Ensure that errors during preload do not prevent validation
report creation
Issue-ID: VVP-335
Signed-off-by: Lovett, Trevor <trevor.lovett@att.com>
Change-Id: I0cfd411b6a034422e349b96c462e68a4f0ceb876
:return: path to env file (assumes it is present and named correctly)
"""
base_path = os.path.splitext(heat_path)[0]
- return "{}.env".format(base_path)
+ env_path = "{}.env".format(base_path)
+ return env_path if os.path.exists(env_path) else None
class VnfModule(FilterBaseOutputs):
def pytest_terminal_summary(terminalreporter, exitstatus):
# Ensures all preload information and warnings appear after
# test results
- create_preloads(terminalreporter.config, exitstatus)
+ try:
+ create_preloads(terminalreporter.config, exitstatus)
+ except Exception:
+ print("Error creating preloads, skipping preload generation")
+ traceback.print_exc()
# noinspection PyUnusedLocal