Commit c1876299 authored by Łukasz Nowak's avatar Łukasz Nowak

slapos.cookbook: Expose problems found in _failsafe publishing

Marking that publish failed is important, but allow the operator of the system
understand what is the real problem (aka - do not swallow exception
information) is also very important.
parent 6fa1d9ae
Pipeline #27816 failed with stage
...@@ -30,6 +30,7 @@ from slapos.recipe.librecipe import wrap ...@@ -30,6 +30,7 @@ from slapos.recipe.librecipe import wrap
from slapos.recipe.librecipe import GenericSlapRecipe from slapos.recipe.librecipe import GenericSlapRecipe
import six import six
import os import os
import traceback
CONNECTION_PARAMETER_STRING = 'connection-' CONNECTION_PARAMETER_STRING = 'connection-'
...@@ -79,7 +80,7 @@ class Failsafe(object): ...@@ -79,7 +80,7 @@ class Failsafe(object):
except Exception: except Exception:
if error_status_file is not None: if error_status_file is not None:
with open(error_status_file, 'w') as fh: with open(error_status_file, 'w') as fh:
fh.write('') fh.write(traceback.format_exc())
else: else:
if error_status_file is not None: if error_status_file is not None:
if os.path.exists(error_status_file): if os.path.exists(error_status_file):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment