Add checks for currently running bmc image before erasing
- Check if the image to be erased is currently running on the BMC. If it
is, fail to erase the image.
Change-Id: Ief2ba2e5e16f6664eeb429699b826cae78ef9291
Signed-off-by: Eddie James <eajames@us.ibm.com>
diff --git a/version.cpp b/version.cpp
index b564416..e6dd9de 100644
--- a/version.cpp
+++ b/version.cpp
@@ -4,6 +4,7 @@
#include <fstream>
#include <stdexcept>
#include <phosphor-logging/log.hpp>
+#include "config.h"
#include "version.hpp"
namespace phosphor
@@ -101,6 +102,11 @@
return version;
}
+bool Version::isFunctional()
+{
+ return versionStr == getBMCVersion(OS_RELEASE_FILE);
+}
+
} // namespace manager
} // namespace software
} // namepsace phosphor