Skip to content

Commit 88e263e

Browse files
committed
allow selected PG* env variables so that pg_virtualenv works
1 parent 6d7d1e8 commit 88e263e

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 json
2122
import datetime as dt
@@ -505,6 +506,9 @@ def execute_osm2pgsql(context, output):
505506
env['LUA_PATH'] = context.user_args.lua_path
506507
if context.user_args.themepark_path:
507508
env['THEMEPARK_PATH'] = context.user_args.themepark_path
509+
for k in ['PGPORT', 'PGPASSWORD', 'PGUSER', 'PGHOST']:
510+
if k in os.environ:
511+
env[k] = os.environ[k]
508512

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

0 commit comments

Comments
 (0)