From 25bc9f49d75cb70e3b2d88c4ebb3fbb4c63ce409 Mon Sep 17 00:00:00 2001 From: Jeff Lane Date: Mon, 21 Aug 2017 18:06:46 -0400 Subject: Fix dmesg_attachment job to work on systems that don't have a /var/log/dmesg file present, such as MAAS deployments. lp: #1712103 --- jobs/info.txt.in | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/jobs/info.txt.in b/jobs/info.txt.in index 0b270d87..900d4c74 100644 --- a/jobs/info.txt.in +++ b/jobs/info.txt.in @@ -31,10 +31,16 @@ _summary: Attach a copy of /proc/cpuinfo id: dmesg_attachment plugin: attachment category_id: com.canonical.plainbox::info -command: cat /var/log/dmesg | ansi_parser +user: root +command: + if [ -e /var/log/dmesg ]; then + cat /var/log/dmesg | ansi_parser + else + dmesg | ansi_parser + fi estimated_duration: 0.640 -_description: Attaches a copy of /var/log/dmesg to the test results -_summary: Attach a copy of /var/log/dmesg +_description: Attaches a copy of /var/log/dmesg or the current dmesg buffer to the test results +_summary: Attach a copy of dmesg id: dmi_attachment plugin: attachment -- cgit v1.2.3