Skip to content

Commit 7f16a20

Browse files
cloudutils: use ip command instead of route in networkConfig.py (#10726)
1 parent 9d9737a commit 7f16a20

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

python/lib/cloudutils/networkConfig.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ def listNetworks():
4141
return devs
4242
@staticmethod
4343
def getDefaultNetwork():
44-
cmd = bash("route -n|awk \'/^0.0.0.0/ {print $2,$8}\'")
44+
cmd = bash("ip route show default | awk \'{print $3,$5}\'")
4545
if not cmd.isSuccess():
4646
logging.debug("Failed to get default route")
4747
raise CloudRuntimeException("Failed to get default route")

0 commit comments

Comments
 (0)