Adding support for FW_IMAGE_NAME tag for determining FW version on AP, as part of FW Upgrade support

This commit is contained in:
Mike Hansen
2020-07-20 15:16:07 -04:00
parent 643797b9e3
commit 95e702119c
3 changed files with 22 additions and 21 deletions

View File

@@ -10,7 +10,6 @@ import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.Callable;
import java.util.concurrent.TimeUnit;
import java.util.function.Consumer;
import java.util.function.Predicate;
import java.util.stream.Collectors;
@@ -28,7 +27,6 @@ import org.springframework.stereotype.Component;
import com.telecominfraproject.wlan.alarm.AlarmServiceInterface;
import com.telecominfraproject.wlan.client.ClientServiceInterface;
import com.telecominfraproject.wlan.client.info.models.ClientInfoDetails;
import com.telecominfraproject.wlan.client.session.models.ClientDhcpDetails;
import com.telecominfraproject.wlan.client.session.models.ClientSession;
import com.telecominfraproject.wlan.client.session.models.ClientSessionDetails;
import com.telecominfraproject.wlan.client.session.models.ClientSessionMetricDetails;
@@ -98,7 +96,6 @@ import com.telecominfraproject.wlan.servicemetric.models.ServiceMetric;
import com.telecominfraproject.wlan.servicemetric.neighbourscan.models.NeighbourReport;
import com.telecominfraproject.wlan.servicemetric.neighbourscan.models.NeighbourScanReports;
import com.telecominfraproject.wlan.status.StatusServiceInterface;
import com.telecominfraproject.wlan.status.dashboard.models.CustomerPortalDashboardStatus;
import com.telecominfraproject.wlan.status.equipment.models.EquipmentAdminStatusData;
import com.telecominfraproject.wlan.status.equipment.models.EquipmentLANStatusData;
import com.telecominfraproject.wlan.status.equipment.models.EquipmentProtocolState;
@@ -114,17 +111,7 @@ import com.telecominfraproject.wlan.status.equipment.report.models.OperatingSyst
import com.telecominfraproject.wlan.status.models.Status;
import com.telecominfraproject.wlan.status.models.StatusCode;
import com.telecominfraproject.wlan.status.models.StatusDataType;
import com.telecominfraproject.wlan.status.network.models.CapacityDetails;
import com.telecominfraproject.wlan.status.network.models.ChannelUtilizationDetails;
import com.telecominfraproject.wlan.status.network.models.CommonProbeDetails;
import com.telecominfraproject.wlan.status.network.models.EquipmentPerformanceDetails;
import com.telecominfraproject.wlan.status.network.models.NetworkAdminStatusData;
import com.telecominfraproject.wlan.status.network.models.NetworkAggregateStatusData;
import com.telecominfraproject.wlan.status.network.models.NoiseFloorDetails;
import com.telecominfraproject.wlan.status.network.models.RadioUtilizationDetails;
import com.telecominfraproject.wlan.status.network.models.RadiusDetails;
import com.telecominfraproject.wlan.status.network.models.TrafficDetails;
import com.telecominfraproject.wlan.status.network.models.UserDetails;
import sts.OpensyncStats.Client;
import sts.OpensyncStats.ClientReport;
@@ -631,15 +618,23 @@ public class OpensyncExternalIntegrationCloud implements OpensyncExternalIntegra
}
}
if (fwVersionName != null && !fwVersionName.equals(connectNodeInfo.firmwareVersion)) {
String fwImageName = null;
fwUpgradeStatusData.setTargetSwVersion(fwVersionName);
if (connectNodeInfo.versionMatrix != null
&& connectNodeInfo.versionMatrix.containsKey("FW_IMAGE_NAME")) {
fwImageName = connectNodeInfo.versionMatrix.get("FW_IMAGE_NAME");
}
if (fwVersionName != null && !fwVersionName.equals(fwImageName)) {
fwUpgradeStatusData.setTargetSwVersion(fwImageName);
fwUpgradeStatusData.setUpgradeState(EquipmentUpgradeState.out_of_date);
statusRecord.setDetails(fwUpgradeStatusData);
} else {
} else if (fwVersionName != null && fwVersionName.equals(fwImageName)) {
fwUpgradeStatusData.setUpgradeState(EquipmentUpgradeState.up_to_date);
statusRecord.setDetails(fwUpgradeStatusData);
} else {
fwUpgradeStatusData.setUpgradeState(EquipmentUpgradeState.undefined);
statusRecord.setDetails(fwUpgradeStatusData);
}
statusRecord = statusServiceInterface.update(statusRecord);

View File

@@ -5,6 +5,7 @@ import java.util.Map;
public class ConnectNodeInfo implements Cloneable {
public Map<String, String> mqttSettings = new HashMap<>();
public Map<String, String> versionMatrix = new HashMap<>();
public Map<String, String> wifiRadioStates = new HashMap<>();
public String redirectorAddr;
public String managerAddr;
@@ -34,6 +35,9 @@ public class ConnectNodeInfo implements Cloneable {
if (this.wifiRadioStates != null) {
ret.wifiRadioStates = new HashMap<>(this.wifiRadioStates);
}
if (this.versionMatrix != null) {
ret.versionMatrix = new HashMap<>(this.versionMatrix);
}
return ret;
} catch (CloneNotSupportedException e) {
throw new IllegalStateException("Cannot clone ", e);
@@ -44,10 +48,10 @@ public class ConnectNodeInfo implements Cloneable {
public String toString() {
return String.format(
"ConnectNodeInfo [mqttSettings=%s, redirectorAddr=%s, managerAddr=%s, skuNumber=%s, serialNumber=%s, "
+ "macAddress=%s, ipV4Address=%s, platformVersion=%s, firmwareVersion=%s, revision=%s, model=%s, ifName=%s, lanIpV4Address=%s, lanIfName=%s, lanIfType=%s, lanMacAddress=%s, ifType=%s, wifiRadioStates=%s]",
+ "macAddress=%s, ipV4Address=%s, platformVersion=%s, firmwareVersion=%s, revision=%s, model=%s, ifName=%s, lanIpV4Address=%s, lanIfName=%s, lanIfType=%s, lanMacAddress=%s, ifType=%s, wifiRadioStates=%s, versionMatrix=%s]",
mqttSettings, redirectorAddr, managerAddr, skuNumber, serialNumber, macAddress, ipV4Address,
platformVersion, firmwareVersion, revision, model, ifName, lanIpV4Address, lanIfName, lanIfType,
lanMacAddress, ifType, wifiRadioStates);
lanMacAddress, ifType, wifiRadioStates, versionMatrix);
}
}

View File

@@ -158,6 +158,7 @@ public class OvsdbDao {
columns.add("firmware_version");
columns.add("platform_version");
columns.add("revision");
columns.add("version_matrix");
operations.add(new Select(awlanNodeDbTable, conditions, columns));
CompletableFuture<OperationResult[]> fResult = ovsdbClient.transact(ovsdbName, operations);
@@ -178,6 +179,7 @@ public class OvsdbDao {
}
ret.mqttSettings = row != null ? row.getMapColumn("mqtt_settings") : null;
ret.versionMatrix = row != null ? row.getMapColumn("version_matrix") : null;
ret.redirectorAddr = row != null ? row.getStringColumn("redirector_addr") : null;
ret.managerAddr = row != null ? row.getStringColumn("manager_addr") : null;
@@ -610,8 +612,8 @@ public class OvsdbDao {
if (res instanceof ErrorResult) {
LOG.error("Could not update {}:", wifiStatsConfigDbTable);
LOG.error("Error: {} Details: {}",
((ErrorResult) res).getError(), ((ErrorResult) res).getDetails());
LOG.error("Error: {} Details: {}", ((ErrorResult) res).getError(),
((ErrorResult) res).getDetails());
} else {
LOG.debug("Updated {}:", wifiStatsConfigDbTable);
LOG.debug("Op Result {}", res);