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/05 17:24:54 UTC
[GitHub] rhtyd commented on a change in pull request #3080: kvm: Use 'ip
route show default 0.0.0.0/0' to find the default gateway
rhtyd commented on a change in 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#discussion_r239161576
##########
File path: 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}'");
Review comment:
I think `ip route show default | ...` was sufficient.
----------------------------------------------------------------
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