You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by GitBox <gi...@apache.org> on 2018/12/06 08:34:49 UTC

[GitHub] rhtyd closed pull request #3080: kvm: Use 'ip route show default 0.0.0.0/0' to find the default gateway

rhtyd closed pull request #3080: kvm: Use 'ip route show default 0.0.0.0/0' to find the default gateway
URL: https://github.com/apache/cloudstack/pull/3080
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java b/plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java
index 26fcd01f63f..cf6f610ef6f 100644
--- a/plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java
+++ b/plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java
@@ -1015,21 +1015,21 @@ public boolean configure(final String name, final Map<String, Object> params) th
         */
 
         if (_pifs.get("private") == null) {
-            s_logger.debug("Failed to get private nic name");
+            s_logger.error("Failed to get private nic name");
             throw new ConfigurationException("Failed to get private nic name");
         }
 
         if (_pifs.get("public") == null) {
-            s_logger.debug("Failed to get public nic name");
+            s_logger.error("Failed to get public nic name");
             throw new ConfigurationException("Failed to get public nic name");
         }
         s_logger.debug("Found pif: " + _pifs.get("private") + " on " + _privBridgeName + ", pif: " + _pifs.get("public") + " on " + _publicBridgeName);
 
         _canBridgeFirewall = canBridgeFirewall(_pifs.get("public"));
 
-        _localGateway = Script.runSimpleBashScript("ip route |grep default|awk '{print $3}'");
+        _localGateway = Script.runSimpleBashScript("ip route show default 0.0.0.0/0|head -1|awk '{print $3}'");
         if (_localGateway == null) {
-            s_logger.debug("Failed to found the local gateway");
+            s_logger.warn("No default IPv4 gateway found");
         }
 
         _mountPoint = (String)params.get("mount.path");


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services