Skip to content

Commit 14ecb4f

Browse files
author
SrikanteswaraRao Talluri
committed
CLOUDSTACK-5113: Fix get_template method to return 'BUILTIN' template
by default
1 parent 6220e48 commit 14ecb4f

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

‎tools/marvin/marvin/integration/lib/common.py‎

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,9 @@ def get_pod(apiclient, zoneid, services=None):
209209
raise Exception("Exception: Failed to find specified pod.")
210210

211211

212-
def get_template(apiclient, zoneid, ostype, services=None):
212+
def get_template(apiclient, zoneid, ostype, services=None,
213+
templatefilter='featured',
214+
templatetype='BUILTIN'):
213215
"Returns a template"
214216

215217
cmd = listOsTypes.listOsTypesCmd()
@@ -223,7 +225,7 @@ def get_template(apiclient, zoneid, ostype, services=None):
223225
"Failed to find OS type with description: %s" % ostype)
224226

225227
cmd = listTemplates.listTemplatesCmd()
226-
cmd.templatefilter = 'featured'
228+
cmd.templatefilter = templatefilter
227229
cmd.zoneid = zoneid
228230

229231
if services:
@@ -237,7 +239,7 @@ def get_template(apiclient, zoneid, ostype, services=None):
237239
for template in list_templates:
238240
if template.ostypeid == ostypeid:
239241
return template
240-
elif template.isready:
242+
elif template.isready and template.templatetype == templatetype:
241243
return template
242244

243245
raise Exception("Exception: Failed to find template with OSTypeID: %s" %

0 commit comments

Comments
 (0)