[WIFI-1593] Cleaning up unused validationCode and validationMethod in FirmwareDownloadRequest flow (#27)

This commit is contained in:
ralphlee3
2021-02-16 17:46:30 -05:00
committed by GitHub
parent 19be90a423
commit 036f402824
7 changed files with 12 additions and 21 deletions

View File

@@ -813,8 +813,7 @@ public class OpensyncExternalIntegrationCloud implements OpensyncExternalIntegra
}
CEGWFirmwareDownloadRequest fwDownloadRequest = new CEGWFirmwareDownloadRequest(ce.getInventoryId(),
ce.getId(), fwVersion.getVersionName(), fwVersion.getFilename(),
fwVersion.getValidationMethod(), fwVersion.getValidationCode());
ce.getId(), fwVersion.getVersionName(), fwVersion.getFilename());
List<CEGWBaseCommand> commands = new ArrayList<>();
commands.add(fwDownloadRequest);

View File

@@ -341,10 +341,9 @@ public class OpensyncCloudGatewayController {
String filepath = dlRequest.getFilePath();
String firmwareVersion = dlRequest.getFirmwareVersion();
String username = dlRequest.getUsername();
String validationCode = dlRequest.getValidationCode();
String resultDetails = tipwlanOvsdbClient.processFirmwareDownload(inventoryId, filepath, firmwareVersion,
username, validationCode);
username);
response.setResultDetail(resultDetails);

View File

@@ -21,8 +21,7 @@ public interface OvsdbClientInterface {
void processClientBlocklistChange(String apId, List<MacAddress> blockList);
String processFirmwareDownload(String apId, String firmwareUrl, String firmwareVersion, String username,
String validationCode);
String processFirmwareDownload(String apId, String firmwareUrl, String firmwareVersion, String username);
String closeSession(String apId);

View File

@@ -815,13 +815,11 @@ public class TipWlanOvsdbClient implements OvsdbClientInterface {
}
@Override
public String processFirmwareDownload(String apId, String firmwareUrl, String firmwareVersion, String username,
String validationCode) {
public String processFirmwareDownload(String apId, String firmwareUrl, String firmwareVersion, String username) {
try {
OvsdbSession session = ovsdbSessionMapInterface.getSession(apId);
ovsdbDao.configureFirmwareDownload(session.getOvsdbClient(), apId, firmwareUrl, firmwareVersion, username,
validationCode);
ovsdbDao.configureFirmwareDownload(session.getOvsdbClient(), apId, firmwareUrl, firmwareVersion, username);
} catch (Exception e) {
LOG.error("Failed to initialize firmware download to " + apId + " " + e.getLocalizedMessage());
return "Failed to initialize firmware download to " + apId + " " + e.getLocalizedMessage();

View File

@@ -62,9 +62,8 @@ public class OvsdbDao extends OvsdbDaoBase {
}
public void configureFirmwareDownload(OvsdbClient ovsdbClient, String apId, String firmwareUrl,
String firmwareVersion, String username, String validationCode) throws Exception {
ovsdbFirmware.configureFirmwareDownload(ovsdbClient, apId, firmwareUrl, firmwareVersion, username,
validationCode);
String firmwareVersion, String username) throws Exception {
ovsdbFirmware.configureFirmwareDownload(ovsdbClient, apId, firmwareUrl, firmwareVersion, username);
}
public void configureFirmwareFlash(OvsdbClient ovsdbClient, String apId, String firmwareVersion, String username) {

View File

@@ -21,14 +21,13 @@ import com.vmware.ovsdb.service.OvsdbClient;
public class OvsdbFirmwareConfig extends OvsdbDaoBase {
void configureFirmwareDownload(OvsdbClient ovsdbClient, String apId, String firmwareUrl, String firmwareVersion,
String username, String validationCode) throws Exception {
String username) throws Exception {
try {
LOG.debug("configureFirmwareDownload for {} to version {} url {} validationCode {} username {}", apId,
firmwareVersion, firmwareUrl, validationCode, username);
LOG.debug("configureFirmwareDownload for {} to version {} url {} username {}", apId,
firmwareVersion, firmwareUrl, username);
List<Operation> operations = new ArrayList<>();
Map<String, Value> updateColumns = new HashMap<>();
updateColumns.put("upgrade_dl_timer", new Atom<>(upgradeDlTimerSeconds));
updateColumns.put("firmware_pass", new Atom<>(validationCode));
updateColumns.put("firmware_url", new Atom<>(firmwareUrl));
updateColumns.put("upgrade_timer", new Atom<>(upgradeTimerSeconds));
Row row = new Row(updateColumns);

View File

@@ -152,13 +152,11 @@ public class OpensyncGatewayTipWlanOvsdbClientTest {
assert (tipwlanOvsdbClient.processFirmwareDownload("Test_Client_21P10C68818122",
"http://127.0.0.1/~username/ea8300-2020-07-08-6632239/openwrt-ipq40xx-generic-linksys_ea8300-squashfs-sysupgrade.bin",
"openwrt-ipq40xx-generic-linksys_ea8300-squashfs-sysupgrade", "username",
"b0d03d8fba6b2261786ac97d49a629f2").equals(expectedResult));
"openwrt-ipq40xx-generic-linksys_ea8300-squashfs-sysupgrade", "username").equals(expectedResult));
Mockito.verify(ovsdbDao).configureFirmwareDownload(ovsdbClient, "Test_Client_21P10C68818122",
"http://127.0.0.1/~username/ea8300-2020-07-08-6632239/openwrt-ipq40xx-generic-linksys_ea8300-squashfs-sysupgrade.bin",
"openwrt-ipq40xx-generic-linksys_ea8300-squashfs-sysupgrade", "username",
"b0d03d8fba6b2261786ac97d49a629f2");
"openwrt-ipq40xx-generic-linksys_ea8300-squashfs-sysupgrade", "username");
}