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

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