@@ -107,8 +107,7 @@ def conn(host=None, user=None, password=None, *, init_fun=None, reset=False, use
107
107
#encrypted-connection-options).
108
108
"""
109
109
if not hasattr (conn , 'connection' ) or reset :
110
- host_input = host if host is not None else config ['database.host' ]
111
- host = get_host_hook (host_input )
110
+ host = host if host is not None else config ['database.host' ]
112
111
user = user if user is not None else config ['database.user' ]
113
112
password = password if password is not None else config ['database.password' ]
114
113
if user is None : # pragma: no cover
@@ -117,8 +116,7 @@ def conn(host=None, user=None, password=None, *, init_fun=None, reset=False, use
117
116
password = getpass (prompt = "Please enter DataJoint password: " )
118
117
init_fun = init_fun if init_fun is not None else config ['connection.init_function' ]
119
118
use_tls = use_tls if use_tls is not None else config ['database.use_tls' ]
120
- conn .connection = Connection (host , user , password , None , init_fun , use_tls ,
121
- host_input = host_input )
119
+ conn .connection = Connection (host , user , password , None , init_fun , use_tls )
122
120
return conn .connection
123
121
124
122
@@ -160,8 +158,8 @@ class Connection:
160
158
:param use_tls: TLS encryption option
161
159
"""
162
160
163
- def __init__ (self , host , user , password , port = None , init_fun = None , use_tls = None ,
164
- host_input = None ):
161
+ def __init__ (self , host , user , password , port = None , init_fun = None , use_tls = None ):
162
+ host_input , host = ( host , get_host_hook ( host ))
165
163
if ':' in host :
166
164
# the port in the hostname overrides the port argument
167
165
host , port = host .split (':' )
0 commit comments