blob_handler: Have delete return a status
A user of this library would like to know if the delete operation
succeeds or fails.
Change-Id: Ida5890be9dad214854527c8afffd05bffc7e5e2a
Signed-off-by: William A. Kennington III <wak@google.com>
diff --git a/src/ipmiblob/blob_handler.cpp b/src/ipmiblob/blob_handler.cpp
index 3d14eff..2076add 100644
--- a/src/ipmiblob/blob_handler.cpp
+++ b/src/ipmiblob/blob_handler.cpp
@@ -357,7 +357,7 @@
}
}
-void BlobHandler::deleteBlob(const std::string& id)
+bool BlobHandler::deleteBlob(const std::string& id)
{
std::vector<std::uint8_t> name;
std::copy(id.begin(), id.end(), std::back_inserter(name));
@@ -366,11 +366,13 @@
try
{
sendIpmiPayload(BlobOEMCommands::bmcBlobDelete, name);
+ return true;
}
catch (const BlobException& b)
{
std::fprintf(stderr, "Received failure on delete: %s\n", b.what());
}
+ return false;
}
std::vector<std::uint8_t> BlobHandler::readBytes(std::uint16_t session,