[devtools] Set dumb value for postgres's db-host to avoid unexpected connection to a local server
Currently, if something goes wrong (eg config built before call to
startpgcluster) while a pg server is running on localhost, it may connect to
this server and run the test in there unexepectedly.
--- a/cubicweb/devtools/__init__.py Fri May 20 12:05:29 2016 +0200
+++ b/cubicweb/devtools/__init__.py Fri May 20 13:07:21 2016 +0200
@@ -97,6 +97,9 @@
DEFAULT_PSQL_SOURCES['system']['db-driver'] = 'postgres'
DEFAULT_PSQL_SOURCES['system']['db-user'] = text_type(getpass.getuser())
DEFAULT_PSQL_SOURCES['system']['db-password'] = None
+# insert a dumb value as db-host to avoid unexpected connection to local server
+DEFAULT_PSQL_SOURCES['system']['db-host'] = 'REPLACEME'
+
def turn_repo_off(repo):
""" Idea: this is less costly than a full re-creation of the repo object.