1
|
import logging
|
2
|
import os
|
3
|
|
4
|
def get_index_properties():
|
5
|
if 'DLI_CONF_PATH' not in os.environ:
|
6
|
logging.error("ENVIRONEMENT VARIABLE DLI_CONF_PATH DOES NOT EXISTS ")
|
7
|
raise Exception("ENVIRONEMENT VARIABLE DLI_CONF_PATH DOES NOT EXISTS ")
|
8
|
|
9
|
if not os.path.exists(os.environ['DLI_CONF_PATH']):
|
10
|
logging.error("FILE {} DOES NOT EXISTS ".format(os.environ['DLI_CONF_PATH']))
|
11
|
raise Exception("FILE {} DOES NOT EXISTS ".format(os.environ['DLI_CONF_PATH']))
|
12
|
|
13
|
|
14
|
with open(os.environ['DLI_CONF_PATH']) as f:
|
15
|
p = {}
|
16
|
for line in f:
|
17
|
if not line.startswith("#"):
|
18
|
data = line.strip().split("=")
|
19
|
p[data[0].strip()] = data[1].strip()
|
20
|
return p
|
21
|
|