bug 8099: returning systemvms for direct networking

status 8099: resolved fixed
This commit is contained in:
abhishek 2011-01-25 13:52:49 -08:00
parent 69846d7c6e
commit b2a9b3061d

View File

@ -89,6 +89,7 @@ import com.cloud.dc.DataCenterVO;
import com.cloud.dc.HostPodVO;
import com.cloud.dc.Pod;
import com.cloud.dc.Vlan;
import com.cloud.dc.DataCenter.NetworkType;
import com.cloud.dc.Vlan.VlanType;
import com.cloud.dc.VlanVO;
import com.cloud.domain.Domain;
@ -1230,7 +1231,11 @@ public class ApiResponseHelper implements ResponseGenerator {
for (Nic singleNic : nics) {
Network network = ApiDBUtils.findNetworkById(singleNic.getNetworkId());
if (network != null) {
if (network.getTrafficType() == TrafficType.Public) {
TrafficType trafficType = TrafficType.Public;
if(zone.getNetworkType() == NetworkType.Basic) {
trafficType = TrafficType.Guest;
}
if (network.getTrafficType() == trafficType) {
vmResponse.setPublicIp(singleNic.getIp4Address());
vmResponse.setPublicMacAddress(singleNic.getMacAddress());
vmResponse.setPublicNetmask(singleNic.getNetmask());