common: allow update to Version interface
Change 'setVersion' to change the 'Version' property on
xyz.openbmc_project.Software.Version
Tested: 'Version' property is updated an error is no longer printed.
Change-Id: I684b9feb5465239aae5cfae846179782d579678c
Signed-off-by: Alexander Hansen <alexander.hansen@9elements.com>
diff --git a/common/src/software.cpp b/common/src/software.cpp
index 03e9199..faa377a 100644
--- a/common/src/software.cpp
+++ b/common/src/software.cpp
@@ -127,13 +127,12 @@
{
debug("{SWID}: set version {VERSION}", "SWID", swid, "VERSION", versionStr);
- if (version)
+ if (!version)
{
- error("{SWID}: version was already set", "SWID", swid);
- return;
+ version =
+ std::make_unique<SoftwareVersion>(ctx, objectPath.str.c_str());
}
- version = std::make_unique<SoftwareVersion>(ctx, objectPath.str.c_str());
version->version(versionStr);
}