change driver config

This commit is contained in:
root 2020-04-26 04:38:28 -04:00 committed by Dana Van Aken
parent ae091160c0
commit c9951a287b
2 changed files with 7 additions and 4 deletions

View File

@ -48,7 +48,7 @@ DB_PORT = '5432'
DB_CONF = '/etc/postgresql/9.6/main/postgresql.conf' DB_CONF = '/etc/postgresql/9.6/main/postgresql.conf'
# Path to the directory for storing database dump files # Path to the directory for storing database dump files
DB_DUMP_DIR = '/var/lib/postgresql/9.6/main/dumpfiles' DB_DUMP_DIR = None
# Base config settings to always include when installing new configurations # Base config settings to always include when installing new configurations
if DB_TYPE == 'mysql': if DB_TYPE == 'mysql':
@ -97,7 +97,10 @@ TEMP_DIR = '/tmp/driver'
# Path to the directory for storing database dump files # Path to the directory for storing database dump files
if DB_DUMP_DIR is None: if DB_DUMP_DIR is None:
if HOST_CONN == 'local':
DB_DUMP_DIR = os.path.join(DRIVER_HOME, 'dumpfiles') DB_DUMP_DIR = os.path.join(DRIVER_HOME, 'dumpfiles')
else:
DB_DUMP_DIR = os.path.expanduser('~/dumpfiles')
if not os.path.exists(DB_DUMP_DIR): if not os.path.exists(DB_DUMP_DIR):
os.mkdir(DB_DUMP_DIR) os.mkdir(DB_DUMP_DIR)
@ -138,7 +141,7 @@ OLTPBENCH_BENCH = 'tpcc'
CONTROLLER_HOME = DRIVER_HOME + '/../controller' CONTROLLER_HOME = DRIVER_HOME + '/../controller'
# Path to the controller configuration file # Path to the controller configuration file
CONTROLLER_CONFIG = os.path.join(CONTROLLER_HOME, 'config/postgres_config.json') CONTROLLER_CONFIG = os.path.join(CONTROLLER_HOME, 'config/{}_config.json'.format(DB_TYPE))
#========================================================== #==========================================================

View File

@ -84,7 +84,7 @@ def create_controller_config():
elif dconf.DB_TYPE == 'oracle': elif dconf.DB_TYPE == 'oracle':
dburl_fmt = 'jdbc:oracle:thin:@{host}:{port}:{db}'.format dburl_fmt = 'jdbc:oracle:thin:@{host}:{port}:{db}'.format
elif dconf.DB_TYPE == 'mysql': elif dconf.DB_TYPE == 'mysql':
dburl_fmt = 'jdbc:mysql://{host}:{port}/{db}?useSSL=false'.format dburl_fmt = 'jdbc:mysql://{host}:{port}/{db}'.format
else: else:
raise Exception("Database Type {} Not Implemented !".format(dconf.DB_TYPE)) raise Exception("Database Type {} Not Implemented !".format(dconf.DB_TYPE))