fall back to private network if can't find public network

This commit is contained in:
Edison Su 2011-11-03 16:58:25 -07:00
parent 028d63b671
commit c99870941f
1 changed files with 7 additions and 3 deletions

View File

@ -699,12 +699,16 @@ public class LibvirtComputingResource extends ServerResourceBase implements Serv
/*get pifs from bridge*/
String pubPif = null;
String privPif = null;
if (_publicBridgeName != null) {
pubPif = Script.runSimpleBashScript("brctl show | grep " + _publicBridgeName + " | awk '{print $4}'");
}
if (_guestBridgeName != null) {
privPif = Script.runSimpleBashScript("brctl show | grep " + _guestBridgeName + " | awk '{print $4}'");
}
if (_publicBridgeName != null) {
pubPif = Script.runSimpleBashScript("brctl show | grep " + _publicBridgeName + " | awk '{print $4}'");
if (pubPif == null) {
pubPif = privPif;
}
}
return new Pair<String, String>(privPif, pubPif);
}
private String getVnetId(String vnetId) {