hawq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From r...@apache.org
Subject incubator-hawq git commit: HAWQ-320. Can't get current user name if \$USER is not set
Date Wed, 06 Jan 2016 04:05:05 GMT
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 <rlei@pivotal.io>
Authored: Wed Jan 6 11:44:42 2016 +0800
Committer: rlei <rlei@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()


Mime
View raw message