diff options
author | Christian Poessinger <christian@poessinger.com> | 2020-04-27 19:18:44 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-04-27 19:18:44 +0200 |
commit | 9bdc3dca0d1b2cec3422b08c186af80ac2aa665e (patch) | |
tree | da61eb05d3b449c49dae81401a7e30a6aec87ffe /python/vyos/airbag.py | |
parent | 5403dbae479266411eaa754ca3f32af79b26a284 (diff) | |
parent | 4e86c7aaa32570e8785a6caa3614c570bcd038a7 (diff) | |
download | vyos-1x-9bdc3dca0d1b2cec3422b08c186af80ac2aa665e.tar.gz vyos-1x-9bdc3dca0d1b2cec3422b08c186af80ac2aa665e.zip |
Merge pull request #379 from thomas-mangin/T2226-improve
util: T2226: multiple improvements
Diffstat (limited to 'python/vyos/airbag.py')
-rw-r--r-- | python/vyos/airbag.py | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/python/vyos/airbag.py b/python/vyos/airbag.py index 6698aa404..b7838d8a2 100644 --- a/python/vyos/airbag.py +++ b/python/vyos/airbag.py @@ -26,6 +26,17 @@ from vyos.version import get_full_version_data DISABLE = False +_noteworthy = [] + +def noteworthy(msg): + """ + noteworthy can be use to take note things which we may not want to + report to the user may but be worth including in bug report + if something goes wrong later on + """ + _noteworthy.append(msg) + + # emulate a file object class _IO(object): def __init__(self, std, log): @@ -58,11 +69,16 @@ def bug_report(dtype, value, trace): information = get_full_version_data() trace = '\n'.join(format_exception(dtype, value, trace)).replace('\n\n','\n') + note = '' + if _noteworthy: + note = 'noteworthy:\n' + note += '\n'.join(_noteworthy) information.update({ 'date': datetime.now().strftime('%Y-%m-%d %H:%M:%S'), 'trace': trace, 'instructions': COMMUNITY if 'rolling' in get_version() else SUPPORTED, + 'note': note, }) sys.stdout.write(INTRO.format(**information)) @@ -145,6 +161,7 @@ Hardware S/N: {hardware_serial} Hardware UUID: {hardware_uuid} {trace} +{note} """ INTRO = """\ |