Hi Gary,
ack, review only. /Thanks HansN
On 08/01/2018 06:49 AM, Gary Lee wrote:
---
src/osaf/consensus/consensus.cc | 17 +++++++++++++++++
src/osaf/consensus/consensus.h | 3 +++
2 files changed, 20 insertions(+)
diff --git a/src/osaf/consensus/consensus.cc b/src/osaf/consensus/consensus.cc
index 800b776e6..2a8e9bb1c 100644
--- a/src/osaf/consensus/consensus.cc
+++ b/src/osaf/consensus/consensus.cc
@@ -453,6 +453,23 @@ SaAisErrorT Consensus::ParseTakeoverRequest(const
std::string& request,
return SA_AIS_OK;
}
+SaAisErrorT Consensus::ReadTakeoverRequest(std::string& request) {
+ TRACE_ENTER();
+
+ std::string value;
+ SaAisErrorT rc;
+
+ rc = KeyValue::Get(kTakeoverRequestKeyname, value);
+ if (rc != SA_AIS_OK) {
+ // it doesn't always exist, don't log an error
+ TRACE("Could not read takeover request (%d)", rc);
+ return SA_AIS_ERR_FAILED_OPERATION;
+ }
+
+ request = value;
+ return SA_AIS_OK;
+}
+
SaAisErrorT Consensus::ReadTakeoverRequest(std::vector<std::string>& tokens) {
TRACE_ENTER();
diff --git a/src/osaf/consensus/consensus.h b/src/osaf/consensus/consensus.h
index fbcbb2037..a606d9de1 100644
--- a/src/osaf/consensus/consensus.h
+++ b/src/osaf/consensus/consensus.h
@@ -45,6 +45,9 @@ class Consensus {
void MonitorTakeoverRequest(ConsensusCallback callback,
const uint32_t user_defined);
+ // Retrieve takeover request (if any)
+ SaAisErrorT ReadTakeoverRequest(std::string& request);
+
// Is consensus service enabled?
bool IsEnabled() const;
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel