Jayanth Othayoth | a3f6aa7 | 2017-07-04 02:15:04 -0500 | [diff] [blame] | 1 | #include <phosphor-logging/log.hpp> |
2 | |||||
Jayanth Othayoth | 224882b | 2017-05-04 05:46:45 -0500 | [diff] [blame] | 3 | #include "dump_entry.hpp" |
Jayanth Othayoth | a320c7c | 2017-06-14 07:17:21 -0500 | [diff] [blame] | 4 | #include "dump_manager.hpp" |
5 | |||||
Jayanth Othayoth | 224882b | 2017-05-04 05:46:45 -0500 | [diff] [blame] | 6 | namespace phosphor |
7 | { | ||||
8 | namespace dump | ||||
9 | { | ||||
10 | |||||
Jayanth Othayoth | a320c7c | 2017-06-14 07:17:21 -0500 | [diff] [blame] | 11 | using namespace phosphor::logging; |
Jayanth Othayoth | 224882b | 2017-05-04 05:46:45 -0500 | [diff] [blame] | 12 | |
13 | void Entry::delete_() | ||||
14 | { | ||||
Jayanth Othayoth | a320c7c | 2017-06-14 07:17:21 -0500 | [diff] [blame] | 15 | //Delete Dump file from Permanent location |
Jayanth Othayoth | a3f6aa7 | 2017-07-04 02:15:04 -0500 | [diff] [blame] | 16 | try |
Jayanth Othayoth | a320c7c | 2017-06-14 07:17:21 -0500 | [diff] [blame] | 17 | { |
Jayanth Othayoth | 580cb2d | 2017-07-17 01:16:19 -0500 | [diff] [blame] | 18 | fs::remove_all(file.parent_path()); |
Jayanth Othayoth | a320c7c | 2017-06-14 07:17:21 -0500 | [diff] [blame] | 19 | } |
Jayanth Othayoth | a3f6aa7 | 2017-07-04 02:15:04 -0500 | [diff] [blame] | 20 | catch (fs::filesystem_error& e) |
21 | { | ||||
22 | //Log Error message and continue | ||||
23 | log<level::ERR>(e.what()); | ||||
24 | } | ||||
25 | |||||
Jayanth Othayoth | a320c7c | 2017-06-14 07:17:21 -0500 | [diff] [blame] | 26 | // Remove Dump entry D-bus object |
27 | parent.erase(id); | ||||
Jayanth Othayoth | 224882b | 2017-05-04 05:46:45 -0500 | [diff] [blame] | 28 | } |
29 | |||||
30 | } // namespace dump | ||||
31 | } // namepsace phosphor |