mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
CLOUDSTACK-308. ec2-describe-instances - Instance type should return right service offering name
This commit is contained in:
parent
f3fa54e732
commit
77674721ca
@ -30,7 +30,10 @@ public class CloudStackServiceOfferingVO {
|
||||
@Id
|
||||
@Column(name="id")
|
||||
private String id;
|
||||
|
||||
|
||||
@Column(name="uuid")
|
||||
private String uuid;
|
||||
|
||||
@Column(name="name")
|
||||
private String name;
|
||||
|
||||
@ -61,7 +64,9 @@ public class CloudStackServiceOfferingVO {
|
||||
public void setDomainId(String domainId) {
|
||||
this.domainId = domainId;
|
||||
}
|
||||
|
||||
|
||||
public String getUuid() {
|
||||
return uuid;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -58,13 +58,13 @@ public class CloudStackSvcOfferingDaoImpl extends GenericDaoBase<CloudStackServi
|
||||
@Override
|
||||
public CloudStackServiceOfferingVO getSvcOfferingById( String id ){
|
||||
SearchBuilder <CloudStackServiceOfferingVO> searchByID = createSearchBuilder();
|
||||
searchByID.and("id", searchByID.entity().getName(), SearchCriteria.Op.EQ);
|
||||
searchByID.and("uuid", searchByID.entity().getUuid(), SearchCriteria.Op.EQ);
|
||||
searchByID.done();
|
||||
Transaction txn = Transaction.open(Transaction.CLOUD_DB);
|
||||
try {
|
||||
txn.start();
|
||||
SearchCriteria<CloudStackServiceOfferingVO> sc = searchByID.create();
|
||||
sc.setParameters("id", id);
|
||||
sc.setParameters("uuid", id);
|
||||
return findOneBy(sc);
|
||||
|
||||
}finally {
|
||||
|
||||
@ -1772,7 +1772,7 @@ public class EC2Engine extends ManagerBase {
|
||||
private String serviceOfferingIdToInstanceType( String serviceOfferingId ) throws Exception {
|
||||
try{
|
||||
|
||||
CloudStackServiceOfferingVO offering = scvoDao.getSvcOfferingById(serviceOfferingId); //dao.getSvcOfferingById(serviceOfferingId);
|
||||
CloudStackServiceOfferingVO offering = scvoDao.getSvcOfferingById(serviceOfferingId);
|
||||
if(offering == null){
|
||||
logger.warn( "No instanceType match for serviceOfferingId: [" + serviceOfferingId + "]" );
|
||||
return "m1.small";
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user