Skip to content

Commit baf2c26

Browse files
author
GabrielBrascher
committed
Fix error when removing deleted VLAN on table pod_vlan_map
1 parent b81e9c9 commit baf2c26

1 file changed

Lines changed: 12 additions & 2 deletions

File tree

server/src/main/java/com/cloud/configuration/ConfigurationManagerImpl.java

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@ public class ConfigurationManagerImpl extends ManagerBase implements Configurati
266266
@Inject
267267
DomainVlanMapDao _domainVlanMapDao;
268268
@Inject
269-
PodVlanMapDao _podVlanMapDao;
269+
PodVlanMapDao podVlanMapDao;
270270
@Inject
271271
DataCenterDao _zoneDao;
272272
@Inject
@@ -3949,7 +3949,7 @@ public VlanVO doInTransaction(final TransactionStatus status) {
39493949
} else if (podId != null) {
39503950
// This VLAN is pod-wide, so create a PodVlanMapVO entry
39513951
final PodVlanMapVO podVlanMapVO = new PodVlanMapVO(podId, vlan.getId());
3952-
_podVlanMapDao.persist(podVlanMapVO);
3952+
podVlanMapDao.persist(podVlanMapVO);
39533953
}
39543954
return vlan;
39553955
}
@@ -4045,7 +4045,17 @@ public boolean deleteVlanAndPublicIpRange(final long userId, final long vlanDbId
40454045
@Override
40464046
public void doInTransactionWithoutResult(final TransactionStatus status) {
40474047
_publicIpAddressDao.deletePublicIPRange(vlanDbId);
4048+
s_logger.debug(String.format("Delete Public IP Range (from user_ip_address, where vlan_db_d=%s)", vlanDbId));
4049+
40484050
_vlanDao.remove(vlanDbId);
4051+
s_logger.debug(String.format("Mark vlan as Remove vlan (vlan_db_id=%s)", vlanDbId));
4052+
4053+
SearchBuilder<PodVlanMapVO> sb = podVlanMapDao.createSearchBuilder();
4054+
sb.and("vlan_db_id", sb.entity().getVlanDbId(), SearchCriteria.Op.EQ);
4055+
SearchCriteria<PodVlanMapVO> sc = sb.create();
4056+
sc.setParameters("vlan_db_id", vlanDbId);
4057+
podVlanMapDao.remove(sc);
4058+
s_logger.debug(String.format("Delete vlan_db_id=%s in pod_vlan_map", vlanDbId));
40494059
}
40504060
});
40514061

0 commit comments

Comments
 (0)