mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
CLOUDSTACK-5113: Fix get_template method to return 'BUILTIN' template in ready state with
matching given ostype
This commit is contained in:
parent
641f85cf6f
commit
c98ac9aae0
@ -237,15 +237,14 @@ def get_template(apiclient, zoneid, ostype, services=None,
|
||||
if isinstance(list_templates, list):
|
||||
assert len(list_templates) > 0, "received empty response on template of type %s"%ostype
|
||||
for template in list_templates:
|
||||
if template.ostypeid == ostypeid:
|
||||
return template
|
||||
elif template.isready and template.templatetype == templatetype:
|
||||
if template.ostypeid == ostypeid and template.isready and template.templatetype == templatetype:
|
||||
return template
|
||||
|
||||
raise Exception("Exception: Failed to find template with OSTypeID: %s" %
|
||||
ostypeid)
|
||||
raise Exception("Exception: Failed to find template of type %s with OSTypeID and which is in "
|
||||
"ready state: %s" %(templatetype, ostypeid))
|
||||
return
|
||||
|
||||
|
||||
def download_systemplates_sec_storage(server, services):
|
||||
"""Download System templates on sec storage"""
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user