From 9cc5aaa978fbfe5b23dcb13bf256b216df9a6128 Mon Sep 17 00:00:00 2001 From: will Date: Fri, 29 Oct 2010 13:17:32 -0700 Subject: [PATCH] Fixed listTemplates to use the template type. --- server/src/com/cloud/api/commands/ListTemplatesCmd.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/server/src/com/cloud/api/commands/ListTemplatesCmd.java b/server/src/com/cloud/api/commands/ListTemplatesCmd.java index ccb33ea9dcd..65fe5c875a3 100644 --- a/server/src/com/cloud/api/commands/ListTemplatesCmd.java +++ b/server/src/com/cloud/api/commands/ListTemplatesCmd.java @@ -33,6 +33,7 @@ import com.cloud.async.AsyncJobVO; import com.cloud.dc.DataCenterVO; import com.cloud.host.HostVO; import com.cloud.storage.GuestOS; +import com.cloud.storage.Storage; import com.cloud.storage.VMTemplateHostVO; import com.cloud.storage.VMTemplateStorageResourceAssoc.Status; import com.cloud.storage.VMTemplateVO; @@ -152,9 +153,7 @@ public class ListTemplatesCmd extends BaseListCmd { List templateResponses = new ArrayList(); for (VMTemplateVO template : templates) { - // 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")) { + if (!showDomr && template.getTemplateType() == Storage.TemplateType.SYSTEM) { continue; }