Fix firmware page not loading
Had an image without an "Activation" property.
This image did not have an Activation interface.
Added an if for the Activation property.
Also moved the activationStatus var so it would be empty if the
Activation property did not exist.
Resolves openbmc/openbmc#3309
Tested: The page loads now with the image missing the Activation
property.
Change-Id: I252e1277c88ce0a8b59b4f7441b1032954cef3e0
Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
diff --git a/app/common/services/api-utils.js b/app/common/services/api-utils.js
index e071dfc..2ac6110 100644
--- a/app/common/services/api-utils.js
+++ b/app/common/services/api-utils.js
@@ -924,7 +924,6 @@
var json = JSON.stringify(response.data);
var content = JSON.parse(json);
var data = [];
- var activationStatus = '';
var isExtended = false;
var bmcActiveVersion = '';
var hostActiveVersion = '';
@@ -966,11 +965,16 @@
for (var key in content.data) {
if (content.data.hasOwnProperty(key) &&
content.data[key].hasOwnProperty('Version')) {
+ var activationStatus = '';
+
// 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].Activation) {
+ activationStatus =
+ content.data[key].Activation.split('.').pop();
+ }
+
if (functionalImages.includes(key)) {
activationStatus = 'Functional';
}