From 249993b2f1a982ccf49aa3a375f4b917973e8d89 Mon Sep 17 00:00:00 2001 From: SrikanteswaraRao Talluri Date: Tue, 7 Jan 2014 17:39:19 +0530 Subject: [PATCH] CLOUDSTACK-5113: Fix get_template method to return 'BUILTIN' template by default --- tools/marvin/marvin/integration/lib/common.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/tools/marvin/marvin/integration/lib/common.py b/tools/marvin/marvin/integration/lib/common.py index c52467543b2..504cd4cdc98 100644 --- a/tools/marvin/marvin/integration/lib/common.py +++ b/tools/marvin/marvin/integration/lib/common.py @@ -209,7 +209,9 @@ def get_pod(apiclient, zoneid, services=None): raise Exception("Exception: Failed to find specified pod.") -def get_template(apiclient, zoneid, ostype, services=None): +def get_template(apiclient, zoneid, ostype, services=None, + templatefilter='featured', + templatetype='BUILTIN'): "Returns a template" cmd = listOsTypes.listOsTypesCmd() @@ -223,7 +225,7 @@ def get_template(apiclient, zoneid, ostype, services=None): "Failed to find OS type with description: %s" % ostype) cmd = listTemplates.listTemplatesCmd() - cmd.templatefilter = 'featured' + cmd.templatefilter = templatefilter cmd.zoneid = zoneid if services: @@ -237,7 +239,7 @@ def get_template(apiclient, zoneid, ostype, services=None): for template in list_templates: if template.ostypeid == ostypeid: return template - elif template.isready: + elif template.isready and template.templatetype == templatetype: return template raise Exception("Exception: Failed to find template with OSTypeID: %s" %