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(
124
124
socket_connection .setsockopt (socket .SOL_SOCKET , socket .SO_REUSEPORT , 1 )
125
125
126
126
try :
127
+ hostname = os .getenv ("SF_AUTH_SOCKET_ADDR" , "localhost" )
127
128
try :
128
129
socket_connection .bind (
129
130
(
130
- os . getenv ( "SF_AUTH_SOCKET_ADDR" , "localhost" ) ,
131
+ hostname ,
131
132
int (os .getenv ("SF_AUTH_SOCKET_PORT" , 0 )),
132
133
)
133
134
)
134
135
except socket .gaierror as ex :
135
136
if ex .args [0 ] == socket .EAI_NONAME :
136
137
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." ,
139
140
errno = ER_NO_HOSTNAME_FOUND ,
140
141
)
141
142
else :
You can’t perform that action at this time.
0 commit comments