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

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