The validation check of deviceIp and devicePort should be OR, not AND.
Change-Id: I8a4ca1642d0bc6b196222ee60b6af9bf19f6330d
Signed-off-by: Li guosheng <li.guosheng6@zte.com.cn>
if (!Strings.isNullOrEmpty(deviceId)) {
status = service.disconnectDevice(deviceId);
} else {
- if (!NetconfCommandUtils.isIpValid(deviceIp) && !NetconfCommandUtils.isPortValid(devicePort)) {
+ if (!NetconfCommandUtils.isIpValid(deviceIp) || !NetconfCommandUtils.isPortValid(devicePort)) {
return "Invalid IP:" + deviceIp + " or Port:" + devicePort + "Please enter a valid entry to proceed.";
}
status = service.disconnectDevice(deviceIp, devicePort);