Rework karaf CLI commands to print results on console
[controller.git] / opendaylight / md-sal / samples / clustering-test-app / karaf-cli / src / main / java / org / opendaylight / clustering / it / karaf / cli / AbstractRpcAction.java
index d76dbb5bcecc35746eff07030151cf9dc12515f8..eb483bfd76cac6b50e15cc9c1ba4550bb93f95d1 100644 (file)
@@ -23,8 +23,10 @@ public abstract class AbstractRpcAction implements Action {
         if (!result.isSuccessful()) {
             // FIXME: is there a better way to report errors?
             System.out.println("Invocation failed: " + result.getErrors());
         if (!result.isSuccessful()) {
             // FIXME: is there a better way to report errors?
             System.out.println("Invocation failed: " + result.getErrors());
+            return null;
+        } else {
+            return result.getResult();
         }
         }
-        return null;
     }
 
     protected abstract ListenableFuture<? extends RpcResult<?>> invokeRpc();
     }
 
     protected abstract ListenableFuture<? extends RpcResult<?>> invokeRpc();