Пример #1
0
def get_local_templates(conn):
    vm_type = conn.getType().lower()
    # workaround for ON-433: we equate qemu and kvm backends
    if vm_type == 'qemu':
        vm_type = 'kvm'
    tmpls = []
    from opennode.cli.actions.templates import get_template_info, get_local_templates as local_templates
    for tmpl_name in local_templates(vm_type):
        tmpl_data = get_template_info(tmpl_name, vm_type)
        tmpl_data['template_name'] = tmpl_name
        tmpls.append(tmpl_data)
    return tmpls
Пример #2
0
def get_local_templates(conn):
    vm_type = conn.getType().lower()
    # workaround for ON-433: we equate qemu and kvm backends
    if vm_type == 'qemu':
        vm_type = 'kvm'
    tmpls = []
    from opennode.cli.actions.templates import get_template_info, get_local_templates as local_templates
    for tmpl_name in local_templates(vm_type):
        tmpl_data = get_template_info(tmpl_name, vm_type)
        tmpl_data['template_name'] = tmpl_name
        tmpls.append(tmpl_data)
    return tmpls