Grep not working for Karaf commands 09/83109/3
authorManu B <manu.b@ericsson.com>
Tue, 4 Sep 2018 07:29:26 +0000 (12:59 +0530)
committerFaseela K <faseela.k@ericsson.com>
Tue, 20 Aug 2019 08:34:57 +0000 (08:34 +0000)
This cover changes for idmanager.
The fix is to replace Session.getConsole() with System.print().

Change-Id: Ic85a495ae5386b996942b47c7a6b75f281dd3f3c
Signed-off-by: Manu B <amitesh.soni@ericsson.com>
idmanager/idmanager-shell/src/main/java/org/opendaylight/genius/idmanager/shell/IdManagerCacheCli.java

index 88b384cf30f2ba5c1db1b0e7fa7396798b63b7f5..837033bcb4c4d59436b206f06651fb3ded9db10c 100644 (file)
@@ -28,25 +28,26 @@ public class IdManagerCacheCli extends OsgiCommandSupport {
         this.idManagerMonitor = idManagerMonitor;
     }
 
+    @SuppressWarnings("checkstyle:RegexpSinglelineJava")
     @Override
     protected Object doExecute() {
         if (idManagerMonitor == null) {
-            session.getConsole().println("No IdManagerMonitor service available");
+            System.out.println("No IdManagerMonitor service available");
             return null;
         }
         Map<String, String> cache = idManagerMonitor.getLocalPoolsDetails();
-        session.getConsole().println("No of pools in cluster " + cache.keySet().size());
-        session.getConsole().println(DEMARCATION);
+        System.out.println("No of pools in cluster " + cache.keySet().size());
+        System.out.println(DEMARCATION);
         if (poolName == null) {
             cache.keySet().forEach(idPoolName -> {
                 print(idPoolName, cache.get(idPoolName));
-                session.getConsole().println(DEMARCATION);
-                session.getConsole().println(DEMARCATION);
+                System.out.println(DEMARCATION);
+                System.out.println(DEMARCATION);
             });
         } else {
             Object idPool = cache.get(poolName);
             if (idPool == null) {
-                session.getConsole().println("Local Id pool not found for " + poolName);
+                System.out.println("Local Id pool not found for " + poolName);
             } else {
                 print(poolName, idPool);
             }
@@ -54,8 +55,9 @@ public class IdManagerCacheCli extends OsgiCommandSupport {
         return null;
     }
 
+    @SuppressWarnings("checkstyle:RegexpSinglelineJava")
     private void print(String idPoolName, Object idPool) {
-        session.getConsole().println("Pool name: " + idPoolName);
-        session.getConsole().println("IdPool: " + idPool);
+        System.out.println("Pool name: " + idPoolName);
+        System.out.println("IdPool: " + idPool);
     }
 }