ListTemplates will no longer return any SystemVM templates. I am using a startsWith() string match for now since we used to make this comparision by ID with a single hypervisor.

This commit is contained in:
will 2010-10-28 13:28:33 -07:00
parent b145b082a0
commit c5fef26f11
2 changed files with 9 additions and 13 deletions

View File

@ -39,6 +39,7 @@ import com.cloud.storage.VMTemplateVO;
import com.cloud.storage.dao.VMTemplateDao.TemplateFilter;
import com.cloud.storage.template.TemplateConstants;
import com.cloud.user.Account;
import com.cloud.user.AccountVO;
import com.cloud.user.UserContext;
@Implementation(method="listTemplates", description="List all public, private, and privileged templates.")
@ -151,7 +152,9 @@ public class ListTemplatesCmd extends BaseListCmd {
List<TemplateResponse> templateResponses = new ArrayList<TemplateResponse>();
for (VMTemplateVO template : templates) {
if (!showDomr && template.getId() == TemplateConstants.DEFAULT_SYSTEM_VM_DB_ID) {
// Since we've added multiple domR templates and with different DB ids, I'm changing
// this to filter out any templates with names that start with system for now.
if (!showDomr && template.getName().startsWith("SystemVM")) {
continue;
}

View File

@ -537,11 +537,10 @@ function initVMWizard() {
var commandString;
var searchInput = $vmPopup.find("#search_input").val();
if (selectedTemplateTypeInVmPopup != "blank") { //template
var hypervisor = $vmPopup.find("#wizard_hypervisor").val();
if (searchInput != null && searchInput.length > 0)
commandString = "command=listTemplates&templatefilter="+selectedTemplateTypeInVmPopup+"&zoneid="+zoneId+"&hypervisor="+hypervisor+"&keyword="+searchInput+"&page="+currentPageInTemplateGridInVmPopup;
commandString = "command=listTemplates&templatefilter="+selectedTemplateTypeInVmPopup+"&zoneid="+zoneId+"&keyword="+searchInput+"&page="+currentPageInTemplateGridInVmPopup;
else
commandString = "command=listTemplates&templatefilter="+selectedTemplateTypeInVmPopup+"&zoneid="+zoneId+"&hypervisor="+hypervisor+"&page="+currentPageInTemplateGridInVmPopup;
commandString = "command=listTemplates&templatefilter="+selectedTemplateTypeInVmPopup+"&zoneid="+zoneId+"&page="+currentPageInTemplateGridInVmPopup;
}
else { //ISO
if (searchInput != null && searchInput.length > 0)
@ -673,13 +672,6 @@ function initVMWizard() {
return false;
});
$vmPopup.find("#wizard_hypervisor").bind("change", function(event) {
var selectedHypervisor = $(this).val();
if(selectedHypervisor != null && selectedHypervisor.length > 0)
listTemplatesInVmPopup();
return false;
});
function displayDiskOffering(type) {
if(type=="data") {
$vmPopup.find("#wizard_data_disk_offering_title").show();
@ -763,8 +755,9 @@ function initVMWizard() {
$thisPopup.find("#root_disk_offering_container").hide();
}
$thisPopup.find("#wizard_review_zone").text($thisPopup.find("#wizard_zone option:selected").text());
$thisPopup.find("#wizard_review_hypervisor").text($thisPopup.find("#wizard_hypervisor option:selected").text());
$thisPopup.find("#wizard_review_zone").text($thisPopup.find("#wizard_zone option:selected").text());
// This is taking from the selected template but need to change this to the dropdown that supports ISO.
$thisPopup.find("#wizard_review_hypervisor").text($selectedVmWizardTemplate.data("hypervisor"));
$thisPopup.find("#wizard_review_template").text($thisPopup.find("#step1 .rev_wiztemplistbox_selected .rev_wiztemp_listtext").text());
}