Skip to content

Commit 7a13daa

Browse files
authored
fix host (#373)
Signed-off-by: Wei Du <[email protected]>
1 parent 5f0e60b commit 7a13daa

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

nemo_run/run/ray/templates/ray.sub.j2

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ nodes_array=($nodes)
8888
ip_addresses_array=()
8989

9090
for node in $nodes; do
91-
ip_address=$(host $node | awk '/has address/ { print $4 }')
91+
ip_address=$(getent hosts "$node" | awk '{print $1}' | head -n1)
9292
# Add the IP address to the array
9393
ip_addresses_array+=("$ip_address")
9494
done

test/core/execution/artifacts/expected_ray_cluster.sub

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ nodes_array=($nodes)
9090
ip_addresses_array=()
9191

9292
for node in $nodes; do
93-
ip_address=$(host $node | awk '/has address/ { print $4 }')
93+
ip_address=$(getent hosts "$node" | awk '{print $1}' | head -n1)
9494
# Add the IP address to the array
9595
ip_addresses_array+=("$ip_address")
9696
done

test/core/execution/artifacts/expected_ray_cluster_ssh.sub

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ nodes_array=($nodes)
9191
ip_addresses_array=()
9292

9393
for node in $nodes; do
94-
ip_address=$(host $node | awk '/has address/ { print $4 }')
94+
ip_address=$(getent hosts "$node" | awk '{print $1}' | head -n1)
9595
# Add the IP address to the array
9696
ip_addresses_array+=("$ip_address")
9797
done

0 commit comments

Comments
 (0)