fix
This commit is contained in:
parent
d3ff2e3646
commit
b7cd62a872
@ -7,10 +7,7 @@ import racal.sunyard.main.SydApi4j;
|
||||
import java.io.BufferedReader;
|
||||
import java.io.FileReader;
|
||||
import java.io.IOException;
|
||||
import java.util.Arrays;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.*;
|
||||
|
||||
public class TestCert {
|
||||
public static void main(String[] args) throws InterruptedException {
|
||||
@ -22,8 +19,11 @@ public class TestCert {
|
||||
String snmpInfo = "/app/test/snmp.txt";
|
||||
String certInfo = "/app/test/cert.txt";
|
||||
Map<String, String> map = readFileToMap(ipInfo);
|
||||
String ipInfos = map.get("ipList");
|
||||
List<String> ipList = Arrays.asList(ipInfos.split(","));
|
||||
String ipInfos = map.getOrDefault("ipList", null);
|
||||
List<String> ipList = new ArrayList<>();
|
||||
if (ipInfos != null) {
|
||||
ipList = Arrays.asList(ipInfos.split(","));
|
||||
}
|
||||
int timeout = Integer.parseInt(map.get("timout"));
|
||||
String cert = readFileAsString(certInfo);
|
||||
String bkCode = map.get("bkcode");
|
||||
|
||||
@ -236,7 +236,7 @@ public class Test4NongxinCW {
|
||||
map.put("snmp.community", "public");
|
||||
map.put("snmp.version", "1");
|
||||
SydApi4j sydApi4j = new SydApi4j();
|
||||
sydApi4j.importCertToServers(masterNodes, timeout, cert1, "12345678", new Gson().toJson(map));
|
||||
sydApi4j.importCertToServers(new ArrayList<>(), timeout, cert1, "12345678", new Gson().toJson(map));
|
||||
stopWatch.stop();
|
||||
System.out.println(stopWatch.getTotalTimeSeconds());
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user