[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(), CEGWFirmwareDownloadRequest fwDownloadRequest = new CEGWFirmwareDownloadRequest(ce.getInventoryId(),
ce.getId(), fwVersion.getVersionName(), fwVersion.getFilename(), ce.getId(), fwVersion.getVersionName(), fwVersion.getFilename());
fwVersion.getValidationMethod(), fwVersion.getValidationCode());
List<CEGWBaseCommand> commands = new ArrayList<>(); List<CEGWBaseCommand> commands = new ArrayList<>();
commands.add(fwDownloadRequest); commands.add(fwDownloadRequest);

View File

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

View File

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

View File

@@ -815,13 +815,11 @@ public class TipWlanOvsdbClient implements OvsdbClientInterface {
} }
@Override @Override
public String processFirmwareDownload(String apId, String firmwareUrl, String firmwareVersion, String username, public String processFirmwareDownload(String apId, String firmwareUrl, String firmwareVersion, String username) {
String validationCode) {
try { try {
OvsdbSession session = ovsdbSessionMapInterface.getSession(apId); OvsdbSession session = ovsdbSessionMapInterface.getSession(apId);
ovsdbDao.configureFirmwareDownload(session.getOvsdbClient(), apId, firmwareUrl, firmwareVersion, username, ovsdbDao.configureFirmwareDownload(session.getOvsdbClient(), apId, firmwareUrl, firmwareVersion, username);
validationCode);
} catch (Exception e) { } catch (Exception e) {
LOG.error("Failed to initialize firmware download to " + apId + " " + e.getLocalizedMessage()); LOG.error("Failed to initialize firmware download to " + apId + " " + e.getLocalizedMessage());
return "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, public void configureFirmwareDownload(OvsdbClient ovsdbClient, String apId, String firmwareUrl,
String firmwareVersion, String username, String validationCode) throws Exception { String firmwareVersion, String username) throws Exception {
ovsdbFirmware.configureFirmwareDownload(ovsdbClient, apId, firmwareUrl, firmwareVersion, username, ovsdbFirmware.configureFirmwareDownload(ovsdbClient, apId, firmwareUrl, firmwareVersion, username);
validationCode);
} }
public void configureFirmwareFlash(OvsdbClient ovsdbClient, String apId, String firmwareVersion, String 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 { public class OvsdbFirmwareConfig extends OvsdbDaoBase {
void configureFirmwareDownload(OvsdbClient ovsdbClient, String apId, String firmwareUrl, String firmwareVersion, void configureFirmwareDownload(OvsdbClient ovsdbClient, String apId, String firmwareUrl, String firmwareVersion,
String username, String validationCode) throws Exception { String username) throws Exception {
try { try {
LOG.debug("configureFirmwareDownload for {} to version {} url {} validationCode {} username {}", apId, LOG.debug("configureFirmwareDownload for {} to version {} url {} username {}", apId,
firmwareVersion, firmwareUrl, validationCode, username); firmwareVersion, firmwareUrl, username);
List<Operation> operations = new ArrayList<>(); List<Operation> operations = new ArrayList<>();
Map<String, Value> updateColumns = new HashMap<>(); Map<String, Value> updateColumns = new HashMap<>();
updateColumns.put("upgrade_dl_timer", new Atom<>(upgradeDlTimerSeconds)); updateColumns.put("upgrade_dl_timer", new Atom<>(upgradeDlTimerSeconds));
updateColumns.put("firmware_pass", new Atom<>(validationCode));
updateColumns.put("firmware_url", new Atom<>(firmwareUrl)); updateColumns.put("firmware_url", new Atom<>(firmwareUrl));
updateColumns.put("upgrade_timer", new Atom<>(upgradeTimerSeconds)); updateColumns.put("upgrade_timer", new Atom<>(upgradeTimerSeconds));
Row row = new Row(updateColumns); Row row = new Row(updateColumns);

View File

@@ -152,13 +152,11 @@ public class OpensyncGatewayTipWlanOvsdbClientTest {
assert (tipwlanOvsdbClient.processFirmwareDownload("Test_Client_21P10C68818122", 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", "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", "openwrt-ipq40xx-generic-linksys_ea8300-squashfs-sysupgrade", "username").equals(expectedResult));
"b0d03d8fba6b2261786ac97d49a629f2").equals(expectedResult));
Mockito.verify(ovsdbDao).configureFirmwareDownload(ovsdbClient, "Test_Client_21P10C68818122", 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", "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", "openwrt-ipq40xx-generic-linksys_ea8300-squashfs-sysupgrade", "username");
"b0d03d8fba6b2261786ac97d49a629f2");
} }