Skip to content

Commit

Permalink
item_updater: Use relative path to append OS_RELEASE_FILE
Browse files Browse the repository at this point in the history
The path append behavior changed between std::experimental and
std::filesystem where appending an absolute path replaces the path
instead of appending, therefore need to use .relative_path().

This was causing the item updater to recreate the d-bus objects with
version OS_RELEASE_FILE instead of MEDIA_DIR/rofs-x/OS_RELEASE_FILE
marking the 2 versions of the system functional and with the same
version string.

Fixes #5

Tested: Verified with debug logs that the path was just OS_RELEASE_FILE
        without this change, and it was MEDIA_DIR/rofs-x/OS_RELEASE_FILE
        after this change, the version strings were correct, and only 1
        functional BMC association was created.

Change-Id: I2f81942d7fbb24e839e8f712cd2d84a80b7cd125
Signed-off-by: Adriana Kobylak <anoo@us.ibm.com>
  • Loading branch information
anoo1 committed Jun 10, 2020
1 parent 58aa750 commit 24a8d83
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion item_updater.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,8 @@ void ItemUpdater::processBMCImage()
// The versionId is extracted from the path
// for example /media/ro-2a1022fe.
auto id = iter.path().native().substr(BMC_RO_PREFIX_LEN);
auto osRelease = iter.path() / OS_RELEASE_FILE;
fs::path releaseFile(OS_RELEASE_FILE);
auto osRelease = iter.path() / releaseFile.relative_path();
if (!fs::is_regular_file(osRelease))
{
log<level::ERR>(
Expand Down

0 comments on commit 24a8d83

Please sign in to comment.