summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSiddharth Ravikumar <sravik@bgsu.edu>2015-02-08 21:17:24 -0500
committerSiddharth Ravikumar <sravik@bgsu.edu>2015-02-08 21:17:24 -0500
commit57f5accd78d2819bc7c26d8248419aafb0d13855 (patch)
tree4aa3d5ae3f791e6df2282e06205faadd3fc36c34
parent7822ed1d829aa34fe9c92de24f1f68042b05ed64 (diff)
[bugfix]: combox/config.py - when empty string is given for 'silo_dir'; it sets the dir to PWD, this was not intended. This was fixed.
When empty string is given for 'silo_dir', the intended default directory was the combox's config directory. The input to 'silo_dir' was directly given to path.abspath() The path.abspath() function, when an empty string is given returns the PWD. That's where the bug was! So, now the 'silo_dir' input is read to a local variable `silo_dir'. If the local variable `silo_dir' is empty, the combox config directory is assigned; else, the given directory is assigned.
-rw-r--r--combox/config.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/combox/config.py b/combox/config.py
index 290bc3c..c4b83c4 100644
--- a/combox/config.py
+++ b/combox/config.py
@@ -79,9 +79,11 @@ def config_cb(config_dir = path.join(os.getenv('HOME'),'.combox/'),
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))
+ silo_dir = input_func(silo_help_txt)
- if not config_info['silo_dir']:
+ if silo_dir:
+ config_info['silo_dir'] = path.abspath(silo_dir)
+ else:
config_info['silo_dir'] = config_dir
config_info['topsecret'] = pass_func()