From 6b56bb9eeb303cd7121d8c8fc8b7e791b0cffa63 Mon Sep 17 00:00:00 2001 From: Siddharth Ravikumar Date: Wed, 21 Jan 2015 07:08:18 -0500 Subject: now the config file also makes note of the 'silo' directory. silo directory is the location where the silo (silo.db) containing information about files in the combox directory is stored. modified: combox/config.py modified: tests/config_test.py modified: tests/test-config/config.yaml --- combox/config.py | 7 +++++++ tests/config_test.py | 2 +- tests/test-config/config.yaml | 1 + 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/combox/config.py b/combox/config.py index 7e1998e..36a5a71 100644 --- a/combox/config.py +++ b/combox/config.py @@ -76,6 +76,13 @@ def config_cb(config_dir = path.join(os.getenv('HOME'),'.combox/'), config_info = {} config_info['combox_dir'] = path.abspath(input_func('path to combox directory')) + + silo_help_txt = 'silo directory (default: %s)' % (config_dir) + config_info['silo_dir'] = path.abspath(input_func(silo_help_txt)) + + if not config_info['silo_dir']: + config_info['silo_dir'] = config_dir + config_info['topsecret'] = pass_func() no_nodes = int(input_func('number of nodes')) diff --git a/tests/config_test.py b/tests/config_test.py index bfbcbb4..9840ba1 100644 --- a/tests/config_test.py +++ b/tests/config_test.py @@ -31,7 +31,7 @@ node_dir_0 = path.join('tests', 'shard-dir-0') node_dir_1 = path.join('tests', 'shard-dir-1') # sample config info. -CONFIG_INFO = [combox_dir, '2', +CONFIG_INFO = [combox_dir, CONFIG_DIR, '2', 'node-0', node_dir_0, '1024', 'node-1', node_dir_1, '1024'] diff --git a/tests/test-config/config.yaml b/tests/test-config/config.yaml index 765b06b..6c503b3 100644 --- a/tests/test-config/config.yaml +++ b/tests/test-config/config.yaml @@ -8,4 +8,5 @@ nodes_info: available: '1024' path: /home/rsd/bgc/combox/tests/shard-dir-1 size: '1024' +silo_dir: /home/rsd/bgc/combox/tests/test-config topsecret: topsecret -- cgit v1.2.3