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

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