[devtools] Set dumb value for postgres's db-host to avoid unexpected connection to a local server
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Fri, 20 May 2016 13:07:21 +0200
changeset 11264 1a3a0ac2b41d
parent 11259 84e2a1121f4b
child 11265 ce04184fbf90
[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.
cubicweb/devtools/__init__.py
--- 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.