From: parmentelat Date: Thu, 6 Dec 2018 14:53:48 +0000 (+0100) Subject: use python3 for gethostbyname X-Git-Tag: py3ok~28 X-Git-Url: http://git.onelab.eu/?p=build.git;a=commitdiff_plain;h=140ec07b8ce5a7f3994f1c0f14a22c8a04940691 use python3 for gethostbyname --- diff --git a/lbuild-initvm.sh b/lbuild-initvm.sh index 720cf0a2..e4d3c6af 100755 --- a/lbuild-initvm.sh +++ b/lbuild-initvm.sh @@ -51,7 +51,7 @@ DEBIAN_PREINSTALLED="openssh-server openssh-client" ########## networking utilities function gethostbyname () { local hostname=$1 - python -c "import socket; print socket.gethostbyname('"$hostname"')" 2> /dev/null + python3 -c "import socket; print(socket.gethostbyname('"$hostname"'))" 2> /dev/null } # e.g. 21 -> 255.255.248.0