@@ -1009,7 +1009,7 @@ protected void checkIfZoneIsDeletable(long zoneId) {
10091009 if (tableName .equals ("host_pod_ref" ) || tableName .equals ("host" ) || tableName .equals ("volumes" )) {
10101010 selectSql += " AND removed is NULL" ;
10111011 }
1012-
1012+
10131013 if (tableName .equals ("vm_instance" )) {
10141014 selectSql += " AND state != '" + VirtualMachine .State .Expunging .toString () + "'" ;
10151015 }
@@ -1570,7 +1570,7 @@ public ServiceOffering createServiceOffering(CreateServiceOfferingCmd cmd) {
15701570 throw new InvalidParameterValueException ("Please specify a valid domain id" );
15711571 }
15721572 }
1573-
1573+
15741574 boolean localStorageRequired = false ;
15751575 String storageType = cmd .getStorageType ();
15761576 if (storageType == null ) {
@@ -1608,7 +1608,7 @@ else if (VirtualMachine.Type.DomainRouter.toString().toLowerCase().equals(vm_typ
16081608 vm_type = VirtualMachine .Type .DomainRouter ;
16091609 }
16101610 }
1611-
1611+
16121612 return createServiceOffering (userId , cmd .getIsSystem (), vm_type , cmd .getServiceOfferingName (), cpuNumber .intValue (), memory .intValue (), cpuSpeed .intValue (), cmd .getDisplayText (), localStorageRequired , offerHA ,
16131613 limitCpuUse , cmd .getTags (), cmd .getDomainId (), cmd .getHostTag ());
16141614 }
@@ -1642,7 +1642,7 @@ public ServiceOffering updateServiceOffering(UpdateServiceOfferingCmd cmd) {
16421642
16431643 // Verify input parameters
16441644 ServiceOffering offeringHandle = getServiceOffering (id );
1645-
1645+
16461646 if (offeringHandle == null ) {
16471647 throw new InvalidParameterValueException ("unable to find service offering " + id );
16481648 }
@@ -1837,7 +1837,7 @@ public boolean deleteServiceOffering(DeleteServiceOfferingCmd cmd) {
18371837 if (offering == null ) {
18381838 throw new InvalidParameterValueException ("unable to find service offering " + offeringId );
18391839 }
1840-
1840+
18411841 if (offering .getDefaultUse ()){
18421842 throw new InvalidParameterValueException ("Default service offerings cannot be deleted" );
18431843 }
@@ -2182,9 +2182,9 @@ public Vlan createVlanAndPublicIpRange(Long userId, Long zoneId, Long podId, Str
21822182 throw new InvalidParameterValueException ("The IP range with tag: " + vlan .getVlanTag () + " in zone " + zone .getName ()
21832183 + " has the same subnet. Please specify a different gateway/netmask." );
21842184 }
2185-
2185+
21862186 boolean vlansUntaggedAndVirtual = (vlanId .equals (Vlan .UNTAGGED ) && vlanId .equals (vlan .getVlanTag ()) && forVirtualNetwork && vlan .getVlanType () == VlanType .VirtualNetwork );
2187-
2187+
21882188 if (vlansUntaggedAndVirtual && !newVlanSubnet .equals (otherVlanSubnet )) {
21892189 throw new InvalidParameterValueException ("The Untagged ip range with different subnet already exists in zone " + zone .getId ());
21902190 }
@@ -2400,9 +2400,9 @@ protected boolean savePublicIPRange(String startIP, String endIP, long zoneId, l
24002400 Transaction txn = Transaction .currentTxn ();
24012401 txn .start ();
24022402 IPRangeConfig config = new IPRangeConfig ();
2403- config .savePublicIPRange (txn , startIPLong , endIPLong , zoneId , vlanDbId , sourceNetworkid );
2403+ List < String > problemIps = config .savePublicIPRange (txn , startIPLong , endIPLong , zoneId , vlanDbId , sourceNetworkid );
24042404 txn .commit ();
2405- return true ;
2405+ return problemIps != null && problemIps . size () == 0 ;
24062406 }
24072407
24082408 @ DB
@@ -3152,7 +3152,7 @@ public ServiceOffering getServiceOffering(long serviceOfferingId) {
31523152 if (offering != null && offering .getRemoved () == null ) {
31533153 return offering ;
31543154 }
3155-
3155+
31563156 return null ;
31573157 }
31583158
@@ -3185,14 +3185,14 @@ public Integer getServiceOfferingNetworkRate(long serviceOfferingId) {
31853185
31863186 return networkRate ;
31873187 }
3188-
3188+
31893189 @ Override
31903190 public DiskOffering getDiskOffering (long diskOfferingId ) {
31913191 DiskOfferingVO offering = _diskOfferingDao .findById (diskOfferingId );
31923192 if (offering != null && offering .getRemoved () == null ) {
31933193 return offering ;
31943194 }
3195-
3195+
31963196 return null ;
31973197 }
31983198
0 commit comments