Blob Blame Raw
From da2eddac30d499e77597e8660c539d0be90830af Mon Sep 17 00:00:00 2001
From: Matej Habrnal <mhabrnal@redhat.com>
Date: Wed, 9 Mar 2016 14:50:28 +0100
Subject: [PATCH] report client: add silent mode to clean_up()

Related to: #1255259

Signed-off-by: Matej Habrnal <mhabrnal@redhat.com>
---
 src/client-python/reportclient/debuginfo.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/client-python/reportclient/debuginfo.py b/src/client-python/reportclient/debuginfo.py
index 823539b..0385f71 100644
--- a/src/client-python/reportclient/debuginfo.py
+++ b/src/client-python/reportclient/debuginfo.py
@@ -150,7 +150,7 @@ def unpack_rpm(package_full_path, files, tmp_dir, destdir, exact_files=False):
         return RETURN_FAILURE
 
 
-def clean_up(tmp_dir):
+def clean_up(tmp_dir, silent=False):
     """
     Removes the temporary directory.
     """
@@ -159,7 +159,7 @@ def clean_up(tmp_dir):
         try:
             shutil.rmtree(tmp_dir)
         except OSError as ex:
-            if ex.errno != errno.ENOENT:
+            if ex.errno != errno.ENOENT and silent == False:
                 error_msg(_("Can't remove '{0}': {1}").format(tmp_dir, str(ex)))
 
 
-- 
2.5.5