def prepare_host_upgrade(url):
    installer_dir = '/boot/installer'
    done = True

    # download the installer files
    try:
        shutil.rmtree(installer_dir)
    except:
        pass
    os.mkdir(installer_dir, 0700)

    a = accessor.createAccessor(url)
    done = get_boot_files(a, installer_dir)

    if done:
        done = gen_answerfile(installer_dir, url)

    if done:
        # create bootloader entry
        set_boot_config(installer_dir)

    if not done:
        try:
            shutil.rmtree(installer_dir)
        except:
            pass
    return done
def prepare_host_upgrade(url):
    installer_dir = '/boot/installer'
    done = True

    # download the installer files
    try:
        shutil.rmtree(installer_dir)
    except:
        pass
    os.mkdir(installer_dir, 0700)

    a = accessor.createAccessor(url)
    done = get_boot_files(a, installer_dir)

    if done:
        done = gen_answerfile(installer_dir, url)
        
    if done:
        # create bootloader entry
        set_boot_config(installer_dir)
        
    if not done:
        try:
            shutil.rmtree(installer_dir)
        except:
            pass
    return done
def test_repo(url):
    try:
        a = accessor.createAccessor(url)
    except:
        return False
    if not get_boot_files(a, None):
        return False
    r = repository.Repository.findRepositories(a)
    return len(r) > 0
def test_repo(url):
    try:
        a = accessor.createAccessor(url)
    except:
        return False
    if not get_boot_files(a, None):
        return False
    r = repository.Repository.findRepositories(a)
    return len(r) > 0