lorax/docs/html/pylorax.html
2020-04-28 11:52:52 -07:00

2240 lines
180 KiB
HTML

<!DOCTYPE html>
<!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]-->
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>pylorax package &mdash; Lorax 33.2 documentation</title>
<script type="text/javascript" src="_static/js/modernizr.min.js"></script>
<script type="text/javascript" id="documentation_options" data-url_root="./" src="_static/documentation_options.js"></script>
<script type="text/javascript" src="_static/jquery.js"></script>
<script type="text/javascript" src="_static/underscore.js"></script>
<script type="text/javascript" src="_static/doctools.js"></script>
<script type="text/javascript" src="_static/language_data.js"></script>
<script type="text/javascript" src="_static/js/theme.js"></script>
<link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<link rel="index" title="Index" href="genindex.html" />
<link rel="search" title="Search" href="search.html" />
<link rel="next" title="pylorax.api package" href="pylorax.api.html" />
<link rel="prev" title="lifted package" href="lifted.html" />
</head>
<body class="wy-body-for-nav">
<div class="wy-grid-for-nav">
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
<div class="wy-side-scroll">
<div class="wy-side-nav-search" >
<a href="index.html" class="icon icon-home"> Lorax
</a>
<div class="version">
33.2
</div>
<div role="search">
<form id="rtd-search-form" class="wy-form" action="search.html" method="get">
<input type="text" name="q" placeholder="Search docs" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
</div>
<div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="intro.html">Introduction to Lorax</a></li>
<li class="toctree-l1"><a class="reference internal" href="intro.html#before-lorax">Before Lorax</a></li>
<li class="toctree-l1"><a class="reference internal" href="lorax.html">Lorax</a></li>
<li class="toctree-l1"><a class="reference internal" href="livemedia-creator.html">livemedia-creator</a></li>
<li class="toctree-l1"><a class="reference internal" href="lorax-composer.html">lorax-composer</a></li>
<li class="toctree-l1"><a class="reference internal" href="composer-cli.html">composer-cli</a></li>
<li class="toctree-l1"><a class="reference internal" href="mkksiso.html">mkksiso</a></li>
<li class="toctree-l1"><a class="reference internal" href="product-images.html">Product and Updates Images</a></li>
<li class="toctree-l1 current"><a class="reference internal" href="modules.html">src</a><ul class="current">
<li class="toctree-l2"><a class="reference internal" href="composer.html">composer package</a></li>
<li class="toctree-l2"><a class="reference internal" href="lifted.html">lifted package</a></li>
<li class="toctree-l2 current"><a class="current reference internal" href="#">pylorax package</a><ul>
<li class="toctree-l3"><a class="reference internal" href="#subpackages">Subpackages</a><ul>
<li class="toctree-l4"><a class="reference internal" href="pylorax.api.html">pylorax.api package</a></li>
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="#submodules">Submodules</a></li>
<li class="toctree-l3"><a class="reference internal" href="#module-pylorax.base">pylorax.base module</a></li>
<li class="toctree-l3"><a class="reference internal" href="#module-pylorax.buildstamp">pylorax.buildstamp module</a></li>
<li class="toctree-l3"><a class="reference internal" href="#module-pylorax.cmdline">pylorax.cmdline module</a></li>
<li class="toctree-l3"><a class="reference internal" href="#module-pylorax.creator">pylorax.creator module</a></li>
<li class="toctree-l3"><a class="reference internal" href="#module-pylorax.decorators">pylorax.decorators module</a></li>
<li class="toctree-l3"><a class="reference internal" href="#module-pylorax.discinfo">pylorax.discinfo module</a></li>
<li class="toctree-l3"><a class="reference internal" href="#module-pylorax.dnfbase">pylorax.dnfbase module</a></li>
<li class="toctree-l3"><a class="reference internal" href="#module-pylorax.dnfhelper">pylorax.dnfhelper module</a></li>
<li class="toctree-l3"><a class="reference internal" href="#module-pylorax.executils">pylorax.executils module</a></li>
<li class="toctree-l3"><a class="reference internal" href="#module-pylorax.imgutils">pylorax.imgutils module</a></li>
<li class="toctree-l3"><a class="reference internal" href="#module-pylorax.installer">pylorax.installer module</a></li>
<li class="toctree-l3"><a class="reference internal" href="#module-pylorax.ltmpl">pylorax.ltmpl module</a></li>
<li class="toctree-l3"><a class="reference internal" href="#module-pylorax.monitor">pylorax.monitor module</a></li>
<li class="toctree-l3"><a class="reference internal" href="#module-pylorax.mount">pylorax.mount module</a></li>
<li class="toctree-l3"><a class="reference internal" href="#module-pylorax.output">pylorax.output module</a></li>
<li class="toctree-l3"><a class="reference internal" href="#module-pylorax.sysutils">pylorax.sysutils module</a></li>
<li class="toctree-l3"><a class="reference internal" href="#module-pylorax.treebuilder">pylorax.treebuilder module</a></li>
<li class="toctree-l3"><a class="reference internal" href="#module-pylorax.treeinfo">pylorax.treeinfo module</a></li>
<li class="toctree-l3"><a class="reference internal" href="#module-pylorax">Module contents</a></li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
</div>
</nav>
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
<nav class="wy-nav-top" aria-label="top navigation">
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="index.html">Lorax</a>
</nav>
<div class="wy-nav-content">
<div class="rst-content">
<div role="navigation" aria-label="breadcrumbs navigation">
<ul class="wy-breadcrumbs">
<li><a href="index.html">Docs</a> &raquo;</li>
<li><a href="modules.html">src</a> &raquo;</li>
<li>pylorax package</li>
<li class="wy-breadcrumbs-aside">
<a href="_sources/pylorax.rst.txt" rel="nofollow"> View page source</a>
</li>
</ul>
<hr/>
</div>
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
<div itemprop="articleBody">
<div class="section" id="pylorax-package">
<h1>pylorax package<a class="headerlink" href="#pylorax-package" title="Permalink to this headline"></a></h1>
<div class="section" id="subpackages">
<h2>Subpackages<a class="headerlink" href="#subpackages" title="Permalink to this headline"></a></h2>
<div class="toctree-wrapper compound">
<ul>
<li class="toctree-l1"><a class="reference internal" href="pylorax.api.html">pylorax.api package</a><ul>
<li class="toctree-l2"><a class="reference internal" href="pylorax.api.html#submodules">Submodules</a></li>
<li class="toctree-l2"><a class="reference internal" href="pylorax.api.html#module-pylorax.api.bisect">pylorax.api.bisect module</a></li>
<li class="toctree-l2"><a class="reference internal" href="pylorax.api.html#module-pylorax.api.checkparams">pylorax.api.checkparams module</a></li>
<li class="toctree-l2"><a class="reference internal" href="pylorax.api.html#module-pylorax.api.cmdline">pylorax.api.cmdline module</a></li>
<li class="toctree-l2"><a class="reference internal" href="pylorax.api.html#module-pylorax.api.compose">pylorax.api.compose module</a><ul>
<li class="toctree-l3"><a class="reference internal" href="pylorax.api.html#adding-new-output-types">Adding New Output Types</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="pylorax.api.html#module-pylorax.api.config">pylorax.api.config module</a></li>
<li class="toctree-l2"><a class="reference internal" href="pylorax.api.html#module-pylorax.api.dnfbase">pylorax.api.dnfbase module</a></li>
<li class="toctree-l2"><a class="reference internal" href="pylorax.api.html#module-pylorax.api.errors">pylorax.api.errors module</a></li>
<li class="toctree-l2"><a class="reference internal" href="pylorax.api.html#module-pylorax.api.flask_blueprint">pylorax.api.flask_blueprint module</a></li>
<li class="toctree-l2"><a class="reference internal" href="pylorax.api.html#module-pylorax.api.gitrpm">pylorax.api.gitrpm module</a></li>
<li class="toctree-l2"><a class="reference internal" href="pylorax.api.html#module-pylorax.api.projects">pylorax.api.projects module</a></li>
<li class="toctree-l2"><a class="reference internal" href="pylorax.api.html#module-pylorax.api.queue">pylorax.api.queue module</a></li>
<li class="toctree-l2"><a class="reference internal" href="pylorax.api.html#module-pylorax.api.recipes">pylorax.api.recipes module</a></li>
<li class="toctree-l2"><a class="reference internal" href="pylorax.api.html#module-pylorax.api.regexes">pylorax.api.regexes module</a></li>
<li class="toctree-l2"><a class="reference internal" href="pylorax.api.html#module-pylorax.api.server">pylorax.api.server module</a></li>
<li class="toctree-l2"><a class="reference internal" href="pylorax.api.html#module-pylorax.api.timestamp">pylorax.api.timestamp module</a></li>
<li class="toctree-l2"><a class="reference internal" href="pylorax.api.html#module-pylorax.api.toml">pylorax.api.toml module</a></li>
<li class="toctree-l2"><a class="reference internal" href="pylorax.api.html#module-pylorax.api.utils">pylorax.api.utils module</a></li>
<li class="toctree-l2"><a class="reference internal" href="pylorax.api.html#module-pylorax.api.v0">pylorax.api.v0 module</a><ul>
<li class="toctree-l3"><a class="reference internal" href="pylorax.api.html#status-responses">Status Responses</a></li>
<li class="toctree-l3"><a class="reference internal" href="pylorax.api.html#api-routes">API Routes</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="pylorax.api.html#module-pylorax.api.v1">pylorax.api.v1 module</a></li>
<li class="toctree-l2"><a class="reference internal" href="pylorax.api.html#module-pylorax.api.workspace">pylorax.api.workspace module</a></li>
<li class="toctree-l2"><a class="reference internal" href="pylorax.api.html#module-pylorax.api">Module contents</a></li>
</ul>
</li>
</ul>
</div>
</div>
<div class="section" id="submodules">
<h2>Submodules<a class="headerlink" href="#submodules" title="Permalink to this headline"></a></h2>
</div>
<div class="section" id="module-pylorax.base">
<span id="pylorax-base-module"></span><h2>pylorax.base module<a class="headerlink" href="#module-pylorax.base" title="Permalink to this headline"></a></h2>
<dl class="class">
<dt id="pylorax.base.BaseLoraxClass">
<em class="property">class </em><code class="sig-prename descclassname">pylorax.base.</code><code class="sig-name descname">BaseLoraxClass</code><a class="reference internal" href="_modules/pylorax/base.html#BaseLoraxClass"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.base.BaseLoraxClass" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <a class="reference external" href="https://docs.python.org/3/library/functions.html#object" title="(in Python v3.8)"><code class="xref py py-class docutils literal notranslate"><span class="pre">object</span></code></a></p>
<dl class="method">
<dt id="pylorax.base.BaseLoraxClass.pcritical">
<code class="sig-name descname">pcritical</code><span class="sig-paren">(</span><em class="sig-param">msg</em>, <em class="sig-param">fobj=&lt;_io.TextIOWrapper name='&lt;stdout&gt;' mode='w' encoding='UTF-8'&gt;</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/base.html#BaseLoraxClass.pcritical"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.base.BaseLoraxClass.pcritical" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="method">
<dt id="pylorax.base.BaseLoraxClass.pdebug">
<code class="sig-name descname">pdebug</code><span class="sig-paren">(</span><em class="sig-param">msg</em>, <em class="sig-param">fobj=&lt;_io.TextIOWrapper name='&lt;stdout&gt;' mode='w' encoding='UTF-8'&gt;</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/base.html#BaseLoraxClass.pdebug"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.base.BaseLoraxClass.pdebug" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="method">
<dt id="pylorax.base.BaseLoraxClass.perror">
<code class="sig-name descname">perror</code><span class="sig-paren">(</span><em class="sig-param">msg</em>, <em class="sig-param">fobj=&lt;_io.TextIOWrapper name='&lt;stdout&gt;' mode='w' encoding='UTF-8'&gt;</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/base.html#BaseLoraxClass.perror"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.base.BaseLoraxClass.perror" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="method">
<dt id="pylorax.base.BaseLoraxClass.pinfo">
<code class="sig-name descname">pinfo</code><span class="sig-paren">(</span><em class="sig-param">msg</em>, <em class="sig-param">fobj=&lt;_io.TextIOWrapper name='&lt;stdout&gt;' mode='w' encoding='UTF-8'&gt;</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/base.html#BaseLoraxClass.pinfo"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.base.BaseLoraxClass.pinfo" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="method">
<dt id="pylorax.base.BaseLoraxClass.pwarning">
<code class="sig-name descname">pwarning</code><span class="sig-paren">(</span><em class="sig-param">msg</em>, <em class="sig-param">fobj=&lt;_io.TextIOWrapper name='&lt;stdout&gt;' mode='w' encoding='UTF-8'&gt;</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/base.html#BaseLoraxClass.pwarning"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.base.BaseLoraxClass.pwarning" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
<dl class="class">
<dt id="pylorax.base.DataHolder">
<em class="property">class </em><code class="sig-prename descclassname">pylorax.base.</code><code class="sig-name descname">DataHolder</code><span class="sig-paren">(</span><em class="sig-param">**kwargs</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/base.html#DataHolder"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.base.DataHolder" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#dict" title="(in Python v3.8)"><code class="xref py py-class docutils literal notranslate"><span class="pre">dict</span></code></a></p>
<dl class="method">
<dt id="pylorax.base.DataHolder.copy">
<code class="sig-name descname">copy</code><span class="sig-paren">(</span><span class="sig-paren">)</span> &#x2192; a shallow copy of D<a class="reference internal" href="_modules/pylorax/base.html#DataHolder.copy"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.base.DataHolder.copy" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
</div>
<div class="section" id="module-pylorax.buildstamp">
<span id="pylorax-buildstamp-module"></span><h2>pylorax.buildstamp module<a class="headerlink" href="#module-pylorax.buildstamp" title="Permalink to this headline"></a></h2>
<dl class="class">
<dt id="pylorax.buildstamp.BuildStamp">
<em class="property">class </em><code class="sig-prename descclassname">pylorax.buildstamp.</code><code class="sig-name descname">BuildStamp</code><span class="sig-paren">(</span><em class="sig-param">product</em>, <em class="sig-param">version</em>, <em class="sig-param">bugurl</em>, <em class="sig-param">isfinal</em>, <em class="sig-param">buildarch</em>, <em class="sig-param">variant=''</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/buildstamp.html#BuildStamp"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.buildstamp.BuildStamp" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <a class="reference external" href="https://docs.python.org/3/library/functions.html#object" title="(in Python v3.8)"><code class="xref py py-class docutils literal notranslate"><span class="pre">object</span></code></a></p>
<dl class="method">
<dt id="pylorax.buildstamp.BuildStamp.write">
<code class="sig-name descname">write</code><span class="sig-paren">(</span><em class="sig-param">outfile</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/buildstamp.html#BuildStamp.write"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.buildstamp.BuildStamp.write" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
</div>
<div class="section" id="module-pylorax.cmdline">
<span id="pylorax-cmdline-module"></span><h2>pylorax.cmdline module<a class="headerlink" href="#module-pylorax.cmdline" title="Permalink to this headline"></a></h2>
<dl class="function">
<dt id="pylorax.cmdline.lmc_parser">
<code class="sig-prename descclassname">pylorax.cmdline.</code><code class="sig-name descname">lmc_parser</code><span class="sig-paren">(</span><em class="sig-param">dracut_default=''</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/cmdline.html#lmc_parser"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.cmdline.lmc_parser" title="Permalink to this definition"></a></dt>
<dd><p>Return a ArgumentParser object for live-media-creator.</p>
</dd></dl>
<dl class="function">
<dt id="pylorax.cmdline.lorax_parser">
<code class="sig-prename descclassname">pylorax.cmdline.</code><code class="sig-name descname">lorax_parser</code><span class="sig-paren">(</span><em class="sig-param">dracut_default=''</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/cmdline.html#lorax_parser"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.cmdline.lorax_parser" title="Permalink to this definition"></a></dt>
<dd><p>Return the ArgumentParser for lorax</p>
</dd></dl>
</div>
<div class="section" id="module-pylorax.creator">
<span id="pylorax-creator-module"></span><h2>pylorax.creator module<a class="headerlink" href="#module-pylorax.creator" title="Permalink to this headline"></a></h2>
<dl class="class">
<dt id="pylorax.creator.FakeDNF">
<em class="property">class </em><code class="sig-prename descclassname">pylorax.creator.</code><code class="sig-name descname">FakeDNF</code><span class="sig-paren">(</span><em class="sig-param">conf</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/creator.html#FakeDNF"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.creator.FakeDNF" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <a class="reference external" href="https://docs.python.org/3/library/functions.html#object" title="(in Python v3.8)"><code class="xref py py-class docutils literal notranslate"><span class="pre">object</span></code></a></p>
<p>A minimal DNF object suitable for passing to RuntimeBuilder</p>
<p>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.</p>
<dl class="method">
<dt id="pylorax.creator.FakeDNF.reset">
<code class="sig-name descname">reset</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/creator.html#FakeDNF.reset"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.creator.FakeDNF.reset" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
<dl class="function">
<dt id="pylorax.creator.calculate_disk_size">
<code class="sig-prename descclassname">pylorax.creator.</code><code class="sig-name descname">calculate_disk_size</code><span class="sig-paren">(</span><em class="sig-param">opts</em>, <em class="sig-param">ks</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/creator.html#calculate_disk_size"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.creator.calculate_disk_size" title="Permalink to this definition"></a></dt>
<dd><p>Calculate the disk size from the kickstart</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>opts</strong> (<em>argparse options</em>) -- options passed to livemedia-creator</p></li>
<li><p><strong>ks</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.8)"><em>str</em></a>) -- Path to the kickstart to use for the installation</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>Disk size in MiB</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p><a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.8)">int</a></p>
</dd>
</dl>
<p>Also takes into account the use of reqpart or reqpart --add-boot</p>
</dd></dl>
<dl class="function">
<dt id="pylorax.creator.check_kickstart">
<code class="sig-prename descclassname">pylorax.creator.</code><code class="sig-name descname">check_kickstart</code><span class="sig-paren">(</span><em class="sig-param">ks</em>, <em class="sig-param">opts</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/creator.html#check_kickstart"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.creator.check_kickstart" title="Permalink to this definition"></a></dt>
<dd><p>Check the parsed kickstart object for errors</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>ks</strong> (<em>pykickstart.parser.KickstartParser</em>) -- Parsed Kickstart object</p></li>
<li><p><strong>opts</strong> (<em>Either a DataHolder</em><em> or </em><em>ArgumentParser</em>) -- Commandline options to control the process</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>List of error strings or empty list</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#list" title="(in Python v3.8)">list</a></p>
</dd>
</dl>
</dd></dl>
<dl class="function">
<dt id="pylorax.creator.create_pxe_config">
<code class="sig-prename descclassname">pylorax.creator.</code><code class="sig-name descname">create_pxe_config</code><span class="sig-paren">(</span><em class="sig-param">template</em>, <em class="sig-param">images_dir</em>, <em class="sig-param">live_image_name</em>, <em class="sig-param">add_args=None</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/creator.html#create_pxe_config"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.creator.create_pxe_config" title="Permalink to this definition"></a></dt>
<dd><p>Create template for pxe to live configuration</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>images_dir</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.8)"><em>str</em></a>) -- Path of directory with images to be used</p></li>
<li><p><strong>live_image_name</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.8)"><em>str</em></a>) -- Name of live rootfs image file</p></li>
<li><p><strong>add_args</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#list" title="(in Python v3.8)"><em>list</em></a>) -- Arguments to be added to initrd= pxe config</p></li>
</ul>
</dd>
</dl>
</dd></dl>
<dl class="function">
<dt id="pylorax.creator.dracut_args">
<code class="sig-prename descclassname">pylorax.creator.</code><code class="sig-name descname">dracut_args</code><span class="sig-paren">(</span><em class="sig-param">opts</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/creator.html#dracut_args"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.creator.dracut_args" title="Permalink to this definition"></a></dt>
<dd><p>Return a list of the args to pass to dracut</p>
<p>Return the default argument list unless one of the dracut cmdline arguments
has been used.</p>
</dd></dl>
<dl class="function">
<dt id="pylorax.creator.find_ostree_root">
<code class="sig-prename descclassname">pylorax.creator.</code><code class="sig-name descname">find_ostree_root</code><span class="sig-paren">(</span><em class="sig-param">phys_root</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/creator.html#find_ostree_root"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.creator.find_ostree_root" title="Permalink to this definition"></a></dt>
<dd><p>Find root of ostree deployment</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>phys_root</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.8)"><em>str</em></a>) -- Path to physical root</p>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>Relative path of ostree deployment root</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.8)">str</a></p>
</dd>
<dt class="field-even">Raises</dt>
<dd class="field-even"><p><a class="reference external" href="https://docs.python.org/3/library/exceptions.html#Exception" title="(in Python v3.8)"><strong>Exception</strong></a> -- More than one deployment roots were found</p>
</dd>
</dl>
</dd></dl>
<dl class="function">
<dt id="pylorax.creator.get_arch">
<code class="sig-prename descclassname">pylorax.creator.</code><code class="sig-name descname">get_arch</code><span class="sig-paren">(</span><em class="sig-param">mount_dir</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/creator.html#get_arch"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.creator.get_arch" title="Permalink to this definition"></a></dt>
<dd><p>Get the kernel arch</p>
<dl class="field-list simple">
<dt class="field-odd">Returns</dt>
<dd class="field-odd"><p>Arch of first kernel found at mount_dir/boot/ or i386</p>
</dd>
<dt class="field-even">Return type</dt>
<dd class="field-even"><p><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.8)">str</a></p>
</dd>
</dl>
</dd></dl>
<dl class="function">
<dt id="pylorax.creator.is_image_mounted">
<code class="sig-prename descclassname">pylorax.creator.</code><code class="sig-name descname">is_image_mounted</code><span class="sig-paren">(</span><em class="sig-param">disk_img</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/creator.html#is_image_mounted"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.creator.is_image_mounted" title="Permalink to this definition"></a></dt>
<dd><p>Check to see if the disk_img is mounted</p>
<dl class="field-list simple">
<dt class="field-odd">Returns</dt>
<dd class="field-odd"><p>True if disk_img is in /proc/mounts</p>
</dd>
<dt class="field-even">Return type</dt>
<dd class="field-even"><p><a class="reference external" href="https://docs.python.org/3/library/functions.html#bool" title="(in Python v3.8)">bool</a></p>
</dd>
</dl>
</dd></dl>
<dl class="function">
<dt id="pylorax.creator.make_appliance">
<code class="sig-prename descclassname">pylorax.creator.</code><code class="sig-name descname">make_appliance</code><span class="sig-paren">(</span><em class="sig-param">disk_img</em>, <em class="sig-param">name</em>, <em class="sig-param">template</em>, <em class="sig-param">outfile</em>, <em class="sig-param">networks=None</em>, <em class="sig-param">ram=1024</em>, <em class="sig-param">vcpus=1</em>, <em class="sig-param">arch=None</em>, <em class="sig-param">title='Linux'</em>, <em class="sig-param">project='Linux'</em>, <em class="sig-param">releasever='32'</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/creator.html#make_appliance"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.creator.make_appliance" title="Permalink to this definition"></a></dt>
<dd><p>Generate an appliance description file</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>disk_img</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.8)"><em>str</em></a>) -- Full path of the disk image</p></li>
<li><p><strong>name</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.8)"><em>str</em></a>) -- Name of the appliance, passed to the template</p></li>
<li><p><strong>template</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.8)"><em>str</em></a>) -- Full path of Mako template</p></li>
<li><p><strong>outfile</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.8)"><em>str</em></a>) -- Full path of file to write, using template</p></li>
<li><p><strong>networks</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#list" title="(in Python v3.8)"><em>list</em></a>) -- List of networks(str) from the kickstart</p></li>
<li><p><strong>ram</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.8)"><em>int</em></a>) -- Ram, in MiB, passed to template. Default is 1024</p></li>
<li><p><strong>vcpus</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.8)"><em>int</em></a>) -- CPUs, passed to template. Default is 1</p></li>
<li><p><strong>arch</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.8)"><em>str</em></a>) -- CPU architecture. Default is 'x86_64'</p></li>
<li><p><strong>title</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.8)"><em>str</em></a>) -- Title, passed to template. Default is 'Linux'</p></li>
<li><p><strong>project</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.8)"><em>str</em></a>) -- Project, passed to template. Default is 'Linux'</p></li>
<li><p><strong>releasever</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.8)"><em>str</em></a>) -- Release version, passed to template. Default is 32</p></li>
</ul>
</dd>
</dl>
</dd></dl>
<dl class="function">
<dt id="pylorax.creator.make_image">
<code class="sig-prename descclassname">pylorax.creator.</code><code class="sig-name descname">make_image</code><span class="sig-paren">(</span><em class="sig-param">opts</em>, <em class="sig-param">ks</em>, <em class="sig-param">cancel_func=None</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/creator.html#make_image"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.creator.make_image" title="Permalink to this definition"></a></dt>
<dd><p>Install to a disk image</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>opts</strong> (<em>argparse options</em>) -- options passed to livemedia-creator</p></li>
<li><p><strong>ks</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.8)"><em>str</em></a>) -- Path to the kickstart to use for the installation</p></li>
<li><p><strong>cancel_func</strong> (<em>function</em>) -- Function that returns True to cancel build</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>Path of the image created</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.8)">str</a></p>
</dd>
</dl>
<p>Use qemu+boot.iso or anaconda to install to a disk image.</p>
</dd></dl>
<dl class="function">
<dt id="pylorax.creator.make_live_images">
<code class="sig-prename descclassname">pylorax.creator.</code><code class="sig-name descname">make_live_images</code><span class="sig-paren">(</span><em class="sig-param">opts</em>, <em class="sig-param">work_dir</em>, <em class="sig-param">disk_img</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/creator.html#make_live_images"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.creator.make_live_images" title="Permalink to this definition"></a></dt>
<dd><p>Create live images from direcory or rootfs image</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>opts</strong> (<em>argparse options</em>) -- options passed to livemedia-creator</p></li>
<li><p><strong>work_dir</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.8)"><em>str</em></a>) -- Directory for storing results</p></li>
<li><p><strong>disk_img</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.8)"><em>str</em></a>) -- Path to disk image (fsimage or partitioned)</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>Path of directory with created images or None</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.8)">str</a></p>
</dd>
</dl>
<p>fsck.ext4 is run on the rootfs_image to make sure there are no errors and to zero
out any deleted blocks to make it compress better. If this fails for any reason
it will return None and log the error.</p>
</dd></dl>
<dl class="function">
<dt id="pylorax.creator.make_livecd">
<code class="sig-prename descclassname">pylorax.creator.</code><code class="sig-name descname">make_livecd</code><span class="sig-paren">(</span><em class="sig-param">opts</em>, <em class="sig-param">mount_dir</em>, <em class="sig-param">work_dir</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/creator.html#make_livecd"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.creator.make_livecd" title="Permalink to this definition"></a></dt>
<dd><p>Take the content from the disk image and make a livecd out of it</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>opts</strong> (<em>argparse options</em>) -- options passed to livemedia-creator</p></li>
<li><p><strong>mount_dir</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.8)"><em>str</em></a>) -- Directory tree to compress</p></li>
<li><p><strong>work_dir</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.8)"><em>str</em></a>) -- Output compressed image to work_dir+images/install.img</p></li>
</ul>
</dd>
</dl>
<dl class="simple">
<dt>This uses wwood's squashfs live initramfs method:</dt><dd><ul class="simple">
<li><p>put the real / into LiveOS/rootfs.img</p></li>
<li><p>make a squashfs of the LiveOS/rootfs.img tree</p></li>
<li><p>This is loaded by dracut when the cmdline is passed to the kernel:
root=live:CDLABEL=&lt;volid&gt; rd.live.image</p></li>
</ul>
</dd>
</dl>
</dd></dl>
<dl class="function">
<dt id="pylorax.creator.make_runtime">
<code class="sig-prename descclassname">pylorax.creator.</code><code class="sig-name descname">make_runtime</code><span class="sig-paren">(</span><em class="sig-param">opts</em>, <em class="sig-param">mount_dir</em>, <em class="sig-param">work_dir</em>, <em class="sig-param">size=None</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/creator.html#make_runtime"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.creator.make_runtime" title="Permalink to this definition"></a></dt>
<dd><p>Make the squashfs image from a directory</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>opts</strong> (<em>argparse options</em>) -- options passed to livemedia-creator</p></li>
<li><p><strong>mount_dir</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.8)"><em>str</em></a>) -- Directory tree to compress</p></li>
<li><p><strong>work_dir</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.8)"><em>str</em></a>) -- Output compressed image to work_dir+images/install.img</p></li>
<li><p><strong>size</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.8)"><em>int</em></a>) -- Size of disk image, in GiB</p></li>
</ul>
</dd>
</dl>
</dd></dl>
<dl class="function">
<dt id="pylorax.creator.mount_boot_part_over_root">
<code class="sig-prename descclassname">pylorax.creator.</code><code class="sig-name descname">mount_boot_part_over_root</code><span class="sig-paren">(</span><em class="sig-param">img_mount</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/creator.html#mount_boot_part_over_root"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.creator.mount_boot_part_over_root" title="Permalink to this definition"></a></dt>
<dd><p>Mount boot partition to /boot of root fs mounted in img_mount</p>
<p>Used for OSTree so it finds deployment configurations on live rootfs</p>
<p>param img_mount: object with mounted disk image root partition
type img_mount: imgutils.PartitionMount</p>
</dd></dl>
<dl class="function">
<dt id="pylorax.creator.rebuild_initrds_for_live">
<code class="sig-prename descclassname">pylorax.creator.</code><code class="sig-name descname">rebuild_initrds_for_live</code><span class="sig-paren">(</span><em class="sig-param">opts</em>, <em class="sig-param">sys_root_dir</em>, <em class="sig-param">results_dir</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/creator.html#rebuild_initrds_for_live"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.creator.rebuild_initrds_for_live" title="Permalink to this definition"></a></dt>
<dd><p>Rebuild intrds for pxe live image (root=live:<a class="reference external" href="http://">http://</a>)</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>opts</strong> (<em>argparse options</em>) -- options passed to livemedia-creator</p></li>
<li><p><strong>sys_root_dir</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.8)"><em>str</em></a>) -- Path to root of the system</p></li>
<li><p><strong>results_dir</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.8)"><em>str</em></a>) -- Path of directory for storing results</p></li>
</ul>
</dd>
</dl>
</dd></dl>
<dl class="function">
<dt id="pylorax.creator.run_creator">
<code class="sig-prename descclassname">pylorax.creator.</code><code class="sig-name descname">run_creator</code><span class="sig-paren">(</span><em class="sig-param">opts</em>, <em class="sig-param">cancel_func=None</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/creator.html#run_creator"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.creator.run_creator" title="Permalink to this definition"></a></dt>
<dd><p>Run the image creator process</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>opts</strong> (<em>Either a DataHolder</em><em> or </em><em>ArgumentParser</em>) -- Commandline options to control the process</p></li>
<li><p><strong>cancel_func</strong> (<em>function</em>) -- Function that returns True to cancel build</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>The result directory and the disk image path.</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>Tuple of str</p>
</dd>
</dl>
<p>This function takes the opts arguments and creates the selected output image.
See the cmdline --help for livemedia-creator for the possible options</p>
<p>(Yes, this is not ideal, but we can fix that later)</p>
</dd></dl>
<dl class="function">
<dt id="pylorax.creator.squashfs_args">
<code class="sig-prename descclassname">pylorax.creator.</code><code class="sig-name descname">squashfs_args</code><span class="sig-paren">(</span><em class="sig-param">opts</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/creator.html#squashfs_args"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.creator.squashfs_args" title="Permalink to this definition"></a></dt>
<dd><p>Returns the compression type and args to use when making squashfs</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>opts</strong> -- ArgumentParser object with compression and compressopts</p>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>tuple of compression type and args</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#tuple" title="(in Python v3.8)">tuple</a></p>
</dd>
</dl>
</dd></dl>
</div>
<div class="section" id="module-pylorax.decorators">
<span id="pylorax-decorators-module"></span><h2>pylorax.decorators module<a class="headerlink" href="#module-pylorax.decorators" title="Permalink to this headline"></a></h2>
<dl class="function">
<dt id="pylorax.decorators.singleton">
<code class="sig-prename descclassname">pylorax.decorators.</code><code class="sig-name descname">singleton</code><span class="sig-paren">(</span><em class="sig-param">cls</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/decorators.html#singleton"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.decorators.singleton" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</div>
<div class="section" id="module-pylorax.discinfo">
<span id="pylorax-discinfo-module"></span><h2>pylorax.discinfo module<a class="headerlink" href="#module-pylorax.discinfo" title="Permalink to this headline"></a></h2>
<dl class="class">
<dt id="pylorax.discinfo.DiscInfo">
<em class="property">class </em><code class="sig-prename descclassname">pylorax.discinfo.</code><code class="sig-name descname">DiscInfo</code><span class="sig-paren">(</span><em class="sig-param">release</em>, <em class="sig-param">basearch</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/discinfo.html#DiscInfo"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.discinfo.DiscInfo" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <a class="reference external" href="https://docs.python.org/3/library/functions.html#object" title="(in Python v3.8)"><code class="xref py py-class docutils literal notranslate"><span class="pre">object</span></code></a></p>
<dl class="method">
<dt id="pylorax.discinfo.DiscInfo.write">
<code class="sig-name descname">write</code><span class="sig-paren">(</span><em class="sig-param">outfile</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/discinfo.html#DiscInfo.write"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.discinfo.DiscInfo.write" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
</div>
<div class="section" id="module-pylorax.dnfbase">
<span id="pylorax-dnfbase-module"></span><h2>pylorax.dnfbase module<a class="headerlink" href="#module-pylorax.dnfbase" title="Permalink to this headline"></a></h2>
<dl class="function">
<dt id="pylorax.dnfbase.get_dnf_base_object">
<code class="sig-prename descclassname">pylorax.dnfbase.</code><code class="sig-name descname">get_dnf_base_object</code><span class="sig-paren">(</span><em class="sig-param">installroot</em>, <em class="sig-param">sources</em>, <em class="sig-param">mirrorlists=None</em>, <em class="sig-param">repos=None</em>, <em class="sig-param">enablerepos=None</em>, <em class="sig-param">disablerepos=None</em>, <em class="sig-param">tempdir='/var/tmp'</em>, <em class="sig-param">proxy=None</em>, <em class="sig-param">releasever='32'</em>, <em class="sig-param">cachedir=None</em>, <em class="sig-param">logdir=None</em>, <em class="sig-param">sslverify=True</em>, <em class="sig-param">dnfplugins=None</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/dnfbase.html#get_dnf_base_object"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.dnfbase.get_dnf_base_object" title="Permalink to this definition"></a></dt>
<dd><p>Create a dnf Base object and setup the repositories and installroot</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>installroot</strong> (<em>string</em>) -- Full path to the installroot</p></li>
<li><p><strong>sources</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#list" title="(in Python v3.8)"><em>list</em></a>) -- List of source repo urls to use for the installation</p></li>
<li><p><strong>enablerepos</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#list" title="(in Python v3.8)"><em>list</em></a>) -- List of repo names to enable</p></li>
<li><p><strong>disablerepos</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#list" title="(in Python v3.8)"><em>list</em></a>) -- List of repo names to disable</p></li>
<li><p><strong>mirrorlist</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#list" title="(in Python v3.8)"><em>list</em></a>) -- List of mirrors to use</p></li>
<li><p><strong>tempdir</strong> (<em>string</em>) -- Path of temporary directory</p></li>
<li><p><strong>proxy</strong> (<em>string</em>) -- http proxy to use when fetching packages</p></li>
<li><p><strong>releasever</strong> (<em>string</em>) -- Release version to pass to dnf</p></li>
<li><p><strong>cachedir</strong> (<em>string</em>) -- Directory to use for caching packages</p></li>
<li><p><strong>noverifyssl</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#bool" title="(in Python v3.8)"><em>bool</em></a>) -- Set to True to ignore the CA of ssl certs. eg. use self-signed ssl for https repos.</p></li>
</ul>
</dd>
</dl>
<p>If tempdir is not set /var/tmp is used.
If cachedir is None a dnf.cache directory is created inside tmpdir</p>
</dd></dl>
</div>
<div class="section" id="module-pylorax.dnfhelper">
<span id="pylorax-dnfhelper-module"></span><h2>pylorax.dnfhelper module<a class="headerlink" href="#module-pylorax.dnfhelper" title="Permalink to this headline"></a></h2>
<dl class="class">
<dt id="pylorax.dnfhelper.LoraxDownloadCallback">
<em class="property">class </em><code class="sig-prename descclassname">pylorax.dnfhelper.</code><code class="sig-name descname">LoraxDownloadCallback</code><a class="reference internal" href="_modules/pylorax/dnfhelper.html#LoraxDownloadCallback"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.dnfhelper.LoraxDownloadCallback" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">DownloadProgress</span></code></p>
<dl class="method">
<dt id="pylorax.dnfhelper.LoraxDownloadCallback.end">
<code class="sig-name descname">end</code><span class="sig-paren">(</span><em class="sig-param">payload</em>, <em class="sig-param">status</em>, <em class="sig-param">msg</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/dnfhelper.html#LoraxDownloadCallback.end"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.dnfhelper.LoraxDownloadCallback.end" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="method">
<dt id="pylorax.dnfhelper.LoraxDownloadCallback.progress">
<code class="sig-name descname">progress</code><span class="sig-paren">(</span><em class="sig-param">payload</em>, <em class="sig-param">done</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/dnfhelper.html#LoraxDownloadCallback.progress"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.dnfhelper.LoraxDownloadCallback.progress" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="method">
<dt id="pylorax.dnfhelper.LoraxDownloadCallback.start">
<code class="sig-name descname">start</code><span class="sig-paren">(</span><em class="sig-param">total_files</em>, <em class="sig-param">total_size</em>, <em class="sig-param">total_drpms=0</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/dnfhelper.html#LoraxDownloadCallback.start"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.dnfhelper.LoraxDownloadCallback.start" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
<dl class="class">
<dt id="pylorax.dnfhelper.LoraxRpmCallback">
<em class="property">class </em><code class="sig-prename descclassname">pylorax.dnfhelper.</code><code class="sig-name descname">LoraxRpmCallback</code><a class="reference internal" href="_modules/pylorax/dnfhelper.html#LoraxRpmCallback"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.dnfhelper.LoraxRpmCallback" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">TransactionProgress</span></code></p>
<dl class="method">
<dt id="pylorax.dnfhelper.LoraxRpmCallback.error">
<code class="sig-name descname">error</code><span class="sig-paren">(</span><em class="sig-param">message</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/dnfhelper.html#LoraxRpmCallback.error"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.dnfhelper.LoraxRpmCallback.error" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="method">
<dt id="pylorax.dnfhelper.LoraxRpmCallback.progress">
<code class="sig-name descname">progress</code><span class="sig-paren">(</span><em class="sig-param">package</em>, <em class="sig-param">action</em>, <em class="sig-param">ti_done</em>, <em class="sig-param">ti_total</em>, <em class="sig-param">ts_done</em>, <em class="sig-param">ts_total</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/dnfhelper.html#LoraxRpmCallback.progress"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.dnfhelper.LoraxRpmCallback.progress" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
</div>
<div class="section" id="module-pylorax.executils">
<span id="pylorax-executils-module"></span><h2>pylorax.executils module<a class="headerlink" href="#module-pylorax.executils" title="Permalink to this headline"></a></h2>
<dl class="class">
<dt id="pylorax.executils.ExecProduct">
<em class="property">class </em><code class="sig-prename descclassname">pylorax.executils.</code><code class="sig-name descname">ExecProduct</code><span class="sig-paren">(</span><em class="sig-param">rc</em>, <em class="sig-param">stdout</em>, <em class="sig-param">stderr</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/executils.html#ExecProduct"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.executils.ExecProduct" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <a class="reference external" href="https://docs.python.org/3/library/functions.html#object" title="(in Python v3.8)"><code class="xref py py-class docutils literal notranslate"><span class="pre">object</span></code></a></p>
</dd></dl>
<dl class="function">
<dt id="pylorax.executils.augmentEnv">
<code class="sig-prename descclassname">pylorax.executils.</code><code class="sig-name descname">augmentEnv</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/executils.html#augmentEnv"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.executils.augmentEnv" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="function">
<dt id="pylorax.executils.execReadlines">
<code class="sig-prename descclassname">pylorax.executils.</code><code class="sig-name descname">execReadlines</code><span class="sig-paren">(</span><em class="sig-param">command</em>, <em class="sig-param">argv</em>, <em class="sig-param">stdin=None</em>, <em class="sig-param">root='/'</em>, <em class="sig-param">env_prune=None</em>, <em class="sig-param">filter_stderr=False</em>, <em class="sig-param">callback=&lt;function &lt;lambda&gt;&gt;</em>, <em class="sig-param">env_add=None</em>, <em class="sig-param">reset_handlers=True</em>, <em class="sig-param">reset_lang=True</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/executils.html#execReadlines"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.executils.execReadlines" title="Permalink to this definition"></a></dt>
<dd><p>Execute an external command and return the line output of the command
in real-time.</p>
<p>This method assumes that there is a reasonably low delay between the
end of output and the process exiting. If the child process closes
stdout and then keeps on truckin' there will be problems.</p>
<dl class="simple">
<dt>NOTE/WARNING: UnicodeDecodeError will be raised if the output of the</dt><dd><p>external command can't be decoded as UTF-8.</p>
</dd>
</dl>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>command</strong> -- The command to run</p></li>
<li><p><strong>argv</strong> -- The argument list</p></li>
<li><p><strong>stdin</strong> -- The file object to read stdin from.</p></li>
<li><p><strong>stdout</strong> -- Optional file object to redirect stdout and stderr to.</p></li>
<li><p><strong>root</strong> -- The directory to chroot to before running command.</p></li>
<li><p><strong>env_prune</strong> -- environment variable to remove before execution</p></li>
<li><p><strong>filter_stderr</strong> -- Whether stderr should be excluded from the returned output</p></li>
<li><p><strong>callback</strong> -- method to call while waiting for process to finish, passed Popen object</p></li>
<li><p><strong>env_add</strong> -- environment variables to add before execution</p></li>
<li><p><strong>reset_handlers</strong> -- whether to reset to SIG_DFL any signal handlers set to SIG_IGN</p></li>
<li><p><strong>reset_lang</strong> -- whether to set the locale of the child process to C</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>Iterator of the lines from the command</p>
</dd>
</dl>
<p>Output from the file is not logged to program.log
This returns an iterator with the lines from the command until it has finished</p>
</dd></dl>
<dl class="function">
<dt id="pylorax.executils.execWithCapture">
<code class="sig-prename descclassname">pylorax.executils.</code><code class="sig-name descname">execWithCapture</code><span class="sig-paren">(</span><em class="sig-param">command</em>, <em class="sig-param">argv</em>, <em class="sig-param">stdin=None</em>, <em class="sig-param">root='/'</em>, <em class="sig-param">log_output=True</em>, <em class="sig-param">filter_stderr=False</em>, <em class="sig-param">raise_err=False</em>, <em class="sig-param">callback=None</em>, <em class="sig-param">env_add=None</em>, <em class="sig-param">reset_handlers=True</em>, <em class="sig-param">reset_lang=True</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/executils.html#execWithCapture"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.executils.execWithCapture" title="Permalink to this definition"></a></dt>
<dd><p>Run an external program and capture standard out and err.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>command</strong> -- The command to run</p></li>
<li><p><strong>argv</strong> -- The argument list</p></li>
<li><p><strong>stdin</strong> -- The file object to read stdin from.</p></li>
<li><p><strong>root</strong> -- The directory to chroot to before running command.</p></li>
<li><p><strong>log_output</strong> -- Whether to log the output of command</p></li>
<li><p><strong>filter_stderr</strong> -- Whether stderr should be excluded from the returned output</p></li>
<li><p><strong>callback</strong> -- method to call while waiting for process to finish, passed Popen object</p></li>
<li><p><strong>env_add</strong> -- environment variables to add before execution</p></li>
<li><p><strong>reset_handlers</strong> -- whether to reset to SIG_DFL any signal handlers set to SIG_IGN</p></li>
<li><p><strong>reset_lang</strong> -- whether to set the locale of the child process to C</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>The output of the command</p>
</dd>
</dl>
</dd></dl>
<dl class="function">
<dt id="pylorax.executils.execWithRedirect">
<code class="sig-prename descclassname">pylorax.executils.</code><code class="sig-name descname">execWithRedirect</code><span class="sig-paren">(</span><em class="sig-param">command</em>, <em class="sig-param">argv</em>, <em class="sig-param">stdin=None</em>, <em class="sig-param">stdout=None</em>, <em class="sig-param">root='/'</em>, <em class="sig-param">env_prune=None</em>, <em class="sig-param">log_output=True</em>, <em class="sig-param">binary_output=False</em>, <em class="sig-param">raise_err=False</em>, <em class="sig-param">callback=None</em>, <em class="sig-param">env_add=None</em>, <em class="sig-param">reset_handlers=True</em>, <em class="sig-param">reset_lang=True</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/executils.html#execWithRedirect"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.executils.execWithRedirect" title="Permalink to this definition"></a></dt>
<dd><p>Run an external program and redirect the output to a file.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>command</strong> -- The command to run</p></li>
<li><p><strong>argv</strong> -- The argument list</p></li>
<li><p><strong>stdin</strong> -- The file object to read stdin from.</p></li>
<li><p><strong>stdout</strong> -- Optional file object to redirect stdout and stderr to.</p></li>
<li><p><strong>root</strong> -- The directory to chroot to before running command.</p></li>
<li><p><strong>env_prune</strong> -- environment variable to remove before execution</p></li>
<li><p><strong>log_output</strong> -- whether to log the output of command</p></li>
<li><p><strong>binary_output</strong> -- whether to treat the output of command as binary data</p></li>
<li><p><strong>raise_err</strong> -- whether to raise a CalledProcessError if the returncode is non-zero</p></li>
<li><p><strong>callback</strong> -- method to call while waiting for process to finish, passed Popen object</p></li>
<li><p><strong>env_add</strong> -- environment variables to add before execution</p></li>
<li><p><strong>reset_handlers</strong> -- whether to reset to SIG_DFL any signal handlers set to SIG_IGN</p></li>
<li><p><strong>reset_lang</strong> -- whether to set the locale of the child process to C</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>The return code of the command</p>
</dd>
</dl>
</dd></dl>
<dl class="function">
<dt id="pylorax.executils.runcmd">
<code class="sig-prename descclassname">pylorax.executils.</code><code class="sig-name descname">runcmd</code><span class="sig-paren">(</span><em class="sig-param">cmd</em>, <em class="sig-param">**kwargs</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/executils.html#runcmd"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.executils.runcmd" title="Permalink to this definition"></a></dt>
<dd><p>run execWithRedirect with raise_err=True</p>
</dd></dl>
<dl class="function">
<dt id="pylorax.executils.runcmd_output">
<code class="sig-prename descclassname">pylorax.executils.</code><code class="sig-name descname">runcmd_output</code><span class="sig-paren">(</span><em class="sig-param">cmd</em>, <em class="sig-param">**kwargs</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/executils.html#runcmd_output"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.executils.runcmd_output" title="Permalink to this definition"></a></dt>
<dd><p>run execWithCapture with raise_err=True</p>
</dd></dl>
<dl class="function">
<dt id="pylorax.executils.setenv">
<code class="sig-prename descclassname">pylorax.executils.</code><code class="sig-name descname">setenv</code><span class="sig-paren">(</span><em class="sig-param">name</em>, <em class="sig-param">value</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/executils.html#setenv"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.executils.setenv" title="Permalink to this definition"></a></dt>
<dd><p>Set an environment variable to be used by child processes.</p>
<p>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
variable name, the old value is overwritten.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>name</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.8)"><em>str</em></a>) -- The name of the environment variable</p></li>
<li><p><strong>value</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.8)"><em>str</em></a>) -- The value of the environment variable</p></li>
</ul>
</dd>
</dl>
</dd></dl>
<dl class="function">
<dt id="pylorax.executils.startProgram">
<code class="sig-prename descclassname">pylorax.executils.</code><code class="sig-name descname">startProgram</code><span class="sig-paren">(</span><em class="sig-param">argv</em>, <em class="sig-param">root='/'</em>, <em class="sig-param">stdin=None</em>, <em class="sig-param">stdout=-1</em>, <em class="sig-param">stderr=-2</em>, <em class="sig-param">env_prune=None</em>, <em class="sig-param">env_add=None</em>, <em class="sig-param">reset_handlers=True</em>, <em class="sig-param">reset_lang=True</em>, <em class="sig-param">**kwargs</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/executils.html#startProgram"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.executils.startProgram" title="Permalink to this definition"></a></dt>
<dd><p>Start an external program and return the Popen object.</p>
<p>The root and reset_handlers arguments are handled by passing a
preexec_fn argument to subprocess.Popen, but an additional preexec_fn
can still be specified and will be run. The user preexec_fn will be run
last.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>argv</strong> -- The command to run and argument</p></li>
<li><p><strong>root</strong> -- The directory to chroot to before running command.</p></li>
<li><p><strong>stdin</strong> -- The file object to read stdin from.</p></li>
<li><p><strong>stdout</strong> -- The file object to write stdout to.</p></li>
<li><p><strong>stderr</strong> -- The file object to write stderr to.</p></li>
<li><p><strong>env_prune</strong> -- environment variables to remove before execution</p></li>
<li><p><strong>env_add</strong> -- environment variables to add before execution</p></li>
<li><p><strong>reset_handlers</strong> -- whether to reset to SIG_DFL any signal handlers set to SIG_IGN</p></li>
<li><p><strong>reset_lang</strong> -- whether to set the locale of the child process to C</p></li>
<li><p><strong>kwargs</strong> -- Additional parameters to pass to subprocess.Popen</p></li>
<li><p><strong>preexec_fn</strong> -- A function to run before execution starts.</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>A Popen object for the running command.</p>
</dd>
</dl>
</dd></dl>
</div>
<div class="section" id="module-pylorax.imgutils">
<span id="pylorax-imgutils-module"></span><h2>pylorax.imgutils module<a class="headerlink" href="#module-pylorax.imgutils" title="Permalink to this headline"></a></h2>
<dl class="class">
<dt id="pylorax.imgutils.DMDev">
<em class="property">class </em><code class="sig-prename descclassname">pylorax.imgutils.</code><code class="sig-name descname">DMDev</code><span class="sig-paren">(</span><em class="sig-param">dev</em>, <em class="sig-param">size</em>, <em class="sig-param">name=None</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/imgutils.html#DMDev"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.imgutils.DMDev" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <a class="reference external" href="https://docs.python.org/3/library/functions.html#object" title="(in Python v3.8)"><code class="xref py py-class docutils literal notranslate"><span class="pre">object</span></code></a></p>
</dd></dl>
<dl class="class">
<dt id="pylorax.imgutils.LoopDev">
<em class="property">class </em><code class="sig-prename descclassname">pylorax.imgutils.</code><code class="sig-name descname">LoopDev</code><span class="sig-paren">(</span><em class="sig-param">filename</em>, <em class="sig-param">size=None</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/imgutils.html#LoopDev"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.imgutils.LoopDev" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <a class="reference external" href="https://docs.python.org/3/library/functions.html#object" title="(in Python v3.8)"><code class="xref py py-class docutils literal notranslate"><span class="pre">object</span></code></a></p>
</dd></dl>
<dl class="class">
<dt id="pylorax.imgutils.Mount">
<em class="property">class </em><code class="sig-prename descclassname">pylorax.imgutils.</code><code class="sig-name descname">Mount</code><span class="sig-paren">(</span><em class="sig-param">dev</em>, <em class="sig-param">opts=''</em>, <em class="sig-param">mnt=None</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/imgutils.html#Mount"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.imgutils.Mount" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <a class="reference external" href="https://docs.python.org/3/library/functions.html#object" title="(in Python v3.8)"><code class="xref py py-class docutils literal notranslate"><span class="pre">object</span></code></a></p>
</dd></dl>
<dl class="class">
<dt id="pylorax.imgutils.PartitionMount">
<em class="property">class </em><code class="sig-prename descclassname">pylorax.imgutils.</code><code class="sig-name descname">PartitionMount</code><span class="sig-paren">(</span><em class="sig-param">disk_img</em>, <em class="sig-param">mount_ok=None</em>, <em class="sig-param">submount=None</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/imgutils.html#PartitionMount"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.imgutils.PartitionMount" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <a class="reference external" href="https://docs.python.org/3/library/functions.html#object" title="(in Python v3.8)"><code class="xref py py-class docutils literal notranslate"><span class="pre">object</span></code></a></p>
<p>Mount a partitioned image file using kpartx</p>
</dd></dl>
<dl class="function">
<dt id="pylorax.imgutils.compress">
<code class="sig-prename descclassname">pylorax.imgutils.</code><code class="sig-name descname">compress</code><span class="sig-paren">(</span><em class="sig-param">command</em>, <em class="sig-param">root</em>, <em class="sig-param">outfile</em>, <em class="sig-param">compression='xz'</em>, <em class="sig-param">compressargs=None</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/imgutils.html#compress"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.imgutils.compress" title="Permalink to this definition"></a></dt>
<dd><p>Make a compressed archive of the given rootdir or file.
command is a list of the archiver commands to run
compression should be &quot;xz&quot;, &quot;gzip&quot;, &quot;lzma&quot;, &quot;bzip2&quot;, or None.
compressargs will be used on the compression commandline.</p>
</dd></dl>
<dl class="function">
<dt id="pylorax.imgutils.copytree">
<code class="sig-prename descclassname">pylorax.imgutils.</code><code class="sig-name descname">copytree</code><span class="sig-paren">(</span><em class="sig-param">src</em>, <em class="sig-param">dest</em>, <em class="sig-param">preserve=True</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/imgutils.html#copytree"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.imgutils.copytree" title="Permalink to this definition"></a></dt>
<dd><p>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.</p>
</dd></dl>
<dl class="function">
<dt id="pylorax.imgutils.default_image_name">
<code class="sig-prename descclassname">pylorax.imgutils.</code><code class="sig-name descname">default_image_name</code><span class="sig-paren">(</span><em class="sig-param">compression</em>, <em class="sig-param">basename</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/imgutils.html#default_image_name"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.imgutils.default_image_name" title="Permalink to this definition"></a></dt>
<dd><p>Return a default image name with the correct suffix for the compression type.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>compression</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.8)"><em>str</em></a>) -- Compression type</p></li>
<li><p><strong>basename</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.8)"><em>str</em></a>) -- Base filename</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>basename with compression suffix</p>
</dd>
</dl>
<p>If the compression is unknown it defaults to xz</p>
</dd></dl>
<dl class="function">
<dt id="pylorax.imgutils.dm_attach">
<code class="sig-prename descclassname">pylorax.imgutils.</code><code class="sig-name descname">dm_attach</code><span class="sig-paren">(</span><em class="sig-param">dev</em>, <em class="sig-param">size</em>, <em class="sig-param">name=None</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/imgutils.html#dm_attach"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.imgutils.dm_attach" title="Permalink to this definition"></a></dt>
<dd><p>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.</p>
</dd></dl>
<dl class="function">
<dt id="pylorax.imgutils.dm_detach">
<code class="sig-prename descclassname">pylorax.imgutils.</code><code class="sig-name descname">dm_detach</code><span class="sig-paren">(</span><em class="sig-param">dev</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/imgutils.html#dm_detach"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.imgutils.dm_detach" title="Permalink to this definition"></a></dt>
<dd><p>Detach the named devicemapper device. Returns False if dmsetup fails.</p>
</dd></dl>
<dl class="function">
<dt id="pylorax.imgutils.do_grafts">
<code class="sig-prename descclassname">pylorax.imgutils.</code><code class="sig-name descname">do_grafts</code><span class="sig-paren">(</span><em class="sig-param">grafts</em>, <em class="sig-param">dest</em>, <em class="sig-param">preserve=True</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/imgutils.html#do_grafts"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.imgutils.do_grafts" title="Permalink to this definition"></a></dt>
<dd><p>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.</p>
</dd></dl>
<dl class="function">
<dt id="pylorax.imgutils.estimate_size">
<code class="sig-prename descclassname">pylorax.imgutils.</code><code class="sig-name descname">estimate_size</code><span class="sig-paren">(</span><em class="sig-param">rootdir</em>, <em class="sig-param">graft=None</em>, <em class="sig-param">fstype=None</em>, <em class="sig-param">blocksize=4096</em>, <em class="sig-param">overhead=256</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/imgutils.html#estimate_size"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.imgutils.estimate_size" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="function">
<dt id="pylorax.imgutils.get_loop_name">
<code class="sig-prename descclassname">pylorax.imgutils.</code><code class="sig-name descname">get_loop_name</code><span class="sig-paren">(</span><em class="sig-param">path</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/imgutils.html#get_loop_name"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.imgutils.get_loop_name" title="Permalink to this definition"></a></dt>
<dd><p>Return the loop device associated with the path.
Raises RuntimeError if more than one loop is associated</p>
</dd></dl>
<dl class="function">
<dt id="pylorax.imgutils.kpartx_disk_img">
<code class="sig-prename descclassname">pylorax.imgutils.</code><code class="sig-name descname">kpartx_disk_img</code><span class="sig-paren">(</span><em class="sig-param">disk_img</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/imgutils.html#kpartx_disk_img"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.imgutils.kpartx_disk_img" title="Permalink to this definition"></a></dt>
<dd><p>Attach a disk image's partitions to /dev/loopX using kpartx</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>disk_img</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.8)"><em>str</em></a>) -- The full path to a partitioned disk image</p>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>list of (loopXpN, size)</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>list of tuples</p>
</dd>
</dl>
</dd></dl>
<dl class="function">
<dt id="pylorax.imgutils.loop_attach">
<code class="sig-prename descclassname">pylorax.imgutils.</code><code class="sig-name descname">loop_attach</code><span class="sig-paren">(</span><em class="sig-param">outfile</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/imgutils.html#loop_attach"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.imgutils.loop_attach" title="Permalink to this definition"></a></dt>
<dd><p>Attach a loop device to the given file. Return the loop device name.</p>
<p>On rare occasions it appears that the device never shows up, some experiments
seem to indicate that it may be a race with another process using /dev/loop* devices.</p>
<p>So we now try 3 times before actually failing.</p>
<p>Raises CalledProcessError if losetup fails.</p>
</dd></dl>
<dl class="function">
<dt id="pylorax.imgutils.loop_detach">
<code class="sig-prename descclassname">pylorax.imgutils.</code><code class="sig-name descname">loop_detach</code><span class="sig-paren">(</span><em class="sig-param">loopdev</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/imgutils.html#loop_detach"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.imgutils.loop_detach" title="Permalink to this definition"></a></dt>
<dd><p>Detach the given loop device. Return False on failure.</p>
</dd></dl>
<dl class="function">
<dt id="pylorax.imgutils.loop_waitfor">
<code class="sig-prename descclassname">pylorax.imgutils.</code><code class="sig-name descname">loop_waitfor</code><span class="sig-paren">(</span><em class="sig-param">loop_dev</em>, <em class="sig-param">outfile</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/imgutils.html#loop_waitfor"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.imgutils.loop_waitfor" title="Permalink to this definition"></a></dt>
<dd><p>Make sure the loop device is attached to the outfile.</p>
<p>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
loop device really is associated with the backing file before continuing.</p>
<p>Raise RuntimeError if it isn't setup after 5 tries.</p>
</dd></dl>
<dl class="function">
<dt id="pylorax.imgutils.mkbtrfsimg">
<code class="sig-prename descclassname">pylorax.imgutils.</code><code class="sig-name descname">mkbtrfsimg</code><span class="sig-paren">(</span><em class="sig-param">rootdir</em>, <em class="sig-param">outfile</em>, <em class="sig-param">size=None</em>, <em class="sig-param">label=''</em>, <em class="sig-param">mountargs=''</em>, <em class="sig-param">graft=None</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/imgutils.html#mkbtrfsimg"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.imgutils.mkbtrfsimg" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="function">
<dt id="pylorax.imgutils.mkcpio">
<code class="sig-prename descclassname">pylorax.imgutils.</code><code class="sig-name descname">mkcpio</code><span class="sig-paren">(</span><em class="sig-param">root</em>, <em class="sig-param">outfile</em>, <em class="sig-param">compression='xz'</em>, <em class="sig-param">compressargs=None</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/imgutils.html#mkcpio"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.imgutils.mkcpio" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="function">
<dt id="pylorax.imgutils.mkdosimg">
<code class="sig-prename descclassname">pylorax.imgutils.</code><code class="sig-name descname">mkdosimg</code><span class="sig-paren">(</span><em class="sig-param">rootdir</em>, <em class="sig-param">outfile</em>, <em class="sig-param">size=None</em>, <em class="sig-param">label=''</em>, <em class="sig-param">mountargs='shortname=winnt</em>, <em class="sig-param">umask=0077'</em>, <em class="sig-param">graft=None</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/imgutils.html#mkdosimg"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.imgutils.mkdosimg" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="function">
<dt id="pylorax.imgutils.mkext4img">
<code class="sig-prename descclassname">pylorax.imgutils.</code><code class="sig-name descname">mkext4img</code><span class="sig-paren">(</span><em class="sig-param">rootdir</em>, <em class="sig-param">outfile</em>, <em class="sig-param">size=None</em>, <em class="sig-param">label=''</em>, <em class="sig-param">mountargs=''</em>, <em class="sig-param">graft=None</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/imgutils.html#mkext4img"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.imgutils.mkext4img" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="function">
<dt id="pylorax.imgutils.mkfsimage">
<code class="sig-prename descclassname">pylorax.imgutils.</code><code class="sig-name descname">mkfsimage</code><span class="sig-paren">(</span><em class="sig-param">fstype</em>, <em class="sig-param">rootdir</em>, <em class="sig-param">outfile</em>, <em class="sig-param">size=None</em>, <em class="sig-param">mkfsargs=None</em>, <em class="sig-param">mountargs=''</em>, <em class="sig-param">graft=None</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/imgutils.html#mkfsimage"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.imgutils.mkfsimage" title="Permalink to this definition"></a></dt>
<dd><p>Generic filesystem image creation function.
fstype should be a filesystem type - &quot;mkfs.${fstype}&quot; must exist.
graft should be a dict: {&quot;some/path/in/image&quot;: &quot;local/file/or/dir&quot;};
if the path ends with a '/' it's assumed to be a directory.
Will raise CalledProcessError if something goes wrong.</p>
</dd></dl>
<dl class="function">
<dt id="pylorax.imgutils.mkfsimage_from_disk">
<code class="sig-prename descclassname">pylorax.imgutils.</code><code class="sig-name descname">mkfsimage_from_disk</code><span class="sig-paren">(</span><em class="sig-param">diskimage</em>, <em class="sig-param">fsimage</em>, <em class="sig-param">img_size=None</em>, <em class="sig-param">label='Anaconda'</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/imgutils.html#mkfsimage_from_disk"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.imgutils.mkfsimage_from_disk" title="Permalink to this definition"></a></dt>
<dd><p>Copy the / partition of a partitioned disk image to an un-partitioned
disk image.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>diskimage</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.8)"><em>str</em></a>) -- The full path to partitioned disk image with a /</p></li>
<li><p><strong>fsimage</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.8)"><em>str</em></a>) -- The full path of the output fs image file</p></li>
<li><p><strong>img_size</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.8)"><em>int</em></a>) -- Optional size of the fsimage in MiB or None to make
it as small as possible</p></li>
<li><p><strong>label</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.8)"><em>str</em></a>) -- The label to apply to the image. Defaults to &quot;Anaconda&quot;</p></li>
</ul>
</dd>
</dl>
</dd></dl>
<dl class="function">
<dt id="pylorax.imgutils.mkhfsimg">
<code class="sig-prename descclassname">pylorax.imgutils.</code><code class="sig-name descname">mkhfsimg</code><span class="sig-paren">(</span><em class="sig-param">rootdir</em>, <em class="sig-param">outfile</em>, <em class="sig-param">size=None</em>, <em class="sig-param">label=''</em>, <em class="sig-param">mountargs=''</em>, <em class="sig-param">graft=None</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/imgutils.html#mkhfsimg"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.imgutils.mkhfsimg" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="function">
<dt id="pylorax.imgutils.mkqcow2">
<code class="sig-prename descclassname">pylorax.imgutils.</code><code class="sig-name descname">mkqcow2</code><span class="sig-paren">(</span><em class="sig-param">outfile</em>, <em class="sig-param">size</em>, <em class="sig-param">options=None</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/imgutils.html#mkqcow2"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.imgutils.mkqcow2" title="Permalink to this definition"></a></dt>
<dd><p>use qemu-img to create a file of the given size.
options is a list of options passed to qemu-img</p>
<p>Default format is qcow2, override by passing &quot;-f&quot;, fmt
in options.</p>
</dd></dl>
<dl class="function">
<dt id="pylorax.imgutils.mkqemu_img">
<code class="sig-prename descclassname">pylorax.imgutils.</code><code class="sig-name descname">mkqemu_img</code><span class="sig-paren">(</span><em class="sig-param">outfile</em>, <em class="sig-param">size</em>, <em class="sig-param">options=None</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/imgutils.html#mkqemu_img"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.imgutils.mkqemu_img" title="Permalink to this definition"></a></dt>
<dd><p>use qemu-img to create a file of the given size.
options is a list of options passed to qemu-img</p>
<p>Default format is qcow2, override by passing &quot;-f&quot;, fmt
in options.</p>
</dd></dl>
<dl class="function">
<dt id="pylorax.imgutils.mkrootfsimg">
<code class="sig-prename descclassname">pylorax.imgutils.</code><code class="sig-name descname">mkrootfsimg</code><span class="sig-paren">(</span><em class="sig-param">rootdir</em>, <em class="sig-param">outfile</em>, <em class="sig-param">label</em>, <em class="sig-param">size=2</em>, <em class="sig-param">sysroot=''</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/imgutils.html#mkrootfsimg"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.imgutils.mkrootfsimg" title="Permalink to this definition"></a></dt>
<dd><p>Make rootfs image from a directory</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>rootdir</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.8)"><em>str</em></a>) -- Root directory</p></li>
<li><p><strong>outfile</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.8)"><em>str</em></a>) -- Path of output image file</p></li>
<li><p><strong>label</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.8)"><em>str</em></a>) -- Filesystem label</p></li>
<li><p><strong>size</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.8)"><em>int</em></a>) -- Size of the image in GiB, if None computed automatically</p></li>
<li><p><strong>sysroot</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.8)"><em>str</em></a>) -- path to system (deployment) root relative to physical root</p></li>
</ul>
</dd>
</dl>
</dd></dl>
<dl class="function">
<dt id="pylorax.imgutils.mksparse">
<code class="sig-prename descclassname">pylorax.imgutils.</code><code class="sig-name descname">mksparse</code><span class="sig-paren">(</span><em class="sig-param">outfile</em>, <em class="sig-param">size</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/imgutils.html#mksparse"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.imgutils.mksparse" title="Permalink to this definition"></a></dt>
<dd><p>use os.ftruncate to create a sparse file of the given size.</p>
</dd></dl>
<dl class="function">
<dt id="pylorax.imgutils.mksquashfs">
<code class="sig-prename descclassname">pylorax.imgutils.</code><code class="sig-name descname">mksquashfs</code><span class="sig-paren">(</span><em class="sig-param">rootdir</em>, <em class="sig-param">outfile</em>, <em class="sig-param">compression='default'</em>, <em class="sig-param">compressargs=None</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/imgutils.html#mksquashfs"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.imgutils.mksquashfs" title="Permalink to this definition"></a></dt>
<dd><p>Make a squashfs image containing the given rootdir.</p>
</dd></dl>
<dl class="function">
<dt id="pylorax.imgutils.mktar">
<code class="sig-prename descclassname">pylorax.imgutils.</code><code class="sig-name descname">mktar</code><span class="sig-paren">(</span><em class="sig-param">root</em>, <em class="sig-param">outfile</em>, <em class="sig-param">compression='xz'</em>, <em class="sig-param">compressargs=None</em>, <em class="sig-param">selinux=True</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/imgutils.html#mktar"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.imgutils.mktar" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="function">
<dt id="pylorax.imgutils.mount">
<code class="sig-prename descclassname">pylorax.imgutils.</code><code class="sig-name descname">mount</code><span class="sig-paren">(</span><em class="sig-param">dev</em>, <em class="sig-param">opts=''</em>, <em class="sig-param">mnt=None</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/imgutils.html#mount"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.imgutils.mount" title="Permalink to this definition"></a></dt>
<dd><p>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
returned.
raises CalledProcessError if mount fails.</p>
</dd></dl>
<dl class="function">
<dt id="pylorax.imgutils.round_to_blocks">
<code class="sig-prename descclassname">pylorax.imgutils.</code><code class="sig-name descname">round_to_blocks</code><span class="sig-paren">(</span><em class="sig-param">size</em>, <em class="sig-param">blocksize</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/imgutils.html#round_to_blocks"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.imgutils.round_to_blocks" title="Permalink to this definition"></a></dt>
<dd><p>If size isn't a multiple of blocksize, round up to the next multiple</p>
</dd></dl>
<dl class="function">
<dt id="pylorax.imgutils.umount">
<code class="sig-prename descclassname">pylorax.imgutils.</code><code class="sig-name descname">umount</code><span class="sig-paren">(</span><em class="sig-param">mnt</em>, <em class="sig-param">lazy=False</em>, <em class="sig-param">maxretry=3</em>, <em class="sig-param">retrysleep=1.0</em>, <em class="sig-param">delete=True</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/imgutils.html#umount"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.imgutils.umount" title="Permalink to this definition"></a></dt>
<dd><p>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.</p>
</dd></dl>
</div>
<div class="section" id="module-pylorax.installer">
<span id="pylorax-installer-module"></span><h2>pylorax.installer module<a class="headerlink" href="#module-pylorax.installer" title="Permalink to this headline"></a></h2>
<dl class="exception">
<dt id="pylorax.installer.InstallError">
<em class="property">exception </em><code class="sig-prename descclassname">pylorax.installer.</code><code class="sig-name descname">InstallError</code><a class="reference internal" href="_modules/pylorax/installer.html#InstallError"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.installer.InstallError" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <a class="reference external" href="https://docs.python.org/3/library/exceptions.html#Exception" title="(in Python v3.8)"><code class="xref py py-class docutils literal notranslate"><span class="pre">Exception</span></code></a></p>
</dd></dl>
<dl class="class">
<dt id="pylorax.installer.QEMUInstall">
<em class="property">class </em><code class="sig-prename descclassname">pylorax.installer.</code><code class="sig-name descname">QEMUInstall</code><span class="sig-paren">(</span><em class="sig-param">opts</em>, <em class="sig-param">iso</em>, <em class="sig-param">ks_paths</em>, <em class="sig-param">disk_img</em>, <em class="sig-param">img_size=2048</em>, <em class="sig-param">kernel_args=None</em>, <em class="sig-param">memory=1024</em>, <em class="sig-param">vcpus=None</em>, <em class="sig-param">vnc=None</em>, <em class="sig-param">arch=None</em>, <em class="sig-param">cancel_func=None</em>, <em class="sig-param">virtio_host='127.0.0.1'</em>, <em class="sig-param">virtio_port=6080</em>, <em class="sig-param">image_type=None</em>, <em class="sig-param">boot_uefi=False</em>, <em class="sig-param">ovmf_path=None</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/installer.html#QEMUInstall"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.installer.QEMUInstall" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <a class="reference external" href="https://docs.python.org/3/library/functions.html#object" title="(in Python v3.8)"><code class="xref py py-class docutils literal notranslate"><span class="pre">object</span></code></a></p>
<p>Run qemu using an iso and a kickstart</p>
<dl class="attribute">
<dt id="pylorax.installer.QEMUInstall.QEMU_CMDS">
<code class="sig-name descname">QEMU_CMDS</code><em class="property"> = {'aarch64': 'qemu-system-aarch64', 'arm': 'qemu-system-arm', 'i386': 'qemu-system-i386', 'ppc64le': 'qemu-system-ppc64', 'x86_64': 'qemu-system-x86_64'}</em><a class="headerlink" href="#pylorax.installer.QEMUInstall.QEMU_CMDS" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
<dl class="function">
<dt id="pylorax.installer.anaconda_cleanup">
<code class="sig-prename descclassname">pylorax.installer.</code><code class="sig-name descname">anaconda_cleanup</code><span class="sig-paren">(</span><em class="sig-param">dirinstall_path</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/installer.html#anaconda_cleanup"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.installer.anaconda_cleanup" title="Permalink to this definition"></a></dt>
<dd><p>Cleanup any leftover mounts from anaconda</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>dirinstall_path</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.8)"><em>str</em></a>) -- Path where anaconda mounts things</p>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>True if cleanups were successful. False if any of them failed.</p>
</dd>
</dl>
<p>If anaconda crashes it may leave things mounted under this path. It will
typically be set to /mnt/sysimage/</p>
<p>Attempts to cleanup may also fail. Catch these and continue trying the
other mountpoints.</p>
<p>Anaconda may also leave /run/anaconda.pid behind, clean that up as well.</p>
</dd></dl>
<dl class="function">
<dt id="pylorax.installer.append_initrd">
<code class="sig-prename descclassname">pylorax.installer.</code><code class="sig-name descname">append_initrd</code><span class="sig-paren">(</span><em class="sig-param">initrd</em>, <em class="sig-param">files</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/installer.html#append_initrd"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.installer.append_initrd" title="Permalink to this definition"></a></dt>
<dd><p>Append files to an initrd.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>initrd</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.8)"><em>str</em></a>) -- Path to initrd</p></li>
<li><p><strong>files</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#list" title="(in Python v3.8)"><em>list</em></a>) -- list of file paths to add</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>Path to a new initrd</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.8)">str</a></p>
</dd>
</dl>
<p>The files are added to the initrd by creating a cpio image
of the files (stored at /) and writing the cpio to the end of a
copy of the initrd.</p>
<p>The initrd is not changed, a copy is made before appending the
cpio archive.</p>
</dd></dl>
<dl class="function">
<dt id="pylorax.installer.create_vagrant_metadata">
<code class="sig-prename descclassname">pylorax.installer.</code><code class="sig-name descname">create_vagrant_metadata</code><span class="sig-paren">(</span><em class="sig-param">path</em>, <em class="sig-param">size=0</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/installer.html#create_vagrant_metadata"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.installer.create_vagrant_metadata" title="Permalink to this definition"></a></dt>
<dd><p>Create a default Vagrant metadata.json file</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>path</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.8)"><em>str</em></a>) -- Path to metadata.json file</p></li>
<li><p><strong>size</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.8)"><em>int</em></a>) -- Disk size in MiB</p></li>
</ul>
</dd>
</dl>
</dd></dl>
<dl class="function">
<dt id="pylorax.installer.find_free_port">
<code class="sig-prename descclassname">pylorax.installer.</code><code class="sig-name descname">find_free_port</code><span class="sig-paren">(</span><em class="sig-param">start=5900</em>, <em class="sig-param">end=5999</em>, <em class="sig-param">host='127.0.0.1'</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/installer.html#find_free_port"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.installer.find_free_port" title="Permalink to this definition"></a></dt>
<dd><p>Return first free port in range.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>start</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.8)"><em>int</em></a>) -- Starting port number</p></li>
<li><p><strong>end</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.8)"><em>int</em></a>) -- Ending port number</p></li>
<li><p><strong>host</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.8)"><em>str</em></a>) -- Host IP to search</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>First free port or -1 if none found</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p><a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.8)">int</a></p>
</dd>
</dl>
</dd></dl>
<dl class="function">
<dt id="pylorax.installer.novirt_cancel_check">
<code class="sig-prename descclassname">pylorax.installer.</code><code class="sig-name descname">novirt_cancel_check</code><span class="sig-paren">(</span><em class="sig-param">cancel_funcs</em>, <em class="sig-param">proc</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/installer.html#novirt_cancel_check"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.installer.novirt_cancel_check" title="Permalink to this definition"></a></dt>
<dd><p>Check to see if there has been an error in the logs</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>cancel_funcs</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#list" title="(in Python v3.8)"><em>list</em></a>) -- list of functions to call, True from any one cancels the build</p></li>
<li><p><strong>proc</strong> (<a class="reference external" href="https://docs.python.org/3/library/subprocess.html#subprocess.Popen" title="(in Python v3.8)"><em>subprocess.Popen</em></a>) -- Popen object for the anaconda process</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>True if the process has been terminated</p>
</dd>
</dl>
<p>The cancel_funcs functions should return a True if an error has been detected.
When an error is detected the process is terminated and this returns True</p>
</dd></dl>
<dl class="function">
<dt id="pylorax.installer.novirt_install">
<code class="sig-prename descclassname">pylorax.installer.</code><code class="sig-name descname">novirt_install</code><span class="sig-paren">(</span><em class="sig-param">opts</em>, <em class="sig-param">disk_img</em>, <em class="sig-param">disk_size</em>, <em class="sig-param">cancel_func=None</em>, <em class="sig-param">tar_img=None</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/installer.html#novirt_install"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.installer.novirt_install" title="Permalink to this definition"></a></dt>
<dd><p>Use Anaconda to install to a disk image</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>opts</strong> (<em>argparse options</em>) -- options passed to livemedia-creator</p></li>
<li><p><strong>disk_img</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.8)"><em>str</em></a>) -- The full path to the disk image to be created</p></li>
<li><p><strong>disk_size</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.8)"><em>int</em></a>) -- The size of the disk_img in MiB</p></li>
<li><p><strong>cancel_func</strong> (<em>function</em>) -- Function that returns True to cancel build</p></li>
<li><p><strong>tar_img</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.8)"><em>str</em></a>) -- For make_tar_disk, the path to final tarball to be created</p></li>
</ul>
</dd>
</dl>
<p>This method runs anaconda to create the image and then based on the opts
passed creates a qemu disk image or tarfile.</p>
</dd></dl>
<dl class="function">
<dt id="pylorax.installer.update_vagrant_metadata">
<code class="sig-prename descclassname">pylorax.installer.</code><code class="sig-name descname">update_vagrant_metadata</code><span class="sig-paren">(</span><em class="sig-param">path</em>, <em class="sig-param">size</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/installer.html#update_vagrant_metadata"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.installer.update_vagrant_metadata" title="Permalink to this definition"></a></dt>
<dd><p>Update the Vagrant metadata.json file</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>path</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.8)"><em>str</em></a>) -- Path to metadata.json file</p></li>
<li><p><strong>size</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.8)"><em>int</em></a>) -- Disk size in MiB</p></li>
</ul>
</dd>
</dl>
<p>This function makes sure that the provider, format and virtual size of the
metadata file are set correctly. All other values are left untouched.</p>
</dd></dl>
<dl class="function">
<dt id="pylorax.installer.virt_install">
<code class="sig-prename descclassname">pylorax.installer.</code><code class="sig-name descname">virt_install</code><span class="sig-paren">(</span><em class="sig-param">opts</em>, <em class="sig-param">install_log</em>, <em class="sig-param">disk_img</em>, <em class="sig-param">disk_size</em>, <em class="sig-param">cancel_func=None</em>, <em class="sig-param">tar_img=None</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/installer.html#virt_install"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.installer.virt_install" title="Permalink to this definition"></a></dt>
<dd><p>Use qemu to install to a disk image</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>opts</strong> (<em>argparse options</em>) -- options passed to livemedia-creator</p></li>
<li><p><strong>install_log</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.8)"><em>str</em></a>) -- The path to write the log from qemu</p></li>
<li><p><strong>disk_img</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.8)"><em>str</em></a>) -- The full path to the disk image to be created</p></li>
<li><p><strong>disk_size</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.8)"><em>int</em></a>) -- The size of the disk_img in MiB</p></li>
<li><p><strong>cancel_func</strong> (<em>function</em>) -- Function that returns True to cancel build</p></li>
<li><p><strong>tar_img</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.8)"><em>str</em></a>) -- For make_tar_disk, the path to final tarball to be created</p></li>
</ul>
</dd>
</dl>
<p>This uses qemu with a boot.iso and a kickstart to create a disk
image and then optionally, based on the opts passed, creates tarfile.</p>
</dd></dl>
</div>
<div class="section" id="module-pylorax.ltmpl">
<span id="pylorax-ltmpl-module"></span><h2>pylorax.ltmpl module<a class="headerlink" href="#module-pylorax.ltmpl" title="Permalink to this headline"></a></h2>
<dl class="class">
<dt id="pylorax.ltmpl.LiveTemplateRunner">
<em class="property">class </em><code class="sig-prename descclassname">pylorax.ltmpl.</code><code class="sig-name descname">LiveTemplateRunner</code><span class="sig-paren">(</span><em class="sig-param">dbo</em>, <em class="sig-param">fatalerrors=True</em>, <em class="sig-param">templatedir=None</em>, <em class="sig-param">defaults=None</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/ltmpl.html#LiveTemplateRunner"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.ltmpl.LiveTemplateRunner" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <a class="reference internal" href="#pylorax.ltmpl.TemplateRunner" title="pylorax.ltmpl.TemplateRunner"><code class="xref py py-class docutils literal notranslate"><span class="pre">pylorax.ltmpl.TemplateRunner</span></code></a></p>
<p>This class parses and executes a limited Lorax template. Sample usage:</p>
<blockquote>
<div><p># install a bunch of packages
runner = LiveTemplateRunner(dbo, templatedir, defaults)
runner.run(&quot;live-install.tmpl&quot;)</p>
<p>It is meant to be used with the live-install.tmpl which lists the per-arch
pacages needed to build the live-iso output.</p>
</div></blockquote>
<dl class="method">
<dt id="pylorax.ltmpl.LiveTemplateRunner.installpkg">
<code class="sig-name descname">installpkg</code><span class="sig-paren">(</span><em class="sig-param">*pkgs</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/ltmpl.html#LiveTemplateRunner.installpkg"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.ltmpl.LiveTemplateRunner.installpkg" title="Permalink to this definition"></a></dt>
<dd><dl>
<dt>installpkg [--required|--optional] [--except PKGGLOB [--except PKGGLOB ...]] PKGGLOB [PKGGLOB ...]</dt><dd><p>Request installation of all packages matching the given globs.
Note that this is just a <em>request</em> - nothing is <em>actually</em> installed
until the 'run_pkg_transaction' command is given.</p>
<p>--required is now the default. If the PKGGLOB can be missing pass --optional</p>
</dd>
</dl>
</dd></dl>
</dd></dl>
<dl class="class">
<dt id="pylorax.ltmpl.LoraxTemplate">
<em class="property">class </em><code class="sig-prename descclassname">pylorax.ltmpl.</code><code class="sig-name descname">LoraxTemplate</code><span class="sig-paren">(</span><em class="sig-param">directories=None</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/ltmpl.html#LoraxTemplate"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.ltmpl.LoraxTemplate" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <a class="reference external" href="https://docs.python.org/3/library/functions.html#object" title="(in Python v3.8)"><code class="xref py py-class docutils literal notranslate"><span class="pre">object</span></code></a></p>
<dl class="method">
<dt id="pylorax.ltmpl.LoraxTemplate.parse">
<code class="sig-name descname">parse</code><span class="sig-paren">(</span><em class="sig-param">template_file</em>, <em class="sig-param">variables</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/ltmpl.html#LoraxTemplate.parse"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.ltmpl.LoraxTemplate.parse" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
<dl class="class">
<dt id="pylorax.ltmpl.LoraxTemplateRunner">
<em class="property">class </em><code class="sig-prename descclassname">pylorax.ltmpl.</code><code class="sig-name descname">LoraxTemplateRunner</code><span class="sig-paren">(</span><em class="sig-param">inroot</em>, <em class="sig-param">outroot</em>, <em class="sig-param">dbo=None</em>, <em class="sig-param">fatalerrors=True</em>, <em class="sig-param">templatedir=None</em>, <em class="sig-param">defaults=None</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/ltmpl.html#LoraxTemplateRunner"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.ltmpl.LoraxTemplateRunner" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <a class="reference internal" href="#pylorax.ltmpl.TemplateRunner" title="pylorax.ltmpl.TemplateRunner"><code class="xref py py-class docutils literal notranslate"><span class="pre">pylorax.ltmpl.TemplateRunner</span></code></a></p>
<p>This class parses and executes Lorax templates. Sample usage:</p>
<blockquote>
<div><p># install a bunch of packages
runner = LoraxTemplateRunner(inroot=rundir, outroot=rundir, dbo=dnf_obj)
runner.run(&quot;install-packages.ltmpl&quot;)</p>
<p># modify a runtime dir
runner = LoraxTemplateRunner(inroot=rundir, outroot=newrun)
runner.run(&quot;runtime-transmogrify.ltmpl&quot;)</p>
</div></blockquote>
<p>NOTES:</p>
<ul class="simple">
<li><p>Commands that run external programs (e.g. systemctl) currently use
the <em>host</em>'s copy of that program, which may cause problems if there's a
big enough difference between the host and the image you're modifying.</p></li>
<li><p>The commands are not executed under a real chroot, so absolute symlinks
will point <em>outside</em> the inroot/outroot. Be careful with symlinks!</p></li>
</ul>
<p>ADDING NEW COMMANDS:</p>
<ul class="simple">
<li><p>Each template command is just a method of the LoraxTemplateRunner
object - so adding a new command is as easy as adding a new function.</p></li>
<li><p>Each function gets arguments that correspond to the rest of the tokens
on that line (after word splitting and brace expansion)</p></li>
<li><p>Commands should raise exceptions for errors - don't use sys.exit()</p></li>
</ul>
<dl class="method">
<dt id="pylorax.ltmpl.LoraxTemplateRunner.append">
<code class="sig-name descname">append</code><span class="sig-paren">(</span><em class="sig-param">filename</em>, <em class="sig-param">data</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/ltmpl.html#LoraxTemplateRunner.append"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.ltmpl.LoraxTemplateRunner.append" title="Permalink to this definition"></a></dt>
<dd><dl>
<dt>append FILE STRING</dt><dd><p>Append STRING (followed by a newline character) to FILE.
Python character escape sequences ('n', 't', etc.) will be
converted to the appropriate characters.</p>
<p>Examples:</p>
<blockquote>
<div><p>append /etc/depmod.d/dd.conf &quot;search updates built-in&quot;
append /etc/resolv.conf &quot;&quot;</p>
</div></blockquote>
</dd>
</dl>
</dd></dl>
<dl class="method">
<dt id="pylorax.ltmpl.LoraxTemplateRunner.chmod">
<code class="sig-name descname">chmod</code><span class="sig-paren">(</span><em class="sig-param">fileglob</em>, <em class="sig-param">mode</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/ltmpl.html#LoraxTemplateRunner.chmod"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.ltmpl.LoraxTemplateRunner.chmod" title="Permalink to this definition"></a></dt>
<dd><dl class="simple">
<dt>chmod FILEGLOB OCTALMODE</dt><dd><p>Change the mode of all the files matching FILEGLOB to OCTALMODE.</p>
</dd>
</dl>
</dd></dl>
<dl class="method">
<dt id="pylorax.ltmpl.LoraxTemplateRunner.copy">
<code class="sig-name descname">copy</code><span class="sig-paren">(</span><em class="sig-param">src</em>, <em class="sig-param">dest</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/ltmpl.html#LoraxTemplateRunner.copy"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.ltmpl.LoraxTemplateRunner.copy" title="Permalink to this definition"></a></dt>
<dd><dl class="simple">
<dt>copy SRC DEST</dt><dd><p>Copy SRC to DEST.
If DEST is a directory, SRC will be copied inside it.
If DEST doesn't exist, SRC will be copied to a file with
that name, if the path leading to it exists.</p>
</dd>
</dl>
</dd></dl>
<dl class="method">
<dt id="pylorax.ltmpl.LoraxTemplateRunner.createaddrsize">
<code class="sig-name descname">createaddrsize</code><span class="sig-paren">(</span><em class="sig-param">addr</em>, <em class="sig-param">src</em>, <em class="sig-param">dest</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/ltmpl.html#LoraxTemplateRunner.createaddrsize"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.ltmpl.LoraxTemplateRunner.createaddrsize" title="Permalink to this definition"></a></dt>
<dd><dl>
<dt>createaddrsize INITRD_ADDRESS INITRD ADDRSIZE</dt><dd><p>Create the initrd.addrsize file required in LPAR boot process.</p>
<dl class="simple">
<dt>Examples:</dt><dd><p>createaddrsize ${INITRD_ADDRESS} ${outroot}/${BOOTDIR}/initrd.img ${outroot}/${BOOTDIR}/initrd.addrsize</p>
</dd>
</dl>
</dd>
</dl>
</dd></dl>
<dl class="method">
<dt id="pylorax.ltmpl.LoraxTemplateRunner.hardlink">
<code class="sig-name descname">hardlink</code><span class="sig-paren">(</span><em class="sig-param">src</em>, <em class="sig-param">dest</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/ltmpl.html#LoraxTemplateRunner.hardlink"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.ltmpl.LoraxTemplateRunner.hardlink" title="Permalink to this definition"></a></dt>
<dd><dl class="simple">
<dt>hardlink SRC DEST</dt><dd><p>Create a hardlink at DEST which is linked to SRC.</p>
</dd>
</dl>
</dd></dl>
<dl class="method">
<dt id="pylorax.ltmpl.LoraxTemplateRunner.install">
<code class="sig-name descname">install</code><span class="sig-paren">(</span><em class="sig-param">srcglob</em>, <em class="sig-param">dest</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/ltmpl.html#LoraxTemplateRunner.install"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.ltmpl.LoraxTemplateRunner.install" title="Permalink to this definition"></a></dt>
<dd><dl>
<dt>install SRC DEST</dt><dd><p>Copy the given file (or files, if a glob is used) from the input
tree to the given destination in the output tree.
The path to DEST must exist in the output tree.
If DEST is a directory, SRC will be copied into that directory.
If DEST doesn't exist, SRC will be copied to a file with that name,
assuming the rest of the path exists.
This is pretty much like how the 'cp' command works.</p>
<dl class="simple">
<dt>Examples:</dt><dd><p>install usr/share/myconfig/grub.conf /boot
install /usr/share/myconfig/grub.conf.in /boot/grub.conf</p>
</dd>
</dl>
</dd>
</dl>
</dd></dl>
<dl class="method">
<dt id="pylorax.ltmpl.LoraxTemplateRunner.installimg">
<code class="sig-name descname">installimg</code><span class="sig-paren">(</span><em class="sig-param">*args</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/ltmpl.html#LoraxTemplateRunner.installimg"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.ltmpl.LoraxTemplateRunner.installimg" title="Permalink to this definition"></a></dt>
<dd><dl>
<dt>installimg [--xz|--gzip|--bzip2|--lzma] [-ARG|--ARG=OPTION] SRCDIR DESTFILE</dt><dd><p>Create a compressed cpio archive of the contents of SRCDIR and place
it in DESTFILE.</p>
<p>If SRCDIR doesn't exist or is empty nothing is created.</p>
<dl class="simple">
<dt>Examples:</dt><dd><p>installimg ${LORAXDIR}/product/ images/product.img
installimg ${LORAXDIR}/updates/ images/updates.img
installimg --xz -6 ${LORAXDIR}/updates/ images/updates.img
installimg --xz -9 --memlimit-compress=3700MiB ${LORAXDIR}/updates/ images/updates.img</p>
</dd>
</dl>
<p>Optionally use a different compression type and override the default args
passed to it. The default is xz -9</p>
</dd>
</dl>
</dd></dl>
<dl class="method">
<dt id="pylorax.ltmpl.LoraxTemplateRunner.installinitrd">
<code class="sig-name descname">installinitrd</code><span class="sig-paren">(</span><em class="sig-param">section</em>, <em class="sig-param">src</em>, <em class="sig-param">dest</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/ltmpl.html#LoraxTemplateRunner.installinitrd"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.ltmpl.LoraxTemplateRunner.installinitrd" title="Permalink to this definition"></a></dt>
<dd><dl class="simple">
<dt>installinitrd SECTION SRC DEST</dt><dd><p>Same as installkernel, but for &quot;initrd&quot;.</p>
</dd>
</dl>
</dd></dl>
<dl class="method">
<dt id="pylorax.ltmpl.LoraxTemplateRunner.installkernel">
<code class="sig-name descname">installkernel</code><span class="sig-paren">(</span><em class="sig-param">section</em>, <em class="sig-param">src</em>, <em class="sig-param">dest</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/ltmpl.html#LoraxTemplateRunner.installkernel"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.ltmpl.LoraxTemplateRunner.installkernel" title="Permalink to this definition"></a></dt>
<dd><dl>
<dt>installkernel SECTION SRC DEST</dt><dd><p>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
SECTION, where &quot;kernel&quot; = DEST.</p>
<dl class="simple">
<dt>Equivalent to:</dt><dd><p>install SRC DEST
treeinfo SECTION kernel DEST</p>
</dd>
</dl>
</dd>
</dl>
</dd></dl>
<dl class="method">
<dt id="pylorax.ltmpl.LoraxTemplateRunner.installpkg">
<code class="sig-name descname">installpkg</code><span class="sig-paren">(</span><em class="sig-param">*pkgs</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/ltmpl.html#LoraxTemplateRunner.installpkg"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.ltmpl.LoraxTemplateRunner.installpkg" title="Permalink to this definition"></a></dt>
<dd><dl>
<dt>installpkg [--required|--optional] [--except PKGGLOB [--except PKGGLOB ...]] PKGGLOB [PKGGLOB ...]</dt><dd><p>Request installation of all packages matching the given globs.
Note that this is just a <em>request</em> - nothing is <em>actually</em> installed
until the 'run_pkg_transaction' command is given.</p>
<p>--required is now the default. If the PKGGLOB can be missing pass --optional</p>
</dd>
</dl>
</dd></dl>
<dl class="method">
<dt id="pylorax.ltmpl.LoraxTemplateRunner.installupgradeinitrd">
<code class="sig-name descname">installupgradeinitrd</code><span class="sig-paren">(</span><em class="sig-param">section</em>, <em class="sig-param">src</em>, <em class="sig-param">dest</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/ltmpl.html#LoraxTemplateRunner.installupgradeinitrd"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.ltmpl.LoraxTemplateRunner.installupgradeinitrd" title="Permalink to this definition"></a></dt>
<dd><dl class="simple">
<dt>installupgradeinitrd SECTION SRC DEST</dt><dd><p>Same as installkernel, but for &quot;upgrade&quot;.</p>
</dd>
</dl>
</dd></dl>
<dl class="method">
<dt id="pylorax.ltmpl.LoraxTemplateRunner.log">
<code class="sig-name descname">log</code><span class="sig-paren">(</span><em class="sig-param">msg</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/ltmpl.html#LoraxTemplateRunner.log"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.ltmpl.LoraxTemplateRunner.log" title="Permalink to this definition"></a></dt>
<dd><dl>
<dt>log MESSAGE</dt><dd><p>Emit the given log message. Be sure to put it in quotes!</p>
<dl class="simple">
<dt>Example:</dt><dd><p>log &quot;Reticulating splines, please wait...&quot;</p>
</dd>
</dl>
</dd>
</dl>
</dd></dl>
<dl class="method">
<dt id="pylorax.ltmpl.LoraxTemplateRunner.mkdir">
<code class="sig-name descname">mkdir</code><span class="sig-paren">(</span><em class="sig-param">*dirs</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/ltmpl.html#LoraxTemplateRunner.mkdir"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.ltmpl.LoraxTemplateRunner.mkdir" title="Permalink to this definition"></a></dt>
<dd><dl>
<dt>mkdir DIR [DIR ...]</dt><dd><p>Create the named DIR(s). Will create leading directories as needed.</p>
<dl class="simple">
<dt>Example:</dt><dd><p>mkdir /images</p>
</dd>
</dl>
</dd>
</dl>
</dd></dl>
<dl class="method">
<dt id="pylorax.ltmpl.LoraxTemplateRunner.move">
<code class="sig-name descname">move</code><span class="sig-paren">(</span><em class="sig-param">src</em>, <em class="sig-param">dest</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/ltmpl.html#LoraxTemplateRunner.move"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.ltmpl.LoraxTemplateRunner.move" title="Permalink to this definition"></a></dt>
<dd><dl class="simple">
<dt>move SRC DEST</dt><dd><p>Move SRC to DEST.</p>
</dd>
</dl>
</dd></dl>
<dl class="method">
<dt id="pylorax.ltmpl.LoraxTemplateRunner.remove">
<code class="sig-name descname">remove</code><span class="sig-paren">(</span><em class="sig-param">*fileglobs</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/ltmpl.html#LoraxTemplateRunner.remove"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.ltmpl.LoraxTemplateRunner.remove" title="Permalink to this definition"></a></dt>
<dd><dl class="simple">
<dt>remove FILEGLOB [FILEGLOB ...]</dt><dd><p>Remove all the named files or directories.
Will <em>not</em> raise exceptions if the file(s) are not found.</p>
</dd>
</dl>
</dd></dl>
<dl class="method">
<dt id="pylorax.ltmpl.LoraxTemplateRunner.removefrom">
<code class="sig-name descname">removefrom</code><span class="sig-paren">(</span><em class="sig-param">pkg</em>, <em class="sig-param">*globs</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/ltmpl.html#LoraxTemplateRunner.removefrom"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.ltmpl.LoraxTemplateRunner.removefrom" title="Permalink to this definition"></a></dt>
<dd><dl>
<dt>removefrom PKGGLOB [--allbut] FILEGLOB [FILEGLOB...]</dt><dd><p>Remove all files matching the given file globs from the package
(or packages) named.
If '--allbut' is used, all the files from the given package(s) will
be removed <em>except</em> the ones which match the file globs.</p>
<dl class="simple">
<dt>Examples:</dt><dd><p>removefrom usbutils /usr/bin/*
removefrom xfsprogs --allbut /sbin/*</p>
</dd>
</dl>
</dd>
</dl>
</dd></dl>
<dl class="method">
<dt id="pylorax.ltmpl.LoraxTemplateRunner.removekmod">
<code class="sig-name descname">removekmod</code><span class="sig-paren">(</span><em class="sig-param">*globs</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/ltmpl.html#LoraxTemplateRunner.removekmod"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.ltmpl.LoraxTemplateRunner.removekmod" title="Permalink to this definition"></a></dt>
<dd><dl>
<dt>removekmod GLOB [GLOB...] [--allbut] KEEPGLOB [KEEPGLOB...]</dt><dd><p>Remove all files and directories matching the given file globs from the kernel
modules directory.</p>
<p>If '--allbut' is used, all the files from the modules will be removed <em>except</em>
the ones which match the file globs. There must be at least one initial GLOB
to search and one KEEPGLOB to keep. The KEEPGLOB is expanded to be <em>KEEPGLOB</em>
so that it will match anywhere in the path.</p>
<p>This only removes files from under /lib/modules/*/kernel/</p>
<dl class="simple">
<dt>Examples:</dt><dd><p>removekmod sound drivers/media drivers/hwmon drivers/video
removekmod drivers/char --allbut virtio_console hw_random</p>
</dd>
</dl>
</dd>
</dl>
</dd></dl>
<dl class="method">
<dt id="pylorax.ltmpl.LoraxTemplateRunner.removepkg">
<code class="sig-name descname">removepkg</code><span class="sig-paren">(</span><em class="sig-param">*pkgs</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/ltmpl.html#LoraxTemplateRunner.removepkg"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.ltmpl.LoraxTemplateRunner.removepkg" title="Permalink to this definition"></a></dt>
<dd><dl>
<dt>removepkg PKGGLOB [PKGGLOB...]</dt><dd><p>Delete the named package(s).</p>
<dl class="simple">
<dt>IMPLEMENTATION NOTES:</dt><dd><p>RPM scriptlets (%preun/%postun) are <em>not</em> run.
Files are deleted, but directories are left behind.</p>
</dd>
</dl>
</dd>
</dl>
</dd></dl>
<dl class="method">
<dt id="pylorax.ltmpl.LoraxTemplateRunner.replace">
<code class="sig-name descname">replace</code><span class="sig-paren">(</span><em class="sig-param">pat</em>, <em class="sig-param">repl</em>, <em class="sig-param">*fileglobs</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/ltmpl.html#LoraxTemplateRunner.replace"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.ltmpl.LoraxTemplateRunner.replace" title="Permalink to this definition"></a></dt>
<dd><dl>
<dt>replace PATTERN REPLACEMENT FILEGLOB [FILEGLOB ...]</dt><dd><p>Find-and-replace the given PATTERN (Python-style regex) with the given
REPLACEMENT string for each of the files listed.</p>
<dl class="simple">
<dt>Example:</dt><dd><p>replace &#64;VERSION&#64; ${product.version} /boot/grub.conf /boot/isolinux.cfg</p>
</dd>
</dl>
</dd>
</dl>
</dd></dl>
<dl class="method">
<dt id="pylorax.ltmpl.LoraxTemplateRunner.run_pkg_transaction">
<code class="sig-name descname">run_pkg_transaction</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/ltmpl.html#LoraxTemplateRunner.run_pkg_transaction"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.ltmpl.LoraxTemplateRunner.run_pkg_transaction" title="Permalink to this definition"></a></dt>
<dd><p>Actually install all the packages requested by previous 'installpkg'
commands.</p>
</dd></dl>
<dl class="method">
<dt id="pylorax.ltmpl.LoraxTemplateRunner.runcmd">
<code class="sig-name descname">runcmd</code><span class="sig-paren">(</span><em class="sig-param">*cmdlist</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/ltmpl.html#LoraxTemplateRunner.runcmd"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.ltmpl.LoraxTemplateRunner.runcmd" title="Permalink to this definition"></a></dt>
<dd><dl>
<dt>runcmd CMD [ARG ...]</dt><dd><p>Run the given command with the given arguments.</p>
<p>NOTE: All paths given MUST be COMPLETE, ABSOLUTE PATHS to the file
or files mentioned. ${root}/${inroot}/${outroot} are good for
constructing these paths.</p>
<p>FURTHER NOTE: Please use this command only as a last resort!
Whenever possible, you should use the existing template commands.
If the existing commands don't do what you need, fix them!</p>
<dl class="simple">
<dt>Examples:</dt><dd><p>(this should be replaced with a &quot;find&quot; function)
runcmd find ${root} -name &quot;<em>.pyo&quot; -type f -delete
%for f in find(root, name=&quot;</em>.pyo&quot;):
remove ${f}
%endfor</p>
</dd>
</dl>
</dd>
</dl>
</dd></dl>
<dl class="method">
<dt id="pylorax.ltmpl.LoraxTemplateRunner.symlink">
<code class="sig-name descname">symlink</code><span class="sig-paren">(</span><em class="sig-param">target</em>, <em class="sig-param">dest</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/ltmpl.html#LoraxTemplateRunner.symlink"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.ltmpl.LoraxTemplateRunner.symlink" title="Permalink to this definition"></a></dt>
<dd><dl class="simple">
<dt>symlink SRC DEST</dt><dd><p>Create a symlink at DEST which points to SRC.</p>
</dd>
</dl>
</dd></dl>
<dl class="method">
<dt id="pylorax.ltmpl.LoraxTemplateRunner.systemctl">
<code class="sig-name descname">systemctl</code><span class="sig-paren">(</span><em class="sig-param">cmd</em>, <em class="sig-param">*units</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/ltmpl.html#LoraxTemplateRunner.systemctl"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.ltmpl.LoraxTemplateRunner.systemctl" title="Permalink to this definition"></a></dt>
<dd><dl>
<dt>systemctl [enable|disable|mask] UNIT [UNIT...]</dt><dd><p>Enable, disable, or mask the given systemd units.</p>
<dl class="simple">
<dt>Examples:</dt><dd><p>systemctl disable lvm2-monitor.service
systemctl mask fedora-storage-init.service fedora-configure.service</p>
</dd>
</dl>
</dd>
</dl>
</dd></dl>
<dl class="method">
<dt id="pylorax.ltmpl.LoraxTemplateRunner.treeinfo">
<code class="sig-name descname">treeinfo</code><span class="sig-paren">(</span><em class="sig-param">section</em>, <em class="sig-param">key</em>, <em class="sig-param">*valuetoks</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/ltmpl.html#LoraxTemplateRunner.treeinfo"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.ltmpl.LoraxTemplateRunner.treeinfo" title="Permalink to this definition"></a></dt>
<dd><dl>
<dt>treeinfo SECTION KEY ARG [ARG ...]</dt><dd><p>Add an item to the treeinfo data store.
The given SECTION will have a new item added where
KEY = ARG ARG ...</p>
<dl class="simple">
<dt>Example:</dt><dd><p>treeinfo images-${kernel.arch} boot.iso images/boot.iso</p>
</dd>
</dl>
</dd>
</dl>
</dd></dl>
</dd></dl>
<dl class="class">
<dt id="pylorax.ltmpl.TemplateRunner">
<em class="property">class </em><code class="sig-prename descclassname">pylorax.ltmpl.</code><code class="sig-name descname">TemplateRunner</code><span class="sig-paren">(</span><em class="sig-param">fatalerrors=True</em>, <em class="sig-param">templatedir=None</em>, <em class="sig-param">defaults=None</em>, <em class="sig-param">builtins=None</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/ltmpl.html#TemplateRunner"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.ltmpl.TemplateRunner" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <a class="reference external" href="https://docs.python.org/3/library/functions.html#object" title="(in Python v3.8)"><code class="xref py py-class docutils literal notranslate"><span class="pre">object</span></code></a></p>
<p>This class parses and executes Lorax templates. Sample usage:</p>
<blockquote>
<div><p># install a bunch of packages
runner = LoraxTemplateRunner(inroot=rundir, outroot=rundir, dbo=dnf_obj)
runner.run(&quot;install-packages.ltmpl&quot;)</p>
</div></blockquote>
<p>NOTES:</p>
<ul>
<li><p>Parsing procedure is roughly:
1. Mako template expansion (on the whole file)
2. For each line of the result,</p>
<blockquote>
<div><ol class="loweralpha simple">
<li><p>Whitespace splitting (using shlex.split())</p></li>
<li><p>Brace expansion (using brace_expand())</p></li>
<li><p>If the first token is the name of a function, call that function
with the rest of the line as arguments</p></li>
</ol>
</div></blockquote>
</li>
<li><p>Parsing and execution are <em>separate</em> passes - so you can't use the result
of a command in an %if statement (or any other control statements)!</p></li>
</ul>
<dl class="method">
<dt id="pylorax.ltmpl.TemplateRunner.run">
<code class="sig-name descname">run</code><span class="sig-paren">(</span><em class="sig-param">templatefile</em>, <em class="sig-param">**variables</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/ltmpl.html#TemplateRunner.run"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.ltmpl.TemplateRunner.run" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
<dl class="function">
<dt id="pylorax.ltmpl.brace_expand">
<code class="sig-prename descclassname">pylorax.ltmpl.</code><code class="sig-name descname">brace_expand</code><span class="sig-paren">(</span><em class="sig-param">s</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/ltmpl.html#brace_expand"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.ltmpl.brace_expand" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="function">
<dt id="pylorax.ltmpl.rexists">
<code class="sig-prename descclassname">pylorax.ltmpl.</code><code class="sig-name descname">rexists</code><span class="sig-paren">(</span><em class="sig-param">pathname</em>, <em class="sig-param">root=''</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/ltmpl.html#rexists"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.ltmpl.rexists" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="function">
<dt id="pylorax.ltmpl.rglob">
<code class="sig-prename descclassname">pylorax.ltmpl.</code><code class="sig-name descname">rglob</code><span class="sig-paren">(</span><em class="sig-param">pathname</em>, <em class="sig-param">root='/'</em>, <em class="sig-param">fatal=False</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/ltmpl.html#rglob"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.ltmpl.rglob" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="function">
<dt id="pylorax.ltmpl.split_and_expand">
<code class="sig-prename descclassname">pylorax.ltmpl.</code><code class="sig-name descname">split_and_expand</code><span class="sig-paren">(</span><em class="sig-param">line</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/ltmpl.html#split_and_expand"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.ltmpl.split_and_expand" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</div>
<div class="section" id="module-pylorax.monitor">
<span id="pylorax-monitor-module"></span><h2>pylorax.monitor module<a class="headerlink" href="#module-pylorax.monitor" title="Permalink to this headline"></a></h2>
<dl class="class">
<dt id="pylorax.monitor.LogMonitor">
<em class="property">class </em><code class="sig-prename descclassname">pylorax.monitor.</code><code class="sig-name descname">LogMonitor</code><span class="sig-paren">(</span><em class="sig-param">log_path=None</em>, <em class="sig-param">host='localhost'</em>, <em class="sig-param">port=0</em>, <em class="sig-param">timeout=None</em>, <em class="sig-param">log_request_handler_class=&lt;class 'pylorax.monitor.LogRequestHandler'&gt;</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/monitor.html#LogMonitor"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.monitor.LogMonitor" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <a class="reference external" href="https://docs.python.org/3/library/functions.html#object" title="(in Python v3.8)"><code class="xref py py-class docutils literal notranslate"><span class="pre">object</span></code></a></p>
<p>Setup a server to monitor the logs output by the installation</p>
<p>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.</p>
<dl class="method">
<dt id="pylorax.monitor.LogMonitor.shutdown">
<code class="sig-name descname">shutdown</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/monitor.html#LogMonitor.shutdown"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.monitor.LogMonitor.shutdown" title="Permalink to this definition"></a></dt>
<dd><p>Force shutdown of the monitoring thread</p>
</dd></dl>
</dd></dl>
<dl class="class">
<dt id="pylorax.monitor.LogRequestHandler">
<em class="property">class </em><code class="sig-prename descclassname">pylorax.monitor.</code><code class="sig-name descname">LogRequestHandler</code><span class="sig-paren">(</span><em class="sig-param">request</em>, <em class="sig-param">client_address</em>, <em class="sig-param">server</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/monitor.html#LogRequestHandler"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.monitor.LogRequestHandler" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <a class="reference external" href="https://docs.python.org/3/library/socketserver.html#socketserver.BaseRequestHandler" title="(in Python v3.8)"><code class="xref py py-class docutils literal notranslate"><span class="pre">socketserver.BaseRequestHandler</span></code></a></p>
<p>Handle monitoring and saving the logfiles from the virtual install</p>
<p>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.</p>
<dl class="method">
<dt id="pylorax.monitor.LogRequestHandler.finish">
<code class="sig-name descname">finish</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/monitor.html#LogRequestHandler.finish"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.monitor.LogRequestHandler.finish" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="method">
<dt id="pylorax.monitor.LogRequestHandler.handle">
<code class="sig-name descname">handle</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/monitor.html#LogRequestHandler.handle"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.monitor.LogRequestHandler.handle" title="Permalink to this definition"></a></dt>
<dd><p>Write incoming data to a logfile and check for errors</p>
<p>Split incoming data into lines and check for any Tracebacks or other
errors that indicate that the install failed.</p>
<p>Loops until self.server.kill is True</p>
</dd></dl>
<dl class="method">
<dt id="pylorax.monitor.LogRequestHandler.iserror">
<code class="sig-name descname">iserror</code><span class="sig-paren">(</span><em class="sig-param">line</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/monitor.html#LogRequestHandler.iserror"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.monitor.LogRequestHandler.iserror" title="Permalink to this definition"></a></dt>
<dd><p>Check a line to see if it contains an error indicating installation failure</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>line</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.8)"><em>str</em></a>) -- log line to check for failure</p>
</dd>
</dl>
<p>If the line contains IGNORED it will be skipped.</p>
</dd></dl>
<dl class="attribute">
<dt id="pylorax.monitor.LogRequestHandler.re_tests">
<code class="sig-name descname">re_tests</code><em class="property"> = ['packaging: base repo .* not valid', 'packaging: .* requires .*']</em><a class="headerlink" href="#pylorax.monitor.LogRequestHandler.re_tests" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="method">
<dt id="pylorax.monitor.LogRequestHandler.setup">
<code class="sig-name descname">setup</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/monitor.html#LogRequestHandler.setup"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.monitor.LogRequestHandler.setup" title="Permalink to this definition"></a></dt>
<dd><p>Start writing to self.server.log_path</p>
</dd></dl>
<dl class="attribute">
<dt id="pylorax.monitor.LogRequestHandler.simple_tests">
<code class="sig-name descname">simple_tests</code><em class="property"> = ['Traceback (', 'traceback script(s) have been run', 'Out of memory:', 'Call Trace:', 'insufficient disk space:', 'Not enough disk space to download the packages', 'error populating transaction after', 'crashed on signal', 'packaging: Missed: NoSuchPackage', 'packaging: Installation failed', 'The following error occurred while installing. This is a fatal error']</em><a class="headerlink" href="#pylorax.monitor.LogRequestHandler.simple_tests" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
<dl class="class">
<dt id="pylorax.monitor.LogServer">
<em class="property">class </em><code class="sig-prename descclassname">pylorax.monitor.</code><code class="sig-name descname">LogServer</code><span class="sig-paren">(</span><em class="sig-param">log_path</em>, <em class="sig-param">*args</em>, <em class="sig-param">**kwargs</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/monitor.html#LogServer"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.monitor.LogServer" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <a class="reference external" href="https://docs.python.org/3/library/socketserver.html#socketserver.TCPServer" title="(in Python v3.8)"><code class="xref py py-class docutils literal notranslate"><span class="pre">socketserver.TCPServer</span></code></a></p>
<p>A TCP Server that listens for log data</p>
<dl class="method">
<dt id="pylorax.monitor.LogServer.log_check">
<code class="sig-name descname">log_check</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/monitor.html#LogServer.log_check"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.monitor.LogServer.log_check" title="Permalink to this definition"></a></dt>
<dd><p>Check to see if an error has been found in the log</p>
<dl class="field-list simple">
<dt class="field-odd">Returns</dt>
<dd class="field-odd"><p>True if there has been an error</p>
</dd>
<dt class="field-even">Return type</dt>
<dd class="field-even"><p><a class="reference external" href="https://docs.python.org/3/library/functions.html#bool" title="(in Python v3.8)">bool</a></p>
</dd>
</dl>
</dd></dl>
<dl class="attribute">
<dt id="pylorax.monitor.LogServer.timeout">
<code class="sig-name descname">timeout</code><em class="property"> = 60</em><a class="headerlink" href="#pylorax.monitor.LogServer.timeout" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
</div>
<div class="section" id="module-pylorax.mount">
<span id="pylorax-mount-module"></span><h2>pylorax.mount module<a class="headerlink" href="#module-pylorax.mount" title="Permalink to this headline"></a></h2>
<dl class="class">
<dt id="pylorax.mount.IsoMountpoint">
<em class="property">class </em><code class="sig-prename descclassname">pylorax.mount.</code><code class="sig-name descname">IsoMountpoint</code><span class="sig-paren">(</span><em class="sig-param">iso_path</em>, <em class="sig-param">initrd_path=None</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/mount.html#IsoMountpoint"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.mount.IsoMountpoint" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <a class="reference external" href="https://docs.python.org/3/library/functions.html#object" title="(in Python v3.8)"><code class="xref py py-class docutils literal notranslate"><span class="pre">object</span></code></a></p>
<p>Mount the iso and check to make sure the vmlinuz and initrd.img files exist</p>
<p>Also check the iso for a a stage2 image and set a flag and extract the
iso's label.</p>
<p>stage2 can be either LiveOS/squashfs.img or images/install.img</p>
<dl class="method">
<dt id="pylorax.mount.IsoMountpoint.get_iso_label">
<code class="sig-name descname">get_iso_label</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/mount.html#IsoMountpoint.get_iso_label"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.mount.IsoMountpoint.get_iso_label" title="Permalink to this definition"></a></dt>
<dd><p>Get the iso's label using isoinfo</p>
<p>Sets self.label if one is found</p>
</dd></dl>
<dl class="method">
<dt id="pylorax.mount.IsoMountpoint.umount">
<code class="sig-name descname">umount</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/mount.html#IsoMountpoint.umount"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.mount.IsoMountpoint.umount" title="Permalink to this definition"></a></dt>
<dd><p>Unmount the iso</p>
</dd></dl>
</dd></dl>
</div>
<div class="section" id="module-pylorax.output">
<span id="pylorax-output-module"></span><h2>pylorax.output module<a class="headerlink" href="#module-pylorax.output" title="Permalink to this headline"></a></h2>
</div>
<div class="section" id="module-pylorax.sysutils">
<span id="pylorax-sysutils-module"></span><h2>pylorax.sysutils module<a class="headerlink" href="#module-pylorax.sysutils" title="Permalink to this headline"></a></h2>
<dl class="function">
<dt id="pylorax.sysutils.joinpaths">
<code class="sig-prename descclassname">pylorax.sysutils.</code><code class="sig-name descname">joinpaths</code><span class="sig-paren">(</span><em class="sig-param">*args</em>, <em class="sig-param">**kwargs</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/sysutils.html#joinpaths"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.sysutils.joinpaths" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="function">
<dt id="pylorax.sysutils.touch">
<code class="sig-prename descclassname">pylorax.sysutils.</code><code class="sig-name descname">touch</code><span class="sig-paren">(</span><em class="sig-param">fname</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/sysutils.html#touch"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.sysutils.touch" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="function">
<dt id="pylorax.sysutils.replace">
<code class="sig-prename descclassname">pylorax.sysutils.</code><code class="sig-name descname">replace</code><span class="sig-paren">(</span><em class="sig-param">fname</em>, <em class="sig-param">find</em>, <em class="sig-param">sub</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/sysutils.html#replace"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.sysutils.replace" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="function">
<dt id="pylorax.sysutils.chown_">
<code class="sig-prename descclassname">pylorax.sysutils.</code><code class="sig-name descname">chown_</code><span class="sig-paren">(</span><em class="sig-param">path</em>, <em class="sig-param">user=None</em>, <em class="sig-param">group=None</em>, <em class="sig-param">recursive=False</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/sysutils.html#chown_"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.sysutils.chown_" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="function">
<dt id="pylorax.sysutils.chmod_">
<code class="sig-prename descclassname">pylorax.sysutils.</code><code class="sig-name descname">chmod_</code><span class="sig-paren">(</span><em class="sig-param">path</em>, <em class="sig-param">mode</em>, <em class="sig-param">recursive=False</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/sysutils.html#chmod_"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.sysutils.chmod_" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="function">
<dt id="pylorax.sysutils.remove">
<code class="sig-prename descclassname">pylorax.sysutils.</code><code class="sig-name descname">remove</code><span class="sig-paren">(</span><em class="sig-param">target</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/sysutils.html#remove"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.sysutils.remove" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="function">
<dt id="pylorax.sysutils.linktree">
<code class="sig-prename descclassname">pylorax.sysutils.</code><code class="sig-name descname">linktree</code><span class="sig-paren">(</span><em class="sig-param">src</em>, <em class="sig-param">dst</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/sysutils.html#linktree"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.sysutils.linktree" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</div>
<div class="section" id="module-pylorax.treebuilder">
<span id="pylorax-treebuilder-module"></span><h2>pylorax.treebuilder module<a class="headerlink" href="#module-pylorax.treebuilder" title="Permalink to this headline"></a></h2>
<dl class="class">
<dt id="pylorax.treebuilder.RuntimeBuilder">
<em class="property">class </em><code class="sig-prename descclassname">pylorax.treebuilder.</code><code class="sig-name descname">RuntimeBuilder</code><span class="sig-paren">(</span><em class="sig-param">product</em>, <em class="sig-param">arch</em>, <em class="sig-param">dbo</em>, <em class="sig-param">templatedir=None</em>, <em class="sig-param">installpkgs=None</em>, <em class="sig-param">excludepkgs=None</em>, <em class="sig-param">add_templates=None</em>, <em class="sig-param">add_template_vars=None</em>, <em class="sig-param">skip_branding=False</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/treebuilder.html#RuntimeBuilder"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.treebuilder.RuntimeBuilder" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <a class="reference external" href="https://docs.python.org/3/library/functions.html#object" title="(in Python v3.8)"><code class="xref py py-class docutils literal notranslate"><span class="pre">object</span></code></a></p>
<p>Builds the anaconda runtime image.</p>
<dl class="method">
<dt id="pylorax.treebuilder.RuntimeBuilder.cleanup">
<code class="sig-name descname">cleanup</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/treebuilder.html#RuntimeBuilder.cleanup"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.treebuilder.RuntimeBuilder.cleanup" title="Permalink to this definition"></a></dt>
<dd><p>Remove unneeded packages and files with runtime-cleanup.tmpl</p>
</dd></dl>
<dl class="method">
<dt id="pylorax.treebuilder.RuntimeBuilder.create_ext4_runtime">
<code class="sig-name descname">create_ext4_runtime</code><span class="sig-paren">(</span><em class="sig-param">outfile='/var/tmp/squashfs.img'</em>, <em class="sig-param">compression='xz'</em>, <em class="sig-param">compressargs=None</em>, <em class="sig-param">size=2</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/treebuilder.html#RuntimeBuilder.create_ext4_runtime"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.treebuilder.RuntimeBuilder.create_ext4_runtime" title="Permalink to this definition"></a></dt>
<dd><p>Create a squashfs compressed ext4 runtime</p>
</dd></dl>
<dl class="method">
<dt id="pylorax.treebuilder.RuntimeBuilder.create_squashfs_runtime">
<code class="sig-name descname">create_squashfs_runtime</code><span class="sig-paren">(</span><em class="sig-param">outfile='/var/tmp/squashfs.img'</em>, <em class="sig-param">compression='xz'</em>, <em class="sig-param">compressargs=None</em>, <em class="sig-param">size=2</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/treebuilder.html#RuntimeBuilder.create_squashfs_runtime"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.treebuilder.RuntimeBuilder.create_squashfs_runtime" title="Permalink to this definition"></a></dt>
<dd><p>Create a plain squashfs runtime</p>
</dd></dl>
<dl class="method">
<dt id="pylorax.treebuilder.RuntimeBuilder.finished">
<code class="sig-name descname">finished</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/treebuilder.html#RuntimeBuilder.finished"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.treebuilder.RuntimeBuilder.finished" title="Permalink to this definition"></a></dt>
<dd><p>Done using RuntimeBuilder</p>
<p>Close the dnf base object</p>
</dd></dl>
<dl class="method">
<dt id="pylorax.treebuilder.RuntimeBuilder.generate_module_data">
<code class="sig-name descname">generate_module_data</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/treebuilder.html#RuntimeBuilder.generate_module_data"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.treebuilder.RuntimeBuilder.generate_module_data" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="method">
<dt id="pylorax.treebuilder.RuntimeBuilder.install">
<code class="sig-name descname">install</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/treebuilder.html#RuntimeBuilder.install"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.treebuilder.RuntimeBuilder.install" title="Permalink to this definition"></a></dt>
<dd><p>Install packages and do initial setup with runtime-install.tmpl</p>
</dd></dl>
<dl class="method">
<dt id="pylorax.treebuilder.RuntimeBuilder.postinstall">
<code class="sig-name descname">postinstall</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/treebuilder.html#RuntimeBuilder.postinstall"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.treebuilder.RuntimeBuilder.postinstall" title="Permalink to this definition"></a></dt>
<dd><p>Do some post-install setup work with runtime-postinstall.tmpl</p>
</dd></dl>
<dl class="method">
<dt id="pylorax.treebuilder.RuntimeBuilder.verify">
<code class="sig-name descname">verify</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/treebuilder.html#RuntimeBuilder.verify"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.treebuilder.RuntimeBuilder.verify" title="Permalink to this definition"></a></dt>
<dd><p>Ensure that contents of the installroot can run</p>
</dd></dl>
<dl class="method">
<dt id="pylorax.treebuilder.RuntimeBuilder.writepkglists">
<code class="sig-name descname">writepkglists</code><span class="sig-paren">(</span><em class="sig-param">pkglistdir</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/treebuilder.html#RuntimeBuilder.writepkglists"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.treebuilder.RuntimeBuilder.writepkglists" title="Permalink to this definition"></a></dt>
<dd><p>debugging data: write out lists of package contents</p>
</dd></dl>
<dl class="method">
<dt id="pylorax.treebuilder.RuntimeBuilder.writepkgsizes">
<code class="sig-name descname">writepkgsizes</code><span class="sig-paren">(</span><em class="sig-param">pkgsizefile</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/treebuilder.html#RuntimeBuilder.writepkgsizes"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.treebuilder.RuntimeBuilder.writepkgsizes" title="Permalink to this definition"></a></dt>
<dd><p>debugging data: write a big list of pkg sizes</p>
</dd></dl>
</dd></dl>
<dl class="class">
<dt id="pylorax.treebuilder.TreeBuilder">
<em class="property">class </em><code class="sig-prename descclassname">pylorax.treebuilder.</code><code class="sig-name descname">TreeBuilder</code><span class="sig-paren">(</span><em class="sig-param">product</em>, <em class="sig-param">arch</em>, <em class="sig-param">inroot</em>, <em class="sig-param">outroot</em>, <em class="sig-param">runtime</em>, <em class="sig-param">isolabel</em>, <em class="sig-param">domacboot=True</em>, <em class="sig-param">doupgrade=True</em>, <em class="sig-param">templatedir=None</em>, <em class="sig-param">add_templates=None</em>, <em class="sig-param">add_template_vars=None</em>, <em class="sig-param">workdir=None</em>, <em class="sig-param">extra_boot_args=''</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/treebuilder.html#TreeBuilder"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.treebuilder.TreeBuilder" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <a class="reference external" href="https://docs.python.org/3/library/functions.html#object" title="(in Python v3.8)"><code class="xref py py-class docutils literal notranslate"><span class="pre">object</span></code></a></p>
<p>Builds the arch-specific boot images.
inroot should be the installtree root (the newly-built runtime dir)</p>
<dl class="method">
<dt id="pylorax.treebuilder.TreeBuilder.build">
<code class="sig-name descname">build</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/treebuilder.html#TreeBuilder.build"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.treebuilder.TreeBuilder.build" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="method">
<dt id="pylorax.treebuilder.TreeBuilder.copy_dracut_hooks">
<code class="sig-name descname">copy_dracut_hooks</code><span class="sig-paren">(</span><em class="sig-param">hooks</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/treebuilder.html#TreeBuilder.copy_dracut_hooks"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.treebuilder.TreeBuilder.copy_dracut_hooks" title="Permalink to this definition"></a></dt>
<dd><p>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</p>
<p>hooks is a list of tuples with the name of the hook script and the
target dracut hook directory
(eg. [(&quot;99anaconda-copy-ks.sh&quot;, &quot;/lib/dracut/hooks/pre-pivot&quot;)])</p>
</dd></dl>
<dl class="method">
<dt id="pylorax.treebuilder.TreeBuilder.dracut_hooks_path">
<em class="property">property </em><code class="sig-name descname">dracut_hooks_path</code><a class="headerlink" href="#pylorax.treebuilder.TreeBuilder.dracut_hooks_path" title="Permalink to this definition"></a></dt>
<dd><p>Return the path to the lorax dracut hooks scripts</p>
<p>Use the configured share dir if it is setup,
otherwise default to /usr/share/lorax/dracut_hooks</p>
</dd></dl>
<dl class="method">
<dt id="pylorax.treebuilder.TreeBuilder.implantisomd5">
<code class="sig-name descname">implantisomd5</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/treebuilder.html#TreeBuilder.implantisomd5"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.treebuilder.TreeBuilder.implantisomd5" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="method">
<dt id="pylorax.treebuilder.TreeBuilder.kernels">
<em class="property">property </em><code class="sig-name descname">kernels</code><a class="headerlink" href="#pylorax.treebuilder.TreeBuilder.kernels" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="method">
<dt id="pylorax.treebuilder.TreeBuilder.rebuild_initrds">
<code class="sig-name descname">rebuild_initrds</code><span class="sig-paren">(</span><em class="sig-param">add_args=None</em>, <em class="sig-param">backup=''</em>, <em class="sig-param">prefix=''</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/treebuilder.html#TreeBuilder.rebuild_initrds"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.treebuilder.TreeBuilder.rebuild_initrds" title="Permalink to this definition"></a></dt>
<dd><p>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.
If suffix is specified, the existing initrd is untouched and a new
image is built with the filename &quot;${prefix}-${kernel.version}.img&quot;</p>
<p>If the initrd doesn't exist its name will be created based on the
name of the kernel.</p>
</dd></dl>
</dd></dl>
<dl class="function">
<dt id="pylorax.treebuilder.findkernels">
<code class="sig-prename descclassname">pylorax.treebuilder.</code><code class="sig-name descname">findkernels</code><span class="sig-paren">(</span><em class="sig-param">root='/'</em>, <em class="sig-param">kdir='boot'</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/treebuilder.html#findkernels"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.treebuilder.findkernels" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="function">
<dt id="pylorax.treebuilder.generate_module_info">
<code class="sig-prename descclassname">pylorax.treebuilder.</code><code class="sig-name descname">generate_module_info</code><span class="sig-paren">(</span><em class="sig-param">moddir</em>, <em class="sig-param">outfile=None</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/treebuilder.html#generate_module_info"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.treebuilder.generate_module_info" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="function">
<dt id="pylorax.treebuilder.string_lower">
<code class="sig-prename descclassname">pylorax.treebuilder.</code><code class="sig-name descname">string_lower</code><span class="sig-paren">(</span><em class="sig-param">string</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/treebuilder.html#string_lower"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.treebuilder.string_lower" title="Permalink to this definition"></a></dt>
<dd><p>Return a lowercase string.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>string</strong> -- String to lowercase</p>
</dd>
</dl>
<p>This is used as a filter in the templates.</p>
</dd></dl>
<dl class="function">
<dt id="pylorax.treebuilder.udev_escape">
<code class="sig-prename descclassname">pylorax.treebuilder.</code><code class="sig-name descname">udev_escape</code><span class="sig-paren">(</span><em class="sig-param">label</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/treebuilder.html#udev_escape"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.treebuilder.udev_escape" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</div>
<div class="section" id="module-pylorax.treeinfo">
<span id="pylorax-treeinfo-module"></span><h2>pylorax.treeinfo module<a class="headerlink" href="#module-pylorax.treeinfo" title="Permalink to this headline"></a></h2>
<dl class="class">
<dt id="pylorax.treeinfo.TreeInfo">
<em class="property">class </em><code class="sig-prename descclassname">pylorax.treeinfo.</code><code class="sig-name descname">TreeInfo</code><span class="sig-paren">(</span><em class="sig-param">product</em>, <em class="sig-param">version</em>, <em class="sig-param">variant</em>, <em class="sig-param">basearch</em>, <em class="sig-param">packagedir=''</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/treeinfo.html#TreeInfo"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.treeinfo.TreeInfo" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <a class="reference external" href="https://docs.python.org/3/library/functions.html#object" title="(in Python v3.8)"><code class="xref py py-class docutils literal notranslate"><span class="pre">object</span></code></a></p>
<dl class="method">
<dt id="pylorax.treeinfo.TreeInfo.add_section">
<code class="sig-name descname">add_section</code><span class="sig-paren">(</span><em class="sig-param">section</em>, <em class="sig-param">data</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/treeinfo.html#TreeInfo.add_section"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.treeinfo.TreeInfo.add_section" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="method">
<dt id="pylorax.treeinfo.TreeInfo.write">
<code class="sig-name descname">write</code><span class="sig-paren">(</span><em class="sig-param">outfile</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/treeinfo.html#TreeInfo.write"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.treeinfo.TreeInfo.write" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
</div>
<div class="section" id="module-pylorax">
<span id="module-contents"></span><h2>Module contents<a class="headerlink" href="#module-pylorax" title="Permalink to this headline"></a></h2>
<dl class="class">
<dt id="pylorax.ArchData">
<em class="property">class </em><code class="sig-prename descclassname">pylorax.</code><code class="sig-name descname">ArchData</code><span class="sig-paren">(</span><em class="sig-param">buildarch</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax.html#ArchData"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.ArchData" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <a class="reference internal" href="#pylorax.base.DataHolder" title="pylorax.base.DataHolder"><code class="xref py py-class docutils literal notranslate"><span class="pre">pylorax.base.DataHolder</span></code></a></p>
<dl class="attribute">
<dt id="pylorax.ArchData.bcj_arch">
<code class="sig-name descname">bcj_arch</code><em class="property"> = {'arm': 'arm', 'armhfp': 'arm', 'i386': 'x86', 'ppc64le': 'powerpc', 'x86_64': 'x86'}</em><a class="headerlink" href="#pylorax.ArchData.bcj_arch" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="attribute">
<dt id="pylorax.ArchData.lib64_arches">
<code class="sig-name descname">lib64_arches</code><em class="property"> = ('x86_64', 'ppc64le', 's390x', 'ia64', 'aarch64')</em><a class="headerlink" href="#pylorax.ArchData.lib64_arches" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
<dl class="class">
<dt id="pylorax.Lorax">
<em class="property">class </em><code class="sig-prename descclassname">pylorax.</code><code class="sig-name descname">Lorax</code><a class="reference internal" href="_modules/pylorax.html#Lorax"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.Lorax" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <a class="reference internal" href="#pylorax.base.BaseLoraxClass" title="pylorax.base.BaseLoraxClass"><code class="xref py py-class docutils literal notranslate"><span class="pre">pylorax.base.BaseLoraxClass</span></code></a></p>
<dl class="method">
<dt id="pylorax.Lorax.configure">
<code class="sig-name descname">configure</code><span class="sig-paren">(</span><em class="sig-param">conf_file='/etc/lorax/lorax.conf'</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax.html#Lorax.configure"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.Lorax.configure" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="method">
<dt id="pylorax.Lorax.init_file_logging">
<code class="sig-name descname">init_file_logging</code><span class="sig-paren">(</span><em class="sig-param">logdir</em>, <em class="sig-param">logname='pylorax.log'</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax.html#Lorax.init_file_logging"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.Lorax.init_file_logging" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="method">
<dt id="pylorax.Lorax.init_stream_logging">
<code class="sig-name descname">init_stream_logging</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax.html#Lorax.init_stream_logging"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.Lorax.init_stream_logging" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="method">
<dt id="pylorax.Lorax.run">
<code class="sig-name descname">run</code><span class="sig-paren">(</span><em class="sig-param">dbo</em>, <em class="sig-param">product</em>, <em class="sig-param">version</em>, <em class="sig-param">release</em>, <em class="sig-param">variant=''</em>, <em class="sig-param">bugurl=''</em>, <em class="sig-param">isfinal=False</em>, <em class="sig-param">workdir=None</em>, <em class="sig-param">outputdir=None</em>, <em class="sig-param">buildarch=None</em>, <em class="sig-param">volid=None</em>, <em class="sig-param">domacboot=True</em>, <em class="sig-param">doupgrade=True</em>, <em class="sig-param">remove_temp=False</em>, <em class="sig-param">installpkgs=None</em>, <em class="sig-param">excludepkgs=None</em>, <em class="sig-param">size=2</em>, <em class="sig-param">add_templates=None</em>, <em class="sig-param">add_template_vars=None</em>, <em class="sig-param">add_arch_templates=None</em>, <em class="sig-param">add_arch_template_vars=None</em>, <em class="sig-param">verify=True</em>, <em class="sig-param">user_dracut_args=None</em>, <em class="sig-param">squashfs_only=False</em>, <em class="sig-param">skip_branding=False</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax.html#Lorax.run"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.Lorax.run" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="method">
<dt id="pylorax.Lorax.templatedir">
<em class="property">property </em><code class="sig-name descname">templatedir</code><a class="headerlink" href="#pylorax.Lorax.templatedir" title="Permalink to this definition"></a></dt>
<dd><p>Find the template directory.</p>
<p>Pick the first directory under sharedir/templates.d/ if it exists.
Otherwise use the sharedir</p>
</dd></dl>
</dd></dl>
<dl class="function">
<dt id="pylorax.find_templates">
<code class="sig-prename descclassname">pylorax.</code><code class="sig-name descname">find_templates</code><span class="sig-paren">(</span><em class="sig-param">templatedir='/usr/share/lorax'</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax.html#find_templates"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.find_templates" title="Permalink to this definition"></a></dt>
<dd><p>Find the templates to use.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>templatedir</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.8)"><em>str</em></a>) -- Top directory to search for templates</p>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>Path to templates</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.8)">str</a></p>
</dd>
</dl>
<p>If there is a templates.d directory under templatedir the
lowest numbered directory entry is returned.</p>
<p>eg. /usr/share/lorax/templates.d/99-generic/</p>
</dd></dl>
<dl class="function">
<dt id="pylorax.get_buildarch">
<code class="sig-prename descclassname">pylorax.</code><code class="sig-name descname">get_buildarch</code><span class="sig-paren">(</span><em class="sig-param">dbo</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax.html#get_buildarch"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.get_buildarch" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="function">
<dt id="pylorax.log_selinux_state">
<code class="sig-prename descclassname">pylorax.</code><code class="sig-name descname">log_selinux_state</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax.html#log_selinux_state"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.log_selinux_state" title="Permalink to this definition"></a></dt>
<dd><p>Log the current state of selinux</p>
</dd></dl>
<dl class="function">
<dt id="pylorax.setup_logging">
<code class="sig-prename descclassname">pylorax.</code><code class="sig-name descname">setup_logging</code><span class="sig-paren">(</span><em class="sig-param">logfile</em>, <em class="sig-param">theLogger</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax.html#setup_logging"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.setup_logging" title="Permalink to this definition"></a></dt>
<dd><p>Setup the various logs</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>logfile</strong> (<em>string</em>) -- filename to write the log to</p></li>
<li><p><strong>theLogger</strong> (<a class="reference external" href="https://docs.python.org/3/library/logging.html#logging.Logger" title="(in Python v3.8)"><em>logging.Logger</em></a>) -- top-level logger</p></li>
</ul>
</dd>
</dl>
</dd></dl>
</div>
</div>
</div>
</div>
<footer>
<div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
<a href="pylorax.api.html" class="btn btn-neutral float-right" title="pylorax.api package" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right"></span></a>
<a href="lifted.html" class="btn btn-neutral float-left" title="lifted package" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left"></span> Previous</a>
</div>
<hr/>
<div role="contentinfo">
<p>
&copy; Copyright 2018, Red Hat, Inc.
</p>
</div>
Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/rtfd/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>.
</footer>
</div>
</div>
</section>
</div>
<script type="text/javascript">
jQuery(function () {
SphinxRtdTheme.Navigation.enable(true);
});
</script>
</body>
</html>