Blame SOURCES/0325-harvest_vmcore-Fix-missing-argument-error-during-del.patch

3bf41f
From 8a8c0021681dbc07f702a8245e47b1bed165c77b Mon Sep 17 00:00:00 2001
3bf41f
From: Jake Daryll Obina <jake.obina@gmail.com>
3bf41f
Date: Mon, 25 Jun 2018 11:52:11 +0800
3bf41f
Subject: [PATCH] harvest_vmcore: Fix missing argument error during
3bf41f
 delete_and_close()
3bf41f
3bf41f
delete_and_close() requires a directory name argument and it is being called
3bf41f
without one. This argument is really not necessary though since the directory
3bf41f
name is already saved in the directory object (can be queried via the directory
3bf41f
object's name attribute), and it is the saved directory that is always deleted
3bf41f
regardless of the argument passed in.
3bf41f
3bf41f
Signed-off-by: Jake Daryll Obina <jake.obina@gmail.com>
3bf41f
---
3bf41f
 src/hooks/abrt_harvest_vmcore.py.in | 6 ++++--
3bf41f
 1 file changed, 4 insertions(+), 2 deletions(-)
3bf41f
3bf41f
diff --git a/src/hooks/abrt_harvest_vmcore.py.in b/src/hooks/abrt_harvest_vmcore.py.in
3bf41f
index b2ff283d..18d1b1cf 100644
3bf41f
--- a/src/hooks/abrt_harvest_vmcore.py.in
3bf41f
+++ b/src/hooks/abrt_harvest_vmcore.py.in
3bf41f
@@ -127,13 +127,15 @@ def create_abrtd_info(dest, uuid):
3bf41f
     return dd
3bf41f
 
3bf41f
 
3bf41f
-def delete_and_close(dd, dd_dirname):
3bf41f
+def delete_and_close(dd):
3bf41f
     """
3bf41f
     Deletes the given dump directory and closes it.
3bf41f
 
3bf41f
     dd - dump directory object
3bf41f
-    dd_dirname - full path to dump directory
3bf41f
     """
3bf41f
+    # Save the directory name as the directory object could be destroyed during
3bf41f
+    # delete().
3bf41f
+    dd_dirname = dd.name
3bf41f
     if not dd.delete() == 0:
3bf41f
         sys.stderr.write("Unable to delete '%s'\n" % (dd_dirname))
3bf41f
         return
3bf41f
-- 
3bf41f
2.26.0.rc2
3bf41f