diff options
author | Przemyslaw Czarnowski <przemyslaw.hawrylewicz.czarnowski@intel.com> | 2021-04-14 12:02:46 +0300 |
---|---|---|
committer | Ed Tanous <ed@tanous.net> | 2021-04-22 18:15:05 +0300 |
commit | 1a6258dc985cde406d9098130e4a2d683e82beb2 (patch) | |
tree | b34a6d89dba6e90c83bacb5db6c177e19457d497 /redfish-core/lib/virtual_media.hpp | |
parent | 9a128eb3fc3008f802974360e98de6495ed1a66b (diff) | |
download | bmcweb-1a6258dc985cde406d9098130e4a2d683e82beb2.tar.xz |
Fix comparison for proxy/legacy mode
After sdbusplus made available string path wrapper VM code has been
updated to use it. This makes legacy mode unusable as appropriate
change introduced a problem with comparison of DBus object path, which
is now fixed.
Tested:
After applying this fix, legacy mode has InsertMedia action enabled
again.
Change-Id: I6339ae2977faacf50ce708199aaf3b13b4314398
Signed-off-by: Przemyslaw Czarnowski <przemyslaw.hawrylewicz.czarnowski@intel.com>
Diffstat (limited to 'redfish-core/lib/virtual_media.hpp')
-rw-r--r-- | redfish-core/lib/virtual_media.hpp | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/redfish-core/lib/virtual_media.hpp b/redfish-core/lib/virtual_media.hpp index 9667c71132..685ee5c3bf 100644 --- a/redfish-core/lib/virtual_media.hpp +++ b/redfish-core/lib/virtual_media.hpp @@ -253,10 +253,24 @@ static void getVmData(const std::shared_ptr<bmcweb::AsyncResp>& aResp, continue; } + // "Legacy"/"Proxy" + auto mode = item.first.parent_path(); + // "VirtualMedia" + auto type = mode.parent_path(); + if (mode.filename().empty() || type.filename().empty()) + { + continue; + } + + if (type.filename() != "VirtualMedia") + { + continue; + } + aResp->res.jsonValue = vmItemTemplate(name, resName); // Check if dbus path is Legacy type - if (thispath.find("VirtualMedia/Legacy") != std::string::npos) + if (mode.filename() == "Legacy") { aResp->res.jsonValue["Actions"]["#VirtualMedia.InsertMedia"] ["target"] = |