blob: ce59a7fc0f9ffe90d6bde8a8622fe746ab9b2aef [file] [log] [blame]
Dhruvaraj Subhashchandran4a98e8f2020-01-29 07:11:08 -06001#include "bmc_dump_entry.hpp"
2
3#include "dump_manager.hpp"
Dhruvaraj Subhashchandran580d91d2020-04-22 12:29:18 -05004#include "dump_offload.hpp"
Dhruvaraj Subhashchandran4a98e8f2020-01-29 07:11:08 -06005
6#include <phosphor-logging/log.hpp>
7
8namespace phosphor
9{
10namespace dump
11{
12namespace bmc
13{
14using namespace phosphor::logging;
15
16void Entry::delete_()
17{
18 // Delete Dump file from Permanent location
19 try
20 {
21 fs::remove_all(file.parent_path());
22 }
23 catch (fs::filesystem_error& e)
24 {
25 // Log Error message and continue
26 log<level::ERR>(e.what());
27 }
28
29 // Remove Dump entry D-bus object
30 phosphor::dump::Entry::delete_();
31}
32
Dhruvaraj Subhashchandran580d91d2020-04-22 12:29:18 -050033void Entry::initiateOffload(std::string uri)
34{
35 phosphor::dump::offload::requestOffload(file, id, uri);
36 offloaded(true);
37}
38
Dhruvaraj Subhashchandran4a98e8f2020-01-29 07:11:08 -060039} // namespace bmc
40} // namespace dump
41} // namespace phosphor