Esempio n. 1
0
def create_rhel62_server_x86_64(distro, lab_controller):
    rhel62_server_x86_64 = data_setup.create_distro_tree(
        distro=distro,
        variant=u'Server',
        arch=u'x86_64',
        lab_controllers=[lab_controller],
        urls=[
            u'http://lab.test-kickstart.invalid/distros/RHEL-6.2/Server/x86_64/os/',
            u'nfs://lab.test-kickstart.invalid:/distros/RHEL-6.2/Server/x86_64/os/'
        ])
    rhel62_server_x86_64.repos[:] = [
        DistroTreeRepo(repo_id=u'HighAvailability',
                       repo_type=u'addon',
                       path=u'HighAvailability'),
        DistroTreeRepo(repo_id=u'LoadBalancer',
                       repo_type=u'addon',
                       path=u'LoadBalancer'),
        DistroTreeRepo(repo_id=u'ResilientStorage',
                       repo_type=u'addon',
                       path=u'ResilientStorage'),
        DistroTreeRepo(repo_id=u'ScalableFileSystem',
                       repo_type=u'addon',
                       path=u'ScalableFileSystem'),
        DistroTreeRepo(repo_id=u'Server', repo_type=u'os', path=u'Server'),
        DistroTreeRepo(repo_id=u'optional-x86_64-os',
                       repo_type=u'addon',
                       path=u'../../optional/x86_64/os'),
        DistroTreeRepo(repo_id=u'debug', repo_type=u'debug', path=u'../debug'),
        DistroTreeRepo(repo_id=u'optional-x86_64-debug',
                       repo_type=u'debug',
                       path=u'../../optional/x86_64/debug'),
    ]
    return rhel62_server_x86_64
Esempio n. 2
0
def create_distro_tree(distro=None,
                       distro_name=None,
                       osmajor=u'DansAwesomeLinux6',
                       osminor=u'9',
                       distro_tags=None,
                       arch=u'i386',
                       variant=u'Server',
                       lab_controllers=None,
                       urls=None,
                       harness_dir=True,
                       osmajor_installopts_arch=None,
                       date_created=None,
                       **kwargs):
    if distro is None:
        distro = create_distro(name=distro_name,
                               osmajor=osmajor,
                               osminor=osminor,
                               tags=distro_tags,
                               harness_dir=harness_dir,
                               date_created=date_created)
    distro_tree = DistroTree(distro=distro,
                             arch=Arch.lazy_create(arch=arch),
                             variant=variant)
    if date_created is not None:
        distro_tree.date_created = date_created
    if distro_tree.arch not in distro.osversion.arches:
        distro.osversion.arches.append(distro_tree.arch)
    distro_tree.repos.append(
        DistroTreeRepo(repo_id=variant, repo_type=u'variant', path=u''))
    distro_tree.images.append(
        DistroTreeImage(image_type=ImageType.kernel,
                        kernel_type=KernelType.by_name(u'default'),
                        path=u'pxeboot/vmlinuz'))
    distro_tree.images.append(
        DistroTreeImage(image_type=ImageType.initrd,
                        kernel_type=KernelType.by_name(u'default'),
                        path=u'pxeboot/initrd'))
    session.flush()  # to get an id
    # make it available in all lab controllers by default
    if lab_controllers is None:
        lab_controllers = LabController.query
    for lc in lab_controllers:
        add_distro_tree_to_lab(distro_tree, lc, urls=urls)

    if osmajor_installopts_arch:
        io = OSMajorInstallOptions.lazy_create(
            osmajor_id=distro_tree.distro.osversion.osmajor.id,
            arch_id=distro_tree.arch.id)
        io.ks_meta = osmajor_installopts_arch.get('ks_meta', '')
        io.kernel_options = osmajor_installopts_arch.get('kernel_options', '')
        io.kernel_options_post = osmajor_installopts_arch.get(
            'kernel_options_post', '')

    log.debug('Created distro tree %r', distro_tree)
    return distro_tree
Esempio n. 3
0
def create_rhel62_server_x86_64(lab_controller):
    rhel62 = create_rhel62()
    x86_64 = Arch.by_name(u'x86_64')
    try:
        return DistroTree.query.filter_by(distro=rhel62,
                                          variant=u'Server',
                                          arch=x86_64).one()
    except NoResultFound:
        rhel62_server_x86_64 = data_setup.create_distro_tree(
            distro=rhel62,
            variant=u'Server',
            arch=u'x86_64',
            lab_controllers=[lab_controller],
            urls=[
                u'http://lab.test-kickstart.invalid/distros/RHEL-6.2/Server/x86_64/os/',
                u'nfs://lab.test-kickstart.invalid:/distros/RHEL-6.2/Server/x86_64/os/'
            ])
        rhel62_server_x86_64.repos[:] = [
            DistroTreeRepo(repo_id=u'HighAvailability',
                           repo_type=u'addon',
                           path=u'HighAvailability'),
            DistroTreeRepo(repo_id=u'LoadBalancer',
                           repo_type=u'addon',
                           path=u'LoadBalancer'),
            DistroTreeRepo(repo_id=u'ResilientStorage',
                           repo_type=u'addon',
                           path=u'ResilientStorage'),
            DistroTreeRepo(repo_id=u'ScalableFileSystem',
                           repo_type=u'addon',
                           path=u'ScalableFileSystem'),
            DistroTreeRepo(repo_id=u'Server', repo_type=u'os', path=u'Server'),
            DistroTreeRepo(repo_id=u'optional-x86_64-os',
                           repo_type=u'addon',
                           path=u'../../optional/x86_64/os'),
            DistroTreeRepo(repo_id=u'debug',
                           repo_type=u'debug',
                           path=u'../debug'),
            DistroTreeRepo(repo_id=u'optional-x86_64-debug',
                           repo_type=u'debug',
                           path=u'../../optional/x86_64/debug'),
        ]
        return rhel62_server_x86_64