This repository has been archived on 2026-01-16. You can view files and clone it, but you cannot make any changes to its state, such as pushing and creating new issues, pull requests or comments.
abrt-addon-python3/0207-vmcore-catch-IOErrors-and-OSErrors.patch
Matej Habrnal 69165ba9cc Introduce abrt-addon-python3 package
Signed-off-by: Matej Habrnal <mhabrnal@redhat.com>
2017-07-04 09:22:28 +02:00

41 lines
1.4 KiB
Diff

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