From 1d99de86ab692b779476ec9a7e57c4fdf1be8668 Mon Sep 17 00:00:00 2001 From: lmrv Date: Fri, 12 Aug 2016 10:11:35 +0200 Subject: [PATCH] Command route The command route is not available by default on CentOS7. This one should be replace by the command "ip route". --- python/lib/cloudutils/networkConfig.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/lib/cloudutils/networkConfig.py b/python/lib/cloudutils/networkConfig.py index 41ef9d93ed23..cf33717c59d9 100644 --- a/python/lib/cloudutils/networkConfig.py +++ b/python/lib/cloudutils/networkConfig.py @@ -41,7 +41,7 @@ def listNetworks(): return devs @staticmethod def getDefaultNetwork(): - cmd = bash("route -n|awk \'/^0.0.0.0/ {print $2,$8}\'") + cmd = bash("ip route | awk \'/^default/ {print $3,$5}\'") if not cmd.isSuccess(): logging.debug("Failed to get default route") raise CloudRuntimeException("Failed to get default route")