mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
cloudutils: use ip command instead of route in networkConfig.py (#10726)
This commit is contained in:
parent
9d9737ae04
commit
7f16a207e0
@ -41,7 +41,7 @@ class networkConfig:
|
|||||||
return devs
|
return devs
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def getDefaultNetwork():
|
def getDefaultNetwork():
|
||||||
cmd = bash("route -n|awk \'/^0.0.0.0/ {print $2,$8}\'")
|
cmd = bash("ip route show default | awk \'{print $3,$5}\'")
|
||||||
if not cmd.isSuccess():
|
if not cmd.isSuccess():
|
||||||
logging.debug("Failed to get default route")
|
logging.debug("Failed to get default route")
|
||||||
raise CloudRuntimeException("Failed to get default route")
|
raise CloudRuntimeException("Failed to get default route")
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user