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"""