[dataimport] fix db-namespace default value handling
authorAdrien Di Mascio <Adrien.DiMascio@logilab.fr>
Wed, 25 Nov 2015 10:19:52 +0100
changeset 10929 73e6ec94504b
parent 10928 0aa9da35db30
child 10930 e0f5bfafec90
[dataimport] fix db-namespace default value handling In a fresh new instance, the "db-namespace" option is set as empty by default in the "sources" file. This seems correct but empty string is not a valid pg_schema and actually means that we should use "public"
dataimport/massive_store.py
--- a/dataimport/massive_store.py	Wed Nov 25 11:30:36 2015 +0100
+++ b/dataimport/massive_store.py	Wed Nov 25 10:19:52 2015 +0100
@@ -114,7 +114,7 @@
 
         self.slave_mode = slave_mode
         self.default_values = get_default_values(cnx.vreg.schema)
-        pg_schema = cnx.repo.config.system_source_config.get('db-namespace', 'public')
+        pg_schema = cnx.repo.config.system_source_config.get('db-namespace') or 'public'
         self._dbh = PGHelper(self._cnx, pg_schema)
         self._data_entities = defaultdict(list)
         self._data_relations = defaultdict(list)