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

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