1 #include "bmc_dump_entry.hpp" 2 3 #include "dump_manager.hpp" 4 #include "dump_offload.hpp" 5 6 #include <fmt/core.h> 7 8 #include <phosphor-logging/log.hpp> 9 10 namespace phosphor 11 { 12 namespace dump 13 { 14 namespace bmc 15 { 16 using namespace phosphor::logging; 17 18 void Entry::delete_() 19 { 20 // Delete Dump file from Permanent location 21 try 22 { 23 std::filesystem::remove_all(file.parent_path()); 24 } 25 catch (const std::filesystem::filesystem_error& e) 26 { 27 // Log Error message and continue 28 log<level::ERR>( 29 fmt::format("Failed to delete dump file, errormsg({})", e.what()) 30 .c_str()); 31 } 32 33 // Remove Dump entry D-bus object 34 phosphor::dump::Entry::delete_(); 35 } 36 37 void Entry::initiateOffload(std::string uri) 38 { 39 phosphor::dump::offload::requestOffload(file, id, uri); 40 offloaded(true); 41 } 42 43 } // namespace bmc 44 } // namespace dump 45 } // namespace phosphor 46