diff --git a/src/main/java/org/cloud/sonic/agent/bridge/ios/SibTool.java b/src/main/java/org/cloud/sonic/agent/bridge/ios/SibTool.java index 6852ed50..b1fbfe60 100755 --- a/src/main/java/org/cloud/sonic/agent/bridge/ios/SibTool.java +++ b/src/main/java/org/cloud/sonic/agent/bridge/ios/SibTool.java @@ -163,7 +163,7 @@ public static List getDeviceList() { String commandLine = "%s devices"; List data = ProcessCommandTool.getProcessLocalCommand(String.format(commandLine, sib)); for (String a : data) { - if (a.length() == 0) { + if (a.length() == 0 || a.contains("no device")) { break; } if (a.contains(" ")) { diff --git a/src/main/java/org/cloud/sonic/agent/tests/ios/IOSBatteryThread.java b/src/main/java/org/cloud/sonic/agent/tests/ios/IOSBatteryThread.java index 489af316..6b5fbbef 100755 --- a/src/main/java/org/cloud/sonic/agent/tests/ios/IOSBatteryThread.java +++ b/src/main/java/org/cloud/sonic/agent/tests/ios/IOSBatteryThread.java @@ -53,7 +53,7 @@ public void run() { } List deviceList = SibTool.getDeviceList(); - if (CollectionUtils.isEmpty(deviceList)) { + if (deviceList.size() == 0) { return; }