Skip to content

Commit a487eba

Browse files
committed
remove redunant domainId check
1 parent 8b4f50e commit a487eba

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@
5050
import javax.inject.Inject;
5151
import javax.naming.ConfigurationException;
5252

53-
5453
import com.cloud.exception.UnsupportedServiceException;
5554
import com.cloud.network.as.AutoScaleManager;
5655
import com.cloud.user.AccountManagerImpl;

server/src/main/java/com/cloud/user/DomainManagerImpl.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -557,7 +557,7 @@ private void removeVpcOfferings(Long domainId, String domainIdString) {
557557
List<VpcOfferingJoinVO> vpcOfferingsForThisDomain = vpcOfferingJoinDao.findByDomainId(domainId);
558558
for (VpcOfferingJoinVO vpcOffering : vpcOfferingsForThisDomain) {
559559
int vpcCount = vpcDao.getVpcCountByOfferingId(vpcOffering.getId());
560-
if (domainIdString.equals(vpcOffering.getDomainId()) && vpcCount == 0) {
560+
if (vpcCount == 0) {
561561
vpcOfferingDao.remove(vpcOffering.getId());
562562
} else {
563563
vpcOfferingsDetailsToRemove.add(vpcOffering.getId());
@@ -573,7 +573,7 @@ private void removeNetworkOfferings(Long domainId, String domainIdString) {
573573
List<NetworkOfferingJoinVO> networkOfferingsForThisDomain = networkOfferingJoinDao.findByDomainId(domainId, false);
574574
for (NetworkOfferingJoinVO networkOffering : networkOfferingsForThisDomain) {
575575
int networkCount = networkDao.getNetworkCountByNetworkOffId(networkOffering.getId());
576-
if (domainIdString.equals(networkOffering.getDomainId()) && networkCount == 0) {
576+
if (networkCount == 0) {
577577
networkOfferingDao.remove(networkOffering.getId());
578578
} else {
579579
networkOfferingsDetailsToRemove.add(networkOffering.getId());
@@ -589,7 +589,7 @@ private void removeServiceOfferings(Long domainId, String domainIdString) {
589589
List<ServiceOfferingJoinVO> serviceOfferingsForThisDomain = serviceOfferingJoinDao.findByDomainId(domainId);
590590
for (ServiceOfferingJoinVO serviceOffering : serviceOfferingsForThisDomain) {
591591
int vmCount = vmInstanceDao.getVmCountByOfferingId(serviceOffering.getId());
592-
if (domainIdString.equals(serviceOffering.getDomainId()) && vmCount == 0) {
592+
if (vmCount == 0) {
593593
serviceOfferingDao.remove(serviceOffering.getId());
594594
} else {
595595
serviceOfferingsDetailsToRemove.add(serviceOffering.getId());
@@ -605,7 +605,7 @@ private void removeDiskOfferings(Long domainId, String domainIdString) {
605605
List<DiskOfferingJoinVO> diskOfferingsForThisDomain = diskOfferingJoinDao.findByDomainId(domainId);
606606
for (DiskOfferingJoinVO diskOffering : diskOfferingsForThisDomain) {
607607
int volumeCount = volumeDao.getVolumeCountByOfferingId(diskOffering.getId());
608-
if (domainIdString.equals(diskOffering.getDomainId()) && volumeCount == 0) {
608+
if (volumeCount == 0) {
609609
diskOfferingDao.remove(diskOffering.getId());
610610
} else {
611611
diskOfferingsDetailsToRemove.add(diskOffering.getId());

0 commit comments

Comments
 (0)