From 7bdeea4bae5be3ff4ccbc880d2a681e9b44fc0a6 Mon Sep 17 00:00:00 2001
From: Siba Prasad <sibap@codeaurora.org>
Date: Wed, 8 Mar 2017 20:24:19 +0530
Subject: [PATCH] lrdp-v2: Add remove_file support to ramdump class

This adds remove_file function to ramdump class.

Change-Id: Ibe6196aad7ccd1c2bb381b9adab682394244f879
---
 linux-ramdump-parser-v2/ramdump.py | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/linux-ramdump-parser-v2/ramdump.py b/linux-ramdump-parser-v2/ramdump.py
index 289b850..200c49b 100755
--- a/linux-ramdump-parser-v2/ramdump.py
+++ b/linux-ramdump-parser-v2/ramdump.py
@@ -695,6 +695,16 @@ class RamDump():
             sys.exit(1)
         return f
 
+    def remove_file(self, file_name):
+	file_path = os.path.join(self.outdir, file_name)
+	try:
+	    if (os.path.exists(file_path)):
+		os.remove(file_path)
+	except:
+	    print_out_str('Could not remove file {0}'.format(file_path))
+	    print_out_str('Do you have write/read permissions on the path?')
+	    sys.exit(1)
+
     def get_config(self):
         kconfig_addr = self.address_of('kernel_config_data')
         if kconfig_addr is None:
-- 
GitLab