[devtools] avoid warning about source['global-db-name']
authorJulien Cristau <julien.cristau@logilab.fr>
Fri, 26 Jun 2015 14:04:16 +0200
changeset 10472 7dd84b69c7d4
parent 10471 f04a77fe8418
child 10473 23a2fa8cb725
[devtools] avoid warning about source['global-db-name'] sqlite and postgres db handlers store the db template name there.
devtools/__init__.py
--- a/devtools/__init__.py	Fri Jun 26 10:52:03 2015 +0200
+++ b/devtools/__init__.py	Fri Jun 26 14:04:16 2015 +0200
@@ -296,6 +296,14 @@
         # pure consistency check
         assert self.system_source['db-driver'] == self.DRIVER
 
+        # some handlers want to store info here, avoid a warning
+        from cubicweb.server.sources.native import NativeSQLSource
+        NativeSQLSource.options += (
+            ('global-db-name',
+             {'type': 'string', 'help': 'for internal use only'
+            }),
+        )
+
     def _ensure_test_backup_db_dir(self):
         """Return path of directory for database backup.