diff --git a/docs/html/.buildinfo b/docs/html/.buildinfo index d9e049b1..a85d9874 100644 --- a/docs/html/.buildinfo +++ b/docs/html/.buildinfo @@ -1,4 +1,4 @@ # Sphinx build info version 1 # This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done. -config: 70a7edc36d19abd5eeb8cb6028d02c14 +config: 6b412c1cb8a574fbaeacd67cced1e5e1 tags: 645f666f9bcd5a90fca523b33c5a78b7 diff --git a/docs/html/.doctrees/composer-cli.doctree b/docs/html/.doctrees/composer-cli.doctree index ee92f195..72fd3e18 100644 Binary files a/docs/html/.doctrees/composer-cli.doctree and b/docs/html/.doctrees/composer-cli.doctree differ diff --git a/docs/html/.doctrees/environment.pickle b/docs/html/.doctrees/environment.pickle index 2c4d35a5..18f6117c 100644 Binary files a/docs/html/.doctrees/environment.pickle and b/docs/html/.doctrees/environment.pickle differ diff --git a/docs/html/.doctrees/index.doctree b/docs/html/.doctrees/index.doctree index 71fb8358..9ab1fb4e 100644 Binary files a/docs/html/.doctrees/index.doctree and b/docs/html/.doctrees/index.doctree differ diff --git a/docs/html/.doctrees/intro.doctree b/docs/html/.doctrees/intro.doctree index c9c12690..42730849 100644 Binary files a/docs/html/.doctrees/intro.doctree and b/docs/html/.doctrees/intro.doctree differ diff --git a/docs/html/.doctrees/livemedia-creator.doctree b/docs/html/.doctrees/livemedia-creator.doctree index 039c3895..49526bd3 100644 Binary files a/docs/html/.doctrees/livemedia-creator.doctree and b/docs/html/.doctrees/livemedia-creator.doctree differ diff --git a/docs/html/.doctrees/lorax-composer.doctree b/docs/html/.doctrees/lorax-composer.doctree index 1db844a8..ccaae8c7 100644 Binary files a/docs/html/.doctrees/lorax-composer.doctree and b/docs/html/.doctrees/lorax-composer.doctree differ diff --git a/docs/html/.doctrees/lorax.doctree b/docs/html/.doctrees/lorax.doctree index 1c38f6b4..7b27ff78 100644 Binary files a/docs/html/.doctrees/lorax.doctree and b/docs/html/.doctrees/lorax.doctree differ diff --git a/docs/html/.doctrees/mkksiso.doctree b/docs/html/.doctrees/mkksiso.doctree new file mode 100644 index 00000000..a99ba447 Binary files /dev/null and b/docs/html/.doctrees/mkksiso.doctree differ diff --git a/docs/html/.doctrees/modules.doctree b/docs/html/.doctrees/modules.doctree index f289caa8..7a52f72d 100644 Binary files a/docs/html/.doctrees/modules.doctree and b/docs/html/.doctrees/modules.doctree differ diff --git a/docs/html/.doctrees/product-images.doctree b/docs/html/.doctrees/product-images.doctree index 177cff5c..6d321a4c 100644 Binary files a/docs/html/.doctrees/product-images.doctree and b/docs/html/.doctrees/product-images.doctree differ diff --git a/docs/html/.doctrees/pylorax.api.doctree b/docs/html/.doctrees/pylorax.api.doctree index e592eaba..717214fd 100644 Binary files a/docs/html/.doctrees/pylorax.api.doctree and b/docs/html/.doctrees/pylorax.api.doctree differ diff --git a/docs/html/.doctrees/pylorax.doctree b/docs/html/.doctrees/pylorax.doctree index 8c51bde0..9f0a68b5 100644 Binary files a/docs/html/.doctrees/pylorax.doctree and b/docs/html/.doctrees/pylorax.doctree differ diff --git a/docs/html/_modules/index.html b/docs/html/_modules/index.html index 9a3d5813..5719f882 100644 --- a/docs/html/_modules/index.html +++ b/docs/html/_modules/index.html @@ -1,38 +1,44 @@ - - + - + - + - Overview: module code — Lorax 28.14.42 documentation + Overview: module code — Lorax 28.14.59 documentation - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + @@ -58,7 +64,7 @@
- 28.14.42 + 28.14.59
@@ -75,6 +81,7 @@ + + @@ -130,11 +139,13 @@ + +
- @@ -208,7 +224,6 @@ - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + @@ -60,7 +67,7 @@
- 28.14.42 + 28.14.59
@@ -77,6 +84,7 @@ + + @@ -139,18 +160,20 @@ + +
@@ -252,7 +464,6 @@ save the qcow2 image as jQuery(function () { SphinxRtdTheme.Navigation.enable(true); diff --git a/docs/html/genindex.html b/docs/html/genindex.html index efd3ac0c..bc5bf823 100644 --- a/docs/html/genindex.html +++ b/docs/html/genindex.html @@ -1,39 +1,44 @@ - - - + - + - + - Index — Lorax 28.14.42 documentation + Index — Lorax 28.14.59 documentation - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + @@ -59,7 +64,7 @@
- 28.14.42 + 28.14.59
@@ -76,6 +81,7 @@ + + @@ -131,18 +139,20 @@ + +
@@ -388,7 +400,7 @@ @@ -548,7 +560,7 @@

K

- +
-
  • repo() (pylorax.api.server.GitLock property) +
  • repo (pylorax.api.server.GitLock property)
  • repo_file_exists() (in module pylorax.api.recipes)
  • @@ -992,7 +1219,7 @@
  • take_limits() (in module pylorax.api.v0)
  • -
  • templatedir() (pylorax.Lorax property) +
  • templatedir (pylorax.Lorax property)
  • TemplateRunner (class in pylorax.ltmpl)
  • @@ -1105,20 +1332,25 @@ - @@ -1127,7 +1359,6 @@ - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + @@ -59,7 +66,7 @@
    - 28.14.42 + 28.14.59
    @@ -76,6 +83,7 @@ + + @@ -131,18 +141,20 @@ + +
    - -
    + +

    Documentation for other Lorax Branches

    -
    -
    + +

    Indices and tables

    -
    + - @@ -222,7 +236,6 @@ - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + @@ -60,7 +67,7 @@
    - 28.14.42 + 28.14.59
    @@ -77,6 +84,7 @@ + + @@ -132,18 +142,20 @@ + +
      -
    • Docs »
    • +
    • »
    • Introduction to Lorax
    • - + View page source @@ -157,7 +169,7 @@
      -
      +

      Introduction to Lorax

      I am the Lorax. I speak for the trees [and images].

      Lorax is used to build the Anaconda Installer boot.iso, it consists of a @@ -165,8 +177,8 @@ library, pylorax, a set of templates, and the lorax script. Its operation is driven by a customized set of Mako templates that lists the packages to be installed, steps to execute to remove unneeded files, and creation of the iso for all of the supported architectures.

      -
      -
      + +

      Before Lorax

      Tree building tools such as pungi and revisor rely on ‘buildinstall’ in anaconda/scripts/ to produce the boot images and other such control files @@ -206,36 +218,36 @@ it’s not completely clear from reading the scripts.

      Create a new central driver with all information living in Python modules. Configuration files will provide the knowledge previously contained in the upd-instroot and mk-images* scripts.

      -
      +
      -
    @@ -244,7 +256,6 @@ upd-instroot and mk-images* scripts.

    - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + - + @@ -60,7 +67,7 @@
    - 28.14.42 + 28.14.59
    @@ -77,6 +84,7 @@ + + @@ -164,18 +174,20 @@ + +
      -
    • Docs »
    • +
    • »
    • livemedia-creator
    • - + View page source @@ -189,7 +201,7 @@
      -
      +

      livemedia-creator

      Authors
      @@ -217,7 +229,7 @@ you have the anaconda-tui package installed.

      lmc is an abbreviation for livemedia-creator.

      builder is the system where livemedia-creator is being run

      image is the disk image being created by running livemedia-creator

      -
      +

      livemedia-creator cmdline arguments

      Create Live Install Media

      @@ -254,7 +266,7 @@ you have the anaconda-tui package installed.

      [--timeout TIMEOUT] [-V]
      -
      +

      Named Arguments

      --make-iso
      @@ -385,8 +397,8 @@ you have the anaconda-tui package installed.

      show program’s version number and exit

      -
      -
      + +

      disk/fs image arguments

      --disk-image
      @@ -437,8 +449,8 @@ you have the anaconda-tui package installed.

      Default: []

      -
      -
      + +

      appliance arguments

      --app-name
      @@ -452,8 +464,8 @@ you have the anaconda-tui package installed.

      Default: “appliance.xml”

      -
      -
      + +

      qemu arguments

      --ram
      @@ -489,16 +501,16 @@ you have the anaconda-tui package installed.

      Default: “/dev/random”

      -
      -
      + +

      dracut arguments

      --dracut-arg

      Argument to pass to dracut when rebuilding the initramfs. Pass this once for each argument. NOTE: this overrides the default. (default: )

      -
      -
      + +

      pxe to live arguments

      --live-rootfs-size
      @@ -510,8 +522,8 @@ you have the anaconda-tui package installed.

      Default: False

      -
      -
      + +

      OCI arguments

      --oci-config
      @@ -521,8 +533,8 @@ you have the anaconda-tui package installed.

      runtime.json OCI configuration file

      -
      -
      + +

      Vagrant arguments

      --vagrant-metadata
      @@ -532,9 +544,9 @@ you have the anaconda-tui package installed.

      optional vagrantfile

      -
      -
      -
      + + +

      Quickstart

      Run this to create a bootable live iso:

      sudo livemedia-creator --make-iso \
      @@ -551,8 +563,8 @@ you have the anaconda-tui package installed.

      chosen, or you can use a specific port by passing it. eg. --vnc vnc:127.0.0.1:5

      This is usually a good idea when testing changes to the kickstart. lmc tries to monitor the logs for fatal errors, but may not catch everything.

      -
      -
      +
      +

      How ISO creation works

      There are 2 stages, the install stage which produces a disk or filesystem image as its output, and the boot media creation which uses the image as its input. @@ -586,8 +598,8 @@ the kernel, initrd, the squashfs filesystem, etc. If you only want the boot.iso you can pass --iso-only and the other files will be removed. You can also name the iso by using --iso-name my-live.iso.

      -
      -
      + +

      Kickstarts

      The docs/ directory includes several example kickstarts, one to create a live desktop iso using GNOME, and another to create a minimal disk image. When @@ -655,8 +667,8 @@ packages will get cached, so your kickstart url would look like:

      You can also add an update repo, but don’t name it updates. Add –proxy to it as well.

      -
    -
    + +

    Anaconda image install (no-virt)

    You can create images without using qemu by passing --no-virt on the cmdline. This will use Anaconda’s directory install feature to handle the @@ -688,8 +700,8 @@ virt.

    logged for debugging purposes and if there are SELinux denials they should be reported as a bug.

    - -
    + +

    AMI Images

    Amazon EC2 images can be created by using the –make-ami switch and an appropriate kickstart file. All of the work to customize the image is handled by the kickstart. @@ -699,8 +711,8 @@ that it would work with livemedia-creator.

    sudo livemedia-creator --make-ami --iso=/path/to/boot.iso --ks=./docs/rhel-livemedia-ec2.ks

    This will produce an ami-root.img file in the working directory.

    At this time I have not tested the image with EC2. Feedback would be welcome.

    -
    -
    + +

    Appliance Creation

    livemedia-creator can now replace appliance-tools by using the –make-appliance switch. This will create the partitioned disk image and an XML file that can be @@ -754,8 +766,8 @@ from --releasever--image-type=qcow2 --app-file=minimal-test.xml --image-name=minimal-test.img

    - -
    + +

    Filesystem Image Creation

    livemedia-creator can be used to create un-partitined filesystem images using the --make-fsimage option. As of version 21.8 this works with both qemu and @@ -765,8 +777,8 @@ no-virt modes of operation. Previously it was only available with no-virt.

    livemedia-creator --make-fsimage --iso=/path/to/boot.iso --ks=./docs/rhel-minimal.ks

    You can name the output image with --image-name and set a label on the filesystem with --fs-label

    -
    -
    + +

    TAR File Creation

    The --make-tar command can be used to create a tar of the root filesystem. By default it is compressed using xz, but this can be changed using the @@ -778,15 +790,15 @@ no-virt install methods.

    --image-name=rhel-root.tar.xz
    - -
    + +

    Live Image for PXE Boot

    The --make-pxe-live command will produce squashfs image containing live root filesystem that can be used for pxe boot. Directory with results will contain the live image, kernel image, initrd image and template of pxe configuration for the images.

    -
    -
    + +

    Atomic Live Image for PXE Boot

    The --make-ostree-live command will produce the same result as --make-pxe-live for installations of Atomic Host. Example kickstart for such an installation @@ -795,8 +807,8 @@ in docs/rhel-atomic-pxe-live.ks.

    The PXE images can also be created with --no-virt by using the example kickstart in docs/rhel-atomic-pxe-live-novirt.ks. This also works inside the mock environment.

    -
    -
    + +

    Using Mock and –no-virt to Create Images

    As of lorax version 22.2 you can use livemedia-creator and anaconda version 22.15 inside of a mock chroot with –make-iso and –make-fsimage.

    @@ -847,8 +859,8 @@ group.

    including anaconda logs and livemedia-creator logs. The new iso will be located at ~/results/try-1/images/boot.iso, and the ~/results/try-1/ directory tree will also contain the vmlinuz, initrd, etc.

    -
    -
    + +

    Using Mock and qemu to Create Images

    Version 25.0 of livemedia-creator switches to using qemu for virtualization. This allows creation of all image types, and use of the KVM on the host if @@ -898,8 +910,8 @@ located at ~/results/try-1/images/boot.iso, and the ~/results/try-1/ directory tree will also contain the vmlinuz, initrd, etc.

    This will run qemu without kvm support, which is going to be very slow. You can add mknod /dev/kvm c 10 232; to create the device node before running lmc.

    -
    -
    + +

    OpenStack Image Creation

    OpenStack supports partitioned disk images so --make-disk can be used to create images for importing into glance, OpenStack’s image storage component. @@ -923,8 +935,8 @@ cloud-utils-growpart will grow the image to fit the instance’s disk size.

    If qcow2 wasn’t used then --disk-format should be set to raw.

    - -
    + +

    Container Image Creation

    Use lmc to create a tarfile as described in the TAR File Creation section, but substitute the rhel-container.ks example kickstart which removes the requirement for core files and the kernel.

    @@ -936,8 +948,8 @@ rhel-container.ks example kickstart which removes the requirement for core files

    podman run -i -t rhel-root /bin/bash

    -
    -
    + +

    Open Container Initiative Image Creation

    The OCI is a new specification that is still being worked on. You can read more about it at the Open Container Initiative website. You can create @@ -951,8 +963,8 @@ their specifications can be found --no-virt and inside a mock since it doesn’t use any partitioned disk images.

    -
    -
    + +

    Vagrant Image Creation

    Vagrant images can be created using the following command:

    sudo livemedia-creator --make-vagrant --vagrant-metadata /path/to/metadata.json \
    @@ -970,8 +982,8 @@ the vagrant user with the default insecure SSH pubkey and a few useful
     utilities.

    This also works with --no-virt, but will not work inside a mock due to its use of partitioned disk images and qcow2.

    -
    -
    +
    +

    Creating UEFI disk images with virt

    Partitioned disk images can only be created for the same platform as the host system (BIOS or UEFI). You can use virt to create BIOS images on UEFI systems, and it is also possible @@ -992,8 +1004,8 @@ firmware files.

    Note

    The –virt-uefi method is currently only supported on the x86_64 architecture.

    - -
    + +

    Debugging problems

    Sometimes an installation will get stuck. When using qemu the logs will be written to ./virt-install.log and most of the time any problems that happen @@ -1020,44 +1032,44 @@ running the anacond multi-threaded and it can sometimes become stuck and refuse to exit. When this happens you can usually clean up by first killing the anaconda process then running anaconda-cleanup.

    -
    -
    + +

    Hacking

    Development on this will take place as part of the lorax project, and on the anaconda-devel-list mailing list, and on github

    Feedback, enhancements and bugs are welcome. You can use bugzilla to report bugs against the lorax component.

    -
    - + + - @@ -1066,7 +1078,6 @@ report bugs against the lorax component.

    - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + - + @@ -60,7 +67,7 @@
    - 28.14.42 + 28.14.59
    @@ -77,6 +84,7 @@ + + @@ -171,18 +181,20 @@ + +
      -
    • Docs »
    • +
    • »
    • lorax-composer
    • - + View page source @@ -196,21 +208,29 @@
      -
      +

      lorax-composer

      Authors

      Brian C. Lane <bcl@redhat.com>

      -

      lorax-composer is an API server that allows you to build disk images using +

      lorax-composer is a WELDR API server that allows you to build disk images using Blueprints to describe the package versions to be installed into the image. It is compatible with the Weldr project’s bdcs-api REST protocol. More information on Weldr can be found on the Weldr blog.

      Behind the scenes it uses livemedia-creator and Anaconda to handle the installation and configuration of the images.

      -
      +
      +

      Note

      +

      lorax-composer is now deprecated. It is being replaced by the +osbuild-composer WELDR API server which implements more features (eg. +ostree, image uploads, etc.) You can still use composer-cli and +cockpit-composer with osbuild-composer. See the documentation or +the osbuild website for more information.

      +
      +

      Important Things To Note

      -
      -
      +
      +

      Installation

      The best way to install lorax-composer is to use sudo dnf install lorax-composer composer-cli, this will setup the weldr user and install the @@ -231,8 +251,8 @@ systemd socket activation service. You will then need to enable it with lorax-composer.socket. This will leave the server off until the first request is made. Systemd will then launch the server and it will remain running until the system is rebooted.

      -
      -
      + +

      Quickstart

      1. Create a weldr user and group by running useradd weldr

      2. @@ -251,13 +271,13 @@ be created, and all the blueprints created with the .toml files in the top level of the directory they will be imported into the blueprint git storage when lorax-composer starts.

        -
      -
      + +

      Logs

      Logs are stored under /var/log/lorax-composer/ and include all console messages as well as extra debugging info and API requests.

      -
      -
      + +

      Security

      Some security related issues that you should be aware of before running lorax-composer:

        @@ -268,8 +288,8 @@ messages as well as extra debugging info and API requests.

        inject commands into a blueprint that would result in the kickstart executing arbitrary code on the host. Only authorized users should be allowed to build images using lorax-composer.

        -
      -
      + +

      lorax-composer cmdline arguments

      Lorax Composer API Server

      @@ -281,15 +301,15 @@ images using lorax- BLUEPRINTS
      -
      +

      Positional Arguments

      BLUEPRINTS

      Path to the blueprints

      -
      -
      + +

      Named Arguments

      --socket
      @@ -338,9 +358,9 @@ images using lorax-

      Default: False

      -
      -
      -
      + + +

      How it Works

      The server runs as root, and as weldr. Communication with it is via a unix domain socket (/run/weldr/api.socket by default). The directory and socket @@ -353,14 +373,14 @@ cmdline by passing it the It will then drop root privileges for the API thread and run as the weldr user. The queue and compose thread still runs as root because it needs to be able to mount/umount files and run Anaconda.

      -
      -
      + +

      Composing Images

      The welder-web GUI project can be used to construct blueprints and create composes using a web browser.

      Or use the command line with composer-cli.

      -
      -
      + +

      Blueprints

      Blueprints are simple text files in TOML format that describe which packages, and what versions, to install into the image. They can also define a limited set @@ -385,7 +405,7 @@ automatically bump the PATCH level of the version set to 0.1.0 when the existing blueprint version is 0.0.1 will result in the new blueprint being stored as version 0.1.0.

      -
      +

      [[packages]] and [[modules]]

      These entries describe the package names and matching version glob to be installed into the image.

      The names must match the names exactly, and the versions can be an exact match @@ -394,8 +414,8 @@ character matching.

      NOTE: As of lorax-composer-29.2-1 the versions are not used for depsolving, that is planned for a future release. And currently there are no differences between packages and modules in lorax-composer.

      -
      -
      +
      +

      [[groups]]

      These entries describe a group of packages to be installed into the image. Package groups are defined in the repository metadata. Each group has a descriptive name used primarily for display @@ -404,8 +424,8 @@ way of listing a group.

      Groups have three different ways of categorizing their packages: mandatory, default, and optional. For purposes of blueprints, mandatory and default packages will be installed. There is no mechanism for selecting optional packages.

      -
      -
      + +

      Customizations

      The [customizations] section can be used to configure the hostname of the final image. eg.:

      [customizations]
      @@ -413,7 +433,7 @@ for selecting optional packages.

      This is optional and may be left out to use the defaults.

      -
      +

      [customizations.kernel]

      This allows you to append arguments to the bootloader’s kernel commandline. This will not have any effect on tar or ext4-filesystem images since they do not include a bootloader.

      @@ -422,8 +442,8 @@ effect on tarappend = "nosmt=force"
      -
    -
    + +

    [[customizations.sshkey]]

    Set an existing user’s ssh key in the final image:

    [[customizations.sshkey]]
    @@ -432,8 +452,8 @@ effect on tar

    The key will be added to the user’s authorized_keys file.

    -
    -
    + +

    [[customizations.user]]

    Add a user to the image, and/or set their ssh key. All fields for this section are optional except for the name, here is a complete example:

    @@ -451,8 +471,8 @@ All fields for this section are optional except for the $6$, $5$, or $2b$ it will be stored as an encrypted password. Otherwise it will be treated as a plain text password.

    -
    -
    + +

    [[customizations.group]]

    Add a group to the image. name is required and gid is optional:

    [[customizations.group]]
    @@ -460,8 +480,8 @@ an encrypted password. Otherwise it will be treated as a plain text password.

    gid = 1130
    -
    -
    + +

    [customizations.timezone]

    Customizing the timezone and the NTP servers to use for the system:

    [customizations.timezone]
    @@ -475,8 +495,8 @@ optional and will default to using the distribution defaults which are fine for
     

    In some image types there are already NTP servers setup, eg. Google cloud image, and they cannot be overridden because they are required to boot in the selected environment. But the timezone will be updated to the one selected in the blueprint.

    -
    -
    +
    +

    [customizations.locale]

    Customize the locale settings for the system:

    [customizations.locale]
    @@ -491,8 +511,8 @@ the command line.

    Multiple languages can be added. The first one becomes the primary, and the others are added as secondary. One or the other of languages or keyboard must be included (or both) in the section.

    -
    -
    +
    +

    [customizations.firewall]

    By default the firewall blocks all access except for services that enable their ports explicitly, like sshd. This command can be used to open other ports or services. Ports are configured using @@ -516,8 +536,8 @@ in a customizations only want the default firewall setup this section can be omitted from the blueprint.

    NOTE: The Google and OpenStack templates explicitly disable the firewall for their environment. This cannot be overridden by the blueprint.

    -
    -
    + +

    [customizations.services]

    This section can be used to control which services are enabled at boot time. Some image types already have services enabled or disabled in order for the @@ -532,9 +552,9 @@ file accepted by sy disabled = ["postfix", "telnetd"]

    - - -
    + + +

    [[repos.git]]

    The [[repos.git]] entries are used to add files from a git repository<https://git-scm.com/> repository to the created image. The repository is cloned, the specified ref is checked out @@ -568,34 +588,34 @@ of a branch set it to +

    + +

    Adding Output Types

    livemedia-creator supports a large number of output types, and only some of these are currently available via lorax-composer. To add a new output type to lorax-composer a kickstart file needs to be added to ./share/composer/. The name of the kickstart is what will be used by the /compose/types route, and the compose_type field of the POST to start a compose. It also needs to have -code added to the pylorax.api.compose.compose_args() function. The +code added to the pylorax.api.compose.compose_args() function. The _MAP entry in this function defines what lorax-composer will pass to pylorax.installer.novirt_install() when it runs the compose. When the compose is finished the output files need to be copied out of the build directory (/var/lib/lorax/composer/results/<UUID>/compose/), -pylorax.api.compose.move_compose_results() handles this for each type. +pylorax.api.compose.move_compose_results() handles this for each type. You should move them instead of copying to save space.

    If the new output type does not have support in livemedia-creator it should be added there first. This will make the output available to the widest number of users.

    -
    +

    Example: Add partitioned disk support

    Partitioned disk support is something that livemedia-creator already supports via the --make-disk cmdline argument. To add this to lorax-composer it needs 3 things:

    • A partitioned-disk.ks file in ./share/composer/

    • -
    • A new entry in the _MAP in pylorax.api.compose.compose_args()

    • -
    • Add a bit of code to pylorax.api.compose.move_compose_results() to move the disk image from +

    • A new entry in the _MAP in pylorax.api.compose.compose_args()

    • +
    • Add a bit of code to pylorax.api.compose.move_compose_results() to move the disk image from the compose directory to the results directory.

    The partitioned-disk.ks is pretty similar to the example minimal kickstart @@ -612,9 +632,9 @@ the results directory, or it could do some post-processing on it. The end of the function should always clean up the ./compose/ directory, removing any unneeded extra files. This is especially true for the live-iso since it produces the contents of the iso as well as the boot.iso itself.

    -
    -
    -
    + + +

    Package Sources

    By default lorax-composer uses the host’s configured repositories. It copies the *.repo files from /etc/yum.repos.d/ into @@ -657,7 +677,7 @@ it returns JSON but it can also return TOML if +

    DVD ISO Package Source

    In some situations the system may want to only use a DVD iso as the package source, not the repos from the network. lorax-composer and anaconda @@ -686,38 +706,38 @@ type will not be available.

    mounting the iso and creating a source file to point to it as described in the Package Sources documentation. In that case there is no need to remove the other sources from /etc/yum.repos.d/ or clear the cached repos.

    -
    - - + + + - @@ -726,7 +746,6 @@ sources from /etc/y - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + @@ -60,7 +67,7 @@
    - 28.14.42 + 28.14.59
    @@ -77,6 +84,7 @@ + + @@ -157,18 +167,20 @@ + +
      -
    • Docs »
    • +
    • »
    • Lorax
    • - + View page source @@ -182,7 +194,7 @@
      -
      +

      Lorax

      Authors
      @@ -198,7 +210,7 @@ environment. It is best to run lorax from the same release as is being targeted because the templates may have release specific logic in them. eg. Use the rawhide version to build the boot.iso for rawhide, along with the rawhide repositories.

      -
      +

      lorax cmdline arguments

      Create the Anaconda boot.iso

      @@ -214,27 +226,28 @@ repositories.

      [--add-arch-template-var ADD_ARCH_TEMPLATE_VARS] [--noverify] [--sharedir SHAREDIR] [--enablerepo [repo]] [--disablerepo [repo]] [--rootfs-size ROOTFS_SIZE] - [--noverifyssl] [--skip-branding] [--dracut-arg DRACUT_ARGS] [-V] + [--noverifyssl] [--skip-branding] [--squashfs-only] + [--dracut-arg DRACUT_ARGS] [-V] OUTPUTDIR
      -
      +

      Positional Arguments

      OUTPUTDIR

      Output directory

      -
      -
      + +

      Named Arguments

      -V

      show program’s version number and exit

      -
      -
      + +

      required arguments

      -p, --product
      @@ -255,8 +268,8 @@ repositories.

      Default: []

      -
      -
      + +

      Named Arguments

      -m, --mirrorlist
      @@ -367,18 +380,22 @@ repositories.

      Disable automatic branding package selection. Use –installpkgs to add custom branding.

      Default: False

      +
      --squashfs-only
      +

      Use a plain squashfs filesystem for the runtime.

      +

      Default: False

      +
      -
      -
      + +

      dracut arguments

      --dracut-arg

      Argument to pass to dracut when rebuilding the initramfs. Pass this once for each argument. NOTE: this overrides the default. (default: )

      -
      -
      -
      + + +

      Quickstart

      Run this as root to create a boot.iso in ./results/:

      dnf install lorax
      @@ -394,14 +411,14 @@ repositories.

      override the ones in the distribution repositories.

      Under ./results/ will be the release tree files: .discinfo, .treeinfo, everything that goes onto the boot.iso, the pxeboot directory, and the boot.iso under ./images/.

      -
      -
      +
      +

      Branding

      By default lorax will search for the first package that provides system-release that doesn’t start with generic- and will install it. It then selects a corresponding logo package by using the first part of the system-release package and appending -logos to it. eg. fedora-release and fedora-logos.

      -
      +

      Custom Branding

      If --skip-branding is passed to lorax it will skip selecting the system-release, and logos packages and leave it up to the user to pass any @@ -412,16 +429,16 @@ and fedora-logosNote that this does not prevent something else in the dependency tree from causing these packages to be included. Using --excludepkgs may help if they are unexpectedly included.

      -
      -
      -
      + + +

      Running inside of mock

      If you are using lorax with mock v1.3.4 or later you will need to pass --old-chroot to mock. Mock now defaults to using systemd-nspawn which cannot create the needed loop device nodes. Passing --old-chroot will use the old system where /dev/loop* is setup for you.

      -
      -
      + +

      How it works

      Lorax uses dnf to install packages into a temporary directory, sets up configuration files, it then @@ -435,14 +452,14 @@ supports %if/%endif %> tags and variable substitution with ${}. The default templates are shipped with lorax in /usr/share/lorax/templates.d/99-generic/ and use the .tmpl extension.

      -
      +

      runtime-install.tmpl

      The runtime-install.tmpl template lists packages to be installed using the installpkg command. This template is fairly simple, installing common packages and architecture specific packages. It must end with the run_pkg_transaction command which tells dnf to download and install the packages.

      -
      -
      +
      +

      runtime-postinstall.tmpl

      The runtime-postinstall.tmpl template is where the system configuration happens. The installer environment is similar to a normal running system, but @@ -462,8 +479,8 @@ installation. A number of template commands are used here:

    • symlink creates a symlink

    • systemctl runs systemctl in the installroot

    -
    -
    + +

    runtime-cleanup.tmpl

    The runtime-cleanup.tmpl template is used to remove files that aren’t strictly needed by the installation environment. In addition to the remove template command it uses:

    @@ -477,15 +494,15 @@ remove everything except a select few.

  • removekmod Removes kernel modules

  • -
    -
    + +

    The squashfs filesystem

    After runtime-*.tmpl templates have finished their work lorax creates an empty ext4 filesystem, copies the remaining files to it, and makes a squashfs filesystem of it. This file is the / of the boot.iso’s installer environment and is what is in the LiveOS/squashfs.img file on the iso.

    -
    -
    + +

    iso creation

    The iso creation is handled by another set of templates. The one used depends on the architecture that the iso is being created for. They are also stored in @@ -495,9 +512,9 @@ configuration template files, configuration variable substitution, treeinfo metadata (via the treeinfo template command). Kernel and initrd are copied from the installroot to their final locations and then mkisofs is run to create the boot.iso

    -
    - -
    + + +

    Custom Templates

    The default set of templates and configuration files from the lorax-generic-templates package are shipped in the /usr/share/lorax/templates.d/99-generic/ directory. You can @@ -505,37 +522,37 @@ make a copy of them and place them into another directory under --sharedir to lorax.

    -
    - + + - @@ -544,7 +561,6 @@ should) select the specific template directory by passing jQuery(function () { SphinxRtdTheme.Navigation.enable(true); diff --git a/docs/html/mkksiso.html b/docs/html/mkksiso.html new file mode 100644 index 00000000..cb8a8e29 --- /dev/null +++ b/docs/html/mkksiso.html @@ -0,0 +1,366 @@ + + + + + + + + + + + mkksiso — Lorax 28.14.59 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + + +
    + + + + + +
    + +
    + + + + + + + + + + + + + + + + + + + +
    + + + + +
    +
    +
    +
    + +
    +

    mkksiso

    +
    +
    Authors
    +

    Brian C. Lane <bcl@redhat.com>

    +
    +
    +

    mkksiso is a tool for creating kickstart boot isos. In it’s simplest form +you can add a kickstart to a boot.iso and the kickstart will be executed when +the iso is booted. If the original iso was created with EFI and Mac support the +kickstart boot.iso will include this support as well.

    +

    mkksiso needs to be run as root, it depends on mounting the original iso +and you need to be root to be able to do that.

    +
    +

    mkksiso cmdline arguments

    +

    Add a kickstart and files to an iso

    +
    +

    usage: mkksiso [-h] [-a ADD_PATHS] [-c CMDLINE] [--debug] ks input_iso output_iso

    +
    +
    +

    Optional arguments

    +
    +
    +
    -h, --help
    +

    show this help message and exit

    +
    +
    -a ADD_PATHS, --add ADD_PATHS
    +

    File or directory to add to ISO (may be used multiple +times)

    +
    +
    -c CMDLINE, --cmdline CMDLINE
    +

    Arguments to add to kernel cmdline

    +
    +
    --debug
    +

    print debugging info

    +
    +
    -V VOLID, --volid VOLID
    +

    Set the ISO volume id, defaults to input’s

    +
    +
    +
    +
    +
    +

    Positional arguments

    +
    +
    +
    ks
    +

    Kickstart to add to the ISO

    +
    +
    input_iso
    +

    ISO to modify

    +
    +
    output_iso
    +

    Full pathname of iso to be created

    +
    +
    +
    +
    +
    +
    +

    Create a kickstart boot.iso or DVD

    +

    Create a kickstart like you normally would, kickstart documentation can be +found here, including the +url and repo commands. If you are creating a DVD and only need the +content on the DVD you can use the cdrom command to install without a +network connection. Then run mkksiso like this:

    +
    mkksiso /PATH/TO/KICKSTART /PATH/TO/ISO /PATH/TO/NEW-ISO
    +
    +
    +

    This will create a new iso with the kickstart in the root directory, and the +kernel cmdline will have inst.ks=... added to it so that it will be +executed when the iso is booted (be careful not to boot on a system you don’t +want to wipe out! There will be no prompting).

    +

    By default the volume id of the iso is preserved. You can set a custom volid +by passing -V and the string to set. The kernel cmdline will be changes, and the iso will have th custom volume id. +eg.:

    +
    mkksiso -V "Test Only" /PATH/TO/KICKSTART /PATH/TO/ISO /PATH/TO/NEW-ISO
    +
    +
    +
    +
    +

    Adding package repos to a boot.iso

    +

    You can add repo directories to the iso using --add /PATH/TO/REPO/, make +sure it contains the repodata directory by running createrepo_c on it +first. In the kickstart you can refer to the directories (and files) on the iso +using file:///run/install/repo/DIRECTORY/. You can then use these repos in +the kickstart like this:

    +
    repo --name=extra-repo --baseurl=file:///run/install/repo/extra-repo/
    +
    +
    +

    Run mkksiso like so:

    +
    mkksiso --add /PATH/TO/REPO/ /PATH/TO/KICKSTART /PATH/TO/ISO /PATH/TO/NEW-ISO
    +
    +
    +
    +
    +

    Create a liveimg boot.iso

    +

    You can use the kickstart liveimg command, +to install a pre-generated disk image or tar to the system the iso is booting +on.

    +

    Create a disk image or tar with osbuild-composer or livemedia-creator, +make sure the image includes tools expected by anaconda, as well as the +kernel and bootloader support. In osbuild-composer use the tar image +type and make sure to include the kernel, grub2, and grub2-tools +packages. If you plan to install it to a UEFI machine make sure to include +grub2-efi and efibootmgr in the blueprint.

    +

    Add the root.tar.xz file to the iso using --add /PATH/TO/ROOT.TAR.XZ, +and in the kickstart reference it with the liveimg command like this:

    +
    liveimg --url=file:///run/install/repo/root.tar.xz
    +
    +
    +

    It is also a good idea to use the --checksum argument to liveimg to be +sure the file hasn’t been corrupted:

    +
    mkksiso --add /PATH/TO/root.tar.xz /PATH/TO/KICKSTART /PATH/TO/ISO /PATH/TO/NEW-ISO
    +
    +
    +

    When this iso is booted it will execute the kickstart and install the liveimg +contents to the system without any prompting.

    +
    +
    +

    How it works

    +

    mkksiso first examines the system to make sure the tools it needs are installed, +it will work with xorrisofs or mkisofs installed. It mounts the source iso, +and copies the directories that need to be modified to a temporary directory.

    +

    It then modifies the boot configuration files to include the inst.ks command, +and checks to see if the original iso supports EFI. If it does it regenerates the +EFI boot images with the new configuration, and then runs the available iso creation +tool to add the new files and directories to the new iso. If the architecture is +x86_64 it will also make sure the iso can be booted as an iso or from a USB +stick (hybridiso).

    +

    The last step is to update the iso checksums so that booting with test enabled +will pass.

    +
    +
    + + +
    + +
    + +
    +
    + +
    + +
    + + + + + + + + + + + \ No newline at end of file diff --git a/docs/html/modules.html b/docs/html/modules.html index 541af097..d6ac3420 100644 --- a/docs/html/modules.html +++ b/docs/html/modules.html @@ -1,38 +1,45 @@ - - + - - - - - pylorax — Lorax 28.14.42 documentation - + + + + pylorax — Lorax 28.14.59 documentation - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + @@ -60,7 +67,7 @@
    - 28.14.42 + 28.14.59
    @@ -77,6 +84,7 @@ + + @@ -135,18 +145,20 @@ + +
    @@ -246,7 +258,6 @@ - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + @@ -60,7 +67,7 @@
    - 28.14.42 + 28.14.59
    @@ -77,6 +84,7 @@ + + @@ -132,18 +142,20 @@ + +
      -
    • Docs »
    • +
    • »
    • Product and Updates Images
    • - + View page source @@ -157,7 +169,7 @@
      -
      +

      Product and Updates Images

      Lorax now supports creation of product.img and updates.img as part of the build process. This is implemented using the installimg template command which will @@ -179,36 +191,36 @@ you would put your custom class here:

      If the packages containing the product/updates files are not included as part of normal dependencies you can add specific packages with the --installpkgs command or the installpkgs paramater of pylorax.treebuilder.RuntimeBuilder

      -
      +
      -
    @@ -217,7 +229,6 @@ command or the installpkgs paramater of jQuery(function () { SphinxRtdTheme.Navigation.enable(true); diff --git a/docs/html/py-modindex.html b/docs/html/py-modindex.html index 26451e7f..cfc73045 100644 --- a/docs/html/py-modindex.html +++ b/docs/html/py-modindex.html @@ -1,38 +1,44 @@ - - + - + - + - Python Module Index — Lorax 28.14.42 documentation + Python Module Index — Lorax 28.14.59 documentation - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + @@ -61,7 +67,7 @@
    - 28.14.42 + 28.14.59
    @@ -78,6 +84,7 @@ +
    + @@ -133,11 +142,13 @@ + +
      -
    • Docs »
    • +
    • »
    • Python Module Index
    • @@ -323,20 +334,25 @@
    - @@ -345,7 +361,6 @@ - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + @@ -59,7 +66,7 @@
    - 28.14.42 + 28.14.59
    @@ -76,6 +83,7 @@ + + @@ -160,11 +170,13 @@ + +
      -
    • Docs »
    • +
    • »
    • pylorax »
    • @@ -175,7 +187,7 @@
    • - + View page source @@ -189,24 +201,24 @@
      -
      +

      pylorax.api package

      -
      +

      Submodules

      -
      -
      +
      +

      pylorax.api.cmdline module

      -
      -
      -pylorax.api.cmdline.lorax_composer_parser()[source]
      +
      +
      +pylorax.api.cmdline.lorax_composer_parser()[source]

      Return the ArgumentParser for lorax-composer

      -
      -
      + +

      pylorax.api.compose module

      Setup for composing an image

      -
      +

      Adding New Output Types

      The new output type must add a kickstart template to ./share/composer/ where the name of the kickstart (without the trailing .ks) matches the entry in compose_args.

      @@ -216,9 +228,9 @@ packages required by the output type, it should not have the trailing %end becau package NEVRAs will be appended to it at build time.

      compose_args should have a name matching the kickstart, and it should set the novirt_install parameters needed to generate the desired output. Other types should be set to False.

      -
      -
      -pylorax.api.compose.add_customizations(f, recipe)[source]
      +
      +
      +pylorax.api.compose.add_customizations(f, recipe)[source]

      Add customizations to the kickstart file

      Parameters
      @@ -236,15 +248,15 @@ parameters needed to generate the desired output. Other types should be set to F
      -
      -
      -pylorax.api.compose.bootloader_append(line, kernel_append)[source]
      +
      +
      +pylorax.api.compose.bootloader_append(line, kernel_append)[source]

      Insert the kernel_append string into the –append argument

      Parameters
        -
      • line (str) – The bootloader … line

      • -
      • kernel_append (str) – The arguments to append to the –append section

      • +
      • line (str) – The bootloader … line

      • +
      • kernel_append (str) – The arguments to append to the –append section

      @@ -252,13 +264,13 @@ parameters needed to generate the desired output. Other types should be set to F is parsed correctly, and re-assembled for inclusion into the final kickstart

      -
      -
      -pylorax.api.compose.compose_args(compose_type)[source]
      +
      +
      +pylorax.api.compose.compose_args(compose_type)[source]

      Returns the settings to pass to novirt_install for the compose type

      Parameters
      -

      compose_type (str) – The type of compose to create, from compose_types()

      +

      compose_type (str) – The type of compose to create, from compose_types()

      This will return a dict of options that match the ArgumentParser options for livemedia-creator. @@ -266,23 +278,23 @@ These are the ones the define the type of output, it’s filename, etc. Other options will be filled in by make_compose()

      -
      -
      -pylorax.api.compose.compose_types(share_dir)[source]
      +
      +
      +pylorax.api.compose.compose_types(share_dir)[source]

      Returns a list of tuples of the supported output types, and their state

      The output types come from the kickstart names in /usr/share/lorax/composer/*ks

      If they are disabled on the current arch their state is False. If enabled, it is True. eg. [(“alibaba”, False), (“ext4-filesystem”, True), …]

      -
      -
      -pylorax.api.compose.customize_ks_template(ks_template, recipe)[source]
      +
      +
      +pylorax.api.compose.customize_ks_template(ks_template, recipe)[source]

      Customize the kickstart template and return it

      Parameters
        -
      • ks_template (str) – The kickstart template

      • +
      • ks_template (str) – The kickstart template

      • recipe (Recipe object) –

      @@ -294,15 +306,15 @@ Add bootloader line if it is missing.

      Add default timezone if needed. It does NOT replace an existing timezone entry

      -
      -
      -pylorax.api.compose.firewall_cmd(line, settings)[source]
      +
      +
      +pylorax.api.compose.firewall_cmd(line, settings)[source]

      Update the firewall line with the new ports and services

      Parameters
        -
      • line (str) – The firewall … line

      • -
      • settings (dict) – A dict with the list of services and ports to enable and disable

      • +
      • line (str) – The firewall … line

      • +
      • settings (dict) – A dict with the list of services and ports to enable and disable

      @@ -310,9 +322,9 @@ Add bootloader line if it is missing.

      is parsed correctly, and re-assembled for inclusion into the final kickstart

      -
      -
      -pylorax.api.compose.get_default_services(recipe)[source]
      +
      +
      +pylorax.api.compose.get_default_services(recipe)[source]

      Get the default string for services, based on recipe :param recipe: The recipe

      @@ -320,7 +332,7 @@ is parsed correctly, and re-assembled for inclusion into the final kickstart

      string with “services” or “”

      Return type
      -

      str

      +

      str

      When no services have been selected we don’t need to add anything to the kickstart @@ -328,23 +340,23 @@ so return an empty string. Otherwise return “services” which will be updated the settings.

      -
      -
      -pylorax.api.compose.get_extra_pkgs(dbo, share_dir, compose_type)[source]
      +
      +
      +pylorax.api.compose.get_extra_pkgs(dbo, share_dir, compose_type)[source]

      Return extra packages needed for the output type

      Parameters
      • dbo (dnf.Base) – dnf base object

      • -
      • share_dir (str) – Path to the top level share directory

      • -
      • compose_type (str) – The type of output to create from the recipe

      • +
      • share_dir (str) – Path to the top level share directory

      • +
      • compose_type (str) – The type of output to create from the recipe

      Returns

      List of package names (name only, not NEVRA)

      Return type
      -

      list

      +

      list

      Currently this is only needed by live-iso, it reads ./live/live-install.tmpl and @@ -354,9 +366,9 @@ iso using the templates such as x86.tmpl

      even though the results are applied differently.

      -
      -
      -pylorax.api.compose.get_firewall_settings(recipe)[source]
      +
      +
      +pylorax.api.compose.get_firewall_settings(recipe)[source]

      Return the customizations.firewall settings

      Parameters
      @@ -366,14 +378,14 @@ even though the results are applied differently.

      A dict of settings

      Return type
      -

      dict

      +

      dict

      -
      -
      -pylorax.api.compose.get_kernel_append(recipe)[source]
      +
      +
      +pylorax.api.compose.get_kernel_append(recipe)[source]

      Return the customizations.kernel append value

      Parameters
      @@ -383,14 +395,14 @@ even though the results are applied differently.

      append value or empty string

      Return type
      -

      str

      +

      str

      -
      -
      -pylorax.api.compose.get_keyboard_layout(recipe)[source]
      +
      +
      +pylorax.api.compose.get_keyboard_layout(recipe)[source]

      Return the customizations.locale.keyboard list

      Parameters
      @@ -400,14 +412,14 @@ even though the results are applied differently.

      The keyboard layout string

      Return type
      -

      str

      +

      str

      -
      -
      -pylorax.api.compose.get_languages(recipe)[source]
      +
      +
      +pylorax.api.compose.get_languages(recipe)[source]

      Return the customizations.locale.languages list

      Parameters
      @@ -417,14 +429,14 @@ even though the results are applied differently.

      list of language strings

      Return type
      -

      list

      +

      list

      -
      -
      -pylorax.api.compose.get_services(recipe)[source]
      +
      +
      +pylorax.api.compose.get_services(recipe)[source]

      Return the customizations.services settings

      Parameters
      @@ -434,14 +446,14 @@ even though the results are applied differently.

      A dict of settings

      Return type
      -

      dict

      +

      dict

      -
      -
      -pylorax.api.compose.get_timezone_settings(recipe)[source]
      +
      +
      +pylorax.api.compose.get_timezone_settings(recipe)[source]

      Return the customizations.timezone dict

      Parameters
      @@ -451,20 +463,20 @@ even though the results are applied differently.

      append value or empty string

      Return type
      -

      dict

      +

      dict

      -
      -
      -pylorax.api.compose.keyboard_cmd(line, layout)[source]
      +
      +
      +pylorax.api.compose.keyboard_cmd(line, layout)[source]

      Update the keyboard line with the layout

      Parameters
        -
      • line (str) – The keyboard … line

      • -
      • settings (str) – The keyboard layout

      • +
      • line (str) – The keyboard … line

      • +
      • settings (str) – The keyboard layout

      @@ -472,15 +484,15 @@ even though the results are applied differently.

      is parsed correctly, and re-assembled for inclusion into the final kickstart

      -
      -
      -pylorax.api.compose.lang_cmd(line, languages)[source]
      +
      +
      +pylorax.api.compose.lang_cmd(line, languages)[source]

      Update the lang line with the languages

      Parameters
        -
      • line (str) – The lang … line

      • -
      • settings (list) – The list of languages

      • +
      • line (str) – The lang … line

      • +
      • settings (list) – The list of languages

      @@ -488,23 +500,23 @@ is parsed correctly, and re-assembled for inclusion into the final kickstart

      is parsed correctly, and re-assembled for inclusion into the final kickstart

      -
      -
      -pylorax.api.compose.move_compose_results(cfg, results_dir)[source]
      +
      +
      +pylorax.api.compose.move_compose_results(cfg, results_dir)[source]

      Move the final image to the results_dir and cleanup the unneeded compose files

      Parameters
      • cfg (DataHolder) – Build configuration

      • -
      • results_dir (str) – Directory to put the results into

      • +
      • results_dir (str) – Directory to put the results into

      -
      -
      -pylorax.api.compose.repo_to_ks(r, url='url')[source]
      +
      +
      +pylorax.api.compose.repo_to_ks(r, url='url')[source]

      Return a kickstart line with the correct args. :param r: DNF repository information :type r: dnf.Repo @@ -515,15 +527,15 @@ is parsed correctly, and re-assembled for inclusion into the final kickstart

      Set url to “baseurl” if it is a repo, leave it as “url” for the installation url.

      -
      -
      -pylorax.api.compose.services_cmd(line, settings)[source]
      +
      +
      +pylorax.api.compose.services_cmd(line, settings)[source]

      Update the services line with additional services to enable/disable

      Parameters
        -
      • line (str) – The services … line

      • -
      • settings (dict) – A dict with the list of services to enable and disable

      • +
      • line (str) – The services … line

      • +
      • settings (dict) – A dict with the list of services to enable and disable

      @@ -531,31 +543,31 @@ is parsed correctly, and re-assembled for inclusion into the final kickstart

      is parsed correctly, and re-assembled for inclusion into the final kickstart

      -
      -
      -pylorax.api.compose.start_build(cfg, dnflock, gitlock, branch, recipe_name, compose_type, test_mode=0)[source]
      +
      +
      +pylorax.api.compose.start_build(cfg, dnflock, gitlock, branch, recipe_name, compose_type, test_mode=0)[source]

      Start the build

      Parameters
      • cfg (ComposerConfig) – Configuration object

      • dnflock (YumLock) – Lock and YumBase for depsolving

      • -
      • recipe (str) – The recipe to build

      • -
      • compose_type (str) – The type of output to create from the recipe

      • +
      • recipe (str) – The recipe to build

      • +
      • compose_type (str) – The type of output to create from the recipe

      Returns

      Unique ID for the build that can be used to track its status

      Return type
      -

      str

      +

      str

      -
      -
      -pylorax.api.compose.test_templates(dbo, share_dir)[source]
      +
      +
      +pylorax.api.compose.test_templates(dbo, share_dir)[source]

      Try depsolving each of the the templates and report any errors

      Parameters
      @@ -571,15 +583,15 @@ is parsed correctly, and re-assembled for inclusion into the final kickstart

      Return a list of templates and errors encountered or an empty list

      -
      -
      -pylorax.api.compose.timezone_cmd(line, settings)[source]
      +
      +
      +pylorax.api.compose.timezone_cmd(line, settings)[source]

      Update the timezone line with the settings

      Parameters
        -
      • line (str) – The timezone … line

      • -
      • settings (dict) – A dict with timezone and/or ntpservers list

      • +
      • line (str) – The timezone … line

      • +
      • settings (dict) – A dict with timezone and/or ntpservers list

      @@ -587,9 +599,9 @@ is parsed correctly, and re-assembled for inclusion into the final kickstart

      is parsed correctly, and re-assembled for inclusion into the final kickstart

      -
      -
      -pylorax.api.compose.write_ks_group(f, group)[source]
      +
      +
      +pylorax.api.compose.write_ks_group(f, group)[source]

      Write kickstart group entry

      Parameters
      @@ -602,22 +614,22 @@ is parsed correctly, and re-assembled for inclusion into the final kickstart

      gid is optional

      -
      -
      -pylorax.api.compose.write_ks_root(f, user)[source]
      +
      +
      +pylorax.api.compose.write_ks_root(f, user)[source]

      Write kickstart root password and sshkey entry

      Parameters
      • f (open file object) – kickstart file object

      • -
      • user (dict) – A blueprint user dictionary

      • +
      • user (dict) – A blueprint user dictionary

      Returns

      True if it wrote a rootpw command to the kickstart

      Return type
      -

      bool

      +

      bool

      If the entry contains a ssh key, use sshkey to write it @@ -626,15 +638,15 @@ If it contains password, use rootpw to set it

      for root.

      -
      -
      -pylorax.api.compose.write_ks_user(f, user)[source]
      +
      +
      +pylorax.api.compose.write_ks_user(f, user)[source]

      Write kickstart user and sshkey entry

      Parameters
      • f (open file object) – kickstart file object

      • -
      • user (dict) – A blueprint user dictionary

      • +
      • user (dict) – A blueprint user dictionary

      @@ -643,39 +655,39 @@ All of the user fields are optional, except name, write out a kickstart user ent with whatever options are relevant.

      -
      -
      -
      + + +

      pylorax.api.config module

      -
      -
      -class pylorax.api.config.ComposerConfig(*args, **kwargs)[source]
      +
      +
      +class pylorax.api.config.ComposerConfig(*args, **kwargs)[source]

      Bases: configparser.SafeConfigParser

      -
      -
      -get_default(section, option, default)[source]
      +
      +
      +get_default(section, option, default)[source]
      -
      -
      -pylorax.api.config.configure(conf_file='/etc/lorax/composer.conf', root_dir='/', test_config=False)[source]
      +
      +
      +pylorax.api.config.configure(conf_file='/etc/lorax/composer.conf', root_dir='/', test_config=False)[source]

      lorax-composer configuration

      Parameters
        -
      • conf_file (str) – Path to the config file overriding the default settings

      • -
      • root_dir (str) – Directory to prepend to paths, defaults to /

      • -
      • test_config (bool) – Set to True to skip reading conf_file

      • +
      • conf_file (str) – Path to the config file overriding the default settings

      • +
      • root_dir (str) – Directory to prepend to paths, defaults to /

      • +
      • test_config (bool) – Set to True to skip reading conf_file

      -
      -
      -pylorax.api.config.make_dnf_dirs(conf)[source]
      +
      +
      +pylorax.api.config.make_dnf_dirs(conf)[source]

      Make any missing dnf directories

      Parameters
      @@ -687,15 +699,15 @@ with whatever options are relevant.

      -
      -
      -pylorax.api.config.make_queue_dirs(conf, gid)[source]
      +
      +
      +pylorax.api.config.make_queue_dirs(conf, gid)[source]

      Make any missing queue directories

      Parameters
      • conf (ComposerConfig) – The configuration to use

      • -
      • gid (int) – Group ID that has access to the queue directories

      • +
      • gid (int) – Group ID that has access to the queue directories

      Returns
      @@ -707,68 +719,68 @@ with whatever options are relevant.

      -
      -
      + +

      pylorax.api.crossdomain module

      -
      -
      -pylorax.api.crossdomain.crossdomain(origin, methods=None, headers=None, max_age=21600, attach_to_all=True, automatic_options=True)[source]
      +
      +
      +pylorax.api.crossdomain.crossdomain(origin, methods=None, headers=None, max_age=21600, attach_to_all=True, automatic_options=True)[source]
      -
      -
      + +

      pylorax.api.dnfbase module

      -
      -
      + +

      pylorax.api.projects module

      -
      -
      -exception pylorax.api.projects.ProjectsError[source]
      -

      Bases: Exception

      +
      +
      +exception pylorax.api.projects.ProjectsError[source]
      +

      Bases: Exception

      -
      -
      -pylorax.api.projects.api_changelog(changelog)[source]
      +
      +
      +pylorax.api.projects.api_changelog(changelog)[source]

      Convert the changelog to a string

      Parameters
      -

      changelog (tuple) – A list of time, author, string tuples.

      +

      changelog (tuple) – A list of time, author, string tuples.

      Returns

      The most recent changelog text or “”

      Return type
      -

      str

      +

      str

      This returns only the most recent changelog entry.

      -
      -
      -pylorax.api.projects.api_time(t)[source]
      +
      +
      +pylorax.api.projects.api_time(t)[source]

      Convert time since epoch to a string

      Parameters
      -

      t (int) – Seconds since epoch

      +

      t (int) – Seconds since epoch

      Returns

      Time string

      Return type
      -

      str

      +

      str

      -
      -
      -pylorax.api.projects.delete_repo_source(source_glob, source_name)[source]
      +
      +
      +pylorax.api.projects.delete_repo_source(source_glob, source_name)[source]

      Delete a source from a repo file

      Parameters
      -

      source_glob (str) – A glob of the repo sources to search

      +

      source_glob (str) – A glob of the repo sources to search

      Returns

      None

      @@ -783,32 +795,32 @@ If it is the last one in the file, delete the file.

      source_name isn’t passed to it.

      -
      -
      -pylorax.api.projects.dep_evra(dep)[source]
      +
      +
      +pylorax.api.projects.dep_evra(dep)[source]

      Return the epoch:version-release.arch for the dep

      Parameters
      -

      dep (dict) – dependency dict

      +

      dep (dict) – dependency dict

      Returns

      epoch:version-release.arch

      Return type
      -

      str

      +

      str

      -
      -
      -pylorax.api.projects.dep_nevra(dep)[source]
      +
      +
      +pylorax.api.projects.dep_nevra(dep)[source]

      Return the name-epoch:version-release.arch

      -
      -
      -pylorax.api.projects.dnf_repo_to_file_repo(repo)[source]
      +
      +
      +pylorax.api.projects.dnf_repo_to_file_repo(repo)[source]

      Return a string representation of a DNF Repo object suitable for writing to a .repo file

      Parameters
      @@ -818,7 +830,7 @@ source_name isn’t passed to it.

      A string

      Return type
      -

      str

      +

      str

      The DNF Repo.dump() function does not produce a string that can be used as a dnf .repo file, @@ -826,22 +838,22 @@ it ouputs baseurl and gpgkey as python lists which DNF cannot read. So do this m only the attributes we care about.

      -
      -
      -pylorax.api.projects.estimate_size(packages, block_size=6144)[source]
      +
      +
      +pylorax.api.projects.estimate_size(packages, block_size=6144)[source]

      Estimate the installed size of a package list

      Parameters
      • packages (list of hawkey.Package objects) – The packages to be installed

      • -
      • block_size (int) – The block size to use for rounding up file sizes.

      • +
      • block_size (int) – The block size to use for rounding up file sizes.

      Returns

      The estimated size of installed packages

      Return type
      -

      int

      +

      int

      Estimating actual requirements is difficult without the actual file sizes, which @@ -849,13 +861,13 @@ dnf doesn’t provide access to. So use the file count and block size to estimat a minimum size for each package.

      -
      -
      -pylorax.api.projects.get_repo_sources(source_glob)[source]
      +
      +
      +pylorax.api.projects.get_repo_sources(source_glob)[source]

      Return a list of sources from a directory of yum repositories

      Parameters
      -

      source_glob (str) – A glob to use to match the source files, including full path

      +

      source_glob (str) – A glob to use to match the source files, including full path

      Returns

      A list of the source ids in all of the matching files

      @@ -866,13 +878,13 @@ a minimum size for each package.

      -
      -
      -pylorax.api.projects.get_source_ids(source_path)[source]
      +
      +
      +pylorax.api.projects.get_source_ids(source_path)[source]

      Return a list of the source ids in a file

      Parameters
      -

      source_path (str) – Full path and filename of the source (yum repo) file

      +

      source_path (str) – Full path and filename of the source (yum repo) file

      Returns

      A list of source id strings

      @@ -883,15 +895,15 @@ a minimum size for each package.

      -
      -
      -pylorax.api.projects.modules_info(dbo, module_names)[source]
      +
      +
      +pylorax.api.projects.modules_info(dbo, module_names)[source]

      Return details about a module, including dependencies

      Parameters
      • dbo (dnf.Base) – dnf base object

      • -
      • module_names (str) – Names of the modules to get info about

      • +
      • module_names (str) – Names of the modules to get info about

      Returns
      @@ -903,16 +915,16 @@ a minimum size for each package.

      -
      -
      -pylorax.api.projects.modules_list(dbo, module_names)[source]
      +
      +
      +pylorax.api.projects.modules_list(dbo, module_names)[source]

      Return a list of modules

      Parameters
      • dbo (dnf.Base) – dnf base object

      • offset – Number of modules to skip

      • -
      • limit (int) – Maximum number of modules to return

      • +
      • limit (int) – Maximum number of modules to return

      Returns
      @@ -926,9 +938,9 @@ a minimum size for each package.

      and sets the type to “rpm”

      -
      -
      -pylorax.api.projects.pkg_to_build(pkg)[source]
      +
      +
      +pylorax.api.projects.pkg_to_build(pkg)[source]

      Extract the build details from a hawkey.Package object

      Parameters
      @@ -938,16 +950,16 @@ and sets the type to “rpm”

      A dict with the build details, epoch, release, arch, build_time, changelog, …

      Return type
      -

      dict

      +

      dict

      metadata entries are hard-coded to {}

      Note that this only returns the build dict, it does not include the name, description, etc.

      -
      -
      -pylorax.api.projects.pkg_to_dep(pkg)[source]
      +
      +
      +pylorax.api.projects.pkg_to_dep(pkg)[source]

      Extract the info from a hawkey.Package object

      Parameters
      @@ -957,14 +969,14 @@ and sets the type to “rpm”

      A dict with name, epoch, version, release, arch

      Return type
      -

      dict

      +

      dict

      -
      -
      -pylorax.api.projects.pkg_to_project(pkg)[source]
      +
      +
      +pylorax.api.projects.pkg_to_project(pkg)[source]

      Extract the details from a hawkey.Package object

      Parameters
      @@ -974,15 +986,15 @@ and sets the type to “rpm”

      A dict with the name, summary, description, and url.

      Return type
      -

      dict

      +

      dict

      upstream_vcs is hard-coded to UPSTREAM_VCS

      -
      -
      -pylorax.api.projects.pkg_to_project_info(pkg)[source]
      +
      +
      +pylorax.api.projects.pkg_to_project_info(pkg)[source]

      Extract the details from a hawkey.Package object

      Parameters
      @@ -992,33 +1004,33 @@ and sets the type to “rpm”

      A dict with the project details, as well as epoch, release, arch, build_time, changelog, …

      Return type
      -

      dict

      +

      dict

      metadata entries are hard-coded to {}

      -
      -
      -pylorax.api.projects.proj_to_module(proj)[source]
      +
      +
      +pylorax.api.projects.proj_to_module(proj)[source]

      Extract the name from a project_info dict

      Parameters
      -

      pkg (dict) – dict with package details

      +

      pkg (dict) – dict with package details

      Returns

      A dict with name, and group_type

      Return type
      -

      dict

      +

      dict

      group_type is hard-coded to “rpm”

      -
      -
      -pylorax.api.projects.projects_depsolve(dbo, projects, groups)[source]
      +
      +
      +pylorax.api.projects.projects_depsolve(dbo, projects, groups)[source]

      Return the dependencies for a list of projects

      Parameters
      @@ -1040,9 +1052,9 @@ and sets the type to “rpm”

      -
      -
      -pylorax.api.projects.projects_depsolve_with_size(dbo, projects, groups, with_core=True)[source]
      +
      +
      +pylorax.api.projects.projects_depsolve_with_size(dbo, projects, groups, with_core=True)[source]

      Return the dependencies and installed size for a list of projects

      Parameters
      @@ -1056,7 +1068,7 @@ and sets the type to “rpm”

      installed size and a list of NEVRA’s of the project and its dependencies

      Return type
      -

      tuple of (int, list of dicts)

      +

      tuple of (int, list of dicts)

      Raises

      ProjectsError if there was a problem installing something

      @@ -1064,15 +1076,15 @@ and sets the type to “rpm”

      -
      -
      -pylorax.api.projects.projects_info(dbo, project_names)[source]
      +
      +
      +pylorax.api.projects.projects_info(dbo, project_names)[source]

      Return details about specific projects

      Parameters
      • dbo (dnf.Base) – dnf base object

      • -
      • project_names (str) – List of names of projects to get info about

      • +
      • project_names (str) – List of names of projects to get info about

      Returns
      @@ -1085,9 +1097,9 @@ and sets the type to “rpm”

      If project_names is None it will return the full list of available packages

      -
      -
      -pylorax.api.projects.projects_list(dbo)[source]
      +
      +
      +pylorax.api.projects.projects_list(dbo)[source]

      Return a list of projects

      Parameters
      @@ -1102,22 +1114,22 @@ and sets the type to “rpm”

      -
      -
      -pylorax.api.projects.repo_to_source(repo, system_source)[source]
      +
      +
      +pylorax.api.projects.repo_to_source(repo, system_source)[source]

      Return a Weldr Source dict created from the DNF Repository

      Parameters
      • repo (dnf.RepoDict) – DNF Repository

      • -
      • system_source (bool) – True if this source is an immutable system source

      • +
      • system_source (bool) – True if this source is an immutable system source

      Returns

      A dict with Weldr Source fields filled in

      Return type
      -

      dict

      +

      dict

      Example:

      @@ -1137,13 +1149,13 @@ and sets the type to “rpm”

      -
      -
      -pylorax.api.projects.source_to_repo(source, dnf_conf)[source]
      +
      +
      +pylorax.api.projects.source_to_repo(source, dnf_conf)[source]

      Return a dnf Repo object created from a source dict

      Parameters
      -

      source (dict) – A Weldr source dict

      +

      source (dict) – A Weldr source dict

      Returns

      A dnf Repo object

      @@ -1169,19 +1181,19 @@ and sets the type to “rpm”

      -
      -
      + +

      pylorax.api.queue module

      Functions to monitor compose queue and run anaconda

      -
      -
      -pylorax.api.queue.build_status(cfg, status_filter=None)[source]
      +
      +
      +pylorax.api.queue.build_status(cfg, status_filter=None)[source]

      Return the details of finished or failed builds

      Parameters
      • cfg (ComposerConfig) – Configuration settings

      • -
      • status_filter (str) – What builds to return. None == all, “FINISHED”, or “FAILED”

      • +
      • status_filter (str) – What builds to return. None == all, “FINISHED”, or “FAILED”

      Returns
      @@ -1196,9 +1208,9 @@ system. It does not return the status of builds that have not been finished. Use queue_status() for those.

      -
      -
      -pylorax.api.queue.check_queues(cfg)[source]
      +
      +
      +pylorax.api.queue.check_queues(cfg)[source]

      Check to make sure the new and run queue symlinks are correct

      Parameters
      @@ -1209,19 +1221,19 @@ Use queue_status() for those.

      set in STATUS have a symlink in queue/new/

      -
      -
      -pylorax.api.queue.compose_detail(results_dir)[source]
      +
      +
      +pylorax.api.queue.compose_detail(results_dir)[source]

      Return details about the build.

      Parameters
      -

      results_dir (str) – The directory containing the metadata and results for the build

      +

      results_dir (str) – The directory containing the metadata and results for the build

      Returns

      A dictionary with details about the compose

      Return type
      -

      dict

      +

      dict

      Raises

      IOError if it cannot read the directory, STATUS, or blueprint file.

      @@ -1246,19 +1258,19 @@ None in Python (or null in JSON). The following timestamps are included:

    -
    -
    -pylorax.api.queue.get_compose_type(results_dir)[source]
    +
    +
    +pylorax.api.queue.get_compose_type(results_dir)[source]

    Return the type of composition.

    Parameters
    -

    results_dir (str) – The directory containing the metadata and results for the build

    +

    results_dir (str) – The directory containing the metadata and results for the build

    Returns

    The type of compose (eg. ‘tar’)

    Return type
    -

    str

    +

    str

    Raises

    RuntimeError if no kickstart template can be found.

    @@ -1266,13 +1278,13 @@ None in Python (or null in JSON). The following timestamps are included:

    -
    -
    -pylorax.api.queue.get_image_name(uuid_dir)[source]
    +
    +
    +pylorax.api.queue.get_image_name(uuid_dir)[source]

    Return the filename and full path of the build’s image file

    Parameters
    -

    uuid (str) – The UUID of the build

    +

    uuid (str) – The UUID of the build

    Returns

    The image filename and full path

    @@ -1286,15 +1298,15 @@ None in Python (or null in JSON). The following timestamps are included:

    -
    -
    -pylorax.api.queue.make_compose(cfg, results_dir)[source]
    +
    +
    +pylorax.api.queue.make_compose(cfg, results_dir)[source]

    Run anaconda with the final-kickstart.ks from results_dir

    Parameters
    • cfg (DataHolder) – Configuration settings

    • -
    • results_dir (str) – The directory containing the metadata and results for the build

    • +
    • results_dir (str) – The directory containing the metadata and results for the build

    Returns
    @@ -1312,9 +1324,9 @@ moved into logs/anaconda/ and their ownership will be set to the user from the c object.

    -
    -
    -pylorax.api.queue.monitor(cfg)[source]
    +
    +
    +pylorax.api.queue.monitor(cfg)[source]

    Monitor the queue for new compose requests

    Parameters
    @@ -1334,9 +1346,9 @@ will be created in the results directory.

    from ./queue/run/ to ./queue/new/ and rerun them.

    -
    -
    -pylorax.api.queue.queue_status(cfg)[source]
    +
    +
    +pylorax.api.queue.queue_status(cfg)[source]

    Return details about what is in the queue.

    Parameters
    @@ -1346,23 +1358,23 @@ from ./queue/run/ to ./queue/new/ and rerun them.

    A list of the new composes, and a list of the running composes

    Return type
    -

    dict

    +

    dict

    This returns a dict with 2 lists. “new” is the list of uuids that are waiting to be built, and “run” has the uuids that are being built (currently limited to 1 at a time).

    -
    -
    -pylorax.api.queue.start_queue_monitor(cfg, uid, gid)[source]
    +
    +
    +pylorax.api.queue.start_queue_monitor(cfg, uid, gid)[source]

    Start the queue monitor as a mp process

    Parameters
    • cfg (ComposerConfig) – Configuration settings

    • -
    • uid (int) – User ID that owns the queue

    • -
    • gid (int) – Group ID that owns the queue

    • +
    • uid (int) – User ID that owns the queue

    • +
    • gid (int) – Group ID that owns the queue

    Returns
    @@ -1371,43 +1383,43 @@ and “run” has the uuids that are being built (currently limited to 1 at a ti
    -
    -
    -pylorax.api.queue.uuid_cancel(cfg, uuid)[source]
    +
    +
    +pylorax.api.queue.uuid_cancel(cfg, uuid)[source]

    Cancel a build and delete its results

    Parameters
    • cfg (ComposerConfig) – Configuration settings

    • -
    • uuid (str) – The UUID of the build

    • +
    • uuid (str) – The UUID of the build

    Returns

    True if it was canceled and deleted

    Return type
    -

    bool

    +

    bool

    Only call this if the build status is WAITING or RUNNING

    -
    -
    -pylorax.api.queue.uuid_delete(cfg, uuid)[source]
    +
    +
    +pylorax.api.queue.uuid_delete(cfg, uuid)[source]

    Delete all of the results from a compose

    Parameters
    • cfg (ComposerConfig) – Configuration settings

    • -
    • uuid (str) – The UUID of the build

    • +
    • uuid (str) – The UUID of the build

    Returns

    True if it was deleted

    Return type
    -

    bool

    +

    bool

    Raises

    This will raise an error if the delete failed

    @@ -1415,15 +1427,15 @@ and “run” has the uuids that are being built (currently limited to 1 at a ti
    -
    -
    -pylorax.api.queue.uuid_image(cfg, uuid)[source]
    +
    +
    +pylorax.api.queue.uuid_image(cfg, uuid)[source]

    Return the filename and full path of the build’s image file

    Parameters
    • cfg (ComposerConfig) – Configuration settings

    • -
    • uuid (str) – The UUID of the build

    • +
    • uuid (str) – The UUID of the build

    Returns
    @@ -1438,22 +1450,22 @@ and “run” has the uuids that are being built (currently limited to 1 at a ti
    -
    -
    -pylorax.api.queue.uuid_info(cfg, uuid)[source]
    +
    +
    +pylorax.api.queue.uuid_info(cfg, uuid)[source]

    Return information about the composition

    Parameters
    • cfg (ComposerConfig) – Configuration settings

    • -
    • uuid (str) – The UUID of the build

    • +
    • uuid (str) – The UUID of the build

    Returns

    dictionary of information about the composition or None

    Return type
    -

    dict

    +

    dict

    Raises

    RuntimeError if there was a problem

    @@ -1471,23 +1483,23 @@ and “run” has the uuids that are being built (currently limited to 1 at a ti
    -
    -
    -pylorax.api.queue.uuid_log(cfg, uuid, size=1024)[source]
    +
    +
    +pylorax.api.queue.uuid_log(cfg, uuid, size=1024)[source]

    Return size kbytes from the end of the anaconda.log

    Parameters
    • cfg (ComposerConfig) – Configuration settings

    • -
    • uuid (str) – The UUID of the build

    • -
    • size (int) – Number of kbytes to read. Default is 1024

    • +
    • uuid (str) – The UUID of the build

    • +
    • size (int) – Number of kbytes to read. Default is 1024

    Returns

    Up to size kbytes from the end of the log

    Return type
    -

    str

    +

    str

    Raises

    RuntimeError if there was a problem (eg. no log file available)

    @@ -1497,39 +1509,39 @@ and “run” has the uuids that are being built (currently limited to 1 at a ti attempt to start on a line boundry, and may return less than size kbytes.

    -
    -
    -pylorax.api.queue.uuid_status(cfg, uuid)[source]
    +
    +
    +pylorax.api.queue.uuid_status(cfg, uuid)[source]

    Return the details of a specific UUID compose

    Parameters
    • cfg (ComposerConfig) – Configuration settings

    • -
    • uuid (str) – The UUID of the build

    • +
    • uuid (str) – The UUID of the build

    Returns

    Details about the build

    Return type
    -

    dict or None

    +

    dict or None

    Returns the same dict as compose_details()

    -
    -
    -pylorax.api.queue.uuid_tar(cfg, uuid, metadata=False, image=False, logs=False)[source]
    +
    +
    +pylorax.api.queue.uuid_tar(cfg, uuid, metadata=False, image=False, logs=False)[source]

    Return a tar of the build data

    Parameters
    • cfg (ComposerConfig) – Configuration settings

    • -
    • uuid (str) – The UUID of the build

    • -
    • metadata (bool) – Set to true to include all the metadata needed to reproduce the build

    • -
    • image (bool) – Set to true to include the output image

    • -
    • logs (bool) – Set to true to include the logs from the build

    • +
    • uuid (str) – The UUID of the build

    • +
    • metadata (bool) – Set to true to include all the metadata needed to reproduce the build

    • +
    • image (bool) – Set to true to include the output image

    • +
    • logs (bool) – Set to true to include the logs from the build

    Returns
    @@ -1546,35 +1558,35 @@ attempt to start on a line boundry, and may return less than size k the selected data to the caller by returning the Popen stdout from the tar process.

    -
    -
    + +

    pylorax.api.recipes module

    -
    -
    -class pylorax.api.recipes.CommitDetails(commit, timestamp, message, revision=None)[source]
    +
    +
    +class pylorax.api.recipes.CommitDetails(commit, timestamp, message, revision=None)[source]

    Bases: pylorax.base.DataHolder

    -
    -
    -exception pylorax.api.recipes.CommitTimeValError[source]
    -

    Bases: Exception

    +
    +
    +exception pylorax.api.recipes.CommitTimeValError[source]
    +

    Bases: Exception

    -
    -
    -pylorax.api.recipes.NewRecipeGit(toml_dict)[source]
    +
    +
    +pylorax.api.recipes.NewRecipeGit(toml_dict)[source]

    Create a RecipeGit object from fields in a TOML dict

    Parameters
      -
    • rpmname (str) – Name of the rpm to create, also used as the prefix name in the tar archive

    • -
    • rpmversion (str) – Version of the rpm, eg. “1.0.0”

    • -
    • rpmrelease (str) – Release of the rpm, eg. “1”

    • -
    • summary (str) – Summary string for the rpm

    • -
    • repo (str) – URL of the get repo to clone and create the archive from

    • -
    • ref (str) – Git reference to check out. eg. origin/branch-name, git tag, or git commit hash

    • -
    • destination (str) – Path to install the / of the git repo at when installing the rpm

    • +
    • rpmname (str) – Name of the rpm to create, also used as the prefix name in the tar archive

    • +
    • rpmversion (str) – Version of the rpm, eg. “1.0.0”

    • +
    • rpmrelease (str) – Release of the rpm, eg. “1”

    • +
    • summary (str) – Summary string for the rpm

    • +
    • repo (str) – URL of the get repo to clone and create the archive from

    • +
    • ref (str) – Git reference to check out. eg. origin/branch-name, git tag, or git commit hash

    • +
    • destination (str) – Path to install the / of the git repo at when installing the rpm

    Returns
    @@ -1599,27 +1611,27 @@ the selected data to the caller by returning the Popen stdout from the tar proce

    Currently there is no support for authentication

    -
    -
    -class pylorax.api.recipes.Recipe(name, description, version, modules, packages, groups, customizations=None, gitrepos=None)[source]
    -

    Bases: dict

    +
    +
    +class pylorax.api.recipes.Recipe(name, description, version, modules, packages, groups, customizations=None, gitrepos=None)[source]
    +

    Bases: dict

    A Recipe of package and modules

    This is a subclass of dict that enforces the constructor arguments and adds a .filename property to return the recipe’s filename, and a .toml() function to return the recipe as a TOML string.

    -
    -
    -bump_version(old_version=None)[source]
    +
    +
    +bump_version(old_version=None)[source]

    semver recipe version number bump

    Parameters
    -

    old_version (str) – An optional old version number

    +

    old_version (str) – An optional old version number

    Returns

    The new version number or None

    Return type
    -

    str

    +

    str

    Raises

    ValueError

    @@ -1632,20 +1644,20 @@ If the old and new versions are the same, bump the patch level If they are different, check and return the new version

    -
    -
    -property filename
    +
    +
    +property filename

    Return the Recipe’s filename

    -

    Replaces spaces in the name with ‘-‘ and appends .toml

    +

    Replaces spaces in the name with ‘-’ and appends .toml

    -
    -
    -freeze(deps)[source]
    +
    +
    +freeze(deps)[source]

    Return a new Recipe with full module and package NEVRA

    Parameters
    -

    deps (list() – A list of dependency NEVRA to use to fill in the modules and packages

    +

    deps (list() – A list of dependency NEVRA to use to fill in the modules and packages

    Returns

    A new Recipe object

    @@ -1656,83 +1668,83 @@ If they are different, check and return the new version

    -
    -
    -property group_names
    +
    +
    +property group_names

    Return the names of the groups. Groups do not have versions.

    -
    -
    -property module_names
    +
    +
    +property module_names

    Return the names of the modules

    -
    -
    -property module_nver
    +
    +
    +property module_nver

    Return the names and version globs of the modules

    -
    -
    -property package_names
    +
    +
    +property package_names

    Return the names of the packages

    -
    -
    -property package_nver
    +
    +
    +property package_nver

    Return the names and version globs of the packages

    -
    -
    -toml()[source]
    +
    +
    +toml()[source]

    Return the Recipe in TOML format

    -
    -
    -exception pylorax.api.recipes.RecipeError[source]
    -

    Bases: Exception

    +
    +
    +exception pylorax.api.recipes.RecipeError[source]
    +

    Bases: Exception

    -
    -
    -exception pylorax.api.recipes.RecipeFileError[source]
    -

    Bases: Exception

    +
    +
    +exception pylorax.api.recipes.RecipeFileError[source]
    +

    Bases: Exception

    -
    -
    -class pylorax.api.recipes.RecipeGit(rpmname, rpmversion, rpmrelease, summary, repo, ref, destination)[source]
    -

    Bases: dict

    +
    +
    +class pylorax.api.recipes.RecipeGit(rpmname, rpmversion, rpmrelease, summary, repo, ref, destination)[source]
    +

    Bases: dict

    -
    -
    -class pylorax.api.recipes.RecipeGroup(name)[source]
    -

    Bases: dict

    +
    +
    +class pylorax.api.recipes.RecipeGroup(name)[source]
    +

    Bases: dict

    -
    -
    -class pylorax.api.recipes.RecipeModule(name, version)[source]
    -

    Bases: dict

    +
    +
    +class pylorax.api.recipes.RecipeModule(name, version)[source]
    +

    Bases: dict

    -
    -
    -class pylorax.api.recipes.RecipePackage(name, version)[source]
    +
    +
    +class pylorax.api.recipes.RecipePackage(name, version)[source]

    Bases: pylorax.api.recipes.RecipeModule

    -
    -
    -pylorax.api.recipes.check_list_case(expected_keys, recipe_keys, prefix='')[source]
    +
    +
    +pylorax.api.recipes.check_list_case(expected_keys, recipe_keys, prefix='')[source]

    Check the case of the recipe keys

    Parameters
    @@ -1750,19 +1762,19 @@ If they are different, check and return the new version

    -
    -
    -pylorax.api.recipes.check_recipe_dict(recipe_dict)[source]
    +
    +
    +pylorax.api.recipes.check_recipe_dict(recipe_dict)[source]

    Check a dict before using it to create a new Recipe

    Parameters
    -

    recipe_dict (dict) – A plain dict of the recipe

    +

    recipe_dict (dict) – A plain dict of the recipe

    Returns

    True if dict is ok

    Return type
    -

    bool

    +

    bool

    Raises

    RecipeError

    @@ -1775,9 +1787,9 @@ are of the correct format, when included.

    a string that can be presented to users.

    -
    -
    -pylorax.api.recipes.check_required_list(lst, fields)[source]
    +
    +
    +pylorax.api.recipes.check_required_list(lst, fields)[source]

    Check a list of dicts for required fields

    Parameters
    @@ -1795,15 +1807,15 @@ a string that can be presented to users.

    -
    -
    -pylorax.api.recipes.commit_recipe(repo, branch, recipe)[source]
    +
    +
    +pylorax.api.recipes.commit_recipe(repo, branch, recipe)[source]

    Commit a recipe to a branch

    Parameters
    • repo (Git.Repository) – Open repository

    • -
    • branch (str) – Branch name

    • +
    • branch (str) – Branch name

    • recipe (Recipe) – Recipe to commit

    @@ -1819,16 +1831,16 @@ a string that can be presented to users.

    -
    -
    -pylorax.api.recipes.commit_recipe_directory(repo, branch, directory)[source]
    +
    +
    +pylorax.api.recipes.commit_recipe_directory(repo, branch, directory)[source]

    Commit all *.toml files from a directory, if they aren’t already in git.

    Parameters
    • repo (Git.Repository) – Open repository

    • -
    • branch (str) – Branch name

    • -
    • directory (str) – The directory of *.toml recipes to commit

    • +
    • branch (str) – Branch name

    • +
    • directory (str) – The directory of *.toml recipes to commit

    Returns
    @@ -1842,16 +1854,16 @@ a string that can be presented to users.

    be tried.

    -
    -
    -pylorax.api.recipes.commit_recipe_file(repo, branch, filename)[source]
    +
    +
    +pylorax.api.recipes.commit_recipe_file(repo, branch, filename)[source]

    Commit a recipe file to a branch

    Parameters
    • repo (Git.Repository) – Open repository

    • -
    • branch (str) – Branch name

    • -
    • filename (str) – Path to the recipe file to commit

    • +
    • branch (str) – Branch name

    • +
    • filename (str) – Path to the recipe file to commit

    Returns
    @@ -1866,22 +1878,22 @@ be tried.

    -
    -
    -pylorax.api.recipes.customizations_diff(old_recipe, new_recipe)[source]
    +
    +
    +pylorax.api.recipes.customizations_diff(old_recipe, new_recipe)[source]

    Diff the customizations sections from two versions of a recipe

    -
    -
    -pylorax.api.recipes.delete_file(repo, branch, filename)[source]
    +
    +
    +pylorax.api.recipes.delete_file(repo, branch, filename)[source]

    Delete a file from a branch.

    Parameters
    • repo (Git.Repository) – Open repository

    • -
    • branch (str) – Branch name

    • -
    • filename (str) – filename to delete

    • +
    • branch (str) – Branch name

    • +
    • filename (str) – filename to delete

    Returns
    @@ -1896,16 +1908,16 @@ be tried.

    -
    -
    -pylorax.api.recipes.delete_recipe(repo, branch, recipe_name)[source]
    +
    +
    +pylorax.api.recipes.delete_recipe(repo, branch, recipe_name)[source]

    Delete a recipe from a branch.

    Parameters
    • repo (Git.Repository) – Open repository

    • -
    • branch (str) – Branch name

    • -
    • recipe_name (str) – Recipe name to delete

    • +
    • branch (str) – Branch name

    • +
    • recipe_name (str) – Recipe name to delete

    Returns
    @@ -1920,38 +1932,38 @@ be tried.

    -
    -
    -pylorax.api.recipes.diff_lists(title, field, old_items, new_items)[source]
    +
    +
    +pylorax.api.recipes.diff_lists(title, field, old_items, new_items)[source]

    Return the differences between two lists of dicts.

    Parameters
      -
    • title (str) – Title of the entry

    • -
    • field (str) – Field to use as the key for comparisons

    • -
    • old_items (list(dict)) – List of item dicts with “name” field

    • -
    • new_items (list(dict)) – List of item dicts with “name” field

    • +
    • title (str) – Title of the entry

    • +
    • field (str) – Field to use as the key for comparisons

    • +
    • old_items (list(dict)) – List of item dicts with “name” field

    • +
    • new_items (list(dict)) – List of item dicts with “name” field

    Returns

    List of diff dicts with old/new entries

    Return type
    -

    list(dict)

    +

    list(dict)

    -
    -
    -pylorax.api.recipes.find_commit_tag(repo, branch, filename, commit_id)[source]
    +
    +
    +pylorax.api.recipes.find_commit_tag(repo, branch, filename, commit_id)[source]

    Find the tag that matches the commit_id

    Parameters
    • repo (Git.Repository) – Open repository

    • -
    • branch (str) – Branch name

    • -
    • filename (str) – filename to revert

    • +
    • branch (str) – Branch name

    • +
    • filename (str) – filename to revert

    • commit_id (Git.OId) – The commit id to check

    @@ -1959,7 +1971,7 @@ be tried.

    The tag or None if there isn’t one

    Return type
    -

    str or None

    +

    str or None

    There should be only 1 tag pointing to a commit, but there may not @@ -1967,15 +1979,15 @@ be a tag at all.

    The tag will look like: ‘refs/tags/<branch>/<filename>/r<revision>’

    -
    -
    -pylorax.api.recipes.find_field_value(field, value, lst)[source]
    +
    +
    +pylorax.api.recipes.find_field_value(field, value, lst)[source]

    Find a field matching value in the list of dicts.

    Parameters
      -
    • field (str) – field to search for

    • -
    • value (str) – value to match in the field

    • +
    • field (str) – field to search for

    • +
    • value (str) – value to match in the field

    • lst (list of dict) – List of dict’s with field

    @@ -1983,7 +1995,7 @@ be a tag at all.

    First dict with matching field:value, or None

    Return type
    -

    dict or None

    +

    dict or None

    Used to return a specific entry from a list that looks like this:

    @@ -1991,14 +2003,14 @@ be a tag at all.

    find_field_value(“name”, “one”, lst) will return the matching dict.

    -
    -
    -pylorax.api.recipes.find_name(name, lst)[source]
    +
    +
    +pylorax.api.recipes.find_name(name, lst)[source]

    Find the dict matching the name in a list and return it.

    Parameters
      -
    • name (str) – Name to search for

    • +
    • name (str) – Name to search for

    • lst (list of dict) – List of dict’s with “name” field

    @@ -2006,15 +2018,15 @@ be a tag at all.

    First dict with matching name, or None

    Return type
    -

    dict or None

    +

    dict or None

    This is just a wrapper for find_field_value with field set to “name”

    -
    -
    -pylorax.api.recipes.find_recipe_obj(path, recipe, default=None)[source]
    +
    +
    +pylorax.api.recipes.find_recipe_obj(path, recipe, default=None)[source]

    Find a recipe object

    Parameters
    @@ -2031,15 +2043,15 @@ return the default if it doesn’t exist.

    find_recipe_obj([“customizations”, “hostname”], recipe, “”)

    -
    -
    -pylorax.api.recipes.get_commit_details(commit, revision=None)[source]
    +
    +
    +pylorax.api.recipes.get_commit_details(commit, revision=None)[source]

    Return the details about a specific commit.

    Parameters
    • commit (Git.Commit) – The commit to get details from

    • -
    • revision (int) – Optional commit revision

    • +
    • revision (int) – Optional commit revision

    Returns
    @@ -2054,39 +2066,39 @@ return the default if it doesn’t exist.

    -
    -
    -pylorax.api.recipes.get_revision_from_tag(tag)[source]
    +
    +
    +pylorax.api.recipes.get_revision_from_tag(tag)[source]

    Return the revision number from a tag

    Parameters
    -

    tag (str) – The tag to exract the revision from

    +

    tag (str) – The tag to exract the revision from

    Returns

    The integer revision or None

    Return type
    -

    int or None

    +

    int or None

    The revision is the part after the r in ‘branch/filename/rXXX’

    -
    -
    -pylorax.api.recipes.gfile(path)[source]
    +
    +
    +pylorax.api.recipes.gfile(path)[source]

    Convert a string path to GFile for use with Git

    -
    -
    -pylorax.api.recipes.head_commit(repo, branch)[source]
    +
    +
    +pylorax.api.recipes.head_commit(repo, branch)[source]

    Get the branch’s HEAD Commit Object

    Parameters
    • repo (Git.Repository) – Open repository

    • -
    • branch (str) – Branch name

    • +
    • branch (str) – Branch name

    Returns
    @@ -2101,36 +2113,36 @@ return the default if it doesn’t exist.

    -
    -
    -pylorax.api.recipes.is_commit_tag(repo, commit_id, tag)[source]
    +
    +
    +pylorax.api.recipes.is_commit_tag(repo, commit_id, tag)[source]

    Check to see if a tag points to a specific commit.

    Parameters
    • repo (Git.Repository) – Open repository

    • commit_id (Git.OId) – The commit id to check

    • -
    • tag (str) – The tag to check

    • +
    • tag (str) – The tag to check

    Returns

    True if the tag points to the commit, False otherwise

    Return type
    -

    bool

    +

    bool

    -
    -
    -pylorax.api.recipes.is_parent_diff(repo, filename, tree, parent)[source]
    +
    +
    +pylorax.api.recipes.is_parent_diff(repo, filename, tree, parent)[source]

    Check to see if the commit is different from its parents

    Parameters
    • repo (Git.Repository) – Open repository

    • -
    • filename (str) – filename to revert

    • +
    • filename (str) – filename to revert

    • tree (Git.Tree) – The commit’s tree

    • parent (Git.Commit) – The commit’s parent commit

    @@ -2139,27 +2151,27 @@ return the default if it doesn’t exist.

    True if filename in the commit is different from its parents

    Return type
    -

    bool

    +

    bool

    -
    -
    -pylorax.api.recipes.list_branch_files(repo, branch)[source]
    +
    +
    +pylorax.api.recipes.list_branch_files(repo, branch)[source]

    Return a sorted list of the files on the branch HEAD

    Parameters
    • repo (Git.Repository) – Open repository

    • -
    • branch (str) – Branch name

    • +
    • branch (str) – Branch name

    Returns

    A sorted list of the filenames

    Return type
    -

    list(str)

    +

    list(str)

    Raises

    Can raise errors from Ggit

    @@ -2167,22 +2179,22 @@ return the default if it doesn’t exist.

    -
    -
    -pylorax.api.recipes.list_commit_files(repo, commit)[source]
    +
    +
    +pylorax.api.recipes.list_commit_files(repo, commit)[source]

    Return a sorted list of the files on a commit

    Parameters
    • repo (Git.Repository) – Open repository

    • -
    • commit (str) – The commit hash to list

    • +
    • commit (str) – The commit hash to list

    Returns

    A sorted list of the filenames

    Return type
    -

    list(str)

    +

    list(str)

    Raises

    Can raise errors from Ggit

    @@ -2190,24 +2202,24 @@ return the default if it doesn’t exist.

    -
    -
    -pylorax.api.recipes.list_commits(repo, branch, filename, limit=0)[source]
    +
    +
    +pylorax.api.recipes.list_commits(repo, branch, filename, limit=0)[source]

    List the commit history of a file on a branch.

    Parameters
    • repo (Git.Repository) – Open repository

    • -
    • branch (str) – Branch name

    • -
    • filename (str) – filename to revert

    • -
    • limit (int) – Number of commits to return (0=all)

    • +
    • branch (str) – Branch name

    • +
    • filename (str) – filename to revert

    • +
    • limit (int) – Number of commits to return (0=all)

    Returns

    A list of commit details

    Return type
    -

    list(CommitDetails)

    +

    list(CommitDetails)

    Raises

    Can raise errors from Ggit

    @@ -2215,9 +2227,9 @@ return the default if it doesn’t exist.

    -
    -
    -pylorax.api.recipes.open_or_create_repo(path)[source]
    +
    +
    +pylorax.api.recipes.open_or_create_repo(path)[source]

    Open an existing repo, or create a new one

    Parameters
    @@ -2238,15 +2250,15 @@ If a repo already exists it will be opened and returned instead of creating a new one.

    -
    -
    -pylorax.api.recipes.prepare_commit(repo, branch, builder)[source]
    +
    +
    +pylorax.api.recipes.prepare_commit(repo, branch, builder)[source]

    Prepare for a commit

    Parameters
    • repo (Git.Repository) – Open repository

    • -
    • branch (str) – Branch name

    • +
    • branch (str) – Branch name

    • builder (TreeBuilder) – instance of TreeBuilder

    @@ -2254,7 +2266,7 @@ creating a new one.

    (Tree, Sig, Ref)

    Return type
    -

    tuple

    +

    tuple

    Raises

    Can raise errors from Ggit

    @@ -2262,24 +2274,24 @@ creating a new one.

    -
    -
    -pylorax.api.recipes.read_commit(repo, branch, filename, commit=None)[source]
    +
    +
    +pylorax.api.recipes.read_commit(repo, branch, filename, commit=None)[source]

    Return the contents of a file on a specific branch or commit.

    Parameters
    • repo (Git.Repository) – Open repository

    • -
    • branch (str) – Branch name

    • -
    • filename (str) – filename to read

    • -
    • commit (str) – Optional commit hash

    • +
    • branch (str) – Branch name

    • +
    • filename (str) – filename to read

    • +
    • commit (str) – Optional commit hash

    Returns

    The commit id, and the contents of the commit

    Return type
    -

    tuple(str, str)

    +

    tuple(str, str)

    Raises

    Can raise errors from Ggit

    @@ -2289,22 +2301,22 @@ creating a new one.

    commit:filename

    -
    -
    -pylorax.api.recipes.read_commit_spec(repo, spec)[source]
    +
    +
    +pylorax.api.recipes.read_commit_spec(repo, spec)[source]

    Return the raw content of the blob specified by the spec

    Parameters
    • repo (Git.Repository) – Open repository

    • -
    • spec (str) – Git revparse spec

    • +
    • spec (str) – Git revparse spec

    Returns

    Contents of the commit

    Return type
    -

    str

    +

    str

    Raises

    Can raise errors from Ggit

    @@ -2313,24 +2325,24 @@ commit:filename

    eg. To read the README file from master the spec is “master:README”

    -
    -
    -pylorax.api.recipes.read_recipe_and_id(repo, branch, recipe_name, commit=None)[source]
    +
    +
    +pylorax.api.recipes.read_recipe_and_id(repo, branch, recipe_name, commit=None)[source]

    Read a recipe commit and its id from git

    Parameters
    • repo (Git.Repository) – Open repository

    • -
    • branch (str) – Branch name

    • -
    • recipe_name (str) – Recipe name to read

    • -
    • commit (str) – Optional commit hash

    • +
    • branch (str) – Branch name

    • +
    • recipe_name (str) – Recipe name to read

    • +
    • commit (str) – Optional commit hash

    Returns

    The commit id, and a Recipe object

    Return type
    -

    tuple(str, Recipe)

    +

    tuple(str, Recipe)

    Raises

    Can raise errors from Ggit

    @@ -2340,17 +2352,17 @@ commit:filename

    commit:filename

    -
    -
    -pylorax.api.recipes.read_recipe_commit(repo, branch, recipe_name, commit=None)[source]
    +
    +
    +pylorax.api.recipes.read_recipe_commit(repo, branch, recipe_name, commit=None)[source]

    Read a recipe commit from git and return a Recipe object

    Parameters
    • repo (Git.Repository) – Open repository

    • -
    • branch (str) – Branch name

    • -
    • recipe_name (str) – Recipe name to read

    • -
    • commit (str) – Optional commit hash

    • +
    • branch (str) – Branch name

    • +
    • recipe_name (str) – Recipe name to read

    • +
    • commit (str) – Optional commit hash

    Returns
    @@ -2367,9 +2379,9 @@ commit:filename

    commit:filename

    -
    -
    -pylorax.api.recipes.recipe_diff(old_recipe, new_recipe)[source]
    +
    +
    +pylorax.api.recipes.recipe_diff(old_recipe, new_recipe)[source]

    Diff two versions of a recipe

    Parameters
    @@ -2382,25 +2394,25 @@ commit:filename

    A list of diff dict entries with old/new

    Return type
    -

    list(dict)

    +

    list(dict)

    -
    -
    -pylorax.api.recipes.recipe_filename(name)[source]
    +
    +
    +pylorax.api.recipes.recipe_filename(name)[source]

    Return the toml filename for a recipe

    -

    Replaces spaces with ‘-‘ and appends ‘.toml’

    +

    Replaces spaces with ‘-’ and appends ‘.toml’

    -
    -
    -pylorax.api.recipes.recipe_from_dict(recipe_dict)[source]
    +
    +
    +pylorax.api.recipes.recipe_from_dict(recipe_dict)[source]

    Create a Recipe object from a plain dict.

    Parameters
    -

    recipe_dict (dict) – A plain dict of the recipe

    +

    recipe_dict (dict) – A plain dict of the recipe

    Returns

    A Recipe object

    @@ -2414,13 +2426,13 @@ commit:filename

    -
    -
    -pylorax.api.recipes.recipe_from_file(recipe_path)[source]
    +
    +
    +pylorax.api.recipes.recipe_from_file(recipe_path)[source]

    Return a recipe file as a Recipe object

    Parameters
    -

    recipe_path (str) – Path to the recipe fila

    +

    recipe_path (str) – Path to the recipe fila

    Returns

    A Recipe object

    @@ -2431,13 +2443,13 @@ commit:filename

    -
    -
    -pylorax.api.recipes.recipe_from_toml(recipe_str)[source]
    +
    +
    +pylorax.api.recipes.recipe_from_toml(recipe_str)[source]

    Create a Recipe object from a toml string.

    Parameters
    -

    recipe_str (str) – The Recipe TOML string

    +

    recipe_str (str) – The Recipe TOML string

    Returns

    A Recipe object

    @@ -2451,38 +2463,38 @@ commit:filename

    -
    -
    -pylorax.api.recipes.repo_file_exists(repo, branch, filename)[source]
    +
    +
    +pylorax.api.recipes.repo_file_exists(repo, branch, filename)[source]

    Return True if the filename exists on the branch

    Parameters
    • repo (Git.Repository) – Open repository

    • -
    • branch (str) – Branch name

    • -
    • filename (str) – Filename to check

    • +
    • branch (str) – Branch name

    • +
    • filename (str) – Filename to check

    Returns

    True if the filename exists on the HEAD of the branch, False otherwise.

    Return type
    -

    bool

    +

    bool

    -
    -
    -pylorax.api.recipes.revert_file(repo, branch, filename, commit)[source]
    +
    +
    +pylorax.api.recipes.revert_file(repo, branch, filename, commit)[source]

    Revert the contents of a file to that of a previous commit

    Parameters
    • repo (Git.Repository) – Open repository

    • -
    • branch (str) – Branch name

    • -
    • filename (str) – filename to revert

    • -
    • commit (str) – Commit hash

    • +
    • branch (str) – Branch name

    • +
    • filename (str) – filename to revert

    • +
    • commit (str) – Commit hash

    Returns
    @@ -2497,17 +2509,17 @@ commit:filename

    -
    -
    -pylorax.api.recipes.revert_recipe(repo, branch, recipe_name, commit)[source]
    +
    +
    +pylorax.api.recipes.revert_recipe(repo, branch, recipe_name, commit)[source]

    Revert the contents of a recipe to that of a previous commit

    Parameters
    • repo (Git.Repository) – Open repository

    • -
    • branch (str) – Branch name

    • -
    • recipe_name (str) – Recipe name to revert

    • -
    • commit (str) – Commit hash

    • +
    • branch (str) – Branch name

    • +
    • recipe_name (str) – Recipe name to revert

    • +
    • commit (str) – Commit hash

    Returns
    @@ -2522,16 +2534,16 @@ commit:filename

    -
    -
    -pylorax.api.recipes.tag_file_commit(repo, branch, filename)[source]
    +
    +
    +pylorax.api.recipes.tag_file_commit(repo, branch, filename)[source]

    Tag a file’s most recent commit

    Parameters
    • repo (Git.Repository) – Open repository

    • -
    • branch (str) – Branch name

    • -
    • filename (str) – Filename to tag

    • +
    • branch (str) – Branch name

    • +
    • filename (str) – Filename to tag

    Returns
    @@ -2550,16 +2562,16 @@ Revisions start at 1 and increment for each new commit that is tagged. If the commit has already been tagged it will return false.

    -
    -
    -pylorax.api.recipes.tag_recipe_commit(repo, branch, recipe_name)[source]
    +
    +
    +pylorax.api.recipes.tag_recipe_commit(repo, branch, recipe_name)[source]

    Tag a file’s most recent commit

    Parameters
    • repo (Git.Repository) – Open repository

    • -
    • branch (str) – Branch name

    • -
    • recipe_name (str) – Recipe name to tag

    • +
    • branch (str) – Branch name

    • +
    • recipe_name (str) – Recipe name to tag

    Returns
    @@ -2575,18 +2587,18 @@ If the commit has already been tagged it will return false.

    Uses tag_file_commit()

    -
    -
    -pylorax.api.recipes.write_commit(repo, branch, filename, message, content)[source]
    +
    +
    +pylorax.api.recipes.write_commit(repo, branch, filename, message, content)[source]

    Make a new commit to a repository’s branch

    Parameters
    • repo (Git.Repository) – Open repository

    • -
    • branch (str) – Branch name

    • -
    • filename (str) – full path of the file to add

    • -
    • message (str) – The commit message

    • -
    • content (str) – The data to write

    • +
    • branch (str) – Branch name

    • +
    • filename (str) – full path of the file to add

    • +
    • message (str) – The commit message

    • +
    • content (str) – The data to write

    Returns
    @@ -2601,39 +2613,39 @@ If the commit has already been tagged it will return false.

    -
    -
    + +

    pylorax.api.server module

    -
    -
    -class pylorax.api.server.GitLock(repo, lock, dir)
    -

    Bases: tuple

    -
    -
    -property dir
    +
    +
    +class pylorax.api.server.GitLock(repo, lock, dir)
    +

    Bases: tuple

    +
    +
    +property dir

    Alias for field number 2

    -
    -
    -property lock
    +
    +
    +property lock

    Alias for field number 1

    -
    -
    -property repo
    +
    +
    +property repo

    Alias for field number 0

    -
    -
    + +

    pylorax.api.v0 module

    Setup v0 of the API server

    v0_api() must be called to setup the API routes for Flask

    -
    +

    Status Responses

    Some requests only return a status/error response.

    @@ -2653,14 +2665,14 @@ error response with it set to false and an error message included.

    - -
    + +

    API Routes

    All of the blueprints routes support the optional branch argument. If it is not used then the API will use the master branch for blueprints. If you want to create a new branch use the new or workspace routes with ?branch=<branch-name> to store the new blueprint on the new branch.

    -
    +

    /api/v0/blueprints/list

    List the available blueprints:

    @@ -2677,8 +2689,8 @@ store the new blueprint on the new branch.

    - -
    + +

    /api/v0/blueprints/info/<blueprint_names>[?format=<json|toml>]

    Return the JSON representation of the blueprint. This includes 3 top level @@ -2739,8 +2751,8 @@ errors will both be returned.

    - -
    + +

    /api/v0/blueprints/changes/<blueprint_names>[?offset=0&limit=20]

    Return the commits to a blueprint. By default it returns the first 20 commits, this @@ -2800,8 +2812,8 @@ hash can be passed to /api/v0/blueprints/diff/ to retrieve the exac

    - -
    + +

    POST /api/v0/blueprints/new

    Create a new blueprint, or update an existing blueprint. This supports both JSON and TOML @@ -2810,8 +2822,8 @@ for the blueprint format. The blueprint should be in the body of the request wit

    The response will be a status response with status set to true, or an error response with it set to false and an error message included.

    -
    -
    + +

    DELETE /api/v0/blueprints/delete/<blueprint_name>

    Delete a blueprint. The blueprint is deleted from the branch, and will no longer @@ -2821,8 +2833,8 @@ blueprint.

    The response will be a status response with status set to true, or an error response with it set to false and an error message included.

    -
    -
    + +

    POST /api/v0/blueprints/workspace

    Write a blueprint to the temporary workspace. This works exactly the same as new except @@ -2833,8 +2845,8 @@ most recent commit.

    The response will be a status response with status set to true, or an error response with it set to false and an error message included.

    -
    -
    + +

    DELETE /api/v0/blueprints/workspace/<blueprint_name>

    Remove the temporary workspace copy of a blueprint. The info route will now @@ -2843,8 +2855,8 @@ workspace will be lost.

    The response will be a status response with status set to true, or an error response with it set to false and an error message included.

    -
    -
    + +

    POST /api/v0/blueprints/undo/<blueprint_name>/<commit>

    This will revert the blueprint to a previous commit. The commit hash from the changes @@ -2852,8 +2864,8 @@ route can be used in this request.

    The response will be a status response with status set to true, or an error response with it set to false and an error message included.

    -
    -
    + +

    POST /api/v0/blueprints/tag/<blueprint_name>

    Tag a blueprint as a new release. This uses git tags with a special format. @@ -2863,8 +2875,8 @@ can be tagged. Revisions start at 1 and increment for each new tag

    The response will be a status response with status set to true, or an error response with it set to false and an error message included.

    -
    -
    + +

    /api/v0/blueprints/diff/<blueprint_name>/<from_commit>/<to_commit>

    Return the differences between two commits, or the workspace. The commit hash @@ -2908,8 +2920,8 @@ The contents for these will be the old/new values for them.

    - -
    + +

    /api/v0/blueprints/freeze/<blueprint_names>

    Return a JSON representation of the blueprint with the package and module versions set @@ -2950,8 +2962,8 @@ to the exact versions chosen by depsolving the blueprint.

    - -
    + +

    /api/v0/blueprints/depsolve/<blueprint_names>

    Depsolve the blueprint using yum, return the blueprint used, and the NEVRAs of the packages @@ -3026,8 +3038,8 @@ and packages in modules, and any error will be in errors

    - -
    + +

    /api/v0/projects/list[?offset=0&limit=20]

    List all of the available projects. By default this returns the first 20 items, @@ -3051,8 +3063,8 @@ but this can be changed by setting the offset and limit

    - -
    + +

    /api/v0/projects/info/<project_names>

    Return information about the comma-separated list of projects. It includes the description @@ -3090,8 +3102,8 @@ of the package along with the list of available builds.

    - -
    + +

    /api/v0/projects/depsolve/<project_names>

    Depsolve the comma-separated list of projects and return the list of NEVRAs needed @@ -3126,8 +3138,8 @@ to satisfy the request.

    - -
    + +

    /api/v0/projects/source/list

    Return the list of repositories used for depsolving and installing packages.

    @@ -3143,8 +3155,8 @@ to satisfy the request.

    - -
    + +

    /api/v0/projects/source/info/<source-names>

    Return information about the comma-separated list of source names. Or all of the @@ -3172,8 +3184,8 @@ will have it set to false. System sources cannot be changed or deleted.

    - -
    + +

    POST /api/v0/projects/source/new

    Add (or change) a source for use when depsolving blueprints and composing images.

    @@ -3204,8 +3216,8 @@ of the new version of the source. It will overwrite the previous one.

    - -
    + +

    DELETE /api/v0/projects/source/delete/<source-name>

    Delete a user added source. This will fail if a system source is passed to @@ -3213,8 +3225,8 @@ it.

    The response will be a status response with status set to true, or an error response with it set to false and an error message included.

    -
    -
    + +

    /api/v0/modules/list[?offset=0&limit=20]

    Return a list of all of the available modules. This includes the name and the @@ -3248,8 +3260,8 @@ arguments.

    - -
    + +

    /api/v0/modules/list/<module_names>[?offset=0&limit=20]

    Return the list of comma-separated modules. Output is the same as /modules/list

    @@ -3268,8 +3280,8 @@ arguments.

    - -
    + +

    /api/v0/modules/info/<module_names>

    Return the module’s dependencies, and the information about the module.

    @@ -3305,8 +3317,8 @@ arguments.

    - -
    + +

    POST /api/v0/compose

    Start a compose. The content type should be ‘application/json’ and the body of the POST @@ -3328,8 +3340,8 @@ build and add it to the queue. It returns the build uuid and a status if it succ

    - -
    + +

    /api/v0/compose/types

    Returns the list of supported output types that are valid for use with ‘POST /api/v0/compose’

    @@ -3350,8 +3362,8 @@ build and add it to the queue. It returns the build uuid and a status if it succ

    }

    - -
    + +

    /api/v0/compose/queue

    Return the status of the build queue. It includes information about the builds waiting, @@ -3388,8 +3400,8 @@ and the build that is running.

    - -
    + +

    /api/v0/compose/finished

    Return the details on all of the finished composes on the system.

    @@ -3419,8 +3431,8 @@ and the build that is running.

    - -
    + +

    /api/v0/compose/failed

    Return the details on all of the failed composes on the system.

    @@ -3441,8 +3453,8 @@ and the build that is running.

    - -
    + +

    /api/v0/compose/status/<uuids>[?blueprint=<blueprint_name>&status=<compose_status>&type=<compose_type>]

    Return the details for each of the comma-separated list of uuids. A uuid of ‘*’ will return @@ -3473,8 +3485,8 @@ details for all composes.

    - -
    + +

    DELETE /api/v0/compose/cancel/<uuid>

    Cancel the build, if it is not finished, and delete the results. It will return a @@ -3487,8 +3499,8 @@ status of True if it is successful.

    - -
    + +

    DELETE /api/v0/compose/delete/<uuids>

    Delete the list of comma-separated uuids from the compose results.

    @@ -3505,8 +3517,8 @@ status of True if it is successful.

    - -
    + +

    /api/v0/compose/info/<uuid>

    Get detailed information about the compose. The returned JSON string will @@ -3555,8 +3567,8 @@ contain the following information:

    - -
    + +

    /api/v0/compose/metadata/<uuid>

    Returns a .tar of the metadata used for the build. This includes all the @@ -3566,8 +3578,8 @@ populated with repository and package NEVRA.

    UUID-metadata.tar

    The .tar is uncompressed, but is not large.

    -
    -
    + +

    /api/v0/compose/results/<uuid>

    Returns a .tar of the metadata, logs, and output image of the build. This @@ -3577,8 +3589,8 @@ is already in compressed form so the returned tar is not compressed.

    The mime type is set to ‘application/x-tar’ and the filename is set to UUID.tar

    -
    -
    + +

    /api/v0/compose/logs/<uuid>

    Returns a .tar of the anaconda build logs. The tar is not compressed, but is @@ -3586,15 +3598,15 @@ not large.

    The mime type is set to ‘application/x-tar’ and the filename is set to UUID-logs.tar

    -
    -
    + +

    /api/v0/compose/image/<uuid>

    Returns the output image from the build. The filename is set to the filename from the build with the UUID as a prefix. eg. UUID-root.tar.xz or UUID-boot.iso.

    -
    -
    + +

    /api/v0/compose/log/<uuid>[?size=kbytes]

    Returns the end of the anaconda.log. The size parameter is optional and defaults to 1Mbytes @@ -3619,31 +3631,31 @@ a line boundry.

    -
    -
    -pylorax.api.v0.blueprint_exists(api, branch, blueprint_name)[source]
    +
    +
    +pylorax.api.v0.blueprint_exists(api, branch, blueprint_name)[source]

    Return True if the blueprint exists

    Parameters
    • api (Flask) – flask object

    • -
    • branch (str) – Branch name

    • -
    • recipe_name (str) – Recipe name to read

    • +
    • branch (str) – Branch name

    • +
    • recipe_name (str) – Recipe name to read

    -
    -
    -pylorax.api.v0.take_limits(iterable, offset, limit)[source]
    +
    +
    +pylorax.api.v0.take_limits(iterable, offset, limit)[source]

    Apply offset and limit to an iterable object

    Parameters
    • iterable (iter) – The object to limit

    • -
    • offset (int) – The number of items to skip

    • -
    • limit (int) – The total number of items to return

    • +
    • offset (int) – The number of items to skip

    • +
    • limit (int) – The total number of items to return

    Returns
    @@ -3652,26 +3664,26 @@ a line boundry.

    -
    -
    -pylorax.api.v0.v0_api(api)[source]
    +
    +
    +pylorax.api.v0.v0_api(api)[source]
    - - - -
    + + + +

    pylorax.api.workspace module

    -
    -
    -pylorax.api.workspace.workspace_delete(repo, branch, recipe_name)[source]
    +
    +
    +pylorax.api.workspace.workspace_delete(repo, branch, recipe_name)[source]

    Delete the recipe from the workspace

    Parameters
    • repo (Git.Repository) – Open repository

    • -
    • branch (str) – Branch name

    • -
    • recipe_name (str) – The name of the recipe

    • +
    • branch (str) – Branch name

    • +
    • recipe_name (str) – The name of the recipe

    Returns
    @@ -3683,43 +3695,43 @@ a line boundry.

    -
    -
    -pylorax.api.workspace.workspace_dir(repo, branch)[source]
    +
    +
    +pylorax.api.workspace.workspace_dir(repo, branch)[source]

    Create the workspace’s path from a Repository and branch

    Parameters
    • repo (Git.Repository) – Open repository

    • -
    • branch (str) – Branch name

    • +
    • branch (str) – Branch name

    Returns

    The path to the branch’s workspace directory

    Return type
    -

    str

    +

    str

    -
    -
    -pylorax.api.workspace.workspace_read(repo, branch, recipe_name)[source]
    +
    +
    +pylorax.api.workspace.workspace_read(repo, branch, recipe_name)[source]

    Read a Recipe from the branch’s workspace

    Parameters
    • repo (Git.Repository) – Open repository

    • -
    • branch (str) – Branch name

    • -
    • recipe_name (str) – The name of the recipe

    • +
    • branch (str) – Branch name

    • +
    • recipe_name (str) – The name of the recipe

    Returns

    The workspace copy of the recipe, or None if it doesn’t exist

    Return type
    -

    Recipe or None

    +

    Recipe or None

    Raises

    RecipeFileError

    @@ -3727,15 +3739,15 @@ a line boundry.

    -
    -
    -pylorax.api.workspace.workspace_write(repo, branch, recipe)[source]
    +
    +
    +pylorax.api.workspace.workspace_write(repo, branch, recipe)[source]

    Write a recipe to the workspace

    Parameters
    • repo (Git.Repository) – Open repository

    • -
    • branch (str) – Branch name

    • +
    • branch (str) – Branch name

    • recipe (Recipe) – The recipe to write to the workspace

    @@ -3748,43 +3760,44 @@ a line boundry.

    -
    -
    + +

    Module contents

    -
    -
    -pylorax.api.crossdomain(origin, methods=None, headers=None, max_age=21600, attach_to_all=True, automatic_options=True)[source]
    +
    +
    +pylorax.api.crossdomain(origin, methods=None, headers=None, max_age=21600, attach_to_all=True, automatic_options=True)[source]
    -
    - + + - @@ -3793,7 +3806,6 @@ a line boundry.

    - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + @@ -60,7 +67,7 @@
    - 28.14.42 + 28.14.59
    @@ -77,6 +84,7 @@ + + @@ -161,11 +171,13 @@ + +
      -
    • Docs »
    • +
    • »
    • pylorax »
    • @@ -174,7 +186,7 @@
    • - + View page source @@ -188,9 +200,9 @@
      -
      +

      pylorax package

      -
      +

      Subpackages

        @@ -257,125 +269,125 @@
      -
      -
      +
      +

      Submodules

      -
      -
      + +

      pylorax.base module

      -
      -
      -class pylorax.base.BaseLoraxClass[source]
      -

      Bases: object

      -
      -
      -pcritical(msg, fobj=<_io.TextIOWrapper name='<stdout>' mode='w' encoding='UTF-8'>)[source]
      +
      +
      +class pylorax.base.BaseLoraxClass[source]
      +

      Bases: object

      +
      +
      +pcritical(msg, fobj=<_io.TextIOWrapper name='<stdout>' mode='w' encoding='UTF-8'>)[source]
      -
      -
      -pdebug(msg, fobj=<_io.TextIOWrapper name='<stdout>' mode='w' encoding='UTF-8'>)[source]
      +
      +
      +pdebug(msg, fobj=<_io.TextIOWrapper name='<stdout>' mode='w' encoding='UTF-8'>)[source]
      -
      -
      -perror(msg, fobj=<_io.TextIOWrapper name='<stdout>' mode='w' encoding='UTF-8'>)[source]
      +
      +
      +perror(msg, fobj=<_io.TextIOWrapper name='<stdout>' mode='w' encoding='UTF-8'>)[source]
      -
      -
      -pinfo(msg, fobj=<_io.TextIOWrapper name='<stdout>' mode='w' encoding='UTF-8'>)[source]
      +
      +
      +pinfo(msg, fobj=<_io.TextIOWrapper name='<stdout>' mode='w' encoding='UTF-8'>)[source]
      -
      -
      -pwarning(msg, fobj=<_io.TextIOWrapper name='<stdout>' mode='w' encoding='UTF-8'>)[source]
      +
      +
      +pwarning(msg, fobj=<_io.TextIOWrapper name='<stdout>' mode='w' encoding='UTF-8'>)[source]
      -
      -
      -class pylorax.base.DataHolder(**kwargs)[source]
      -

      Bases: dict

      -
      -
      -copy() → a shallow copy of D[source]
      +
      +
      +class pylorax.base.DataHolder(**kwargs)[source]
      +

      Bases: dict

      +
      +
      +copy()a shallow copy of D[source]
      -
      -
      + +

      pylorax.buildstamp module

      -
      -
      -class pylorax.buildstamp.BuildStamp(product, version, bugurl, isfinal, buildarch, variant='')[source]
      -

      Bases: object

      -
      -
      -write(outfile)[source]
      +
      +
      +class pylorax.buildstamp.BuildStamp(product, version, bugurl, isfinal, buildarch, variant='')[source]
      +

      Bases: object

      +
      +
      +write(outfile)[source]
      -
      -
      + +

      pylorax.cmdline module

      -
      -
      -pylorax.cmdline.lmc_parser(dracut_default='')[source]
      +
      +
      +pylorax.cmdline.lmc_parser(dracut_default='')[source]

      Return a ArgumentParser object for live-media-creator.

      -
      -
      -pylorax.cmdline.lorax_parser(dracut_default='')[source]
      +
      +
      +pylorax.cmdline.lorax_parser(dracut_default='')[source]

      Return the ArgumentParser for lorax

      -
      -
      + +

      pylorax.creator module

      -
      -
      -class pylorax.creator.FakeDNF(conf)[source]
      -

      Bases: object

      +
      +
      +class pylorax.creator.FakeDNF(conf)[source]
      +

      Bases: object

      A minimal DNF object suitable for passing to RuntimeBuilder

      lmc uses RuntimeBuilder to run the arch specific iso creation templates, so the the installroot config value is the important part of this. Everything else should be a nop.

      -
      -
      -reset()[source]
      +
      +
      +reset()[source]
      -
      -
      -pylorax.creator.calculate_disk_size(opts, ks)[source]
      +
      +
      +pylorax.creator.calculate_disk_size(opts, ks)[source]

      Calculate the disk size from the kickstart

      Parameters
      • opts (argparse options) – options passed to livemedia-creator

      • -
      • ks (str) – Path to the kickstart to use for the installation

      • +
      • ks (str) – Path to the kickstart to use for the installation

      Returns

      Disk size in MiB

      Return type
      -

      int

      +

      int

      Also takes into account the use of reqpart or reqpart –add-boot

      -
      -
      -pylorax.creator.check_kickstart(ks, opts)[source]
      +
      +
      +pylorax.creator.check_kickstart(ks, opts)[source]

      Check the parsed kickstart object for errors

      Parameters
      @@ -388,106 +400,106 @@ this. Everything else should be a nop.

      List of error strings or empty list

      Return type
      -

      list

      +

      list

      -
      -
      -pylorax.creator.create_pxe_config(template, images_dir, live_image_name, add_args=None)[source]
      +
      +
      +pylorax.creator.create_pxe_config(template, images_dir, live_image_name, add_args=None)[source]

      Create template for pxe to live configuration

      Parameters
        -
      • images_dir (str) – Path of directory with images to be used

      • -
      • live_image_name (str) – Name of live rootfs image file

      • -
      • add_args (list) – Arguments to be added to initrd= pxe config

      • +
      • images_dir (str) – Path of directory with images to be used

      • +
      • live_image_name (str) – Name of live rootfs image file

      • +
      • add_args (list) – Arguments to be added to initrd= pxe config

      -
      -
      -pylorax.creator.find_ostree_root(phys_root)[source]
      +
      +
      +pylorax.creator.find_ostree_root(phys_root)[source]

      Find root of ostree deployment

      Parameters
      -

      phys_root (str) – Path to physical root

      +

      phys_root (str) – Path to physical root

      Returns

      Relative path of ostree deployment root

      Return type
      -

      str

      +

      str

      Raises
      -

      Exception – More than one deployment roots were found

      +

      Exception – More than one deployment roots were found

      -
      -
      -pylorax.creator.get_arch(mount_dir)[source]
      +
      +
      +pylorax.creator.get_arch(mount_dir)[source]

      Get the kernel arch

      Returns

      Arch of first kernel found at mount_dir/boot/ or i386

      Return type
      -

      str

      +

      str

      -
      -
      -pylorax.creator.is_image_mounted(disk_img)[source]
      +
      +
      +pylorax.creator.is_image_mounted(disk_img)[source]

      Check to see if the disk_img is mounted

      Returns

      True if disk_img is in /proc/mounts

      Return type
      -

      bool

      +

      bool

      -
      -
      -pylorax.creator.make_appliance(disk_img, name, template, outfile, networks=None, ram=1024, vcpus=1, arch=None, title='Linux', project='Linux', releasever='29')[source]
      +
      +
      +pylorax.creator.make_appliance(disk_img, name, template, outfile, networks=None, ram=1024, vcpus=1, arch=None, title='Linux', project='Linux', releasever='29')[source]

      Generate an appliance description file

      Parameters
        -
      • disk_img (str) – Full path of the disk image

      • -
      • name (str) – Name of the appliance, passed to the template

      • -
      • template (str) – Full path of Mako template

      • -
      • outfile (str) – Full path of file to write, using template

      • -
      • networks (list) – List of networks(str) from the kickstart

      • -
      • ram (int) – Ram, in MiB, passed to template. Default is 1024

      • -
      • vcpus (int) – CPUs, passed to template. Default is 1

      • -
      • arch (str) – CPU architecture. Default is ‘x86_64’

      • -
      • title (str) – Title, passed to template. Default is ‘Linux’

      • -
      • project (str) – Project, passed to template. Default is ‘Linux’

      • -
      • releasever (str) – Release version, passed to template. Default is 29

      • +
      • disk_img (str) – Full path of the disk image

      • +
      • name (str) – Name of the appliance, passed to the template

      • +
      • template (str) – Full path of Mako template

      • +
      • outfile (str) – Full path of file to write, using template

      • +
      • networks (list) – List of networks(str) from the kickstart

      • +
      • ram (int) – Ram, in MiB, passed to template. Default is 1024

      • +
      • vcpus (int) – CPUs, passed to template. Default is 1

      • +
      • arch (str) – CPU architecture. Default is ‘x86_64’

      • +
      • title (str) – Title, passed to template. Default is ‘Linux’

      • +
      • project (str) – Project, passed to template. Default is ‘Linux’

      • +
      • releasever (str) – Release version, passed to template. Default is 29

      -
      -
      -pylorax.creator.make_image(opts, ks, cancel_func=None)[source]
      +
      +
      +pylorax.creator.make_image(opts, ks, cancel_func=None)[source]

      Install to a disk image

      Parameters
      • opts (argparse options) – options passed to livemedia-creator

      • -
      • ks (str) – Path to the kickstart to use for the installation

      • +
      • ks (str) – Path to the kickstart to use for the installation

      • cancel_func (function) – Function that returns True to cancel build

      @@ -495,29 +507,29 @@ this. Everything else should be a nop.

      Path of the image created

      Return type
      -

      str

      +

      str

      Use qemu+boot.iso or anaconda to install to a disk image.

      -
      -
      -pylorax.creator.make_live_images(opts, work_dir, disk_img)[source]
      +
      +
      +pylorax.creator.make_live_images(opts, work_dir, disk_img)[source]

      Create live images from direcory or rootfs image

      Parameters
      • opts (argparse options) – options passed to livemedia-creator

      • -
      • work_dir (str) – Directory for storing results

      • -
      • disk_img (str) – Path to disk image (fsimage or partitioned)

      • +
      • work_dir (str) – Directory for storing results

      • +
      • disk_img (str) – Path to disk image (fsimage or partitioned)

      Returns

      Path of directory with created images or None

      Return type
      -

      str

      +

      str

      fsck.ext4 is run on the rootfs_image to make sure there are no errors and to zero @@ -525,16 +537,16 @@ out any deleted blocks to make it compress better. If this fails for any reason it will return None and log the error.

      -
      -
      -pylorax.creator.make_livecd(opts, mount_dir, work_dir)[source]
      +
      +
      +pylorax.creator.make_livecd(opts, mount_dir, work_dir)[source]

      Take the content from the disk image and make a livecd out of it

      Parameters
      • opts (argparse options) – options passed to livemedia-creator

      • -
      • mount_dir (str) – Directory tree to compress

      • -
      • work_dir (str) – Output compressed image to work_dir+images/install.img

      • +
      • mount_dir (str) – Directory tree to compress

      • +
      • work_dir (str) – Output compressed image to work_dir+images/install.img

      @@ -549,39 +561,39 @@ root=live:CDLABEL=<volid> rd.live.image

    -
    -
    -pylorax.creator.make_runtime(opts, mount_dir, work_dir, size=None)[source]
    +
    +
    +pylorax.creator.make_runtime(opts, mount_dir, work_dir, size=None)[source]

    Make the squashfs image from a directory

    Parameters
    • opts (argparse options) – options passed to livemedia-creator

    • -
    • mount_dir (str) – Directory tree to compress

    • -
    • work_dir (str) – Output compressed image to work_dir+images/install.img

    • -
    • size (int) – Size of disk image, in GiB

    • +
    • mount_dir (str) – Directory tree to compress

    • +
    • work_dir (str) – Output compressed image to work_dir+images/install.img

    • +
    • size (int) – Size of disk image, in GiB

    -
    -
    -pylorax.creator.make_squashfs(opts, disk_img, work_dir)[source]
    +
    +
    +pylorax.creator.make_squashfs(opts, disk_img, work_dir)[source]

    Create a squashfs image of an unpartitioned filesystem disk image

    Parameters
      -
    • disk_img (str) – Path to the unpartitioned filesystem disk image

    • -
    • work_dir (str) – Output compressed image to work_dir+images/install.img

    • -
    • compression (str) – Compression type to use

    • +
    • disk_img (str) – Path to the unpartitioned filesystem disk image

    • +
    • work_dir (str) – Output compressed image to work_dir+images/install.img

    • +
    • compression (str) – Compression type to use

    Returns

    True if squashfs creation was successful. False if there was an error.

    Return type
    -

    bool

    +

    bool

    Take disk_img and put it into LiveOS/rootfs.img and squashfs this @@ -591,33 +603,33 @@ out any deleted blocks to make it compress better. If this fails for any reason it will return False and log the error.

    -
    -
    -pylorax.creator.mount_boot_part_over_root(img_mount)[source]
    +
    +
    +pylorax.creator.mount_boot_part_over_root(img_mount)[source]

    Mount boot partition to /boot of root fs mounted in img_mount

    Used for OSTree so it finds deployment configurations on live rootfs

    param img_mount: object with mounted disk image root partition type img_mount: imgutils.PartitionMount

    -
    -
    -pylorax.creator.rebuild_initrds_for_live(opts, sys_root_dir, results_dir)[source]
    +
    +
    +pylorax.creator.rebuild_initrds_for_live(opts, sys_root_dir, results_dir)[source]

    Rebuild intrds for pxe live image (root=live:http://)

    Parameters
    • opts (argparse options) – options passed to livemedia-creator

    • -
    • sys_root_dir (str) – Path to root of the system

    • -
    • results_dir (str) – Path of directory for storing results

    • +
    • sys_root_dir (str) – Path to root of the system

    • +
    • results_dir (str) – Path of directory for storing results

    -
    -
    -pylorax.creator.run_creator(opts, cancel_func=None)[source]
    +
    +
    +pylorax.creator.run_creator(opts, cancel_func=None)[source]

    Run the image creator process

    Parameters
    @@ -638,9 +650,9 @@ See the cmdline –help for livemedia-creator for the possible options

    (Yes, this is not ideal, but we can fix that later)

    -
    -
    -pylorax.creator.squashfs_args(opts)[source]
    +
    +
    +pylorax.creator.squashfs_args(opts)[source]

    Returns the compression type and args to use when making squashfs

    Parameters
    @@ -650,53 +662,53 @@ See the cmdline –help for livemedia-creator for the possible options

    tuple of compression type and args

    Return type
    -

    tuple

    +

    tuple

    - -
    + +

    pylorax.decorators module

    -
    -
    -pylorax.decorators.singleton(cls)[source]
    +
    +
    +pylorax.decorators.singleton(cls)[source]
    -
    -
    + +

    pylorax.discinfo module

    -
    -
    -class pylorax.discinfo.DiscInfo(release, basearch)[source]
    -

    Bases: object

    -
    -
    -write(outfile)[source]
    +
    +
    +class pylorax.discinfo.DiscInfo(release, basearch)[source]
    +

    Bases: object

    +
    +
    +write(outfile)[source]
    -
    -
    + +

    pylorax.dnfbase module

    -
    -
    -pylorax.dnfbase.get_dnf_base_object(installroot, sources, mirrorlists=None, repos=None, enablerepos=None, disablerepos=None, tempdir='/var/tmp', proxy=None, releasever='8', cachedir=None, logdir=None, sslverify=True)[source]
    +
    +
    +pylorax.dnfbase.get_dnf_base_object(installroot, sources, mirrorlists=None, repos=None, enablerepos=None, disablerepos=None, tempdir='/var/tmp', proxy=None, releasever='8', cachedir=None, logdir=None, sslverify=True)[source]

    Create a dnf Base object and setup the repositories and installroot

    Parameters
    • installroot (string) – Full path to the installroot

    • -
    • sources (list) – List of source repo urls to use for the installation

    • -
    • enablerepos (list) – List of repo names to enable

    • -
    • disablerepos (list) – List of repo names to disable

    • -
    • mirrorlist (list) – List of mirrors to use

    • +
    • sources (list) – List of source repo urls to use for the installation

    • +
    • enablerepos (list) – List of repo names to enable

    • +
    • disablerepos (list) – List of repo names to disable

    • +
    • mirrorlist (list) – List of mirrors to use

    • tempdir (string) – Path of temporary directory

    • proxy (string) – http proxy to use when fetching packages

    • releasever (string) – Release version to pass to dnf

    • cachedir (string) – Directory to use for caching packages

    • -
    • noverifyssl (bool) – Set to True to ignore the CA of ssl certs. eg. use self-signed ssl for https repos.

    • +
    • noverifyssl (bool) – Set to True to ignore the CA of ssl certs. eg. use self-signed ssl for https repos.

    @@ -704,63 +716,63 @@ See the cmdline –help for livemedia-creator for the possible options

    If cachedir is None a dnf.cache directory is created inside tmpdir

    -
    -
    + +

    pylorax.dnfhelper module

    -
    -
    -class pylorax.dnfhelper.LoraxDownloadCallback[source]
    +
    +
    +class pylorax.dnfhelper.LoraxDownloadCallback[source]

    Bases: DownloadProgress

    -
    -
    -end(payload, status, msg)[source]
    +
    +
    +end(payload, status, msg)[source]
    -
    -
    -progress(payload, done)[source]
    +
    +
    +progress(payload, done)[source]
    -
    -
    -start(total_files, total_size, total_drpms=0)[source]
    +
    +
    +start(total_files, total_size, total_drpms=0)[source]
    -
    -
    -class pylorax.dnfhelper.LoraxRpmCallback[source]
    +
    +
    +class pylorax.dnfhelper.LoraxRpmCallback[source]

    Bases: TransactionProgress

    -
    -
    -error(message)[source]
    +
    +
    +error(message)[source]
    -
    -
    -progress(package, action, ti_done, ti_total, ts_done, ts_total)[source]
    +
    +
    +progress(package, action, ti_done, ti_total, ts_done, ts_total)[source]
    -
    -
    + +

    pylorax.executils module

    -
    -
    -class pylorax.executils.ExecProduct(rc, stdout, stderr)[source]
    -

    Bases: object

    +
    +
    +class pylorax.executils.ExecProduct(rc, stdout, stderr)[source]
    +

    Bases: object

    -
    -
    -pylorax.executils.augmentEnv()[source]
    +
    +
    +pylorax.executils.augmentEnv()[source]
    -
    -
    -pylorax.executils.execReadlines(command, argv, stdin=None, root='/', env_prune=None, filter_stderr=False, callback=<function <lambda>>, env_add=None, reset_handlers=True, reset_lang=True)[source]
    +
    +
    +pylorax.executils.execReadlines(command, argv, stdin=None, root='/', env_prune=None, filter_stderr=False, callback=<function <lambda>>, env_add=None, reset_handlers=True, reset_lang=True)[source]

    Execute an external command and return the line output of the command in real-time.

    This method assumes that there is a reasonably low delay between the @@ -794,9 +806,9 @@ stdout and then keeps on truckin’ there will be problems.

    This returns an iterator with the lines from the command until it has finished

    -
    -
    -pylorax.executils.execWithCapture(command, argv, stdin=None, root='/', log_output=True, filter_stderr=False, raise_err=False, callback=None, env_add=None, reset_handlers=True, reset_lang=True)[source]
    +
    +
    +pylorax.executils.execWithCapture(command, argv, stdin=None, root='/', log_output=True, filter_stderr=False, raise_err=False, callback=None, env_add=None, reset_handlers=True, reset_lang=True)[source]

    Run an external program and capture standard out and err.

    Parameters
    @@ -819,9 +831,9 @@ This returns an iterator with the lines from the command until it has finished
    -
    -
    -pylorax.executils.execWithRedirect(command, argv, stdin=None, stdout=None, root='/', env_prune=None, log_output=True, binary_output=False, raise_err=False, callback=None, env_add=None, reset_handlers=True, reset_lang=True)[source]
    +
    +
    +pylorax.executils.execWithRedirect(command, argv, stdin=None, stdout=None, root='/', env_prune=None, log_output=True, binary_output=False, raise_err=False, callback=None, env_add=None, reset_handlers=True, reset_lang=True)[source]

    Run an external program and redirect the output to a file.

    Parameters
    @@ -847,21 +859,21 @@ This returns an iterator with the lines from the command until it has finished
    -
    -
    -pylorax.executils.runcmd(cmd, **kwargs)[source]
    +
    +
    +pylorax.executils.runcmd(cmd, **kwargs)[source]

    run execWithRedirect with raise_err=True

    -
    -
    -pylorax.executils.runcmd_output(cmd, **kwargs)[source]
    +
    +
    +pylorax.executils.runcmd_output(cmd, **kwargs)[source]

    run execWithCapture with raise_err=True

    -
    -
    -pylorax.executils.setenv(name, value)[source]
    +
    +
    +pylorax.executils.setenv(name, value)[source]

    Set an environment variable to be used by child processes.

    This method does not modify os.environ for the running process, which is not thread-safe. If setenv has already been called for a particular @@ -869,16 +881,16 @@ variable name, the old value is overwritten.

    Parameters
      -
    • name (str) – The name of the environment variable

    • -
    • value (str) – The value of the environment variable

    • +
    • name (str) – The name of the environment variable

    • +
    • value (str) – The value of the environment variable

    -
    -
    -pylorax.executils.startProgram(argv, root='/', stdin=None, stdout=-1, stderr=-2, env_prune=None, env_add=None, reset_handlers=True, reset_lang=True, **kwargs)[source]
    +
    +
    +pylorax.executils.startProgram(argv, root='/', stdin=None, stdout=- 1, stderr=- 2, env_prune=None, env_add=None, reset_handlers=True, reset_lang=True, **kwargs)[source]

    Start an external program and return the Popen object.

    The root and reset_handlers arguments are handled by passing a preexec_fn argument to subprocess.Popen, but an additional preexec_fn @@ -906,61 +918,61 @@ last.

    -
    -
    + +

    pylorax.imgutils module

    -
    -
    -class pylorax.imgutils.DMDev(dev, size, name=None)[source]
    -

    Bases: object

    +
    +
    +class pylorax.imgutils.DMDev(dev, size, name=None)[source]
    +

    Bases: object

    -
    -
    -class pylorax.imgutils.LoopDev(filename, size=None)[source]
    -

    Bases: object

    +
    +
    +class pylorax.imgutils.LoopDev(filename, size=None)[source]
    +

    Bases: object

    -
    -
    -class pylorax.imgutils.Mount(dev, opts='', mnt=None)[source]
    -

    Bases: object

    +
    +
    +class pylorax.imgutils.Mount(dev, opts='', mnt=None)[source]
    +

    Bases: object

    -
    -
    -class pylorax.imgutils.PartitionMount(disk_img, mount_ok=None, submount=None)[source]
    -

    Bases: object

    +
    +
    +class pylorax.imgutils.PartitionMount(disk_img, mount_ok=None, submount=None)[source]
    +

    Bases: object

    Mount a partitioned image file using kpartx

    -
    -
    -pylorax.imgutils.compress(command, root, outfile, compression='xz', compressargs=None)[source]
    +
    +
    +pylorax.imgutils.compress(command, root, outfile, compression='xz', compressargs=None)[source]

    Make a compressed archive of the given rootdir or file. command is a list of the archiver commands to run compression should be “xz”, “gzip”, “lzma”, “bzip2”, or None. compressargs will be used on the compression commandline.

    -
    -
    -pylorax.imgutils.copytree(src, dest, preserve=True)[source]
    +
    +
    +pylorax.imgutils.copytree(src, dest, preserve=True)[source]

    Copy a tree of files using cp -a, thus preserving modes, timestamps, links, acls, sparse files, xattrs, selinux contexts, etc. If preserve is False, uses cp -R (useful for modeless filesystems) raises CalledProcessError if copy fails.

    -
    -
    -pylorax.imgutils.default_image_name(compression, basename)[source]
    +
    +
    +pylorax.imgutils.default_image_name(compression, basename)[source]

    Return a default image name with the correct suffix for the compression type.

    Parameters
      -
    • compression (str) – Compression type

    • -
    • basename (str) – Base filename

    • +
    • compression (str) – Compression type

    • +
    • basename (str) – Base filename

    Returns
    @@ -970,56 +982,56 @@ raises CalledProcessError if copy fails.

    If the compression is unknown it defaults to xz

    -
    -
    -pylorax.imgutils.dm_attach(dev, size, name=None)[source]
    +
    +
    +pylorax.imgutils.dm_attach(dev, size, name=None)[source]

    Attach a devicemapper device to the given device, with the given size. If name is None, a random name will be chosen. Returns the device name. raises CalledProcessError if dmsetup fails.

    -
    -
    -pylorax.imgutils.dm_detach(dev)[source]
    +
    +
    +pylorax.imgutils.dm_detach(dev)[source]

    Detach the named devicemapper device. Returns False if dmsetup fails.

    -
    -
    -pylorax.imgutils.do_grafts(grafts, dest, preserve=True)[source]
    +
    +
    +pylorax.imgutils.do_grafts(grafts, dest, preserve=True)[source]

    Copy each of the items listed in grafts into dest. If the key ends with ‘/’ it’s assumed to be a directory which should be created, otherwise just the leading directories will be created.

    -
    -
    -pylorax.imgutils.estimate_size(rootdir, graft=None, fstype=None, blocksize=4096, overhead=256)[source]
    +
    +
    +pylorax.imgutils.estimate_size(rootdir, graft=None, fstype=None, blocksize=4096, overhead=256)[source]
    -
    -
    -pylorax.imgutils.get_loop_name(path)[source]
    +
    +
    +pylorax.imgutils.get_loop_name(path)[source]

    Return the loop device associated with the path. Raises RuntimeError if more than one loop is associated

    -
    -
    -pylorax.imgutils.loop_attach(outfile)[source]
    +
    +
    +pylorax.imgutils.loop_attach(outfile)[source]

    Attach a loop device to the given file. Return the loop device name. Raises CalledProcessError if losetup fails.

    -
    -
    -pylorax.imgutils.loop_detach(loopdev)[source]
    +
    +
    +pylorax.imgutils.loop_detach(loopdev)[source]

    Detach the given loop device. Return False on failure.

    -
    -
    -pylorax.imgutils.loop_waitfor(loop_dev, outfile)[source]
    +
    +
    +pylorax.imgutils.loop_waitfor(loop_dev, outfile)[source]

    Make sure the loop device is attached to the outfile.

    It seems that on rare occasions losetup can return before the /dev/loopX is ready for use, causing problems with mkfs. This tries to make sure that the @@ -1027,29 +1039,29 @@ loop device really is associated with the backing file before continuing.

    Raise RuntimeError if it isn’t setup after 5 tries.

    -
    -
    -pylorax.imgutils.mkbtrfsimg(rootdir, outfile, size=None, label='', mountargs='', graft=None)[source]
    +
    +
    +pylorax.imgutils.mkbtrfsimg(rootdir, outfile, size=None, label='', mountargs='', graft=None)[source]
    -
    -
    -pylorax.imgutils.mkcpio(root, outfile, compression='xz', compressargs=None)[source]
    +
    +
    +pylorax.imgutils.mkcpio(root, outfile, compression='xz', compressargs=None)[source]
    -
    -
    -pylorax.imgutils.mkdosimg(rootdir, outfile, size=None, label='', mountargs='shortname=winnt, umask=0077', graft=None)[source]
    +
    +
    +pylorax.imgutils.mkdosimg(rootdir, outfile, size=None, label='', mountargs='shortname=winnt,umask=0077', graft=None)[source]
    -
    -
    -pylorax.imgutils.mkext4img(rootdir, outfile, size=None, label='', mountargs='', graft=None)[source]
    +
    +
    +pylorax.imgutils.mkext4img(rootdir, outfile, size=None, label='', mountargs='', graft=None)[source]
    -
    -
    -pylorax.imgutils.mkfsimage(fstype, rootdir, outfile, size=None, mkfsargs=None, mountargs='', graft=None)[source]
    +
    +
    +pylorax.imgutils.mkfsimage(fstype, rootdir, outfile, size=None, mkfsargs=None, mountargs='', graft=None)[source]

    Generic filesystem image creation function. fstype should be a filesystem type - “mkfs.${fstype}” must exist. graft should be a dict: {“some/path/in/image”: “local/file/or/dir”};

    @@ -1059,84 +1071,84 @@ graft should be a dict: {“some/path/in/image”: “local/file/or/dir”};

    Will raise CalledProcessError if something goes wrong.

    -
    -
    -pylorax.imgutils.mkfsimage_from_disk(diskimage, fsimage, img_size=None, label='Anaconda')[source]
    +
    +
    +pylorax.imgutils.mkfsimage_from_disk(diskimage, fsimage, img_size=None, label='Anaconda')[source]

    Copy the / partition of a partitioned disk image to an un-partitioned disk image.

    Parameters
      -
    • diskimage (str) – The full path to partitioned disk image with a /

    • -
    • fsimage (str) – The full path of the output fs image file

    • -
    • img_size (int) – Optional size of the fsimage in MiB or None to make +

    • diskimage (str) – The full path to partitioned disk image with a /

    • +
    • fsimage (str) – The full path of the output fs image file

    • +
    • img_size (int) – Optional size of the fsimage in MiB or None to make it as small as possible

    • -
    • label (str) – The label to apply to the image. Defaults to “Anaconda”

    • +
    • label (str) – The label to apply to the image. Defaults to “Anaconda”

    -
    -
    -pylorax.imgutils.mkhfsimg(rootdir, outfile, size=None, label='', mountargs='', graft=None)[source]
    +
    +
    +pylorax.imgutils.mkhfsimg(rootdir, outfile, size=None, label='', mountargs='', graft=None)[source]
    -
    -
    -pylorax.imgutils.mkqcow2(outfile, size, options=None)[source]
    +
    +
    +pylorax.imgutils.mkqcow2(outfile, size, options=None)[source]

    use qemu-img to create a file of the given size. options is a list of options passed to qemu-img

    Default format is qcow2, override by passing “-f”, fmt in options.

    -
    -
    -pylorax.imgutils.mkqemu_img(outfile, size, options=None)[source]
    +
    +
    +pylorax.imgutils.mkqemu_img(outfile, size, options=None)[source]

    use qemu-img to create a file of the given size. options is a list of options passed to qemu-img

    Default format is qcow2, override by passing “-f”, fmt in options.

    -
    -
    -pylorax.imgutils.mkrootfsimg(rootdir, outfile, label, size=2, sysroot='')[source]
    +
    +
    +pylorax.imgutils.mkrootfsimg(rootdir, outfile, label, size=2, sysroot='')[source]

    Make rootfs image from a directory

    Parameters
      -
    • rootdir (str) – Root directory

    • -
    • outfile (str) – Path of output image file

    • -
    • label (str) – Filesystem label

    • -
    • size (int) – Size of the image in GiB, if None computed automatically

    • -
    • sysroot (str) – path to system (deployment) root relative to physical root

    • +
    • rootdir (str) – Root directory

    • +
    • outfile (str) – Path of output image file

    • +
    • label (str) – Filesystem label

    • +
    • size (int) – Size of the image in GiB, if None computed automatically

    • +
    • sysroot (str) – path to system (deployment) root relative to physical root

    -
    -
    -pylorax.imgutils.mksparse(outfile, size)[source]
    +
    +
    +pylorax.imgutils.mksparse(outfile, size)[source]

    use os.ftruncate to create a sparse file of the given size.

    -
    -
    -pylorax.imgutils.mksquashfs(rootdir, outfile, compression='default', compressargs=None)[source]
    +
    +
    +pylorax.imgutils.mksquashfs(rootdir, outfile, compression='default', compressargs=None)[source]

    Make a squashfs image containing the given rootdir.

    -
    -
    -pylorax.imgutils.mktar(root, outfile, compression='xz', compressargs=None, selinux=True)[source]
    +
    +
    +pylorax.imgutils.mktar(root, outfile, compression='xz', compressargs=None, selinux=True)[source]
    -
    -
    -pylorax.imgutils.mount(dev, opts='', mnt=None)[source]
    +
    +
    +pylorax.imgutils.mount(dev, opts='', mnt=None)[source]

    Mount the given device at the given mountpoint, using the given opts. opts should be a comma-separated string of mount options. if mnt is none, a temporary directory will be created and its path will be @@ -1144,43 +1156,43 @@ returned. raises CalledProcessError if mount fails.

    -
    -
    -pylorax.imgutils.round_to_blocks(size, blocksize)[source]
    +
    +
    +pylorax.imgutils.round_to_blocks(size, blocksize)[source]

    If size isn’t a multiple of blocksize, round up to the next multiple

    -
    -
    -pylorax.imgutils.umount(mnt, lazy=False, maxretry=3, retrysleep=1.0, delete=True)[source]
    +
    +
    +pylorax.imgutils.umount(mnt, lazy=False, maxretry=3, retrysleep=1.0, delete=True)[source]

    Unmount the given mountpoint. If lazy is True, do a lazy umount (-l). If the mount was a temporary dir created by mount, it will be deleted. raises CalledProcessError if umount fails.

    -
    -
    + +

    pylorax.installer module

    -
    -
    -exception pylorax.installer.InstallError[source]
    -

    Bases: Exception

    +
    +
    +exception pylorax.installer.InstallError[source]
    +

    Bases: Exception

    -
    -
    -class pylorax.installer.QEMUInstall(opts, iso, ks_paths, disk_img, img_size=2048, kernel_args=None, memory=1024, vcpus=None, vnc=None, arch=None, cancel_func=None, virtio_host='127.0.0.1', virtio_port=6080, image_type=None, boot_uefi=False, ovmf_path=None)[source]
    -

    Bases: object

    +
    +
    +class pylorax.installer.QEMUInstall(opts, iso, ks_paths, disk_img, img_size=2048, kernel_args=None, memory=1024, vcpus=None, vnc=None, arch=None, cancel_func=None, virtio_host='127.0.0.1', virtio_port=6080, image_type=None, boot_uefi=False, ovmf_path=None)[source]
    +

    Bases: object

    Run qemu using an iso and a kickstart

    -
    -
    -pylorax.installer.anaconda_cleanup(dirinstall_path)[source]
    +
    +
    +pylorax.installer.anaconda_cleanup(dirinstall_path)[source]

    Cleanup any leftover mounts from anaconda

    Parameters
    -

    dirinstall_path (str) – Path where anaconda mounts things

    +

    dirinstall_path (str) – Path where anaconda mounts things

    Returns

    True if cleanups were successful. False if any of them failed.

    @@ -1192,22 +1204,22 @@ typically be set to /mnt/sysimage/

    other mountpoints.

    -
    -
    -pylorax.installer.append_initrd(initrd, files)[source]
    +
    +
    +pylorax.installer.append_initrd(initrd, files)[source]

    Append files to an initrd.

    Parameters
      -
    • initrd (str) – Path to initrd

    • -
    • files (list) – list of file paths to add

    • +
    • initrd (str) – Path to initrd

    • +
    • files (list) – list of file paths to add

    Returns

    Path to a new initrd

    Return type
    -

    str

    +

    str

    The files are added to the initrd by creating a cpio image @@ -1217,50 +1229,50 @@ copy of the initrd.

    cpio archive.

    -
    -
    -pylorax.installer.create_vagrant_metadata(path, size=0)[source]
    +
    +
    +pylorax.installer.create_vagrant_metadata(path, size=0)[source]

    Create a default Vagrant metadata.json file

    Parameters
      -
    • path (str) – Path to metadata.json file

    • -
    • size (int) – Disk size in MiB

    • +
    • path (str) – Path to metadata.json file

    • +
    • size (int) – Disk size in MiB

    -
    -
    -pylorax.installer.find_free_port(start=5900, end=5999, host='127.0.0.1')[source]
    +
    +
    +pylorax.installer.find_free_port(start=5900, end=5999, host='127.0.0.1')[source]

    Return first free port in range.

    Parameters
      -
    • start (int) – Starting port number

    • -
    • end (int) – Ending port number

    • -
    • host (str) – Host IP to search

    • +
    • start (int) – Starting port number

    • +
    • end (int) – Ending port number

    • +
    • host (str) – Host IP to search

    Returns

    First free port or -1 if none found

    Return type
    -

    int

    +

    int

    -
    -
    -pylorax.installer.novirt_cancel_check(cancel_funcs, proc)[source]
    +
    +
    +pylorax.installer.novirt_cancel_check(cancel_funcs, proc)[source]

    Check to see if there has been an error in the logs

    Parameters
      -
    • cancel_funcs (list) – list of functions to call, True from any one cancels the build

    • -
    • proc (subprocess.Popen) – Popen object for the anaconda process

    • +
    • cancel_funcs (list) – list of functions to call, True from any one cancels the build

    • +
    • proc (subprocess.Popen) – Popen object for the anaconda process

    Returns
    @@ -1271,18 +1283,18 @@ cpio archive.

    When an error is detected the process is terminated and this returns True

    -
    -
    -pylorax.installer.novirt_install(opts, disk_img, disk_size, cancel_func=None, tar_img=None)[source]
    +
    +
    +pylorax.installer.novirt_install(opts, disk_img, disk_size, cancel_func=None, tar_img=None)[source]

    Use Anaconda to install to a disk image

    Parameters
    • opts (argparse options) – options passed to livemedia-creator

    • -
    • disk_img (str) – The full path to the disk image to be created

    • -
    • disk_size (int) – The size of the disk_img in MiB

    • +
    • disk_img (str) – The full path to the disk image to be created

    • +
    • disk_size (int) – The size of the disk_img in MiB

    • cancel_func (function) – Function that returns True to cancel build

    • -
    • tar_img (str) – For make_tar_disk, the path to final tarball to be created

    • +
    • tar_img (str) – For make_tar_disk, the path to final tarball to be created

    @@ -1290,15 +1302,15 @@ When an error is detected the process is terminated and this returns True

    passed creates a qemu disk image or tarfile.

    -
    -
    -pylorax.installer.update_vagrant_metadata(path, size)[source]
    +
    +
    +pylorax.installer.update_vagrant_metadata(path, size)[source]

    Update the Vagrant metadata.json file

    Parameters
      -
    • path (str) – Path to metadata.json file

    • -
    • size (int) – Disk size in MiB

    • +
    • path (str) – Path to metadata.json file

    • +
    • size (int) – Disk size in MiB

    @@ -1306,19 +1318,19 @@ passed creates a qemu disk image or tarfile.

    metadata file are set correctly. All other values are left untouched.

    -
    -
    -pylorax.installer.virt_install(opts, install_log, disk_img, disk_size, cancel_func=None, tar_img=None)[source]
    +
    +
    +pylorax.installer.virt_install(opts, install_log, disk_img, disk_size, cancel_func=None, tar_img=None)[source]

    Use qemu to install to a disk image

    Parameters
    • opts (argparse options) – options passed to livemedia-creator

    • -
    • install_log (str) – The path to write the log from qemu

    • -
    • disk_img (str) – The full path to the disk image to be created

    • -
    • disk_size (int) – The size of the disk_img in MiB

    • +
    • install_log (str) – The path to write the log from qemu

    • +
    • disk_img (str) – The full path to the disk image to be created

    • +
    • disk_size (int) – The size of the disk_img in MiB

    • cancel_func (function) – Function that returns True to cancel build

    • -
    • tar_img (str) – For make_tar_disk, the path to final tarball to be created

    • +
    • tar_img (str) – For make_tar_disk, the path to final tarball to be created

    @@ -1326,12 +1338,12 @@ metadata file are set correctly. All other values are left untouched.

    image and then optionally, based on the opts passed, creates tarfile.

    -
    -
    + +

    pylorax.ltmpl module

    -
    -
    -class pylorax.ltmpl.LiveTemplateRunner(dbo, fatalerrors=True, templatedir=None, defaults=None)[source]
    +
    +
    +class pylorax.ltmpl.LiveTemplateRunner(dbo, fatalerrors=True, templatedir=None, defaults=None)[source]

    Bases: pylorax.ltmpl.TemplateRunner

    This class parses and executes a limited Lorax template. Sample usage:

    @@ -1341,9 +1353,9 @@ runner.run(“live-install.tmpl”)

    It is meant to be used with the live-install.tmpl which lists the per-arch pacages needed to build the live-iso output.

    -
    -
    -installpkg(*pkgs)[source]
    +
    +
    +installpkg(*pkgs)[source]
    installpkg [–required|–optional] [–except PKGGLOB [–except PKGGLOB …]] PKGGLOB [PKGGLOB …]

    Request installation of all packages matching the given globs. Note that this is just a request - nothing is actually installed @@ -1355,20 +1367,20 @@ until the ‘run_pkg_transaction’ command is given.

    -
    -
    -class pylorax.ltmpl.LoraxTemplate(directories=None)[source]
    -

    Bases: object

    -
    -
    -parse(template_file, variables)[source]
    +
    +
    +class pylorax.ltmpl.LoraxTemplate(directories=None)[source]
    +

    Bases: object

    +
    +
    +parse(template_file, variables)[source]
    -
    -
    -class pylorax.ltmpl.LoraxTemplateRunner(inroot, outroot, dbo=None, fatalerrors=True, templatedir=None, defaults=None)[source]
    +
    +
    +class pylorax.ltmpl.LoraxTemplateRunner(inroot, outroot, dbo=None, fatalerrors=True, templatedir=None, defaults=None)[source]

    Bases: pylorax.ltmpl.TemplateRunner

    This class parses and executes Lorax templates. Sample usage:

    @@ -1395,12 +1407,12 @@ object - so adding a new command is as easy as adding a new function.

    on that line (after word splitting and brace expansion)

  • Commands should raise exceptions for errors - don’t use sys.exit()

  • -
    -
    -append(filename, data)[source]
    +
    +
    +append(filename, data)[source]
    append FILE STRING

    Append STRING (followed by a newline character) to FILE. -Python character escape sequences (‘n’, ‘t’, etc.) will be +Python character escape sequences (’n’, ‘t’, etc.) will be converted to the appropriate characters.

    Examples:

    @@ -1411,18 +1423,18 @@ append /etc/resolv.conf “”

    -
    -
    -chmod(fileglob, mode)[source]
    +
    +
    +chmod(fileglob, mode)[source]
    chmod FILEGLOB OCTALMODE

    Change the mode of all the files matching FILEGLOB to OCTALMODE.

    -
    -
    -copy(src, dest)[source]
    +
    +
    +copy(src, dest)[source]
    copy SRC DEST

    Copy SRC to DEST. If DEST is a directory, SRC will be copied inside it. @@ -1432,9 +1444,9 @@ that name, if the path leading to it exists.

    -
    -
    -createaddrsize(addr, src, dest)[source]
    +
    +
    +createaddrsize(addr, src, dest)[source]
    createaddrsize INITRD_ADDRESS INITRD ADDRSIZE

    Create the initrd.addrsize file required in LPAR boot process.

    @@ -1445,18 +1457,18 @@ that name, if the path leading to it exists.

    -
    - +
    +
    hardlink SRC DEST

    Create a hardlink at DEST which is linked to SRC.

    -
    -
    -install(srcglob, dest)[source]
    +
    +
    +install(srcglob, dest)[source]
    install SRC DEST

    Copy the given file (or files, if a glob is used) from the input tree to the given destination in the output tree. @@ -1474,9 +1486,9 @@ install /usr/share/myconfig/grub.conf.in /boot/grub.conf

    -
    -
    -installimg(*args)[source]
    +
    +
    +installimg(*args)[source]
    installimg [–xz|–gzip|–bzip2|–lzma] [-ARG|–ARG=OPTION] SRCDIR DESTFILE

    Create a compressed cpio archive of the contents of SRCDIR and place it in DESTFILE.

    @@ -1494,18 +1506,18 @@ passed to it. The default is xz -9

    -
    -
    -installinitrd(section, src, dest)[source]
    +
    +
    +installinitrd(section, src, dest)[source]
    installinitrd SECTION SRC DEST

    Same as installkernel, but for “initrd”.

    -
    -
    -installkernel(section, src, dest)[source]
    +
    +
    +installkernel(section, src, dest)[source]
    installkernel SECTION SRC DEST

    Install the kernel from SRC in the input tree to DEST in the output tree, and then add an item to the treeinfo data store, in the named @@ -1519,9 +1531,9 @@ treeinfo SECTION kernel DEST

    -
    -
    -installpkg(*pkgs)[source]
    +
    +
    +installpkg(*pkgs)[source]
    installpkg [–required|–optional] [–except PKGGLOB [–except PKGGLOB …]] PKGGLOB [PKGGLOB …]

    Request installation of all packages matching the given globs. Note that this is just a request - nothing is actually installed @@ -1531,18 +1543,18 @@ until the ‘run_pkg_transaction’ command is given.

    -
    -
    -installupgradeinitrd(section, src, dest)[source]
    +
    +
    +installupgradeinitrd(section, src, dest)[source]
    installupgradeinitrd SECTION SRC DEST

    Same as installkernel, but for “upgrade”.

    -
    -
    -log(msg)[source]
    +
    +
    +log(msg)[source]
    log MESSAGE

    Emit the given log message. Be sure to put it in quotes!

    @@ -1553,9 +1565,9 @@ until the ‘run_pkg_transaction’ command is given.

    -
    -
    -mkdir(*dirs)[source]
    +
    +
    +mkdir(*dirs)[source]
    mkdir DIR [DIR …]

    Create the named DIR(s). Will create leading directories as needed.

    @@ -1566,18 +1578,18 @@ until the ‘run_pkg_transaction’ command is given.

    -
    -
    -move(src, dest)[source]
    +
    +
    +move(src, dest)[source]
    move SRC DEST

    Move SRC to DEST.

    -
    -
    -remove(*fileglobs)[source]
    +
    +
    +remove(*fileglobs)[source]
    remove FILEGLOB [FILEGLOB …]

    Remove all the named files or directories. Will not raise exceptions if the file(s) are not found.

    @@ -1585,9 +1597,9 @@ Will not raise exceptions if the file(s) are not found.

    -
    -
    -removefrom(pkg, *globs)[source]
    +
    +
    +removefrom(pkg, *globs)[source]
    removefrom PKGGLOB [–allbut] FILEGLOB [FILEGLOB…]

    Remove all files matching the given file globs from the package (or packages) named. @@ -1602,9 +1614,9 @@ removefrom xfsprogs –allbut /sbin/*

    -
    -
    -removekmod(*globs)[source]
    +
    +
    +removekmod(*globs)[source]
    removekmod GLOB [GLOB…] [–allbut] KEEPGLOB [KEEPGLOB…]

    Remove all files and directories matching the given file globs from the kernel modules directory.

    @@ -1622,9 +1634,9 @@ removekmod drivers/char –allbut virtio_console hw_random

    -
    -
    -removepkg(*pkgs)[source]
    +
    +
    +removepkg(*pkgs)[source]
    removepkg PKGGLOB [PKGGLOB…]

    Delete the named package(s).

    @@ -1636,9 +1648,9 @@ Files are deleted, but directories are left behind.

    -
    -
    -replace(pat, repl, *fileglobs)[source]
    +
    +
    +replace(pat, repl, *fileglobs)[source]
    replace PATTERN REPLACEMENT FILEGLOB [FILEGLOB …]

    Find-and-replace the given PATTERN (Python-style regex) with the given REPLACEMENT string for each of the files listed.

    @@ -1650,16 +1662,16 @@ REPLACEMENT string for each of the files listed.

    -
    -
    -run_pkg_transaction()[source]
    +
    +
    +run_pkg_transaction()[source]

    Actually install all the packages requested by previous ‘installpkg’ commands.

    -
    -
    -runcmd(*cmdlist)[source]
    +
    +
    +runcmd(*cmdlist)[source]
    runcmd CMD [ARG …]

    Run the given command with the given arguments.

    NOTE: All paths given MUST be COMPLETE, ABSOLUTE PATHS to the file @@ -1682,18 +1694,18 @@ runcmd find ${root} -name “.pyo” -type f -delete

    -
    - +
    +
    symlink SRC DEST

    Create a symlink at DEST which points to SRC.

    -
    -
    -systemctl(cmd, *units)[source]
    +
    +
    +systemctl(cmd, *units)[source]
    systemctl [enable|disable|mask] UNIT [UNIT…]

    Enable, disable, or mask the given systemd units.

    @@ -1705,9 +1717,9 @@ systemctl mask fedora-storage-init.service fedora-configure.service

    -
    -
    -treeinfo(section, key, *valuetoks)[source]
    +
    +
    +treeinfo(section, key, *valuetoks)[source]
    treeinfo SECTION KEY ARG [ARG …]

    Add an item to the treeinfo data store. The given SECTION will have a new item added where @@ -1722,10 +1734,10 @@ KEY = ARG ARG …

    -
    -
    -class pylorax.ltmpl.TemplateRunner(fatalerrors=True, templatedir=None, defaults=None, builtins=None)[source]
    -

    Bases: object

    +
    +
    +class pylorax.ltmpl.TemplateRunner(fatalerrors=True, templatedir=None, defaults=None, builtins=None)[source]
    +

    Bases: object

    This class parses and executes Lorax templates. Sample usage:

    # install a bunch of packages @@ -1749,263 +1761,270 @@ with the rest of the line as arguments

  • Parsing and execution are separate passes - so you can’t use the result of a command in an %if statement (or any other control statements)!

  • -
    -
    -run(templatefile, **variables)[source]
    +
    +
    +run(templatefile, **variables)[source]
    -
    -
    -pylorax.ltmpl.brace_expand(s)[source]
    +
    +
    +pylorax.ltmpl.brace_expand(s)[source]
    -
    -
    -pylorax.ltmpl.rexists(pathname, root='')[source]
    +
    +
    +pylorax.ltmpl.rexists(pathname, root='')[source]
    -
    -
    -pylorax.ltmpl.rglob(pathname, root='/', fatal=False)[source]
    +
    +
    +pylorax.ltmpl.rglob(pathname, root='/', fatal=False)[source]
    -
    -
    -pylorax.ltmpl.split_and_expand(line)[source]
    +
    +
    +pylorax.ltmpl.split_and_expand(line)[source]
    - -
    + +

    pylorax.monitor module

    -
    -
    -class pylorax.monitor.LogMonitor(log_path=None, host='localhost', port=0, timeout=None)[source]
    -

    Bases: object

    +
    +
    +class pylorax.monitor.LogMonitor(log_path=None, host='localhost', port=0, timeout=None)[source]
    +

    Bases: object

    Setup a server to monitor the logs output by the installation

    This needs to be running before the virt-install runs, it expects there to be a listener on the port used for the virtio log port.

    -
    -
    -shutdown()[source]
    +
    +
    +shutdown()[source]

    Force shutdown of the monitoring thread

    -
    -
    -class pylorax.monitor.LogRequestHandler(request, client_address, server)[source]
    -

    Bases: socketserver.BaseRequestHandler

    +
    +
    +class pylorax.monitor.LogRequestHandler(request, client_address, server)[source]
    +

    Bases: socketserver.BaseRequestHandler

    Handle monitoring and saving the logfiles from the virtual install

    Incoming data is written to self.server.log_path and each line is checked for patterns that would indicate that the installation failed. self.server.log_error is set True when this happens.

    -
    -
    -finish()[source]
    +
    +
    +finish()[source]
    -
    -
    -handle()[source]
    +
    +
    +handle()[source]

    Write incoming data to a logfile and check for errors

    Split incoming data into lines and check for any Tracebacks or other errors that indicate that the install failed.

    Loops until self.server.kill is True

    -
    -
    -iserror(line)[source]
    +
    +
    +iserror(line)[source]

    Check a line to see if it contains an error indicating installation failure

    Parameters
    -

    line (str) – log line to check for failure

    +

    line (str) – log line to check for failure

    If the line contains IGNORED it will be skipped.

    -
    -
    -setup()[source]
    +
    +
    +setup()[source]

    Start writing to self.server.log_path

    -
    -
    -class pylorax.monitor.LogServer(log_path, *args, **kwargs)[source]
    -

    Bases: socketserver.TCPServer

    +
    +
    +class pylorax.monitor.LogServer(log_path, *args, **kwargs)[source]
    +

    Bases: socketserver.TCPServer

    A TCP Server that listens for log data

    -
    -
    -log_check()[source]
    +
    +
    +log_check()[source]

    Check to see if an error has been found in the log

    Returns

    True if there has been an error

    Return type
    -

    bool

    +

    bool

    -
    -
    -timeout = 60
    +
    +
    +timeout = 60
    -
    -
    + +

    pylorax.mount module

    -
    -
    -class pylorax.mount.IsoMountpoint(iso_path, initrd_path=None)[source]
    -

    Bases: object

    +
    +
    +class pylorax.mount.IsoMountpoint(iso_path, initrd_path=None)[source]
    +

    Bases: object

    Mount the iso and check to make sure the vmlinuz and initrd.img files exist

    Also check the iso for a a stage2 image and set a flag and extract the iso’s label.

    stage2 can be either LiveOS/squashfs.img or images/install.img

    -
    -
    -get_iso_label()[source]
    +
    +
    +get_iso_label()[source]

    Get the iso’s label using isoinfo

    Sets self.label if one is found

    -
    -
    -umount()[source]
    +
    +
    +umount()[source]

    Unmount the iso

    -
    -
    + +

    pylorax.output module

    -
    -
    + +

    pylorax.sysutils module

    -
    -
    -pylorax.sysutils.joinpaths(*args, **kwargs)[source]
    +
    +
    +pylorax.sysutils.chmod_(path, mode, recursive=False)[source]
    -
    -
    -pylorax.sysutils.touch(fname)[source]
    +
    +
    +pylorax.sysutils.chown_(path, user=None, group=None, recursive=False)[source]
    -
    -
    -pylorax.sysutils.replace(fname, find, sub)[source]
    +
    +
    +pylorax.sysutils.joinpaths(*args, **kwargs)[source]
    -
    -
    -pylorax.sysutils.chown_(path, user=None, group=None, recursive=False)[source]
    +
    +
    +pylorax.sysutils.linktree(src, dst)[source]
    -
    -
    -pylorax.sysutils.chmod_(path, mode, recursive=False)[source]
    +
    +
    +pylorax.sysutils.remove(target)[source]
    -
    -
    -pylorax.sysutils.remove(target)[source]
    +
    +
    +pylorax.sysutils.replace(fname, find, sub)[source]
    -
    -
    -pylorax.sysutils.linktree(src, dst)[source]
    +
    +
    +pylorax.sysutils.touch(fname)[source]
    -
    -
    + +

    pylorax.treebuilder module

    -
    -
    -class pylorax.treebuilder.RuntimeBuilder(product, arch, dbo, templatedir=None, installpkgs=None, excludepkgs=None, add_templates=None, add_template_vars=None, skip_branding=False)[source]
    -

    Bases: object

    +
    +
    +class pylorax.treebuilder.RuntimeBuilder(product, arch, dbo, templatedir=None, installpkgs=None, excludepkgs=None, add_templates=None, add_template_vars=None, skip_branding=False)[source]
    +

    Bases: object

    Builds the anaconda runtime image.

    -
    -
    -cleanup()[source]
    +
    +
    +cleanup()[source]

    Remove unneeded packages and files with runtime-cleanup.tmpl

    -
    -
    -create_runtime(outfile='/var/tmp/squashfs.img', compression='xz', compressargs=None, size=2)[source]
    -
    +
    +
    +create_ext4_runtime(outfile='/var/tmp/squashfs.img', compression='xz', compressargs=None, size=2)[source]
    +

    Create a squashfs compressed ext4 runtime

    +
    -
    -
    -finished()[source]
    +
    +
    +create_squashfs_runtime(outfile='/var/tmp/squashfs.img', compression='xz', compressargs=None, size=2)[source]
    +

    Create a plain squashfs runtime

    +
    + +
    +
    +finished()[source]

    Done using RuntimeBuilder

    Close the dnf base object

    -
    -
    -generate_module_data()[source]
    +
    +
    +generate_module_data()[source]
    -
    -
    -install()[source]
    +
    +
    +install()[source]

    Install packages and do initial setup with runtime-install.tmpl

    -
    -
    -postinstall()[source]
    +
    +
    +postinstall()[source]

    Do some post-install setup work with runtime-postinstall.tmpl

    -
    -
    -verify()[source]
    +
    +
    +verify()[source]

    Ensure that contents of the installroot can run

    -
    -
    -writepkglists(pkglistdir)[source]
    +
    +
    +writepkglists(pkglistdir)[source]

    debugging data: write out lists of package contents

    -
    -
    -writepkgsizes(pkgsizefile)[source]
    +
    +
    +writepkgsizes(pkgsizefile)[source]

    debugging data: write a big list of pkg sizes

    -
    -
    -class pylorax.treebuilder.TreeBuilder(product, arch, inroot, outroot, runtime, isolabel, domacboot=True, doupgrade=True, templatedir=None, add_templates=None, add_template_vars=None, workdir=None, extra_boot_args='')[source]
    -

    Bases: object

    +
    +
    +class pylorax.treebuilder.TreeBuilder(product, arch, inroot, outroot, runtime, isolabel, domacboot=True, doupgrade=True, templatedir=None, add_templates=None, add_template_vars=None, workdir=None, extra_boot_args='')[source]
    +

    Bases: object

    Builds the arch-specific boot images. inroot should be the installtree root (the newly-built runtime dir)

    -
    -
    -build()[source]
    +
    +
    +build()[source]
    -
    -
    -copy_dracut_hooks(hooks)[source]
    +
    +
    +copy_dracut_hooks(hooks)[source]

    Copy the hook scripts in hooks into the installroot’s /tmp/ and return a list of commands to pass to dracut when creating the initramfs

    @@ -2014,27 +2033,27 @@ target dracut hook directory (eg. [(“99anaconda-copy-ks.sh”, “/lib/dracut/hooks/pre-pivot”)])

    -
    -
    -property dracut_hooks_path
    +
    +
    +property dracut_hooks_path

    Return the path to the lorax dracut hooks scripts

    Use the configured share dir if it is setup, otherwise default to /usr/share/lorax/dracut_hooks

    -
    -
    -implantisomd5()[source]
    +
    +
    +implantisomd5()[source]
    -
    -
    -property kernels
    +
    +
    +property kernels
    -
    -
    -rebuild_initrds(add_args=None, backup='', prefix='')[source]
    +
    +
    +rebuild_initrds(add_args=None, backup='', prefix='')[source]

    Rebuild all the initrds in the tree. If backup is specified, each initrd will be renamed with backup as a suffix before rebuilding. If backup is empty, the existing initrd files will be overwritten. @@ -2046,19 +2065,19 @@ name of the kernel.

    -
    -
    -pylorax.treebuilder.findkernels(root='/', kdir='boot')[source]
    +
    +
    +pylorax.treebuilder.findkernels(root='/', kdir='boot')[source]
    -
    -
    -pylorax.treebuilder.generate_module_info(moddir, outfile=None)[source]
    +
    +
    +pylorax.treebuilder.generate_module_info(moddir, outfile=None)[source]
    -
    -
    -pylorax.treebuilder.string_lower(string)[source]
    +
    +
    +pylorax.treebuilder.string_lower(string)[source]

    Return a lowercase string.

    Parameters
    @@ -2068,76 +2087,76 @@ name of the kernel.

    This is used as a filter in the templates.

    -
    -
    -pylorax.treebuilder.udev_escape(label)[source]
    +
    +
    +pylorax.treebuilder.udev_escape(label)[source]
    -
    -
    + +

    pylorax.treeinfo module

    -
    -
    -class pylorax.treeinfo.TreeInfo(product, version, variant, basearch, packagedir='')[source]
    -

    Bases: object

    -
    -
    -add_section(section, data)[source]
    +
    +
    +class pylorax.treeinfo.TreeInfo(product, version, variant, basearch, packagedir='')[source]
    +

    Bases: object

    +
    +
    +add_section(section, data)[source]
    -
    -
    -write(outfile)[source]
    +
    +
    +write(outfile)[source]
    -
    -
    + +

    Module contents

    -
    -
    -class pylorax.ArchData(buildarch)[source]
    +
    +
    +class pylorax.ArchData(buildarch)[source]

    Bases: pylorax.base.DataHolder

    -
    -
    -bcj_arch = {'arm': 'arm', 'armhfp': 'arm', 'i386': 'x86', 'ppc': 'powerpc', 'ppc64': 'powerpc', 'ppc64le': 'powerpc', 'x86_64': 'x86'}
    +
    +
    +bcj_arch = {'arm': 'arm', 'armhfp': 'arm', 'i386': 'x86', 'ppc': 'powerpc', 'ppc64': 'powerpc', 'ppc64le': 'powerpc', 'x86_64': 'x86'}
    -
    -
    -lib64_arches = ('x86_64', 'ppc64', 'ppc64le', 's390x', 'ia64', 'aarch64')
    +
    +
    +lib64_arches = ('x86_64', 'ppc64', 'ppc64le', 's390x', 'ia64', 'aarch64')
    -
    -
    -class pylorax.Lorax[source]
    +
    +
    +class pylorax.Lorax[source]

    Bases: pylorax.base.BaseLoraxClass

    -
    -
    -configure(conf_file='/etc/lorax/lorax.conf')[source]
    +
    +
    +configure(conf_file='/etc/lorax/lorax.conf')[source]
    -
    -
    -init_file_logging(logdir, logname='pylorax.log')[source]
    +
    +
    +init_file_logging(logdir, logname='pylorax.log')[source]
    -
    -
    -init_stream_logging()[source]
    +
    +
    +init_stream_logging()[source]
    -
    -
    -run(dbo, product, version, release, variant='', bugurl='', isfinal=False, workdir=None, outputdir=None, buildarch=None, volid=None, domacboot=True, doupgrade=True, remove_temp=False, installpkgs=None, excludepkgs=None, size=2, add_templates=None, add_template_vars=None, add_arch_templates=None, add_arch_template_vars=None, verify=True, user_dracut_args=None, skip_branding=False)[source]
    +
    +
    +run(dbo, product, version, release, variant='', bugurl='', isfinal=False, workdir=None, outputdir=None, buildarch=None, volid=None, domacboot=True, doupgrade=True, remove_temp=False, installpkgs=None, excludepkgs=None, size=2, add_templates=None, add_template_vars=None, add_arch_templates=None, add_arch_template_vars=None, verify=True, user_dracut_args=None, skip_branding=False, squashfs_only=False)[source]
    -
    -
    -property templatedir
    +
    +
    +property templatedir

    Find the template directory.

    Pick the first directory under sharedir/templates.d/ if it exists. Otherwise use the sharedir

    @@ -2145,19 +2164,19 @@ Otherwise use the sharedir

    -
    -
    -pylorax.find_templates(templatedir='/usr/share/lorax')[source]
    +
    +
    +pylorax.find_templates(templatedir='/usr/share/lorax')[source]

    Find the templates to use.

    Parameters
    -

    templatedir (str) – Top directory to search for templates

    +

    templatedir (str) – Top directory to search for templates

    Returns

    Path to templates

    Return type
    -

    str

    +

    str

    If there is a templates.d directory under templatedir the @@ -2165,62 +2184,62 @@ lowest numbered directory entry is returned.

    eg. /usr/share/lorax/templates.d/99-generic/

    -
    -
    -pylorax.get_buildarch(dbo)[source]
    +
    +
    +pylorax.get_buildarch(dbo)[source]
    -
    -
    -pylorax.log_selinux_state()[source]
    +
    +
    +pylorax.log_selinux_state()[source]

    Log the current state of selinux

    -
    -
    -pylorax.setup_logging(logfile, theLogger)[source]
    +
    +
    +pylorax.setup_logging(logfile, theLogger)[source]

    Setup the various logs

    Parameters
    • logfile (string) – filename to write the log to

    • -
    • theLogger (logging.Logger) – top-level logger

    • +
    • theLogger (logging.Logger) – top-level logger

    -
    - + + - @@ -2229,7 +2248,6 @@ lowest numbered directory entry is returned.

    - + - - - - + + + + - - - - + @@ -60,7 +67,7 @@
    - 28.14.42 + 28.14.59
    @@ -77,6 +84,7 @@ + + @@ -132,19 +142,19 @@ + +
      -
    • Docs »
    • +
    • »
    • Search
    • - -
    @@ -158,8 +168,7 @@ @@ -173,20 +182,25 @@
    - @@ -195,7 +209,6 @@ -