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

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