Blame SOURCES/0207-vmcore-catch-IOErrors-and-OSErrors.patch

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