File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed
src/snowflake/connector/auth Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -123,18 +123,19 @@ def prepare(
123123 socket_connection .setsockopt (socket .SOL_SOCKET , socket .SO_REUSEPORT , 1 )
124124
125125 try :
126+ hostname = os .getenv ("SF_AUTH_SOCKET_ADDR" , "localhost" )
126127 try :
127128 socket_connection .bind (
128129 (
129- os . getenv ( "SF_AUTH_SOCKET_ADDR" , "localhost" ) ,
130+ hostname ,
130131 int (os .getenv ("SF_AUTH_SOCKET_PORT" , 0 )),
131132 )
132133 )
133134 except socket .gaierror as ex :
134135 if ex .args [0 ] == socket .EAI_NONAME :
135136 raise OperationalError (
136- msg = "localhost is not found. Ensure /etc/hosts has "
137- "localhost entry." ,
137+ msg = f" { hostname } is not found. Ensure /etc/hosts has "
138+ f" { hostname } entry." ,
138139 errno = ER_NO_HOSTNAME_FOUND ,
139140 )
140141 else :
You can’t perform that action at this time.
0 commit comments