geode-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jinmeil...@apache.org
Subject incubator-geode git commit: GEODE-746: When starting a locator using --bind-address, gfsh prints incorrect connect message
Date Mon, 18 Jul 2016 21:26:36 GMT
Repository: incubator-geode
Updated Branches:
  refs/heads/develop 582423cb5 -> 3473229fc


GEODE-746: When starting a locator using --bind-address, gfsh prints incorrect connect message

* This closes #208


Project: http://git-wip-us.apache.org/repos/asf/incubator-geode/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-geode/commit/3473229f
Tree: http://git-wip-us.apache.org/repos/asf/incubator-geode/tree/3473229f
Diff: http://git-wip-us.apache.org/repos/asf/incubator-geode/diff/3473229f

Branch: refs/heads/develop
Commit: 3473229fc3fb1337fb3f85d419f8bddb04a2e9b3
Parents: 582423c
Author: Kevin J. Duling <kduling@pivotal.io>
Authored: Thu Jul 14 15:48:27 2016 -0700
Committer: Jinmei Liao <jiliao@pivotal.io>
Committed: Mon Jul 18 14:25:03 2016 -0700

----------------------------------------------------------------------
 .../cli/commands/LauncherLifecycleCommands.java | 21 ++++++++++++++------
 1 file changed, 15 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/3473229f/geode-core/src/main/java/com/gemstone/gemfire/management/internal/cli/commands/LauncherLifecycleCommands.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/com/gemstone/gemfire/management/internal/cli/commands/LauncherLifecycleCommands.java
b/geode-core/src/main/java/com/gemstone/gemfire/management/internal/cli/commands/LauncherLifecycleCommands.java
index 261163a..2926822 100755
--- a/geode-core/src/main/java/com/gemstone/gemfire/management/internal/cli/commands/LauncherLifecycleCommands.java
+++ b/geode-core/src/main/java/com/gemstone/gemfire/management/internal/cli/commands/LauncherLifecycleCommands.java
@@ -45,6 +45,7 @@ import java.util.Stack;
 import java.util.TreeSet;
 import java.util.concurrent.TimeUnit;
 import java.util.concurrent.atomic.AtomicReference;
+
 import javax.management.MalformedObjectNameException;
 import javax.management.ObjectName;
 import javax.management.Query;
@@ -52,6 +53,10 @@ import javax.management.QueryExp;
 import javax.net.ssl.SSLException;
 import javax.net.ssl.SSLHandshakeException;
 
+import org.springframework.shell.core.annotation.CliAvailabilityIndicator;
+import org.springframework.shell.core.annotation.CliCommand;
+import org.springframework.shell.core.annotation.CliOption;
+
 import com.gemstone.gemfire.GemFireException;
 import com.gemstone.gemfire.SystemFailure;
 import com.gemstone.gemfire.cache.server.CacheServer;
@@ -112,10 +117,6 @@ import com.gemstone.gemfire.management.internal.configuration.messages.SharedCon
 import com.gemstone.gemfire.management.internal.configuration.messages.SharedConfigurationStatusResponse;
 import com.gemstone.gemfire.security.AuthenticationFailedException;
 
-import org.springframework.shell.core.annotation.CliAvailabilityIndicator;
-import org.springframework.shell.core.annotation.CliCommand;
-import org.springframework.shell.core.annotation.CliOption;
-
 /**
  * The LauncherLifecycleCommands class encapsulates all GemFire launcher commands for GemFire
tools (like starting
  * GemFire Monitor (GFMon) and Visual Statistics Display (VSD)) as well external tools (like
jconsole).
@@ -428,7 +429,14 @@ public class LauncherLifecycleCommands extends AbstractCommandsSupport
{
       } else {
         infoResultData.addLine(locatorState.toString());
 
-        String locatorHostName = StringUtils.defaultIfBlank(locatorLauncher.getHostnameForClients(),
getLocalHost());
+        String locatorHostName;
+        InetAddress bindAddr = locatorLauncher.getBindAddress();
+        if (bindAddr != null){
+          locatorHostName = bindAddr.getCanonicalHostName();
+        } else {
+          locatorHostName = StringUtils.defaultIfBlank(locatorLauncher.getHostnameForClients(),
getLocalHost());
+        }
+
         int locatorPort = Integer.parseInt(locatorState.getPort());
 
         // AUTO-CONNECT
@@ -569,7 +577,7 @@ public class LauncherLifecycleCommands extends AbstractCommandsSupport
{
         getGfsh().setOperationInvoker(new JmxOperationInvoker(memberEndpoint.getHost(), memberEndpoint.getPort(),
             null, null, configurationProperties, null));
 
-        String shellAndLogMessage = CliStrings.format(CliStrings.CONNECT__MSG__SUCCESS, memberEndpoint.toString(false));
+        String shellAndLogMessage = CliStrings.format(CliStrings.CONNECT__MSG__SUCCESS, "JMX
Manager " + memberEndpoint.toString(false));
 
         infoResultData.addLine("\n");
         infoResultData.addLine(shellAndLogMessage);
@@ -624,6 +632,7 @@ public class LauncherLifecycleCommands extends AbstractCommandsSupport
{
       final boolean jmxManagerAuthEnabled,
       final boolean jmxManagerSslEnabled,
       final InfoResultData infoResultData) {
+
     infoResultData.addLine("\n");
     infoResultData.addLine(CliStrings.format(CliStrings.START_LOCATOR__USE__0__TO__CONNECT,
         new CommandStringBuilder(CliStrings.CONNECT).addOption(CliStrings.CONNECT__LOCATOR,


Mime
View raw message