Skip to content

Commit 442fc28

Browse files
author
Satheesh Ravi
committed
Added environment variable options for remote path prestodb#339
1 parent 7d23ad4 commit 442fc28

File tree

1 file changed

+19
-5
lines changed

1 file changed

+19
-5
lines changed

prestoadmin/util/constants.py

+19-5
Original file line numberDiff line numberDiff line change
@@ -36,14 +36,28 @@
3636
COORDINATOR_DIR_NAME = 'coordinator'
3737
WORKERS_DIR_NAME = 'workers'
3838
CATALOG_DIR_NAME = 'catalog'
39+
PRESTO_REMOTE_CONF_DIR = 'PRESTO_REMOTE_CONF_DIR'
40+
PRESTO_REMOTE_PACKAGES_PATH = 'PRESTO_REMOTE_PACKAGES_PATH'
41+
PRESTO_REMOTE_SERVER_LOG_FILE = 'PRESTO_REMOTE_SERVER_LOG_FILE'
42+
PRESTO_REMOTE_LAUNCHER_LOG_FILE = 'PRESTO_REMOTE_LAUNCHER_LOG_FILE'
43+
PRESTO_REMOTE_PLUGIN_DIR = 'PRESTO_REMOTE_PLUGIN_DIR'
3944

4045
# remote configuration
41-
REMOTE_CONF_DIR = '/etc/presto'
46+
REMOTE_CONF_DIR = os.environ[PRESTO_REMOTE_CONF_DIR] \
47+
if PRESTO_REMOTE_CONF_DIR in os.environ else '/etc/presto'
4248
REMOTE_CATALOG_DIR = os.path.join(REMOTE_CONF_DIR, 'catalog')
43-
REMOTE_PACKAGES_PATH = '/opt/prestoadmin/packages'
44-
DEFAULT_PRESTO_SERVER_LOG_FILE = '/var/log/presto/server.log'
45-
DEFAULT_PRESTO_LAUNCHER_LOG_FILE = '/var/log/presto/launcher.log'
46-
REMOTE_PLUGIN_DIR = '/usr/lib/presto/lib/plugin'
49+
REMOTE_PACKAGES_PATH = os.environ[PRESTO_REMOTE_PACKAGES_PATH] \
50+
if PRESTO_REMOTE_PACKAGES_PATH in os.environ \
51+
else '/opt/prestoadmin/packages'
52+
DEFAULT_PRESTO_SERVER_LOG_FILE = os.environ[PRESTO_REMOTE_SERVER_LOG_FILE] \
53+
if PRESTO_REMOTE_SERVER_LOG_FILE in os.environ \
54+
else '/var/log/presto/server.log'
55+
DEFAULT_PRESTO_LAUNCHER_LOG_FILE = os.environ[PRESTO_REMOTE_LAUNCHER_LOG_FILE] \
56+
if PRESTO_REMOTE_LAUNCHER_LOG_FILE in os.environ \
57+
else '/var/log/presto/launcher.log'
58+
REMOTE_PLUGIN_DIR = os.environ[PRESTO_REMOTE_PLUGIN_DIR] \
59+
if PRESTO_REMOTE_PLUGIN_DIR in os.environ \
60+
else '/usr/lib/presto/lib/plugin'
4761
REMOTE_COPY_DIR = '/tmp'
4862

4963
# Presto configuration files

0 commit comments

Comments
 (0)