Skip to content

Commit 0754523

Browse files
Alena ProkharchykAlena Prokharchyk
authored andcommitted
bug 13381: fixed update availablity for network offering
status 13381: resolved fixed
1 parent 9273ec4 commit 0754523

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3526,14 +3526,14 @@ public NetworkOffering updateNetworkOffering(UpdateNetworkOfferingCmd cmd) {
35263526
throw new InvalidParameterValueException("Invalid value for Availability. Supported types: " + Availability.Required + ", " + Availability.Optional);
35273527
} else {
35283528
if (availability == NetworkOffering.Availability.Required) {
3529-
boolean canOffBeRequired = (offering.getGuestType() == GuestType.Isolated && _networkMgr.areServicesSupportedByNetworkOffering(offering.getId(), Service.SourceNat));
3529+
boolean canOffBeRequired = (offeringToUpdate.getGuestType() == GuestType.Isolated && _networkMgr.areServicesSupportedByNetworkOffering(offeringToUpdate.getId(), Service.SourceNat));
35303530
if (!canOffBeRequired) {
35313531
throw new InvalidParameterValueException("Availability can be " + NetworkOffering.Availability.Required + " only for networkOfferings of type " + GuestType.Isolated + " and with " + Service.SourceNat.getName() + " enabled");
35323532
}
35333533

35343534
//only one network offering in the system can be Required
35353535
List<NetworkOfferingVO> offerings = _networkOfferingDao.listByAvailability(Availability.Required, false);
3536-
if (!offerings.isEmpty() || offerings.get(0).getId() != offering.getId()) {
3536+
if (!offerings.isEmpty() && offerings.get(0).getId() != offeringToUpdate.getId()) {
35373537
throw new InvalidParameterValueException("System already has network offering id=" + offerings.get(0).getId() + " with availability " + Availability.Required);
35383538
}
35393539
}

0 commit comments

Comments
 (0)