Remove only PATRONI_ prefixed environment variables (#1224)

it will solve a lot of problems with running different FDW
This commit is contained in:
Cody Coons
2019-10-24 08:39:21 +02:00
committed by Alexander Kukushkin
parent 732d33812f
commit d770c910fd
2 changed files with 5 additions and 2 deletions
+2 -1
View File
@@ -24,7 +24,6 @@ import yaml
from click import ClickException
from contextlib import contextmanager
from patroni.config import Config
from patroni.dcs import get_dcs as _get_dcs
from patroni.exceptions import PatroniException
from patroni.postgresql import Postgresql
@@ -67,6 +66,8 @@ def parse_dcs(dcs):
def load_config(path, dcs):
from patroni.config import Config
if not (os.path.exists(path) and os.access(path, os.R_OK)):
logging.debug('Ignoring configuration file "%s". It does not exists or is not readable.', path)
else:
+3 -1
View File
@@ -6,6 +6,8 @@ import re
import signal
import subprocess
from patroni.config import Config
logger = logging.getLogger(__name__)
STOP_SIGNALS = {
@@ -153,7 +155,7 @@ class PostmasterProcess(psutil.Process):
# In order to make everything portable we can't use fork&exec approach here, so we will call
# ourselves and pass list of arguments which must be used to start postgres.
# On Windows, in order to run a side-by-side assembly the specified env must include a valid SYSTEMROOT.
env = {p: os.environ[p] for p in ('PATH', 'LD_LIBRARY_PATH', 'LC_ALL', 'LANG', 'SYSTEMROOT') if p in os.environ}
env = {p: os.environ[p] for p in os.environ if not p.startswith(Config.PATRONI_ENV_PREFIX)}
try:
proc = PostmasterProcess._from_pidfile(data_dir)
if proc and not proc._is_postmaster_process():