blob: d7878c9b96bba078f3e9c5919bc36b46a9a04406 [file] [log] [blame]
Jayanth Othayotha3f6aa72017-07-04 02:15:04 -05001#include <phosphor-logging/log.hpp>
2
Jayanth Othayoth224882b2017-05-04 05:46:45 -05003#include "dump_entry.hpp"
Jayanth Othayotha320c7c2017-06-14 07:17:21 -05004#include "dump_manager.hpp"
5
Jayanth Othayoth224882b2017-05-04 05:46:45 -05006namespace phosphor
7{
8namespace dump
9{
10
Jayanth Othayotha320c7c2017-06-14 07:17:21 -050011using namespace phosphor::logging;
Jayanth Othayoth224882b2017-05-04 05:46:45 -050012
13void Entry::delete_()
14{
Jayanth Othayotha320c7c2017-06-14 07:17:21 -050015 //Delete Dump file from Permanent location
Jayanth Othayotha3f6aa72017-07-04 02:15:04 -050016 try
Jayanth Othayotha320c7c2017-06-14 07:17:21 -050017 {
Jayanth Othayoth580cb2d2017-07-17 01:16:19 -050018 fs::remove_all(file.parent_path());
Jayanth Othayotha320c7c2017-06-14 07:17:21 -050019 }
Jayanth Othayotha3f6aa72017-07-04 02:15:04 -050020 catch (fs::filesystem_error& e)
21 {
22 //Log Error message and continue
23 log<level::ERR>(e.what());
24 }
25
Jayanth Othayotha320c7c2017-06-14 07:17:21 -050026 // Remove Dump entry D-bus object
27 parent.erase(id);
Jayanth Othayoth224882b2017-05-04 05:46:45 -050028}
29
30} // namespace dump
31} // namepsace phosphor