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

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