Blame SOURCES/0001-Report-root-error-when-a-callout-can-t-be-executed.patch

9163a4
From ff69f6c64b14282172716d4e97b4b81da7606483 Mon Sep 17 00:00:00 2001
9163a4
From: Jonathon Jongsma <jjongsma@redhat.com>
9163a4
Date: Wed, 1 Dec 2021 16:37:36 -0600
9163a4
Subject: [PATCH 1/2] Report root error when a callout can't be executed
9163a4
9163a4
We were ignoring the error result when a callout script failed to
9163a4
execute. In order to debug issues more easily, handle the error and
9163a4
print it to the debug output.
9163a4
9163a4
Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
9163a4
---
9163a4
 src/callouts.rs | 8 ++++----
9163a4
 1 file changed, 4 insertions(+), 4 deletions(-)
9163a4
9163a4
diff --git a/src/callouts.rs b/src/callouts.rs
9163a4
index 1c92d85..17b733b 100644
9163a4
--- a/src/callouts.rs
9163a4
+++ b/src/callouts.rs
9163a4
@@ -240,8 +240,8 @@ impl Callout {
9163a4
         for s in dir.as_ref().read_dir().ok()? {
9163a4
             let path = s.ok()?.path();
9163a4
 
9163a4
-            match self.invoke_script(dev, &path, event, action).ok() {
9163a4
-                Some(res) => {
9163a4
+            match self.invoke_script(dev, &path, event, action) {
9163a4
+                Ok(res) => {
9163a4
                     if res.status.code().is_none() {
9163a4
                         warn!("callout script {:?} was terminated by a signal", path);
9163a4
                         continue;
9163a4
@@ -255,8 +255,8 @@ impl Callout {
9163a4
                         );
9163a4
                     }
9163a4
                 }
9163a4
-                _ => {
9163a4
-                    debug!("failed to execute callout script {:?}", path);
9163a4
+                Err(e) => {
9163a4
+                    debug!("failed to execute callout script {:?}: {:?}", path, e);
9163a4
                     continue;
9163a4
                 }
9163a4
             }
9163a4
-- 
9163a4
2.33.1
9163a4