예제 #1
0
def check_node_group_template_usage(node_group_template_id, **kwargs):
    node_groups = []

    for cluster in api.get_clusters():
        node_groups += cluster.node_groups

    for cluster_template in api.get_cluster_templates():
        node_groups += cluster_template.node_groups

    node_group_template_ids = set(
        [node_group.node_group_template_id for node_group in node_groups])

    if node_group_template_id in node_group_template_ids:
        raise ex.InvalidException("Node group template %s is use" %
                                  node_group_template_id)
예제 #2
0
def check_node_group_template_usage(node_group_template_id, **kwargs):
    node_groups = []

    for cluster in api.get_clusters():
        node_groups += cluster.node_groups

    for cluster_template in api.get_cluster_templates():
        node_groups += cluster_template.node_groups

    node_group_template_ids = set([node_group.node_group_template_id
                                   for node_group in node_groups])

    if node_group_template_id in node_group_template_ids:
        raise ex.InvalidException(
            "Node group template %s in use" % node_group_template_id)
예제 #3
0
파일: base.py 프로젝트: jfzhang1984/savanna
def check_cluster_template_exists(cluster_template_id):
    if not api.get_cluster_templates(id=cluster_template_id):
        raise ex.InvalidException("Cluster template with id '%s'"
                                  " doesn't exist" % cluster_template_id)
예제 #4
0
파일: base.py 프로젝트: jfzhang1984/savanna
def check_cluster_template_unique_name(name):
    if name in [t.name for t in api.get_cluster_templates()]:
        raise ex.NameAlreadyExistsException("Cluster template with name '%s'"
                                            " already exists" % name)
예제 #5
0
파일: v10.py 프로젝트: chiehwen/savanna
def cluster_templates_list():
    return u.render(
        cluster_templates=[t.to_dict() for t in api.get_cluster_templates()])
예제 #6
0
파일: base.py 프로젝트: jfzhang2013/savanna
def check_cluster_template_unique_name(name):
    if name in [t.name for t in api.get_cluster_templates()]:
        raise ex.NameAlreadyExistsException("Cluster template with name '%s'"
                                            " already exists" % name)
예제 #7
0
def cluster_templates_list():
    return u.render(
        cluster_templates=[t.to_dict() for t in api.get_cluster_templates()])