Dhruvaraj Subhashchandran | 4a98e8f | 2020-01-29 07:11:08 -0600 | [diff] [blame] | 1 | #include "bmc_dump_entry.hpp" |
| 2 | |
| 3 | #include "dump_manager.hpp" |
Dhruvaraj Subhashchandran | 580d91d | 2020-04-22 12:29:18 -0500 | [diff] [blame] | 4 | #include "dump_offload.hpp" |
Dhruvaraj Subhashchandran | 4a98e8f | 2020-01-29 07:11:08 -0600 | [diff] [blame] | 5 | |
| 6 | #include <phosphor-logging/log.hpp> |
| 7 | |
| 8 | namespace phosphor |
| 9 | { |
| 10 | namespace dump |
| 11 | { |
| 12 | namespace bmc |
| 13 | { |
| 14 | using namespace phosphor::logging; |
| 15 | |
| 16 | void Entry::delete_() |
| 17 | { |
| 18 | // Delete Dump file from Permanent location |
| 19 | try |
| 20 | { |
Jayanth Othayoth | 3fc6df4 | 2021-04-08 03:45:24 -0500 | [diff] [blame] | 21 | std::filesystem::remove_all(file.parent_path()); |
Dhruvaraj Subhashchandran | 4a98e8f | 2020-01-29 07:11:08 -0600 | [diff] [blame] | 22 | } |
Jayanth Othayoth | 3fc6df4 | 2021-04-08 03:45:24 -0500 | [diff] [blame] | 23 | catch (std::filesystem::filesystem_error& e) |
Dhruvaraj Subhashchandran | 4a98e8f | 2020-01-29 07:11:08 -0600 | [diff] [blame] | 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 Subhashchandran | 580d91d | 2020-04-22 12:29:18 -0500 | [diff] [blame] | 33 | void Entry::initiateOffload(std::string uri) |
| 34 | { |
| 35 | phosphor::dump::offload::requestOffload(file, id, uri); |
| 36 | offloaded(true); |
| 37 | } |
| 38 | |
Dhruvaraj Subhashchandran | 4a98e8f | 2020-01-29 07:11:08 -0600 | [diff] [blame] | 39 | } // namespace bmc |
| 40 | } // namespace dump |
| 41 | } // namespace phosphor |