Fixed NPE in VirtualNetworkApplianceManager - happened when stopped domR start was initiated by user vm start

This commit is contained in:
alena 2011-02-03 13:23:07 -08:00
parent a8ce46b57a
commit 1a03097d1b
1 changed files with 6 additions and 1 deletions

View File

@ -1020,8 +1020,13 @@ public class VirtualNetworkApplianceManagerImpl implements VirtualNetworkApplian
}
_routerDao.update(router.getId(), router);
//restart network if restartNetwork = false is not specified in profile parameters
boolean restartNetwork = true;
if (profile.getParameter(Param.RestartNetwork) != null && (Boolean)profile.getParameter(Param.RestartNetwork) == false) {
restartNetwork = false;
}
//The commands should be sent for domR only, skip for DHCP
if (router.getRole() == VirtualRouter.Role.DHCP_FIREWALL_LB_PASSWD_USERDATA && ((Boolean)profile.getParameter(Param.RestartNetwork))== true) {
if (router.getRole() == VirtualRouter.Role.DHCP_FIREWALL_LB_PASSWD_USERDATA && restartNetwork) {
s_logger.debug("Resending ipAssoc, port forwarding, load balancing rules as a part of Virtual router start");
long networkId = router.getNetworkId();
long ownerId = router.getAccountId();