Skip to content

Commit 6ab0c05

Browse files
committed
allow selected PG* env variables so that pg_virtualenv works
1 parent 20a270f commit 6ab0c05

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

scripts/osm2pgsql-test-style

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import sys
1616
import tempfile
1717
import math
1818
import re
19+
import os
1920
import contextlib
2021
import datetime as dt
2122
from decimal import Decimal
@@ -504,6 +505,9 @@ def execute_osm2pgsql(context, output):
504505
env['LUA_PATH'] = context.user_args.lua_path
505506
if context.user_args.themepark_path:
506507
env['THEMEPARK_PATH'] = context.user_args.themepark_path
508+
for k in ['PGPORT', 'PGPASSWORD', 'PGUSER', 'PGHOST']:
509+
if k in os.environ:
510+
env[k] = os.environ[k]
507511

508512
proc = Popen(cmdline, cwd=str(context.workdir),
509513
stdin=PIPE, stdout=PIPE, stderr=PIPE, env=env)

0 commit comments

Comments
 (0)