Stefano Cossu 7 роки тому
батько
коміт
ada0eaac31
2 змінених файлів з 7 додано та 7 видалено
  1. 5 5
      lakesuperior/config_parser.py
  2. 2 2
      lakesuperior/migrator.py

+ 5 - 5
lakesuperior/config_parser.py

@@ -56,21 +56,21 @@ def parse_config(config_dir=None):
     '''
 
     # Merge default and test configurations.
-    test_config = {'application': hiyapyco.load(
+    _test_config = {'application': hiyapyco.load(
             config_dir + '/application.yml',
             config_dir + '/test.yml', method=hiyapyco.METHOD_MERGE)}
 
     if _config['application']['store']['ldp_rs']['location'] \
-            == test_config['application']['store']['ldp_rs']['location']:
+            == _test_config['application']['store']['ldp_rs']['location']:
                 raise RuntimeError(error_msg.format('RDF'))
                 sys.exit()
 
     if _config['application']['store']['ldp_nr']['path'] \
-            == test_config['application']['store']['ldp_nr']['path']:
+            == _test_config['application']['store']['ldp_nr']['path']:
                 raise RuntimeError(error_msg.format('binary'))
                 sys.exit()
-    return _config
+    return _config, _test_config
 
 
 # Load default configuration.
-config = parse_config()
+config, test_config = parse_config()

+ 2 - 2
lakesuperior/migrator.py

@@ -106,7 +106,7 @@ class Migrator:
                 '{}/etc.defaults'.format(cur_dir), self.config_dir)
 
         # Modify and overwrite destination configuration.
-        orig_config = parse_config(self.config_dir)
+        orig_config, _ = parse_config(self.config_dir)
         orig_config['application']['store']['ldp_rs']['location'] = self.dbpath
         orig_config['application']['store']['ldp_nr']['path'] = self.fpath
 
@@ -114,7 +114,7 @@ class Migrator:
                 as config_file:
             config_file.write(yaml.dump(orig_config['application']))
 
-        env.config = parse_config(self.config_dir)
+        env.config, _ = parse_config(self.config_dir)
         env.app_globals = AppGlobals(env.config)
 
         self.rdfly = env.app_globals.rdfly