diff --git a/pyproject.toml b/pyproject.toml index c427e3b..6179b76 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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" }, ] diff --git a/src/rda_python_common/pg_log.py b/src/rda_python_common/pg_log.py index 5264424..c685783 100644 --- a/src/rda_python_common/pg_log.py +++ b/src/rda_python_common/pg_log.py @@ -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) + # 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", @@ -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`` 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. @@ -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']