Skip to content

Commit

Permalink
Fix python3 conversion issue that means hostname lookup from DNS fails
Browse files Browse the repository at this point in the history
  • Loading branch information
coretl committed Sep 15, 2020
1 parent 7ca57e1 commit 4f94151
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion rootfs/network/default.script
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ case "$1" in
hostname "$(cat /etc/hostname)"
elif [ "$(hostname -s)" == "panda" ]; then
# Set hostname from ip addr entry in DNS
cmd="import socket; print socket.gethostbyaddr('$ip')[0]"
cmd="import socket; print(socket.gethostbyaddr('$ip')[0])"
hostname="$(python -c "$cmd")"
if [ -n "$hostname" ]; then
hostname "$hostname"
Expand Down

0 comments on commit 4f94151

Please sign in to comment.