This is an automated email from the ASF dual-hosted git repository.

rohit pushed a commit to branch 4.19
in repository https://gitbox.apache.org/repos/asf/cloudstack.git


The following commit(s) were added to refs/heads/4.19 by this push:
     new 7f16a207e0a cloudutils: use ip command instead of route in 
networkConfig.py (#10726)
7f16a207e0a is described below

commit 7f16a207e0a9410c6e7a5f79f8750a86df7b01fb
Author: Wei Zhou <[email protected]>
AuthorDate: Thu May 1 07:57:59 2025 +0200

    cloudutils: use ip command instead of route in networkConfig.py (#10726)
---
 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 2d1f9936d39..ac51f92aa58 100644
--- a/python/lib/cloudutils/networkConfig.py
+++ b/python/lib/cloudutils/networkConfig.py
@@ -41,7 +41,7 @@ class networkConfig:
         return devs
     @staticmethod
     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():
             logging.debug("Failed to get default route")
             raise CloudRuntimeException("Failed to get default route")

Reply via email to