Exemplo n.º 1
0
def check_node_group_template_unique_name(name):
    if name in [
            t.name for t in api.get_node_group_templates(
                tenant_id=context.ctx().tenant_id)
    ]:
        raise ex.NameAlreadyExistsException(
            _("NodeGroup template with name '%s' already exists") % name)
Exemplo n.º 2
0
def check_node_group_template_unique_name(ng_tmpl_name):
    if ng_tmpl_name in [
            ng_tmpl.name
            for ng_tmpl in api.get_node_group_templates(name=ng_tmpl_name)
    ]:
        raise ex.NameAlreadyExistsException(
            _("NodeGroup template with name '%s' already exists") %
            ng_tmpl_name)
Exemplo n.º 3
0
def check_node_group_template_unique_name(name):
    if name in [t.name for t in api.get_node_group_templates()]:
        raise ex.NameAlreadyExistsException(_("NodeGroup template with name '%s' already exists") % name)
Exemplo n.º 4
0
def node_group_templates_list():
    return u.render(node_group_templates=[
        t.to_dict()
        for t in api.get_node_group_templates(**u.get_request_args().to_dict())
    ])
Exemplo n.º 5
0
def node_group_templates_list():
    result = api.get_node_group_templates(
        **u.get_request_args().to_dict())
    return u.render(res=result, name='node_group_templates')
Exemplo n.º 6
0
def node_group_templates_list():
    result = api.get_node_group_templates(**u.get_request_args().to_dict())
    return u.render(res=result, name='node_group_templates')
Exemplo n.º 7
0
def node_group_templates_list():
    return u.render(
        node_group_templates=[t.to_dict()
                              for t in api.get_node_group_templates(
                              **u.get_request_args().to_dict())])