You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hawq.apache.org by rl...@apache.org on 2016/01/06 05:05:05 UTC

incubator-hawq git commit: HAWQ-320. Can't get current user name if \$USER is not set

Repository: incubator-hawq
Updated Branches:
  refs/heads/master c2e3241b6 -> 1e535bd4d


HAWQ-320. Can't get current user name if \$USER is not set


Project: http://git-wip-us.apache.org/repos/asf/incubator-hawq/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-hawq/commit/1e535bd4
Tree: http://git-wip-us.apache.org/repos/asf/incubator-hawq/tree/1e535bd4
Diff: http://git-wip-us.apache.org/repos/asf/incubator-hawq/diff/1e535bd4

Branch: refs/heads/master
Commit: 1e535bd4db07d03f503526b13734c7a59ff55055
Parents: c2e3241
Author: rlei <rl...@pivotal.io>
Authored: Wed Jan 6 11:44:42 2016 +0800
Committer: rlei <rl...@pivotal.io>
Committed: Wed Jan 6 12:04:33 2016 +0800

----------------------------------------------------------------------
 tools/bin/hawq_ctl | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/1e535bd4/tools/bin/hawq_ctl
----------------------------------------------------------------------
diff --git a/tools/bin/hawq_ctl b/tools/bin/hawq_ctl
index 39a0993..036f8ea 100755
--- a/tools/bin/hawq_ctl
+++ b/tools/bin/hawq_ctl
@@ -26,6 +26,7 @@ try:
     import threading
     import Queue
     import signal
+    import getpass
     from optparse import OptionParser
     from gppylib.gplog import setup_hawq_tool_logging, quiet_stdout_logging, enable_verbose_logging
     from gppylib.commands.unix import getLocalHostname, getUserName
@@ -788,7 +789,7 @@ def get_args():
     source_hawq_env = "source %s/greenplum_path.sh" % opts.GPHOME 
 
     if opts.user == "":
-        opts.user = os.getenv('USER')
+        opts.user = getpass.getuser()
     if opts.user == "root":
         logger.error("'root' user is not allowed")
         sys.exit()