Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
ColossalAI
Commits
14d92993
Unverified
Commit
14d92993
authored
Jan 12, 2023
by
Frank Lee
Committed by
GitHub
Jan 12, 2023
Browse files
[cli] fixed hostname mismatch error (#2465)
parent
c20529fe
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
2 deletions
+7
-2
colossalai/cli/launcher/hostinfo.py
colossalai/cli/launcher/hostinfo.py
+7
-2
No files found.
colossalai/cli/launcher/hostinfo.py
View file @
14d92993
from
typing
import
List
import
socket
from
typing
import
List
class
HostInfo
:
...
...
@@ -35,9 +35,14 @@ class HostInfo:
if
port
is
None
:
port
=
22
# no port specified, lets just use the ssh port
hostname
=
socket
.
getfqdn
(
hostname
)
# socket.getfqdn("127.0.0.1") does not return localhost
# on some users' machines
# thus, we directly return True if hostname is locahost, 127.0.0.1 or 0.0.0.0
if
hostname
in
(
"localhost"
,
"127.0.0.1"
,
"0.0.0.0"
):
return
True
hostname
=
socket
.
getfqdn
(
hostname
)
localhost
=
socket
.
gethostname
()
localaddrs
=
socket
.
getaddrinfo
(
localhost
,
port
)
targetaddrs
=
socket
.
getaddrinfo
(
hostname
,
port
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment