bug 9504: don't send DHCP entry command for Destroyed vm

status 9504: resolved fixed
This commit is contained in:
alena 2011-04-21 14:26:42 -07:00
parent d7ec734b01
commit b83456f895
1 changed files with 10 additions and 8 deletions

View File

@ -1566,8 +1566,9 @@ public class VirtualNetworkApplianceManagerImpl implements VirtualNetworkApplian
private void createDhcpEntriesCommands(DomainRouterVO router, Commands cmds) { private void createDhcpEntriesCommands(DomainRouterVO router, Commands cmds) {
long networkId = router.getNetworkId(); long networkId = router.getNetworkId();
List<UserVmVO> vms = _userVmDao.listByNetworkId(networkId); List<UserVmVO> vms = _userVmDao.listByNetworkId(networkId);
if (vms != null && !vms.isEmpty()) { if (!vms.isEmpty()) {
for (UserVmVO vm : vms) { for (UserVmVO vm : vms) {
if (vm.getState() != State.Destroyed && vm.getState() != State.Expunging) {
NicVO nic = _nicDao.findByInstanceIdAndNetworkId(networkId, vm.getId()); NicVO nic = _nicDao.findByInstanceIdAndNetworkId(networkId, vm.getId());
if (nic != null) { if (nic != null) {
s_logger.debug("Creating dhcp entry for vm " + vm + " on domR " + router + "."); s_logger.debug("Creating dhcp entry for vm " + vm + " on domR " + router + ".");
@ -1580,6 +1581,7 @@ public class VirtualNetworkApplianceManagerImpl implements VirtualNetworkApplian
} }
} }
} }
}
private boolean sendCommandsToRouter(final DomainRouterVO router, Commands cmds) throws AgentUnavailableException { private boolean sendCommandsToRouter(final DomainRouterVO router, Commands cmds) throws AgentUnavailableException {
Answer[] answers = null; Answer[] answers = null;