From c98ac9aae09cce5abeb5bfd24b96dda116b66aa3 Mon Sep 17 00:00:00 2001 From: SrikanteswaraRao Talluri Date: Fri, 10 Jan 2014 19:51:55 +0530 Subject: [PATCH] CLOUDSTACK-5113: Fix get_template method to return 'BUILTIN' template in ready state with matching given ostype --- tools/marvin/marvin/integration/lib/common.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/tools/marvin/marvin/integration/lib/common.py b/tools/marvin/marvin/integration/lib/common.py index 504cd4cdc98..550de1aca77 100644 --- a/tools/marvin/marvin/integration/lib/common.py +++ b/tools/marvin/marvin/integration/lib/common.py @@ -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"""