summaryrefslogtreecommitdiff
path: root/python/vyos/airbag.py
diff options
context:
space:
mode:
authorThomas Mangin <thomas.mangin@exa.net.uk>2020-04-20 17:04:56 +0100
committerThomas Mangin <thomas.mangin@exa.net.uk>2020-04-20 17:04:56 +0100
commit1169b4298bb8bce5cb36f8fa8601d63c30abe67b (patch)
tree58fd6df3f5fc829feff4d5390a834024373cba48 /python/vyos/airbag.py
parentb704d0676ab2d623d2eeb1ed4dc1bcf2a2c4a5e2 (diff)
downloadvyos-1x-1169b4298bb8bce5cb36f8fa8601d63c30abe67b.tar.gz
vyos-1x-1169b4298bb8bce5cb36f8fa8601d63c30abe67b.zip
airbag: T2186: improve information reported
Diffstat (limited to 'python/vyos/airbag.py')
-rw-r--r--python/vyos/airbag.py46
1 files changed, 32 insertions, 14 deletions
diff --git a/python/vyos/airbag.py b/python/vyos/airbag.py
index a2e9de491..6698aa404 100644
--- a/python/vyos/airbag.py
+++ b/python/vyos/airbag.py
@@ -13,15 +13,14 @@
# You should have received a copy of the GNU Lesser General Public
# License along with this library. If not, see <http://www.gnu.org/licenses/>.
-import os
import sys
from datetime import datetime
from vyos import debug
from vyos.config import Config
-from vyos.version import get_version
-from vyos.util import run
from vyos.logger import syslog
+from vyos.version import get_version
+from vyos.version import get_full_version_data
# we allow to disable the extra logging
DISABLE = False
@@ -57,12 +56,14 @@ def bug_report(dtype, value, trace):
sys.stdout.flush()
sys.stderr.flush()
- information = {
+ information = get_full_version_data()
+ trace = '\n'.join(format_exception(dtype, value, trace)).replace('\n\n','\n')
+
+ information.update({
'date': datetime.now().strftime('%Y-%m-%d %H:%M:%S'),
- 'version': get_version(),
- 'trace': '\n'.join(format_exception(dtype, value, trace)),
+ 'trace': trace,
'instructions': COMMUNITY if 'rolling' in get_version() else SUPPORTED,
- }
+ })
sys.stdout.write(INTRO.format(**information))
sys.stdout.flush()
@@ -125,8 +126,23 @@ if get_version() and insession:
# if the key before the value has not time, syslog takes that as the source of the message
FAULT = """\
-Fault Time: {date}
-VyOS image: {version}
+Report Time: {date}
+Image Version: VyOS {version}
+Release Train: {release_train}
+
+Built by: {built_by}
+Built on: {built_on}
+Build UUID: {build_uuid}
+Build Commit ID: {build_git}
+
+Architecture: {system_arch}
+Boot via: {boot_via}
+System type: {system_type}
+
+Hardware vendor: {hardware_vendor}
+Hardware model: {hardware_model}
+Hardware S/N: {hardware_serial}
+Hardware UUID: {hardware_uuid}
{trace}
"""
@@ -134,13 +150,13 @@ VyOS image: {version}
INTRO = """\
VyOS had an issue completing a command.
-We are sorry that you encountered a problem with VyOS.
+We are sorry that you encountered a problem while using VyOS.
There are a few things you can do to help us (and yourself):
{instructions}
-PLEASE, when reporting, do include as much information as you can:
-- do not obfuscate any data (feel free to send us a private communication with
- the extra information if your business policy is strict on information sharing)
+When reporting problems, please include as much information as possible:
+- do not obfuscate any data (feel free to contact us privately if your
+ business policy requires it)
- and include all the information presented below
"""
@@ -157,6 +173,8 @@ COMMUNITY = """\
SUPPORTED = """\
- Make sure you are running the latest stable version of VyOS
the code is available at https://downloads.vyos.io/?dir=release/current
-- Contact us on our online help desk
+- Contact us using the online help desk
https://support.vyos.io/
+- Join our community on slack where our users exchange help and advice
+ https://vyos.slack.com
""".strip()