Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"

[project]
name = "rda_python_common"
version = "3.0.6"
version = "3.0.7"
authors = [
{ name="Zaihua Ji", email="zji@ucar.edu" },
]
Expand Down
12 changes: 3 additions & 9 deletions src/rda_python_common/pg_log.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,8 @@ def __init__(self):
'SETUID': '', # the login name for suid if it is different to the CURUID
'FILEMODE': 0o664, # default 8-base file mode
'EXECMODE': 0o775, # default 8-base executable file mode or directory mode
# COMMONUSER and ADMINUSER are set below via SETPGLOG (env overrides PG<KEY>)
# COMMONUSER and ADMINUSER are set in set_common_pglog() via SETPGLOG,
# which lets environment variables COMMONUSER/ADMINUSER override the defaults
'SUDOGDEX': 0, # 1 to allow sudo to self.PGLOG['COMMONUSER']
'HOSTNAME': '', # current host name the process in running on
'OBJCTSTR': "object",
Expand Down Expand Up @@ -183,13 +184,6 @@ def __init__(self):
self.set_common_pglog()
self.OUTPUT = None

def SETPGLOG(self, key, default):
"""Set ``self.PGLOG[key]`` from environment variable ``PG<key>`` or
fall back to ``default`` if the variable is unset. Used to make
per-environment overrides (e.g. PGCOMMONUSER, PGADMINUSER) survive
package upgrades."""
self.PGLOG[key] = os.environ.get('PG' + key, default)

def open_output(self, outfile=None):
"""Open the result output destination.

Expand Down Expand Up @@ -1435,7 +1429,7 @@ def set_common_pglog(self):

Called automatically by :meth:`__init__`.
"""
# resolve common/admin user from environment (PGCOMMONUSER / PGADMINUSER)
# resolve common/admin user from environment (COMMONUSER / ADMINUSER)
self.SETPGLOG("COMMONUSER", "gdexdata")
self.SETPGLOG("ADMINUSER", "zji")
self.PGLOG['RDAUSER'] = self.PGLOG['COMMONUSER']
Expand Down
Loading