From dcee0ddd55e0521dd6125e16fa0f5c4a41c76c2c Mon Sep 17 00:00:00 2001 From: Tyler Goodlet Date: Mon, 20 Jun 2022 13:07:46 -0400 Subject: [PATCH] Move/expect all marketstore configs under a `/piker/marketstore` subdir --- piker/data/marketstore.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/piker/data/marketstore.py b/piker/data/marketstore.py index 4d1c91ad..19d426af 100644 --- a/piker/data/marketstore.py +++ b/piker/data/marketstore.py @@ -127,10 +127,15 @@ def start_marketstore( import os import docker from .. import config - get_console_log('info', name=__name__) - yml_file = os.path.join(config._config_dir, 'mkts.yml') + mktsdir = os.path.join(config._config_dir, 'marketstore') + + # create when dne + if not os.path.isdir(mktsdir): + os.mkdir(mktsdir) + + yml_file = os.path.join(mktsdir, 'mkts.yml') if not os.path.isfile(yml_file): log.warning( f'No `marketstore` config exists?: {yml_file}\n' @@ -143,14 +148,14 @@ def start_marketstore( # create a mount from user's local piker config dir into container config_dir_mnt = docker.types.Mount( target='/etc', - source=config._config_dir, + source=mktsdir, type='bind', ) # create a user config subdir where the marketstore # backing filesystem database can be persisted. persistent_data_dir = os.path.join( - config._config_dir, 'data', + mktsdir, 'data', ) if not os.path.isdir(persistent_data_dir): os.mkdir(persistent_data_dir)