You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by mm...@apache.org on 2020/09/04 19:34:44 UTC

[ignite] branch master updated: IGNITE-13390 Fixed get_master_key_name command console output (#8209)

This is an automated email from the ASF dual-hosted git repository.

mmuzaf pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ignite.git


The following commit(s) were added to refs/heads/master by this push:
     new cc04d07  IGNITE-13390 Fixed get_master_key_name command console output (#8209)
cc04d07 is described below

commit cc04d0705d58c9f7b4fb293b2db303d9551ca44e
Author: Pavel Pereslegin <xx...@gmail.com>
AuthorDate: Fri Sep 4 22:34:30 2020 +0300

    IGNITE-13390 Fixed get_master_key_name command console output (#8209)
    
    * IGNITE-13390 Fixed 'get_master_key_name' command output.
    
    * Revert "IGNITE-13390 Fixed 'get_master_key_name' command output."
    
    This reverts commit 0fa3a6d7
    
    * IGNITE-13390 'get_master_key_name' console output fix.
---
 .../internal/commandline/encryption/EncryptionCommand.java     |  6 +++++-
 .../java/org/apache/ignite/util/GridCommandHandlerTest.java    | 10 ++++------
 2 files changed, 9 insertions(+), 7 deletions(-)

diff --git a/modules/control-utility/src/main/java/org/apache/ignite/internal/commandline/encryption/EncryptionCommand.java b/modules/control-utility/src/main/java/org/apache/ignite/internal/commandline/encryption/EncryptionCommand.java
index 88d8500..eae8049 100644
--- a/modules/control-utility/src/main/java/org/apache/ignite/internal/commandline/encryption/EncryptionCommand.java
+++ b/modules/control-utility/src/main/java/org/apache/ignite/internal/commandline/encryption/EncryptionCommand.java
@@ -50,13 +50,17 @@ public class EncryptionCommand implements Command<Object> {
     /** {@inheritDoc} */
     @Override public Object execute(GridClientConfiguration clientCfg, Logger logger) throws Exception {
         try (GridClient client = Command.startClient(clientCfg)) {
-            return executeTaskByNameOnNode(
+            String res = executeTaskByNameOnNode(
                 client,
                 taskName,
                 taskArgs,
                 null,
                 clientCfg
             );
+
+            logger.info(res);
+
+            return res;
         }
         catch (Throwable e) {
             logger.severe("Failed to perform operation.");
diff --git a/modules/control-utility/src/test/java/org/apache/ignite/util/GridCommandHandlerTest.java b/modules/control-utility/src/test/java/org/apache/ignite/util/GridCommandHandlerTest.java
index 6174ae8..62a7f17 100644
--- a/modules/control-utility/src/test/java/org/apache/ignite/util/GridCommandHandlerTest.java
+++ b/modules/control-utility/src/test/java/org/apache/ignite/util/GridCommandHandlerTest.java
@@ -2211,19 +2211,17 @@ public class GridCommandHandlerTest extends GridCommandHandlerClusterPerMethodAb
 
         assertEquals(EXIT_CODE_OK, execute(h, "--encryption", "get_master_key_name"));
 
-        Object res = h.getLastOperationResult();
-
-        assertEquals(ignite.encryption().getMasterKeyName(), res);
+        assertContains(log, testOut.toString(), ignite.encryption().getMasterKeyName());
 
         assertEquals(EXIT_CODE_OK, execute(h, "--encryption", "change_master_key", MASTER_KEY_NAME_2));
 
+        assertContains(log, testOut.toString(), "The master key changed.");
+
         assertEquals(MASTER_KEY_NAME_2, ignite.encryption().getMasterKeyName());
 
         assertEquals(EXIT_CODE_OK, execute(h, "--encryption", "get_master_key_name"));
 
-        res = h.getLastOperationResult();
-
-        assertEquals(MASTER_KEY_NAME_2, res);
+        assertContains(log, testOut.toString(), ignite.encryption().getMasterKeyName());
 
         testOut.reset();