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

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