Skip to content

Commit 03f954c

Browse files
committed
Fix the test failures noticed
1 parent 37e2542 commit 03f954c

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

server/src/main/java/com/cloud/network/IpAddressManagerImpl.java

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -829,14 +829,12 @@ public boolean disassociatePublicIpAddress(IpAddress ipAddress, long userId, Acc
829829
providers = servicesMap.stream().map(VpcOfferingServiceMapVO::getProvider).collect(Collectors.toList());
830830
}
831831

832-
if (providers.isEmpty()) {
833-
throw new InvalidParameterValueException("Unable to find the provider for this network");
834-
}
835-
836-
String provider = providers.get(0);
837-
NetworkElement element = _networkModel.getElementImplementingProvider(provider);
838-
if (element != null) {
839-
element.releaseIp(ipToBeDisassociated);
832+
if (!providers.isEmpty()) {
833+
String provider = providers.get(0);
834+
NetworkElement element = _networkModel.getElementImplementingProvider(provider);
835+
if (element != null) {
836+
element.releaseIp(ipToBeDisassociated);
837+
}
840838
}
841839
} finally {
842840
_ipAddressDao.releaseFromLockTable(addrId);

0 commit comments

Comments
 (0)