To fix grep not working for tep:show & 04/51604/3
authorEdwin Anthony <n.edwin.anthony@ericsson.com>
Thu, 9 Feb 2017 07:46:52 +0000 (13:16 +0530)
committerEdwin Anthony <n.edwin.anthony@ericsson.com>
Thu, 9 Feb 2017 07:46:52 +0000 (13:16 +0530)
tep:show-state on karaf console

Change-Id: I59469c0c1da10d55c2bd5d1a9f87e3021c8a46cf
Signed-off-by: Edwin Anthony <n.edwin.anthony@ericsson.com>
itm/itm-impl/src/main/java/org/opendaylight/genius/itm/cli/TepCommandHelper.java

index 9862fdab972c374f41d6d874744b88371d5b6f40..b263b5e960ccadb030ee9d17ccb7931614154470 100644 (file)
@@ -450,14 +450,14 @@ public class TepCommandHelper {
             if (session != null) {
                 if (flag) {
                     for (String p : result) {
-                        session.getConsole().println(p);
+                        System.out.println(p);
                     }
                 } else {
-                    session.getConsole().println("No teps to display");
+                    System.out.println("No teps to display");
                 }
             }
         } else if(session != null){
-            session.getConsole().println("No teps configured");
+            System.out.println("No teps configured");
         }
     }
 
@@ -648,9 +648,9 @@ public void showCache(String cacheName) {
             }
         }
         String displayFormat = "%-16s  %-16s  %-16s  %-16s  %-16s  %-10s  %-10s";
-        session.getConsole().println(String.format(displayFormat, "Tunnel Name", "Source-DPN",
+        System.out.println(String.format(displayFormat, "Tunnel Name", "Source-DPN",
                         "Destination-DPN", "Source-IP", "Destination-IP", "Trunk-State", "Transport Type"));
-        session.getConsole().println("-------------------------------------------------------------------------------------------------------------------------------------");
+        System.out.println("-------------------------------------------------------------------------------------------------------------------------------------");
 
         for (StateTunnelList tunnelInst : tunnelLists) {
            // Display only the internal tunnels
@@ -670,10 +670,9 @@ public void showCache(String cacheName) {
                    tunnelType = ITMConstants.TUNNEL_TYPE_GRE ;
                 else if (tunType.equals(TunnelTypeMplsOverGre.class))
                     tunnelType = ITMConstants.TUNNEL_TYPE_MPLSoGRE;
-                session.getConsole().println(String.format(displayFormat, tunnelInst.getTunnelInterfaceName(), tunnelInst.getSrcInfo().getTepDeviceId(),
+                System.out.println(String.format(displayFormat, tunnelInst.getTunnelInterfaceName(), tunnelInst.getSrcInfo().getTepDeviceId(),
                         tunnelInst.getDstInfo().getTepDeviceId(), tunnelInst.getSrcInfo().getTepIp().getIpv4Address().getValue(), tunnelInst.getDstInfo().getTepIp().getIpv4Address().getValue(), tunnelState,
                         tunnelType));
-                
             }
         }
     }