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

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