コード例 #1
0
ファイル: templates.py プロジェクト: Nemaanjaa/opennode-tui
def get_template_info(template_name, vm_type, storage_pool = c('general', 'default-storage-pool')):
    ovf_file = OvfFile(os.path.join(c("general", "storage-endpoint"),
                                        storage_pool, vm_type, "unpacked",
                                        template_name + ".ovf"))
    vm = vm_ops.get_module(vm_type)
    template_settings = vm.get_ovf_template_settings(ovf_file)
    # XXX handle modification to system params
    #errors = vm.adjust_setting_to_systems_resources(template_settings)
    return template_settings
コード例 #2
0
ファイル: templates.py プロジェクト: carriercomm/opennode-tui
def get_template_info(template_name, vm_type, storage_pool=None):
    config = get_config()
    if not storage_pool:
        storage_pool = config.getstring("general", "default-storage-pool")
    ovf_file = OvfFile(os.path.join(storage.get_pool_path(storage_pool), vm_type, "unpacked", template_name + ".ovf"))
    vm = vm_ops.get_module(vm_type)
    template_settings = vm.get_ovf_template_settings(ovf_file)
    # XXX handle modification to system params
    # errors = vm.adjust_setting_to_systems_resources(template_settings)
    return template_settings
コード例 #3
0
def get_template_info(template_name, vm_type, storage_pool=None):
    config = get_config()
    if not storage_pool:
        storage_pool = config.getstring('general', 'default-storage-pool')
    ovf_file = OvfFile(os.path.join(storage.get_pool_path(storage_pool),
                                    vm_type, "unpacked",
                                    template_name + ".ovf"))
    vm = vm_ops.get_module(vm_type)
    template_settings = vm.get_ovf_template_settings(ovf_file)
    # XXX handle modification to system params
    #errors = vm.adjust_setting_to_systems_resources(template_settings)
    return template_settings