return a ready template even if ostype doesn't match

This commit is contained in:
Prasanna Santhanam 2013-04-21 17:06:01 +05:30
parent 4a0b05a0b2
commit 5a0f4b6330
2 changed files with 4 additions and 2 deletions

View File

@ -80,7 +80,7 @@ class TestRouterServices(cloudstackTestCase):
# Get Zone, Domain and templates
cls.domain = get_domain(cls.api_client, cls.services)
cls.zone = get_zone(cls.api_client, cls.services)
self.services['mode'] = cls.zone.networktype
cls.services['mode'] = cls.zone.networktype
template = get_template(
cls.api_client,
cls.zone.id,

View File

@ -134,6 +134,8 @@ def get_template(apiclient, zoneid, ostype, services=None):
for template in list_templates:
if template.ostypeid == ostypeid:
return template
elif template.isready:
return template
raise Exception("Exception: Failed to find template with OSTypeID: %s" %
ostypeid)