mirror of https://github.com/apache/cloudstack.git
validate CPU speed in system service offering to auto-correct settings from old data set
This commit is contained in:
parent
41e75ab611
commit
14faff534d
|
|
@ -25,7 +25,6 @@ import javax.persistence.EntityExistsException;
|
|||
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
import com.cloud.dc.DataCenterVO;
|
||||
import com.cloud.service.ServiceOfferingVO;
|
||||
import com.cloud.utils.db.DB;
|
||||
import com.cloud.utils.db.GenericDaoBase;
|
||||
|
|
@ -82,6 +81,11 @@ public class ServiceOfferingDaoImpl extends GenericDaoBase<ServiceOfferingVO, Lo
|
|||
assert offering.getUniqueName() != null : "how are you going to find this later if you don't set it?";
|
||||
ServiceOfferingVO vo = findByName(offering.getUniqueName());
|
||||
if (vo != null) {
|
||||
// check invalid CPU speed in system service offering, set it to default value of 500 Mhz if 0 CPU speed is found
|
||||
if(vo.getSpeed() <= 0) {
|
||||
vo.setSpeed(500);
|
||||
update(vo.getId(), vo);
|
||||
}
|
||||
return vo;
|
||||
}
|
||||
try {
|
||||
|
|
|
|||
Loading…
Reference in New Issue