mirror of https://github.com/apache/cloudstack.git
bug 11814: connect template and instance details data when sending command to resource
This commit is contained in:
parent
e61184c3be
commit
a59658177d
|
|
@ -95,14 +95,6 @@ public class TemplateResponse extends BaseResponse implements ControlledEntityRe
|
|||
@SerializedName(ApiConstants.HYPERVISOR) @Param(description="the hypervisor on which the template runs")
|
||||
private String hypervisor;
|
||||
|
||||
/*
|
||||
@SerializedName(ApiConstants.JOB_ID) @Param(description="shows the current pending asynchronous job ID. This tag is not returned if no current pending jobs are acting on the template")
|
||||
private IdentityProxy jobId = new IdentityProxy("async_job");
|
||||
|
||||
@SerializedName(ApiConstants.JOB_STATUS) @Param(description="shows the current pending asynchronous job status")
|
||||
private Integer jobStatus;
|
||||
*/
|
||||
|
||||
@SerializedName(ApiConstants.DOMAIN) @Param(description="the name of the domain to which the template belongs")
|
||||
private String domainName;
|
||||
|
||||
|
|
|
|||
|
|
@ -18,18 +18,24 @@
|
|||
package com.cloud.hypervisor;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import com.cloud.agent.api.Command;
|
||||
import com.cloud.agent.api.to.NicTO;
|
||||
import com.cloud.agent.api.to.VirtualMachineTO;
|
||||
import com.cloud.agent.api.to.VolumeTO;
|
||||
import com.cloud.offering.ServiceOffering;
|
||||
import com.cloud.storage.dao.VMTemplateDetailsDao;
|
||||
import com.cloud.utils.component.AdapterBase;
|
||||
import com.cloud.utils.component.Inject;
|
||||
import com.cloud.vm.NicProfile;
|
||||
import com.cloud.vm.VirtualMachine;
|
||||
import com.cloud.vm.VirtualMachineProfile;
|
||||
|
||||
public abstract class HypervisorGuruBase extends AdapterBase implements HypervisorGuru {
|
||||
|
||||
@Inject VMTemplateDetailsDao _templateDetailsDao;
|
||||
|
||||
protected HypervisorGuruBase() {
|
||||
super();
|
||||
}
|
||||
|
|
@ -78,9 +84,15 @@ public abstract class HypervisorGuruBase extends AdapterBase implements Hypervis
|
|||
} else {
|
||||
to.setArch("x86_64");
|
||||
}
|
||||
|
||||
to.setDetails(vm.getDetails());
|
||||
|
||||
|
||||
long templateId = vm.getTemplateId();
|
||||
Map<String, String> details = _templateDetailsDao.findDetails(templateId);
|
||||
assert(details != null);
|
||||
Map<String, String> detailsInVm = vm.getDetails();
|
||||
if(detailsInVm != null) {
|
||||
details.putAll(detailsInVm);
|
||||
}
|
||||
to.setDetails(details);
|
||||
return to;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue