File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed
src/snowflake/connector/aio/auth Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -94,18 +94,19 @@ async def prepare(
94
94
socket_connection .setsockopt (socket .SOL_SOCKET , socket .SO_REUSEPORT , 1 )
95
95
96
96
try :
97
+ hostname = os .getenv ("SF_AUTH_SOCKET_ADDR" , "localhost" )
97
98
try :
98
99
socket_connection .bind (
99
100
(
100
- os . getenv ( "SF_AUTH_SOCKET_ADDR" , "localhost" ) ,
101
+ hostname ,
101
102
int (os .getenv ("SF_AUTH_SOCKET_PORT" , 0 )),
102
103
)
103
104
)
104
105
except socket .gaierror as ex :
105
106
if ex .args [0 ] == socket .EAI_NONAME :
106
107
raise OperationalError (
107
- msg = "localhost is not found. Ensure /etc/hosts has "
108
- "localhost entry." ,
108
+ msg = f" { hostname } is not found. Ensure /etc/hosts has "
109
+ f" { hostname } entry." ,
109
110
errno = ER_NO_HOSTNAME_FOUND ,
110
111
)
111
112
else :
You can’t perform that action at this time.
0 commit comments