From c07f5815b8dc0d792202d14d0998e9797d2e70db Mon Sep 17 00:00:00 2001 From: Jan David Mol <mol@astron.nl> Date: Thu, 7 Jan 2016 12:41:30 +0000 Subject: [PATCH] Task #8899: Set HOME and USER, since supervisord does not --- LCS/PyCommon/dbcredentials.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/LCS/PyCommon/dbcredentials.py b/LCS/PyCommon/dbcredentials.py index 05f89b60fdf..e06b7d20b43 100644 --- a/LCS/PyCommon/dbcredentials.py +++ b/LCS/PyCommon/dbcredentials.py @@ -29,9 +29,9 @@ __all__ = ["DBCredentials", "options_group", "parse_options"] # obtain the environment, and add USER and HOME if needed (since supervisord does not) environ = os.environ -user_info = pwd.getpwduid(os.getuid()) -environ.setdefault("HOME", user_info["pw_dir"]) -environ.setdefault("USER", user_info["pw_name"]) +user_info = pwd.getpwuid(os.getuid()) +environ.setdefault("HOME", user_info.pw_dir) +environ.setdefault("USER", user_info.pw_name) def findfiles(pattern): """ Returns a list of files matched by `pattern'. -- GitLab