Skip to content

Commit 7953660

Browse files
committed
Don't capture stderr, this will return an error when the runscript command expects null when there is no default route.
1 parent 71dc43e commit 7953660

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

utils/src/com/cloud/utils/net/NetUtils.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ public static String getDefaultHostIp() {
199199

200200
public static String getDefaultEthDevice() {
201201
if (SystemUtils.IS_OS_MAC) {
202-
String defDev = Script.runSimpleBashScript("/sbin/route -n get default | grep interface | awk '{print $2}'");
202+
String defDev = Script.runSimpleBashScript("/sbin/route -n get default 2> /dev/null | grep interface | awk '{print $2}'");
203203
return defDev;
204204
}
205205
String defaultRoute = Script.runSimpleBashScript("/sbin/route | grep default");

0 commit comments

Comments
 (0)