Fix coverity issue 606007, 606008

This commit is contained in:
Hugo Trippaers 2014-01-13 11:58:51 +01:00
parent 044a2078a1
commit 16d333f06d

View File

@ -92,6 +92,9 @@ public class OpenDaylightControllerResourceManagerImpl implements OpenDaylightCo
final String deviceName = NetworkDevice.OpenDaylightController.getName();
NetworkDevice networkDevice = NetworkDevice.getNetworkDevice(deviceName);
if (networkDevice == null) {
throw new CloudRuntimeException("No network device found for name " + deviceName);
}
final Long physicalNetworkId = cmd.getPhysicalNetworkId();
PhysicalNetworkVO physicalNetwork = physicalNetworkDao.findById(physicalNetworkId);
if (physicalNetwork == null) {
@ -156,6 +159,7 @@ public class OpenDaylightControllerResourceManagerImpl implements OpenDaylightCo
// Lets see if there are networks that use us
List<NetworkVO> networkList = networkDao.listByPhysicalNetwork(physicalNetworkId);
if (networkList != null) {
// Networks with broadcast type lswitch are ours
for (NetworkVO network : networkList) {
if (network.getBroadcastDomainType() == Networks.BroadcastDomainType.OpenDaylight) {
@ -165,6 +169,7 @@ public class OpenDaylightControllerResourceManagerImpl implements OpenDaylightCo
}
}
}
}
HostVO host = hostDao.findById(controller.getHostId());
Long hostId = host.getId();