From 7205a7507dcd6d134410fdb19c4a811f455e11f8 Mon Sep 17 00:00:00 2001 From: will Date: Mon, 22 Nov 2010 17:12:26 -0800 Subject: [PATCH] bug 7277: Fixed the logic to prevent System templates from being downloaded. --- server/src/com/cloud/template/TemplateManagerImpl.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server/src/com/cloud/template/TemplateManagerImpl.java b/server/src/com/cloud/template/TemplateManagerImpl.java index e30b855aec0..68925c0efc9 100755 --- a/server/src/com/cloud/template/TemplateManagerImpl.java +++ b/server/src/com/cloud/template/TemplateManagerImpl.java @@ -488,8 +488,8 @@ public class TemplateManagerImpl implements TemplateManager, Manager, TemplateSe if (template == null) { throw new InvalidParameterValueException("Unable to find " +desc+ " with id " + templateId); } - if (template.getId() < 201 ){ - throw new InvalidParameterValueException("Unable to extract the " + desc + " " + template.getName() + " since it is system created and is not available for download"); + if (template.getTemplateType() == Storage.TemplateType.SYSTEM){ + throw new InvalidParameterValueException("Unable to extract the " + desc + " " + template.getName() + " as it is a default System template"); } if (isISO) { if (template.getFormat() != ImageFormat.ISO ){