bcb3c1e
From 01557f26b84f392dd74083b47d763def27683410 Mon Sep 17 00:00:00 2001
bcb3c1e
From: Jakub Filak <jfilak@redhat.com>
bcb3c1e
Date: Thu, 27 Nov 2014 12:45:04 +0100
bcb3c1e
Subject: [PATCH] vmcore: catch IOErrors and OSErrors
bcb3c1e
bcb3c1e
Perhaps some temporary data cleaner removed problem directory while the hook
bcb3c1e
was still using in.
bcb3c1e
bcb3c1e
Resolves: rhbz#1077241
bcb3c1e
bcb3c1e
Signed-off-by: Jakub Filak <jfilak@redhat.com>
bcb3c1e
---
bcb3c1e
 src/hooks/abrt_harvest_vmcore.py.in | 12 ++++++++++--
bcb3c1e
 1 file changed, 10 insertions(+), 2 deletions(-)
bcb3c1e
bcb3c1e
diff --git a/src/hooks/abrt_harvest_vmcore.py.in b/src/hooks/abrt_harvest_vmcore.py.in
bcb3c1e
index 17e2be8..c6a7e6b 100644
bcb3c1e
--- a/src/hooks/abrt_harvest_vmcore.py.in
bcb3c1e
+++ b/src/hooks/abrt_harvest_vmcore.py.in
bcb3c1e
@@ -272,8 +272,16 @@ def harvest_vmcore():
bcb3c1e
             except OSError:
bcb3c1e
                 sys.stderr.write("Unable to delete '%s'. Ignoring\n" % f_full)
bcb3c1e
 
bcb3c1e
-        # Let abrtd know what type of problem it is:
bcb3c1e
-        create_abrtd_info(destdirnew)
bcb3c1e
+        try:
bcb3c1e
+            # Let abrtd know what type of problem it is:
bcb3c1e
+            create_abrtd_info(destdirnew)
bcb3c1e
+        except EnvironmentError as ex:
bcb3c1e
+            sys.stderr.write("Unable to create problem directory info: " + str(ex))
bcb3c1e
+            try:
bcb3c1e
+                shutil.rmtree(destdirnew)
bcb3c1e
+            except Exception as ex:
bcb3c1e
+                sys.stderr.write("Unable to remove incomplete problem directory: " + str(ex))
bcb3c1e
+            continue
bcb3c1e
 
bcb3c1e
         # chown -R 0:0
bcb3c1e
         change_owner_rec(destdirnew)
bcb3c1e
-- 
bcb3c1e
2.1.0
bcb3c1e