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

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