VPC: one more fix for multiple public nic case for the VPC VR

Conflicts:

	server/test/com/cloud/network/MockNetworkManagerImpl.java
This commit is contained in:
Alena Prokharchyk 2012-07-20 14:08:00 -07:00
parent 5a64d4fbb1
commit 2b7ec3f4a8
4 changed files with 23 additions and 24 deletions

View File

@ -386,9 +386,9 @@ public interface NetworkManager extends NetworkService {
/**
* @param vm
* @param network
* @param nic TODO
*/
void removeNic(VirtualMachineProfile<? extends VMInstanceVO> vm, Network network);
void removeNic(VirtualMachineProfile<? extends VMInstanceVO> vm, Nic nic);
/**

View File

@ -2501,9 +2501,8 @@ public class NetworkManagerImpl implements NetworkManager, NetworkService, Manag
}
@Override
public void removeNic(VirtualMachineProfile<? extends VMInstanceVO> vm, Network network) {
NicVO nic = _nicDao.findByInstanceIdAndNetworkId(network.getId(), vm.getVirtualMachine().getId());
removeNic(vm, nic);
public void removeNic(VirtualMachineProfile<? extends VMInstanceVO> vm, Nic nic) {
removeNic(vm, _nicDao.findById(nic.getId()));
}
protected void removeNic(VirtualMachineProfile<? extends VMInstanceVO> vm, NicVO nic) {

View File

@ -2552,7 +2552,7 @@ public class VirtualMachineManagerImpl implements VirtualMachineManager, Listene
s_logger.debug("Successfully released nic " + nic + "for vm " + vm);
//3) Remove the nic
_networkMgr.removeNic(vmProfile, network);
_networkMgr.removeNic(vmProfile, nic);
return result;
}

View File

@ -803,15 +803,6 @@ public class MockNetworkManagerImpl implements NetworkManager, Manager, NetworkS
return null;
}
/* (non-Javadoc)
* @see com.cloud.network.NetworkManager#removeNic(com.cloud.vm.VirtualMachineProfile, com.cloud.network.Network)
*/
@Override
public void removeNic(VirtualMachineProfile<? extends VMInstanceVO> vm, Network network) {
// TODO Auto-generated method stub
}
/* (non-Javadoc)
* @see com.cloud.network.NetworkManager#listPublicIpsAssignedToAccount(long, long, java.lang.Boolean)
*/
@ -921,15 +912,6 @@ public class MockNetworkManagerImpl implements NetworkManager, Manager, NetworkS
return null;
}
/* (non-Javadoc)
* @see com.cloud.network.NetworkManager#handleSystemIpRelease(com.cloud.network.IpAddress)
*/
@Override
public boolean handleSystemIpRelease(IpAddress ip) {
// TODO Auto-generated method stub
return false;
}
/* (non-Javadoc)
* @see com.cloud.network.NetworkManager#checkNetworkPermissions(com.cloud.user.Account, com.cloud.network.Network)
*/
@ -1138,4 +1120,22 @@ public class MockNetworkManagerImpl implements NetworkManager, Manager, NetworkS
// TODO Auto-generated method stub
return false;
}
/* (non-Javadoc)
* @see com.cloud.network.NetworkManager#handleSystemIpRelease(com.cloud.network.IpAddress)
*/
@Override
public boolean handleSystemIpRelease(IpAddress ip) {
// TODO Auto-generated method stub
return false;
}
/* (non-Javadoc)
* @see com.cloud.network.NetworkManager#removeNic(com.cloud.vm.VirtualMachineProfile, com.cloud.vm.Nic)
*/
@Override
public void removeNic(VirtualMachineProfile<? extends VMInstanceVO> vm, Nic nic) {
// TODO Auto-generated method stub
}
}