CLOUDSTACK-5674: Fix get_domain and remove dependency on ostype in get_template
Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/f0eb184d Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/f0eb184d Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/f0eb184d Branch: refs/heads/master Commit: f0eb184d8a5bf3412190468641fa3d887cfe7bb1 Parents: c0d8b9e Author: Girish Shilamkar <[email protected]> Authored: Thu Feb 13 19:57:04 2014 -0500 Committer: Girish Shilamkar <[email protected]> Committed: Thu Feb 13 19:57:04 2014 -0500 ---------------------------------------------------------------------- tools/marvin/marvin/lib/common.py | 26 ++++++++++---------------- 1 file changed, 10 insertions(+), 16 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cloudstack/blob/f0eb184d/tools/marvin/marvin/lib/common.py ---------------------------------------------------------------------- diff --git a/tools/marvin/marvin/lib/common.py b/tools/marvin/marvin/lib/common.py index 41416d4..cf6050c 100644 --- a/tools/marvin/marvin/lib/common.py +++ b/tools/marvin/marvin/lib/common.py @@ -179,8 +179,14 @@ def get_domain(apiclient, domain_id=None, domain_name=None): cmd.name = domain_name if domain_id is not None: cmd.id = domain_id - cmd_out = apiclient.listRegions(cmd) - return FAILED if validateList(cmd_out)[0] != PASS else cmd_out + cmd_out = apiclient.listDomains(cmd) + if validateList(cmd_out)[0] != PASS: + return FAILED + + if (domain_id is None and domain_name is None): + return cmd_out[0] + else: + return cmd_out def get_zone(apiclient, zone_name=None, zone_id=None): @@ -248,19 +254,7 @@ def get_template(apiclient, zone_id=None, ostype_desc=None, template_filter="fea @Output : FAILED in case of any failure template Information matching the inputs ''' - - ''' - Get OS TypeID First based upon ostype_desc - ''' - cmd = listOsTypes.listOsTypesCmd() - cmd.description = ostype_desc - ostypes_out = apiclient.listOsTypes(cmd) - - if (validateList(ostypes_out)[0] != PASS): return FAILED - - ostype_id = ostypes_out[0].id - - listcmd = listTemplates.listTemplatesCmd() + cmd = listTemplates.listTemplatesCmd() cmd.templatefilter = template_filter if domain_id is not None: cmd.domainid = domain_id @@ -284,7 +278,7 @@ def get_template(apiclient, zone_id=None, ostype_desc=None, template_filter="fea if validateList(list_templatesout)[0] != PASS: return FAILED for template in list_templatesout: - if template.ostypeid == ostype_id and template.isready and template.templatetype == template_type: + if template.isready and template.templatetype == template_type: return template ''' Return Failed if None of the templates matched
