summaryrefslogtreecommitdiff
path: root/meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb/0006-Fix-Image-and-ImageName-values-in-schema.patch
diff options
context:
space:
mode:
authorJason M. Bills <jason.m.bills@linux.intel.com>2020-08-31 23:56:28 +0300
committerJason M. Bills <jason.m.bills@linux.intel.com>2020-09-02 00:21:46 +0300
commitf99301c1a626951ee7feee081a1494e795d0e243 (patch)
treeca75379d317be9cc1757a00e0352a048b5d3200b /meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb/0006-Fix-Image-and-ImageName-values-in-schema.patch
parent40108db4434d8c2e0a1ad2d1dd3f5ae34b17352c (diff)
downloadopenbmc-f99301c1a626951ee7feee081a1494e795d0e243.tar.xz
Update to internal 0.74
Signed-off-by: Jason M. Bills <jason.m.bills@linux.intel.com>
Diffstat (limited to 'meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb/0006-Fix-Image-and-ImageName-values-in-schema.patch')
-rw-r--r--meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb/0006-Fix-Image-and-ImageName-values-in-schema.patch38
1 files changed, 38 insertions, 0 deletions
diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb/0006-Fix-Image-and-ImageName-values-in-schema.patch b/meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb/0006-Fix-Image-and-ImageName-values-in-schema.patch
new file mode 100644
index 000000000..c182822a6
--- /dev/null
+++ b/meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb/0006-Fix-Image-and-ImageName-values-in-schema.patch
@@ -0,0 +1,38 @@
+From 15305d3a9db371af924482e5a6959bbf7812cf6c Mon Sep 17 00:00:00 2001
+From: Przemyslaw Czarnowski <przemyslaw.hawrylewicz.czarnowski@intel.com>
+Date: Wed, 29 Jul 2020 15:56:57 +0200
+Subject: [PATCH] Fix Image and ImageName values in schema
+
+According to design document and schema Image shall contain URL of
+image location and ImageName only name of the image.
+
+Change-Id: Ie1a906c66aa2a10113c307eb1e7d2d7da2810fbd
+Signed-off-by: Przemyslaw Czarnowski <przemyslaw.hawrylewicz.czarnowski@intel.com>
+---
+ redfish-core/lib/virtual_media.hpp | 10 +++++++++-
+ 1 file changed, 9 insertions(+), 1 deletion(-)
+
+diff --git a/redfish-core/lib/virtual_media.hpp b/redfish-core/lib/virtual_media.hpp
+index 183abbe..0345e7b 100644
+--- a/redfish-core/lib/virtual_media.hpp
++++ b/redfish-core/lib/virtual_media.hpp
+@@ -97,7 +97,15 @@ static void vmParseInterfaceObject(const DbusInterfaceType& interface,
+ std::get_if<std::string>(&imageUrlProperty->second);
+ if (imageUrlValue && !imageUrlValue->empty())
+ {
+- aResp->res.jsonValue["ImageName"] = *imageUrlValue;
++ std::size_t lastIndex = imageUrlValue->rfind("/");
++ if (lastIndex == std::string::npos)
++ {
++ aResp->res.jsonValue["ImageName"] = *imageUrlValue;
++ }
++
++ aResp->res.jsonValue["ImageName"] =
++ imageUrlValue->substr(lastIndex + 1);
++ aResp->res.jsonValue["Image"] = *imageUrlValue;
+ aResp->res.jsonValue["Inserted"] = *activeValue;
+ if (*activeValue == true)
+ {
+--
+2.25.0
+