You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by gi...@apache.org on 2014/02/10 08:10:13 UTC

git commit: updated refs/heads/4.3-forward to 675414f

Updated Branches:
  refs/heads/4.3-forward 65e1e7003 -> 675414feb


CLOUDSTACK-5978: Changes in get_template function to make it
 independent of ostype passed through test case


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/675414fe
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/675414fe
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/675414fe

Branch: refs/heads/4.3-forward
Commit: 675414feb8d7e15bb4a3251b922a1a1d10639cb0
Parents: 65e1e70
Author: Ashutosh K <as...@clogeny.com>
Authored: Mon Feb 10 12:38:09 2014 +0530
Committer: Girish Shilamkar <gi...@clogeny.com>
Committed: Mon Feb 10 12:39:54 2014 +0530

----------------------------------------------------------------------
 tools/marvin/marvin/integration/lib/common.py | 20 +++++---------------
 1 file changed, 5 insertions(+), 15 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/675414fe/tools/marvin/marvin/integration/lib/common.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/common.py b/tools/marvin/marvin/integration/lib/common.py
index f23b332..e202391 100644
--- a/tools/marvin/marvin/integration/lib/common.py
+++ b/tools/marvin/marvin/integration/lib/common.py
@@ -215,17 +215,7 @@ def get_pod(apiclient, zoneid, services=None):
 def get_template(apiclient, zoneid, ostype, services=None,
                  templatefilter='featured',
                  templatetype='BUILTIN'):
-    "Returns a template"
-
-    cmd = listOsTypes.listOsTypesCmd()
-    cmd.description = ostype
-    ostypes = apiclient.listOsTypes(cmd)
-
-    if isinstance(ostypes, list):
-        ostypeid = ostypes[0].id
-    else:
-        raise Exception(
-            "Failed to find OS type with description: %s" % ostype)
+    "Returns a featured built in template in given zone"
 
     cmd = listTemplates.listTemplatesCmd()
     cmd.templatefilter = templatefilter
@@ -238,13 +228,13 @@ def get_template(apiclient, zoneid, ostype, services=None,
     list_templates = apiclient.listTemplates(cmd)
 
     if isinstance(list_templates, list):
-        assert len(list_templates) > 0, "received empty response on template of type %s"%ostype
+        assert len(list_templates) > 0, "received empty response on featured templates"
         for template in list_templates:
-            if template.ostypeid == ostypeid and template.isready and template.templatetype == templatetype:
+            if template.isready and template.templatetype == templatetype:
                 return template
 
-    raise Exception("Exception: Failed to find template of type %s with OSTypeID and which is in "
-                                "ready state: %s" %(templatetype, ostypeid))
+    raise Exception("Exception: Failed to find built in template which is in "
+                                "ready state: %s" % templatetype)
     return