[
https://issues.apache.org/jira/browse/GEODE-68?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15319337#comment-15319337
]
ASF GitHub Bot commented on GEODE-68:
-------------------------------------
Github user bschuchardt commented on a diff in the pull request:
https://github.com/apache/incubator-geode/pull/152#discussion_r66147139
--- Diff:
geode-core/src/main/java/com/gemstone/gemfire/management/internal/cli/shell/Gfsh.java
---
@@ -279,7 +281,12 @@ protected Gfsh(boolean launchShell, String[] args,
GfshConfig gfshConfig) throws
private void initializeEnvironment() {
env.put(ENV_SYS_USER, System.getProperty("user.name"));
env.put(ENV_SYS_USER_HOME, System.getProperty("user.home"));
- env.put(ENV_SYS_HOST_NAME, System.getProperty("user.name"));
+ try {
+ env.put(ENV_SYS_HOST_NAME,
InetAddress.getLocalHost().getHostName());
--- End diff --
Use SocketCreator.getLocalHost() and SocketCreator.getHostName().
SocketCreator caches host names to avoid going to DNS when the host name is
already known.
> GFSH SYS_HOST_NAME variable should report hostname if available
> ---------------------------------------------------------------
>
> Key: GEODE-68
> URL: https://issues.apache.org/jira/browse/GEODE-68
> Project: Geode
> Issue Type: Bug
> Components: gfsh
> Reporter: William Markito Oliveira
> Assignee: Kevin Duling
> Priority: Minor
> Labels: gfsh
>
> SYS_HOST_NAME is actually displaying SYS_USER_HOME.
> This is very useful for automation scripts.
> {code}
> gfsh>echo --string=$*
> Property | Value
> ------------------------------ |
> ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
> APP_COLLECTION_LIMIT | 20
> APP_FETCH_SIZE | 1000
> APP_LAST_EXIT_STATUS | 0
> APP_LOGGING_ENABLED | false
> APP_LOG_FILE | /Users/wmarkito/gfsh-%u_%g.log
> APP_NAME | gfsh
> APP_PWD | /Users/wmarkito
> APP_QUERY_RESULTS_DISPLAY_MODE | table
> APP_QUIET_EXECUTION | false
> APP_RESULT_VIEWER | basic
> SYS_CLASSPATH |
> /Users/wmarkito/Pivotal/GemFire/sources/github/gemfire/build-artifacts/mac/product/lib/gfsh-dependencies.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_71.jdk/Contents/Home/lib/tools.jar
> SYS_GEMFIRE_DIR | /Users/wmarkito/...
> SYS_HOST_NAME | wmarkito
> SYS_JAVA_VERSION | 1.7.0_72
> SYS_OS | Mac OS X
> SYS_OS_LINE_SEPARATOR |
> SYS_USER | wmarkito
> SYS_USER_HOME | /Users/wmarkito
> {code}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)