示例#1
0
文件: utils.py 项目: bcrochet/katello
def get_template(orgName, envName, tplName):
    template_api = TemplateAPI()

    env = get_environment(orgName, envName)
    tpl = template_api.template_by_name(env["id"], tplName)
    if tpl == None:
        raise ApiDataError(_("Could not find template [ %(tplName)s ] within environment [ %(env_name)s ]") %
            {'tplName':tplName, 'env_name':env["name"]})
    return tpl
示例#2
0
 def get_template_id(cls, environmentId, templateName):
     if templateName != None:
         template_api = TemplateAPI()
         template = template_api.template_by_name(environmentId, templateName)
         if template == None:
             raise OptionException()
         else:
             return template['id']
     else:
         return None
示例#3
0
文件: utils.py 项目: beav/katello
def get_template(orgName, envName, tplName):
    template_api = TemplateAPI()

    env = get_environment(orgName, envName)
    tpl = template_api.template_by_name(env["id"], tplName)
    if tpl == None:
        raise ApiDataError(
            _("Could not find template [ %s ] within environment [ %s ]") %
            (tplName, env["name"]))
    return tpl
示例#4
0
文件: utils.py 项目: jsomara/katello
def get_template(orgName, envName, tplName):
    template_api = TemplateAPI()

    env = get_environment(orgName, envName)
    if env == None:
        return None

    tpl = template_api.template_by_name(env["id"], tplName)
    if tpl == None:
        print >> sys.stderr, _("Could not find template [ %s ] within environment [ %s ]") % (tplName, env["name"])
    return tpl
示例#5
0
 def get_template_id(self, environmentId, templateName):
     if templateName != None:
         template_api = TemplateAPI()
         template = template_api.template_by_name(environmentId,
                                                  templateName)
         if template == None:
             raise OptionException()
         else:
             return template['id']
     else:
         return None
示例#6
0
 def __init__(self):
     super(TemplateAction, self).__init__()
     self.api = TemplateAPI()