Update System GUID handling to be more robust
If the service that owns the GUID has not yet started when
netipmid starts, netipmid was throwing an error and failing
to start. If the time difference was too great, it would fail
to re-start and then stay stopped. This makes the error
handling more robust so that the order is not so important.
Tested: started netipmid with and without the UUID service
running and restarted the service to ensure that
netipmid would stay running.
Signed-off-by: Vernon Mauery <vernon.mauery@linux.intel.com>
Change-Id: Id464330a2ba8416ff229fa258fff0ad7a1b8f51c
diff --git a/command/rakp12.cpp b/command/rakp12.cpp
index a6b4f85..2b7a925 100644
--- a/command/rakp12.cpp
+++ b/command/rakp12.cpp
@@ -292,7 +292,8 @@
std::advance(iter, cipher::rakp_auth::BMC_RANDOM_NUMBER_LEN);
// Managed System GUID
- std::copy_n(cache::guid.data(), cache::guid.size(), iter);
+ const Guid& guid = command::getSystemGUID();
+ std::copy_n(guid.data(), guid.size(), iter);
std::advance(iter, BMC_GUID_LEN);
// Requested Privilege Level
@@ -320,8 +321,7 @@
response->managed_system_random_number);
// Copy System GUID to the Response
- std::copy_n(cache::guid.data(), cache::guid.size(),
- response->managed_system_guid);
+ std::copy_n(guid.data(), guid.size(), response->managed_system_guid);
// Insert the HMAC output into the payload
outPayload.insert(outPayload.end(), output.begin(), output.end());