Fix NetconfDisconnectDeviceCommand logic error. 77/70177/1
authorLiGuosheng <li.guosheng6@zte.com.cn>
Thu, 29 Mar 2018 01:38:20 +0000 (09:38 +0800)
committerLiGuosheng <li.guosheng6@zte.com.cn>
Thu, 29 Mar 2018 01:38:26 +0000 (09:38 +0800)
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>
netconf/netconf-console/src/main/java/org/opendaylight/netconf/console/commands/NetconfDisconnectDeviceCommand.java

index 20f1234ac90dc9af0ebf30353370d5916d695648..ccb9c41bd6c0cb26863d80d2f5bf71a33f225986 100644 (file)
@@ -60,7 +60,7 @@ public class NetconfDisconnectDeviceCommand extends AbstractAction {
         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);