summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSiddharth Ravikumar <sravik@bgsu.edu>2015-01-15 16:59:12 -0500
committerSiddharth Ravikumar <sravik@bgsu.edu>2015-01-15 16:59:12 -0500
commit3458ba2623dcc065d6e75125668233bc4fada149 (patch)
treeb116de063b380473410ba4cb63fdc6181384535f
parent52fcd0f0b75c16d72eec9b1be8becb7f59b1672c (diff)
combox/config.py: node directories are created if they're not already created.
-rw-r--r--combox/config.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/combox/config.py b/combox/config.py
index 4c17184..387c3af 100644
--- a/combox/config.py
+++ b/combox/config.py
@@ -88,6 +88,10 @@ def config_cb(config_dir = path.join(os.getenv('HOME'),'.combox/'),
nodes[node_name]['size'] = input_func('node %d size (in mega bytes)' % i)
nodes[node_name]['available'] = nodes[node_name]['size']
+ # create node path, if it doesn't exists yet.
+ if not path.exists(nodes[node_name]['path']):
+ os.mkdir(nodes[node_name]['path'])
+
config_info['nodes_info'] = nodes
config_file = open(config_file_path, 'w')
yaml.dump(config_info, config_file, default_flow_style=False)