summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGunnar Mills <gmills@us.ibm.com>2018-02-23 21:16:20 -0600
committerGunnar Mills <gmills@us.ibm.com>2018-03-05 11:48:50 -0600
commit9b733bdc51d3f9abffa18863cad28b5dd9c92f6f (patch)
tree0c0e95469672db30dd17a3b21f3d05d68674b01d
parent177b9e5d3fb402794651ae241d018585e72db70b (diff)
downloadphosphor-webui-9b733bdc51d3f9abffa18863cad28b5dd9c92f6f.tar.gz
phosphor-webui-9b733bdc51d3f9abffa18863cad28b5dd9c92f6f.zip
Determine "Functional" images by association
The functional, or running, images should be determined by looking at the functional association, not by looking at priority 0. An image could be functional but not priority 0, this happens after activating a new image. Get the functional images by looking at the endpoints of /xyz/openbmc_project/software/functional. Resolves openbmc/openbmc#2945 Tested: Verified the correct image is functional after activation and during other times of code updating. Change-Id: Ia5ad172b0874e634c0042576018b376b5260e31e Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
-rw-r--r--app/common/services/api-utils.js10
-rw-r--r--app/common/services/constants.js3
2 files changed, 11 insertions, 2 deletions
diff --git a/app/common/services/api-utils.js b/app/common/services/api-utils.js
index 6268f8c..5eadb33 100644
--- a/app/common/services/api-utils.js
+++ b/app/common/services/api-utils.js
@@ -614,6 +614,7 @@ window.angular && (function (angular) {
var hostActiveVersion = "";
var imageType = "";
var extendedVersions = [];
+ var functionalImages = [];
function getFormatedExtendedVersions(extendedVersion){
var versions = [];
@@ -641,16 +642,23 @@ window.angular && (function (angular) {
return versions;
}
+ // Get the list of functional images so we can compare
+ // later if an image is functional
+ if (content.data[Constants.FIRMWARE.FUNCTIONAL_OBJPATH])
+ {
+ functionalImages = content.data[Constants.FIRMWARE.FUNCTIONAL_OBJPATH].endpoints;
+ }
for(var key in content.data){
if(content.data.hasOwnProperty(key) && content.data[key].hasOwnProperty('Version')){
// If the image is "Functional" use that for the
// activation status, else use the value of "Activation"
// github.com/openbmc/phosphor-dbus-interfaces/blob/master/xyz/openbmc_project/Software/Activation.interface.yaml
activationStatus = content.data[key].Activation.split(".").pop();
- if (content.data[key].Priority == 0)
+ if (functionalImages.includes(key))
{
activationStatus = "Functional";
}
+
imageType = content.data[key].Purpose.split(".").pop();
isExtended = content.data[key].hasOwnProperty('ExtendedVersion') && content.data[key].ExtendedVersion != "";
if(isExtended){
diff --git a/app/common/services/constants.js b/app/common/services/constants.js
index c6d9a61..fd8204a 100644
--- a/app/common/services/constants.js
+++ b/app/common/services/constants.js
@@ -111,7 +111,8 @@ window.angular && (function (angular) {
],
SENSOR_SORT_ORDER_DEFAULT: 8,
FIRMWARE: {
- ACTIVATE_FIRMWARE: 'xyz.openbmc_project.Software.Activation.RequestedActivations.Active'
+ ACTIVATE_FIRMWARE: 'xyz.openbmc_project.Software.Activation.RequestedActivations.Active',
+ FUNCTIONAL_OBJPATH: '/xyz/openbmc_project/software/functional'
},
MESSAGES: {
SENSOR: {
OpenPOWER on IntegriCloud