bug 6099: don't send ingress rules when not enabled

This commit is contained in:
Chiradeep Vittal 2010-09-07 17:20:49 -07:00
parent 18de2abfe8
commit b74806929d
1 changed files with 6 additions and 0 deletions

View File

@ -684,6 +684,9 @@ public class NetworkGroupManagerImpl implements NetworkGroupManager {
@Override
@DB
public boolean addInstanceToGroups(final Long userVmId, final List<NetworkGroupVO> groups) {
if (!_enabled) {
return true;
}
if (groups != null) {
final Set<NetworkGroupVO> uniqueGroups = new TreeSet<NetworkGroupVO>(new NetworkGroupVOComparator());
uniqueGroups.addAll(groups);
@ -724,6 +727,9 @@ public class NetworkGroupManagerImpl implements NetworkGroupManager {
@Override
@DB
public void removeInstanceFromGroups(Long userVmId) {
if (!_enabled) {
return;
}
final Transaction txn = Transaction.currentTxn();
txn.start();
UserVm userVm = _userVMDao.acquire(userVmId); //ensures that duplicate entries are not created in addInstance