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

caddy-frontend: Trim down SlapOS log on error

In case of error during processing SlapOS software or instance expose
last 100 lines of the message, which is enough to identify the problem and
does not clutter the test master.
parent ed6bf16e
...@@ -177,7 +177,8 @@ class SlapOSInstanceTestCase(unittest.TestCase): ...@@ -177,7 +177,8 @@ class SlapOSInstanceTestCase(unittest.TestCase):
cls.config, environment=os.environ) cls.config, environment=os.environ)
stream.seek(0) stream.seek(0)
stream.flush() stream.flush()
assert cls.software_status_dict['status_code'] == 0, stream.read() message = ''.join(stream.readlines()[-100:])
assert cls.software_status_dict['status_code'] == 0, message
finally: finally:
logger.removeHandler(stream_handler) logger.removeHandler(stream_handler)
del stream del stream
...@@ -198,7 +199,8 @@ class SlapOSInstanceTestCase(unittest.TestCase): ...@@ -198,7 +199,8 @@ class SlapOSInstanceTestCase(unittest.TestCase):
environment=os.environ) environment=os.environ)
stream.seek(0) stream.seek(0)
stream.flush() stream.flush()
assert cls.instance_status_dict['status_code'] == 0, stream.read() message = ''.join(stream.readlines()[-100:])
assert cls.instance_status_dict['status_code'] == 0, message
finally: finally:
logger.removeHandler(stream_handler) logger.removeHandler(stream_handler)
del stream del stream
......
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