use python3 for gethostbyname
authorparmentelat <thierry.parmentelat@inria.fr>
Thu, 6 Dec 2018 14:53:48 +0000 (15:53 +0100)
committerparmentelat <thierry.parmentelat@inria.fr>
Thu, 6 Dec 2018 14:53:48 +0000 (15:53 +0100)
lbuild-initvm.sh

index 720cf0a..e4d3c6a 100755 (executable)
@@ -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