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 @@ -124,18 +124,19 @@ def prepare(
124124 socket_connection .setsockopt (socket .SOL_SOCKET , socket .SO_REUSEPORT , 1 )
125125
126126 try :
127+ hostname = os .getenv ("SF_AUTH_SOCKET_ADDR" , "localhost" )
127128 try :
128129 socket_connection .bind (
129130 (
130- os . getenv ( "SF_AUTH_SOCKET_ADDR" , "localhost" ) ,
131+ hostname ,
131132 int (os .getenv ("SF_AUTH_SOCKET_PORT" , 0 )),
132133 )
133134 )
134135 except socket .gaierror as ex :
135136 if ex .args [0 ] == socket .EAI_NONAME :
136137 raise OperationalError (
137- msg = "localhost is not found. Ensure /etc/hosts has "
138- "localhost entry." ,
138+ msg = f" { hostname } is not found. Ensure /etc/hosts has "
139+ f" { hostname } entry." ,
139140 errno = ER_NO_HOSTNAME_FOUND ,
140141 )
141142 else :
You can’t perform that action at this time.
0 commit comments