[WIFI-7579] Bugfixes on updating status API for auto-upgrade

This commit is contained in:
ralphlee
2022-04-11 11:43:16 -04:00
parent 78f4169339
commit 73fe2bfbe2

View File

@@ -767,7 +767,7 @@ public class OpensyncExternalIntegrationCloud implements OpensyncExternalIntegra
String firmwareVersion) { String firmwareVersion) {
LOG.debug("reconcileFwVersionToTrack for AP {} with active firmware version {} model {}", ce.getInventoryId(), activeFirmwareImageAp, model); LOG.debug("reconcileFwVersionToTrack for AP {} with active firmware version {} model {}", ce.getInventoryId(), activeFirmwareImageAp, model);
Status statusRecord = statusServiceInterface.getOrNull(autoProvisionedCustomerId, autoProvisionedCustomerId, StatusDataType.FIRMWARE); Status statusRecord = statusServiceInterface.getOrNull(ce.getCustomerId(), ce.getId(), StatusDataType.FIRMWARE);
if (statusRecord == null) { if (statusRecord == null) {
statusRecord = new Status(); statusRecord = new Status();
statusRecord.setCreatedTimestamp(System.currentTimeMillis()); statusRecord.setCreatedTimestamp(System.currentTimeMillis());
@@ -777,7 +777,7 @@ public class OpensyncExternalIntegrationCloud implements OpensyncExternalIntegra
statusRecord.setDetails(new EquipmentUpgradeStatusData()); statusRecord.setDetails(new EquipmentUpgradeStatusData());
((EquipmentUpgradeStatusData) statusRecord.getDetails()).setActiveSwVersion(activeFirmwareImageAp); ((EquipmentUpgradeStatusData) statusRecord.getDetails()).setActiveSwVersion(activeFirmwareImageAp);
if (inactiveFirmwareImageAp != null) { if (inactiveFirmwareImageAp != null) {
((EquipmentUpgradeStatusData) statusRecord.getDetails()).setActiveSwVersion(inactiveFirmwareImageAp); ((EquipmentUpgradeStatusData) statusRecord.getDetails()).setAlternateSwVersion(inactiveFirmwareImageAp);
} }
} }
EquipmentUpgradeStatusData fwUpgradeStatusData = (EquipmentUpgradeStatusData) statusRecord.getDetails(); EquipmentUpgradeStatusData fwUpgradeStatusData = (EquipmentUpgradeStatusData) statusRecord.getDetails();
@@ -795,8 +795,8 @@ public class OpensyncExternalIntegrationCloud implements OpensyncExternalIntegra
// determine if AP requires FW upgrade before cloud // determine if AP requires FW upgrade before cloud
// connection/provision // connection/provision
if (trackSettings.getAutoUpgradeDeprecatedOnBind().equals(TrackFlag.ALWAYS) || trackSettings.getAutoUpgradeUnknownOnBind().equals(TrackFlag.ALWAYS)) { if (trackSettings.getAutoUpgradeDeprecatedOnBind().equals(TrackFlag.ALWAYS) || trackSettings.getAutoUpgradeUnknownOnBind().equals(TrackFlag.ALWAYS)) {
LOG.debug("reconcileFwVersionToTrack for AP {} track flag for auto-upgrade {}", ce.getInventoryId(), LOG.debug("reconcileFwVersionToTrack for AP {} track flag for auto-upgrade; deprecated flag {} ; unknown flag {} ", ce.getInventoryId(),
trackSettings.getAutoUpgradeDeprecatedOnBind()); trackSettings.getAutoUpgradeDeprecatedOnBind(), trackSettings.getAutoUpgradeUnknownOnBind());
// check the reported fw version for the AP, if it is < than // check the reported fw version for the AP, if it is < than
// the default version for the cloud, then download and // the default version for the cloud, then download and
// flash the firmware before proceeding. // flash the firmware before proceeding.