lorax/docs/html/pylorax.html
2018-03-15 13:53:58 -07:00

1653 lines
117 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!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 28.9 documentation</title>
<link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
<link rel="index" title="Index"
href="genindex.html"/>
<link rel="search" title="Search" href="search.html"/>
<link rel="top" title="Lorax 28.9 documentation" href="index.html"/>
<link rel="up" title="pylorax" href="modules.html"/>
<link rel="prev" title="pylorax" href="modules.html"/>
<script src="_static/js/modernizr.min.js"></script>
</head>
<body class="wy-body-for-nav" role="document">
<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">
28.9
</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="product-images.html">Product and Updates Images</a></li>
<li class="toctree-l1 current"><a class="reference internal" href="modules.html">pylorax</a><ul class="current">
<li class="toctree-l2 current"><a class="current reference internal" href="#">pylorax package</a><ul>
<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.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.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.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" role="navigation" 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">pylorax</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="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="descclassname">pylorax.base.</code><code class="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.6)"><code class="xref py py-class docutils literal"><span class="pre">object</span></code></a></p>
<dl class="method">
<dt id="pylorax.base.BaseLoraxClass.pcritical">
<code class="descname">pcritical</code><span class="sig-paren">(</span><em>msg</em>, <em>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="descname">pdebug</code><span class="sig-paren">(</span><em>msg</em>, <em>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="descname">perror</code><span class="sig-paren">(</span><em>msg</em>, <em>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="descname">pinfo</code><span class="sig-paren">(</span><em>msg</em>, <em>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="descname">pwarning</code><span class="sig-paren">(</span><em>msg</em>, <em>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="descclassname">pylorax.base.</code><code class="descname">DataHolder</code><span class="sig-paren">(</span><em>**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.6)"><code class="xref py py-class docutils literal"><span class="pre">dict</span></code></a></p>
<dl class="method">
<dt id="pylorax.base.DataHolder.copy">
<code class="descname">copy</code><span class="sig-paren">(</span><span class="sig-paren">)</span><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="descclassname">pylorax.buildstamp.</code><code class="descname">BuildStamp</code><span class="sig-paren">(</span><em>product</em>, <em>version</em>, <em>bugurl</em>, <em>isfinal</em>, <em>buildarch</em>, <em>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.6)"><code class="xref py py-class docutils literal"><span class="pre">object</span></code></a></p>
<dl class="method">
<dt id="pylorax.buildstamp.BuildStamp.write">
<code class="descname">write</code><span class="sig-paren">(</span><em>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="descclassname">pylorax.cmdline.</code><code class="descname">lmc_parser</code><span class="sig-paren">(</span><em>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="descclassname">pylorax.cmdline.</code><code class="descname">lorax_parser</code><span class="sig-paren">(</span><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.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="descclassname">pylorax.decorators.</code><code class="descname">singleton</code><span class="sig-paren">(</span><em>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="descclassname">pylorax.discinfo.</code><code class="descname">DiscInfo</code><span class="sig-paren">(</span><em>release</em>, <em>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.6)"><code class="xref py py-class docutils literal"><span class="pre">object</span></code></a></p>
<dl class="method">
<dt id="pylorax.discinfo.DiscInfo.write">
<code class="descname">write</code><span class="sig-paren">(</span><em>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.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="descclassname">pylorax.dnfhelper.</code><code class="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"><span class="pre">DownloadProgress</span></code></p>
<dl class="method">
<dt id="pylorax.dnfhelper.LoraxDownloadCallback.end">
<code class="descname">end</code><span class="sig-paren">(</span><em>payload</em>, <em>status</em>, <em>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="descname">progress</code><span class="sig-paren">(</span><em>payload</em>, <em>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="descname">start</code><span class="sig-paren">(</span><em>total_files</em>, <em>total_size</em>, <em>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="descclassname">pylorax.dnfhelper.</code><code class="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"><span class="pre">TransactionProgress</span></code></p>
<dl class="method">
<dt id="pylorax.dnfhelper.LoraxRpmCallback.error">
<code class="descname">error</code><span class="sig-paren">(</span><em>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="descname">progress</code><span class="sig-paren">(</span><em>package</em>, <em>action</em>, <em>ti_done</em>, <em>ti_total</em>, <em>ts_done</em>, <em>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="descclassname">pylorax.executils.</code><code class="descname">ExecProduct</code><span class="sig-paren">(</span><em>rc</em>, <em>stdout</em>, <em>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.6)"><code class="xref py py-class docutils literal"><span class="pre">object</span></code></a></p>
</dd></dl>
<dl class="function">
<dt id="pylorax.executils.augmentEnv">
<code class="descclassname">pylorax.executils.</code><code class="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="descclassname">pylorax.executils.</code><code class="descname">execReadlines</code><span class="sig-paren">(</span><em>command</em>, <em>argv</em>, <em>stdin=None</em>, <em>root='/'</em>, <em>env_prune=None</em>, <em>filter_stderr=False</em>, <em>callback=&lt;function &lt;lambda&gt;&gt;</em>, <em>env_add=None</em>, <em>reset_handlers=True</em>, <em>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="docutils">
<dt>NOTE/WARNING: UnicodeDecodeError will be raised if the output of the</dt>
<dd>external command cant be decoded as UTF-8.</dd>
</dl>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>command</strong> The command to run</li>
<li><strong>argv</strong> The argument list</li>
<li><strong>stdin</strong> The file object to read stdin from.</li>
<li><strong>stdout</strong> Optional file object to redirect stdout and stderr to.</li>
<li><strong>root</strong> The directory to chroot to before running command.</li>
<li><strong>env_prune</strong> environment variable to remove before execution</li>
<li><strong>filter_stderr</strong> Whether stderr should be excluded from the returned output</li>
<li><strong>callback</strong> method to call while waiting for process to finish, passed Popen object</li>
<li><strong>env_add</strong> environment variables to add before execution</li>
<li><strong>reset_handlers</strong> whether to reset to SIG_DFL any signal handlers set to SIG_IGN</li>
<li><strong>reset_lang</strong> whether to set the locale of the child process to C</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">Iterator of the lines from the command</p>
</td>
</tr>
</tbody>
</table>
<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="descclassname">pylorax.executils.</code><code class="descname">execWithCapture</code><span class="sig-paren">(</span><em>command</em>, <em>argv</em>, <em>stdin=None</em>, <em>root='/'</em>, <em>log_output=True</em>, <em>filter_stderr=False</em>, <em>raise_err=False</em>, <em>callback=None</em>, <em>env_add=None</em>, <em>reset_handlers=True</em>, <em>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>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>command</strong> The command to run</li>
<li><strong>argv</strong> The argument list</li>
<li><strong>stdin</strong> The file object to read stdin from.</li>
<li><strong>root</strong> The directory to chroot to before running command.</li>
<li><strong>log_output</strong> Whether to log the output of command</li>
<li><strong>filter_stderr</strong> Whether stderr should be excluded from the returned output</li>
<li><strong>callback</strong> method to call while waiting for process to finish, passed Popen object</li>
<li><strong>env_add</strong> environment variables to add before execution</li>
<li><strong>reset_handlers</strong> whether to reset to SIG_DFL any signal handlers set to SIG_IGN</li>
<li><strong>reset_lang</strong> whether to set the locale of the child process to C</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">The output of the command</p>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="function">
<dt id="pylorax.executils.execWithRedirect">
<code class="descclassname">pylorax.executils.</code><code class="descname">execWithRedirect</code><span class="sig-paren">(</span><em>command</em>, <em>argv</em>, <em>stdin=None</em>, <em>stdout=None</em>, <em>root='/'</em>, <em>env_prune=None</em>, <em>log_output=True</em>, <em>binary_output=False</em>, <em>raise_err=False</em>, <em>callback=None</em>, <em>env_add=None</em>, <em>reset_handlers=True</em>, <em>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>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>command</strong> The command to run</li>
<li><strong>argv</strong> The argument list</li>
<li><strong>stdin</strong> The file object to read stdin from.</li>
<li><strong>stdout</strong> Optional file object to redirect stdout and stderr to.</li>
<li><strong>root</strong> The directory to chroot to before running command.</li>
<li><strong>env_prune</strong> environment variable to remove before execution</li>
<li><strong>log_output</strong> whether to log the output of command</li>
<li><strong>binary_output</strong> whether to treat the output of command as binary data</li>
<li><strong>raise_err</strong> whether to raise a CalledProcessError if the returncode is non-zero</li>
<li><strong>callback</strong> method to call while waiting for process to finish, passed Popen object</li>
<li><strong>env_add</strong> environment variables to add before execution</li>
<li><strong>reset_handlers</strong> whether to reset to SIG_DFL any signal handlers set to SIG_IGN</li>
<li><strong>reset_lang</strong> whether to set the locale of the child process to C</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">The return code of the command</p>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="function">
<dt id="pylorax.executils.runcmd">
<code class="descclassname">pylorax.executils.</code><code class="descname">runcmd</code><span class="sig-paren">(</span><em>cmd</em>, <em>**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="descclassname">pylorax.executils.</code><code class="descname">runcmd_output</code><span class="sig-paren">(</span><em>cmd</em>, <em>**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="descclassname">pylorax.executils.</code><code class="descname">setenv</code><span class="sig-paren">(</span><em>name</em>, <em>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>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
<li><strong>name</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.6)"><em>str</em></a>) The name of the environment variable</li>
<li><strong>value</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.6)"><em>str</em></a>) The value of the environment variable</li>
</ul>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="function">
<dt id="pylorax.executils.startProgram">
<code class="descclassname">pylorax.executils.</code><code class="descname">startProgram</code><span class="sig-paren">(</span><em>argv</em>, <em>root='/'</em>, <em>stdin=None</em>, <em>stdout=-1</em>, <em>stderr=-2</em>, <em>env_prune=None</em>, <em>env_add=None</em>, <em>reset_handlers=True</em>, <em>reset_lang=True</em>, <em>**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>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>argv</strong> The command to run and argument</li>
<li><strong>root</strong> The directory to chroot to before running command.</li>
<li><strong>stdin</strong> The file object to read stdin from.</li>
<li><strong>stdout</strong> The file object to write stdout to.</li>
<li><strong>stderr</strong> The file object to write stderr to.</li>
<li><strong>env_prune</strong> environment variables to remove before execution</li>
<li><strong>env_add</strong> environment variables to add before execution</li>
<li><strong>reset_handlers</strong> whether to reset to SIG_DFL any signal handlers set to SIG_IGN</li>
<li><strong>reset_lang</strong> whether to set the locale of the child process to C</li>
<li><strong>kwargs</strong> Additional parameters to pass to subprocess.Popen</li>
<li><strong>preexec_fn</strong> A function to run before execution starts.</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">A Popen object for the running command.</p>
</td>
</tr>
</tbody>
</table>
</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="descclassname">pylorax.imgutils.</code><code class="descname">DMDev</code><span class="sig-paren">(</span><em>dev</em>, <em>size</em>, <em>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.6)"><code class="xref py py-class docutils literal"><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="descclassname">pylorax.imgutils.</code><code class="descname">LoopDev</code><span class="sig-paren">(</span><em>filename</em>, <em>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.6)"><code class="xref py py-class docutils literal"><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="descclassname">pylorax.imgutils.</code><code class="descname">Mount</code><span class="sig-paren">(</span><em>dev</em>, <em>opts=''</em>, <em>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.6)"><code class="xref py py-class docutils literal"><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="descclassname">pylorax.imgutils.</code><code class="descname">PartitionMount</code><span class="sig-paren">(</span><em>disk_img</em>, <em>mount_ok=None</em>, <em>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.6)"><code class="xref py py-class docutils literal"><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="descclassname">pylorax.imgutils.</code><code class="descname">compress</code><span class="sig-paren">(</span><em>command</em>, <em>rootdir</em>, <em>outfile</em>, <em>compression='xz'</em>, <em>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.
command is a list of the archiver commands to run
compression should be “xz”, “gzip”, “lzma”, “bzip2”, or None.
compressargs will be used on the compression commandline.</p>
</dd></dl>
<dl class="function">
<dt id="pylorax.imgutils.copytree">
<code class="descclassname">pylorax.imgutils.</code><code class="descname">copytree</code><span class="sig-paren">(</span><em>src</em>, <em>dest</em>, <em>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.dm_attach">
<code class="descclassname">pylorax.imgutils.</code><code class="descname">dm_attach</code><span class="sig-paren">(</span><em>dev</em>, <em>size</em>, <em>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="descclassname">pylorax.imgutils.</code><code class="descname">dm_detach</code><span class="sig-paren">(</span><em>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="descclassname">pylorax.imgutils.</code><code class="descname">do_grafts</code><span class="sig-paren">(</span><em>grafts</em>, <em>dest</em>, <em>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 / its 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="descclassname">pylorax.imgutils.</code><code class="descname">estimate_size</code><span class="sig-paren">(</span><em>rootdir</em>, <em>graft=None</em>, <em>fstype=None</em>, <em>blocksize=4096</em>, <em>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="descclassname">pylorax.imgutils.</code><code class="descname">get_loop_name</code><span class="sig-paren">(</span><em>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.loop_attach">
<code class="descclassname">pylorax.imgutils.</code><code class="descname">loop_attach</code><span class="sig-paren">(</span><em>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.
Raises CalledProcessError if losetup fails.</p>
</dd></dl>
<dl class="function">
<dt id="pylorax.imgutils.loop_detach">
<code class="descclassname">pylorax.imgutils.</code><code class="descname">loop_detach</code><span class="sig-paren">(</span><em>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="descclassname">pylorax.imgutils.</code><code class="descname">loop_waitfor</code><span class="sig-paren">(</span><em>loop_dev</em>, <em>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 isnt setup after 5 tries.</p>
</dd></dl>
<dl class="function">
<dt id="pylorax.imgutils.mkbtrfsimg">
<code class="descclassname">pylorax.imgutils.</code><code class="descname">mkbtrfsimg</code><span class="sig-paren">(</span><em>rootdir</em>, <em>outfile</em>, <em>size=None</em>, <em>label=''</em>, <em>mountargs=''</em>, <em>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="descclassname">pylorax.imgutils.</code><code class="descname">mkcpio</code><span class="sig-paren">(</span><em>rootdir</em>, <em>outfile</em>, <em>compression='xz'</em>, <em>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="descclassname">pylorax.imgutils.</code><code class="descname">mkdosimg</code><span class="sig-paren">(</span><em>rootdir</em>, <em>outfile</em>, <em>size=None</em>, <em>label=''</em>, <em>mountargs='shortname=winnt</em>, <em>umask=0077'</em>, <em>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="descclassname">pylorax.imgutils.</code><code class="descname">mkext4img</code><span class="sig-paren">(</span><em>rootdir</em>, <em>outfile</em>, <em>size=None</em>, <em>label=''</em>, <em>mountargs=''</em>, <em>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="descclassname">pylorax.imgutils.</code><code class="descname">mkfsimage</code><span class="sig-paren">(</span><em>fstype</em>, <em>rootdir</em>, <em>outfile</em>, <em>size=None</em>, <em>mkfsargs=None</em>, <em>mountargs=''</em>, <em>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 - “mkfs.${fstype}” must exist.
graft should be a dict: {“some/path/in/image”: “local/file/or/dir”};</p>
<blockquote>
<div>if the path ends with a / its assumed to be a directory.</div></blockquote>
<p>Will raise CalledProcessError if something goes wrong.</p>
</dd></dl>
<dl class="function">
<dt id="pylorax.imgutils.mkhfsimg">
<code class="descclassname">pylorax.imgutils.</code><code class="descname">mkhfsimg</code><span class="sig-paren">(</span><em>rootdir</em>, <em>outfile</em>, <em>size=None</em>, <em>label=''</em>, <em>mountargs=''</em>, <em>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="descclassname">pylorax.imgutils.</code><code class="descname">mkqcow2</code><span class="sig-paren">(</span><em>outfile</em>, <em>size</em>, <em>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 “-f”, fmt
in options.</p>
</dd></dl>
<dl class="function">
<dt id="pylorax.imgutils.mkqemu_img">
<code class="descclassname">pylorax.imgutils.</code><code class="descname">mkqemu_img</code><span class="sig-paren">(</span><em>outfile</em>, <em>size</em>, <em>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 “-f”, fmt
in options.</p>
</dd></dl>
<dl class="function">
<dt id="pylorax.imgutils.mkrootfsimg">
<code class="descclassname">pylorax.imgutils.</code><code class="descname">mkrootfsimg</code><span class="sig-paren">(</span><em>rootdir</em>, <em>outfile</em>, <em>label</em>, <em>size=2</em>, <em>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>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
<li><strong>rootdir</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.6)"><em>str</em></a>) Root directory</li>
<li><strong>outfile</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.6)"><em>str</em></a>) Path of output image file</li>
<li><strong>label</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.6)"><em>str</em></a>) Filesystem label</li>
<li><strong>size</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.6)"><em>int</em></a>) Size of the image in GiB, if None computed automatically</li>
<li><strong>sysroot</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.6)"><em>str</em></a>) path to system (deployment) root relative to physical root</li>
</ul>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="function">
<dt id="pylorax.imgutils.mksparse">
<code class="descclassname">pylorax.imgutils.</code><code class="descname">mksparse</code><span class="sig-paren">(</span><em>outfile</em>, <em>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="descclassname">pylorax.imgutils.</code><code class="descname">mksquashfs</code><span class="sig-paren">(</span><em>rootdir</em>, <em>outfile</em>, <em>compression='default'</em>, <em>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="descclassname">pylorax.imgutils.</code><code class="descname">mktar</code><span class="sig-paren">(</span><em>rootdir</em>, <em>outfile</em>, <em>compression='xz'</em>, <em>compressargs=None</em>, <em>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="descclassname">pylorax.imgutils.</code><code class="descname">mount</code><span class="sig-paren">(</span><em>dev</em>, <em>opts=''</em>, <em>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="descclassname">pylorax.imgutils.</code><code class="descname">round_to_blocks</code><span class="sig-paren">(</span><em>size</em>, <em>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 isnt a multiple of blocksize, round up to the next multiple</p>
</dd></dl>
<dl class="function">
<dt id="pylorax.imgutils.umount">
<code class="descclassname">pylorax.imgutils.</code><code class="descname">umount</code><span class="sig-paren">(</span><em>mnt</em>, <em>lazy=False</em>, <em>maxretry=3</em>, <em>retrysleep=1.0</em>, <em>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.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.LoraxTemplate">
<em class="property">class </em><code class="descclassname">pylorax.ltmpl.</code><code class="descname">LoraxTemplate</code><span class="sig-paren">(</span><em>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.6)"><code class="xref py py-class docutils literal"><span class="pre">object</span></code></a></p>
<dl class="method">
<dt id="pylorax.ltmpl.LoraxTemplate.parse">
<code class="descname">parse</code><span class="sig-paren">(</span><em>template_file</em>, <em>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="descclassname">pylorax.ltmpl.</code><code class="descname">LoraxTemplateRunner</code><span class="sig-paren">(</span><em>inroot</em>, <em>outroot</em>, <em>dbo=None</em>, <em>fatalerrors=True</em>, <em>templatedir=None</em>, <em>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 external" href="https://docs.python.org/3/library/functions.html#object" title="(in Python v3.6)"><code class="xref py py-class docutils literal"><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(“install-packages.ltmpl”)</p>
<p># modify a runtime dir
runner = LoraxTemplateRunner(inroot=rundir, outroot=newrun)
runner.run(“runtime-transmogrify.ltmpl”)</p>
</div></blockquote>
<p>NOTES:</p>
<ul>
<li><p class="first">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>Whitespace splitting (using shlex.split())</li>
<li>Brace expansion (using brace_expand())</li>
<li>If the first token is the name of a function, call that function
with the rest of the line as arguments</li>
</ol>
</div></blockquote>
</li>
<li><p class="first">Parsing and execution are <em>separate</em> passes - so you cant use the result
of a command in an %if statement (or any other control statements)!</p>
</li>
<li><p class="first">Commands that run external programs (systemctl, gconfset) currently use
the <em>host</em>s copy of that program, which may cause problems if theres a
big enough difference between the host and the image youre modifying.</p>
</li>
<li><p class="first">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>Each template command is just a method of the LoraxTemplateRunner
object - so adding a new command is as easy as adding a new function.</li>
<li>Each function gets arguments that correspond to the rest of the tokens
on that line (after word splitting and brace expansion)</li>
<li>Commands should raise exceptions for errors - dont use sys.exit()</li>
</ul>
<dl class="method">
<dt id="pylorax.ltmpl.LoraxTemplateRunner.append">
<code class="descname">append</code><span class="sig-paren">(</span><em>filename</em>, <em>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 class="docutils">
<dt>append FILE STRING</dt>
<dd><p class="first">Append STRING (followed by a newline character) to FILE.
Python character escape sequences (n, t, etc.) will be
converted to the appropriate characters.
Examples:</p>
<blockquote class="last">
<div>append /etc/depmod.d/dd.conf “search updates built-in”
append /etc/resolv.conf “”</div></blockquote>
</dd>
</dl>
</dd></dl>
<dl class="method">
<dt id="pylorax.ltmpl.LoraxTemplateRunner.chmod">
<code class="descname">chmod</code><span class="sig-paren">(</span><em>fileglob</em>, <em>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="docutils">
<dt>chmod FILEGLOB OCTALMODE</dt>
<dd>Change the mode of all the files matching FILEGLOB to OCTALMODE.</dd>
</dl>
</dd></dl>
<dl class="method">
<dt id="pylorax.ltmpl.LoraxTemplateRunner.copy">
<code class="descname">copy</code><span class="sig-paren">(</span><em>src</em>, <em>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="docutils">
<dt>copy SRC DEST</dt>
<dd>Copy SRC to DEST.
If DEST is a directory, SRC will be copied inside it.
If DEST doesnt exist, SRC will be copied to a file with
that name, if the path leading to it exists.</dd>
</dl>
</dd></dl>
<dl class="method">
<dt id="pylorax.ltmpl.LoraxTemplateRunner.createaddrsize">
<code class="descname">createaddrsize</code><span class="sig-paren">(</span><em>addr</em>, <em>src</em>, <em>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 class="docutils">
<dt>createaddrsize INITRD_ADDRESS INITRD ADDRSIZE</dt>
<dd><p class="first">Create the initrd.addrsize file required in LPAR boot process.
Examples:</p>
<blockquote class="last">
<div>createaddrsize ${INITRD_ADDRESS} ${outroot}/${BOOTDIR}/initrd.img ${outroot}/${BOOTDIR}/initrd.addrsize</div></blockquote>
</dd>
</dl>
</dd></dl>
<dl class="method">
<dt id="pylorax.ltmpl.LoraxTemplateRunner.gconfset">
<code class="descname">gconfset</code><span class="sig-paren">(</span><em>path</em>, <em>keytype</em>, <em>value</em>, <em>outfile=None</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/ltmpl.html#LoraxTemplateRunner.gconfset"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.ltmpl.LoraxTemplateRunner.gconfset" title="Permalink to this definition"></a></dt>
<dd><dl class="docutils">
<dt>gconfset PATH KEYTYPE VALUE [OUTFILE]</dt>
<dd><p class="first">Set the given gconf PATH, with type KEYTYPE, to the given value.
OUTFILE defaults to /etc/gconf/gconf.xml.defaults if not given.
Example:</p>
<blockquote class="last">
<div>gconfset /apps/metacity/general/num_workspaces int 1</div></blockquote>
</dd>
</dl>
</dd></dl>
<dl class="method">
<dt id="pylorax.ltmpl.LoraxTemplateRunner.hardlink">
<code class="descname">hardlink</code><span class="sig-paren">(</span><em>src</em>, <em>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="docutils">
<dt>hardlink SRC DEST</dt>
<dd>Create a hardlink at DEST which is linked to SRC.</dd>
</dl>
</dd></dl>
<dl class="method">
<dt id="pylorax.ltmpl.LoraxTemplateRunner.install">
<code class="descname">install</code><span class="sig-paren">(</span><em>srcglob</em>, <em>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 class="docutils">
<dt>install SRC DEST</dt>
<dd><p class="first">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 doesnt 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.
Examples:</p>
<blockquote class="last">
<div>install usr/share/myconfig/grub.conf /boot
install /usr/share/myconfig/grub.conf.in /boot/grub.conf</div></blockquote>
</dd>
</dl>
</dd></dl>
<dl class="method">
<dt id="pylorax.ltmpl.LoraxTemplateRunner.installimg">
<code class="descname">installimg</code><span class="sig-paren">(</span><em>*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 class="docutils">
<dt>installimg [xz|gzip|bzip2|lzma] [-ARG|ARG=OPTION] SRCDIR DESTFILE</dt>
<dd><p class="first">Create a compressed cpio archive of the contents of SRCDIR and place
it in DESTFILE.</p>
<p>If SRCDIR doesnt exist or is empty nothing is created.</p>
<dl class="docutils">
<dt>Examples:</dt>
<dd>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</dd>
</dl>
<p class="last">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="descname">installinitrd</code><span class="sig-paren">(</span><em>section</em>, <em>src</em>, <em>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="docutils">
<dt>installinitrd SECTION SRC DEST</dt>
<dd>Same as installkernel, but for “initrd”.</dd>
</dl>
</dd></dl>
<dl class="method">
<dt id="pylorax.ltmpl.LoraxTemplateRunner.installkernel">
<code class="descname">installkernel</code><span class="sig-paren">(</span><em>section</em>, <em>src</em>, <em>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 class="docutils">
<dt>installkernel SECTION SRC DEST</dt>
<dd><p class="first">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 “kernel” = DEST.</p>
<dl class="last docutils">
<dt>Equivalent to:</dt>
<dd>install SRC DEST
treeinfo SECTION kernel DEST</dd>
</dl>
</dd>
</dl>
</dd></dl>
<dl class="method">
<dt id="pylorax.ltmpl.LoraxTemplateRunner.installpkg">
<code class="descname">installpkg</code><span class="sig-paren">(</span><em>*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 class="docutils">
<dt>installpkg [required|optional] [except PKGGLOB [except PKGGLOB …]] PKGGLOB [PKGGLOB …]</dt>
<dd><p class="first">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 class="last">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="descname">installupgradeinitrd</code><span class="sig-paren">(</span><em>section</em>, <em>src</em>, <em>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="docutils">
<dt>installupgradeinitrd SECTION SRC DEST</dt>
<dd>Same as installkernel, but for “upgrade”.</dd>
</dl>
</dd></dl>
<dl class="method">
<dt id="pylorax.ltmpl.LoraxTemplateRunner.log">
<code class="descname">log</code><span class="sig-paren">(</span><em>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 class="docutils">
<dt>log MESSAGE</dt>
<dd><p class="first">Emit the given log message. Be sure to put it in quotes!
Example:</p>
<blockquote class="last">
<div>log “Reticulating splines, please wait…”</div></blockquote>
</dd>
</dl>
</dd></dl>
<dl class="method">
<dt id="pylorax.ltmpl.LoraxTemplateRunner.mkdir">
<code class="descname">mkdir</code><span class="sig-paren">(</span><em>*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 class="docutils">
<dt>mkdir DIR [DIR …]</dt>
<dd><p class="first">Create the named DIR(s). Will create leading directories as needed.
Example:</p>
<blockquote class="last">
<div>mkdir /images</div></blockquote>
</dd>
</dl>
</dd></dl>
<dl class="method">
<dt id="pylorax.ltmpl.LoraxTemplateRunner.move">
<code class="descname">move</code><span class="sig-paren">(</span><em>src</em>, <em>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="docutils">
<dt>move SRC DEST</dt>
<dd>Move SRC to DEST.</dd>
</dl>
</dd></dl>
<dl class="method">
<dt id="pylorax.ltmpl.LoraxTemplateRunner.remove">
<code class="descname">remove</code><span class="sig-paren">(</span><em>*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="docutils">
<dt>remove FILEGLOB [FILEGLOB …]</dt>
<dd>Remove all the named files or directories.
Will <em>not</em> raise exceptions if the file(s) are not found.</dd>
</dl>
</dd></dl>
<dl class="method">
<dt id="pylorax.ltmpl.LoraxTemplateRunner.removefrom">
<code class="descname">removefrom</code><span class="sig-paren">(</span><em>pkg</em>, <em>*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 class="docutils">
<dt>removefrom PKGGLOB [allbut] FILEGLOB [FILEGLOB…]</dt>
<dd><p class="first">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.
Examples:</p>
<blockquote class="last">
<div>removefrom usbutils /usr/bin/*
removefrom xfsprogs allbut /sbin/*</div></blockquote>
</dd>
</dl>
</dd></dl>
<dl class="method">
<dt id="pylorax.ltmpl.LoraxTemplateRunner.removekmod">
<code class="descname">removekmod</code><span class="sig-paren">(</span><em>*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 class="docutils">
<dt>removekmod GLOB [GLOB…] [allbut] KEEPGLOB [KEEPGLOB…]</dt>
<dd><p class="first">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/<a href="#id1"><span class="problematic" id="id2">*</span></a>/kernel/</p>
<dl class="last docutils">
<dt>Examples:</dt>
<dd>removekmod sound drivers/media drivers/hwmon drivers/video
removekmod drivers/char allbut virtio_console hw_random</dd>
</dl>
</dd>
</dl>
</dd></dl>
<dl class="method">
<dt id="pylorax.ltmpl.LoraxTemplateRunner.removepkg">
<code class="descname">removepkg</code><span class="sig-paren">(</span><em>*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 class="docutils">
<dt>removepkg PKGGLOB [PKGGLOB…]</dt>
<dd><p class="first">Delete the named package(s).
IMPLEMENTATION NOTES:</p>
<blockquote class="last">
<div>RPM scriptlets (%preun/%postun) are <em>not</em> run.
Files are deleted, but directories are left behind.</div></blockquote>
</dd>
</dl>
</dd></dl>
<dl class="method">
<dt id="pylorax.ltmpl.LoraxTemplateRunner.replace">
<code class="descname">replace</code><span class="sig-paren">(</span><em>pat</em>, <em>repl</em>, <em>*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 class="docutils">
<dt>replace PATTERN REPLACEMENT FILEGLOB [FILEGLOB …]</dt>
<dd><p class="first">Find-and-replace the given PATTERN (Python-style regex) with the given
REPLACEMENT string for each of the files listed.
Example:</p>
<blockquote class="last">
<div>replace &#64;VERSION&#64; ${product.version} /boot/grub.conf /boot/isolinux.cfg</div></blockquote>
</dd>
</dl>
</dd></dl>
<dl class="method">
<dt id="pylorax.ltmpl.LoraxTemplateRunner.run">
<code class="descname">run</code><span class="sig-paren">(</span><em>templatefile</em>, <em>**variables</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/ltmpl.html#LoraxTemplateRunner.run"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.ltmpl.LoraxTemplateRunner.run" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="method">
<dt id="pylorax.ltmpl.LoraxTemplateRunner.run_pkg_transaction">
<code class="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="descname">runcmd</code><span class="sig-paren">(</span><em>*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 class="docutils">
<dt>runcmd CMD [ARG …]</dt>
<dd><p class="first">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 dont do what you need, fix them!</p>
<dl class="last docutils">
<dt>Examples:</dt>
<dd><p class="first">(this should be replaced with a “find” function)
runcmd find ${root} -name “<em>.pyo” -type f -delete
%for f in find(root, name=”</em>.pyo”):</p>
<blockquote>
<div>remove ${f}</div></blockquote>
<p class="last">%endfor</p>
</dd>
</dl>
</dd>
</dl>
</dd></dl>
<dl class="method">
<dt id="pylorax.ltmpl.LoraxTemplateRunner.symlink">
<code class="descname">symlink</code><span class="sig-paren">(</span><em>target</em>, <em>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="docutils">
<dt>symlink SRC DEST</dt>
<dd>Create a symlink at DEST which points to SRC.</dd>
</dl>
</dd></dl>
<dl class="method">
<dt id="pylorax.ltmpl.LoraxTemplateRunner.systemctl">
<code class="descname">systemctl</code><span class="sig-paren">(</span><em>cmd</em>, <em>*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 class="docutils">
<dt>systemctl [enable|disable|mask] UNIT [UNIT…]</dt>
<dd><p class="first">Enable, disable, or mask the given systemd units.
Examples:</p>
<blockquote class="last">
<div>systemctl disable lvm2-monitor.service
systemctl mask fedora-storage-init.service fedora-configure.service</div></blockquote>
</dd>
</dl>
</dd></dl>
<dl class="method">
<dt id="pylorax.ltmpl.LoraxTemplateRunner.treeinfo">
<code class="descname">treeinfo</code><span class="sig-paren">(</span><em>section</em>, <em>key</em>, <em>*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 class="docutils">
<dt>treeinfo SECTION KEY ARG [ARG …]</dt>
<dd><p class="first">Add an item to the treeinfo data store.
The given SECTION will have a new item added where
KEY = ARG ARG …
Example:</p>
<blockquote class="last">
<div>treeinfo images-${kernel.arch} boot.iso images/boot.iso</div></blockquote>
</dd>
</dl>
</dd></dl>
</dd></dl>
<dl class="function">
<dt id="pylorax.ltmpl.brace_expand">
<code class="descclassname">pylorax.ltmpl.</code><code class="descname">brace_expand</code><span class="sig-paren">(</span><em>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="descclassname">pylorax.ltmpl.</code><code class="descname">rexists</code><span class="sig-paren">(</span><em>pathname</em>, <em>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="descclassname">pylorax.ltmpl.</code><code class="descname">rglob</code><span class="sig-paren">(</span><em>pathname</em>, <em>root='/'</em>, <em>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="descclassname">pylorax.ltmpl.</code><code class="descname">split_and_expand</code><span class="sig-paren">(</span><em>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="descclassname">pylorax.monitor.</code><code class="descname">LogMonitor</code><span class="sig-paren">(</span><em>log_path=None</em>, <em>host='localhost'</em>, <em>port=0</em>, <em>timeout=None</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.6)"><code class="xref py py-class docutils literal"><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="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="descclassname">pylorax.monitor.</code><code class="descname">LogRequestHandler</code><span class="sig-paren">(</span><em>request</em>, <em>client_address</em>, <em>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.6)"><code class="xref py py-class docutils literal"><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="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="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="descname">iserror</code><span class="sig-paren">(</span><em>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>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>line</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.6)"><em>str</em></a>) log line to check for failure</td>
</tr>
</tbody>
</table>
<p>If the line contains IGNORED it will be skipped.</p>
</dd></dl>
<dl class="method">
<dt id="pylorax.monitor.LogRequestHandler.setup">
<code class="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>
</dd></dl>
<dl class="class">
<dt id="pylorax.monitor.LogServer">
<em class="property">class </em><code class="descclassname">pylorax.monitor.</code><code class="descname">LogServer</code><span class="sig-paren">(</span><em>log_path</em>, <em>*args</em>, <em>**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.6)"><code class="xref py py-class docutils literal"><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="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>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">True if there has been an error</td>
</tr>
<tr class="field-even field"><th class="field-name">Return type:</th><td class="field-body"><a class="reference external" href="https://docs.python.org/3/library/functions.html#bool" title="(in Python v3.6)">bool</a></td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="attribute">
<dt id="pylorax.monitor.LogServer.timeout">
<code class="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="descclassname">pylorax.mount.</code><code class="descname">IsoMountpoint</code><span class="sig-paren">(</span><em>iso_path</em>, <em>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.6)"><code class="xref py py-class docutils literal"><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
isos 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="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 isos 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="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="descclassname">pylorax.sysutils.</code><code class="descname">joinpaths</code><span class="sig-paren">(</span><em>*args</em>, <em>**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="descclassname">pylorax.sysutils.</code><code class="descname">touch</code><span class="sig-paren">(</span><em>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="descclassname">pylorax.sysutils.</code><code class="descname">replace</code><span class="sig-paren">(</span><em>fname</em>, <em>find</em>, <em>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="descclassname">pylorax.sysutils.</code><code class="descname">chown_</code><span class="sig-paren">(</span><em>path</em>, <em>user=None</em>, <em>group=None</em>, <em>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="descclassname">pylorax.sysutils.</code><code class="descname">chmod_</code><span class="sig-paren">(</span><em>path</em>, <em>mode</em>, <em>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="descclassname">pylorax.sysutils.</code><code class="descname">remove</code><span class="sig-paren">(</span><em>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="descclassname">pylorax.sysutils.</code><code class="descname">linktree</code><span class="sig-paren">(</span><em>src</em>, <em>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="descclassname">pylorax.treebuilder.</code><code class="descname">RuntimeBuilder</code><span class="sig-paren">(</span><em>product</em>, <em>arch</em>, <em>dbo</em>, <em>templatedir=None</em>, <em>installpkgs=None</em>, <em>excludepkgs=None</em>, <em>add_templates=None</em>, <em>add_template_vars=None</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.6)"><code class="xref py py-class docutils literal"><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="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_runtime">
<code class="descname">create_runtime</code><span class="sig-paren">(</span><em>outfile='/var/tmp/squashfs.img'</em>, <em>compression='xz'</em>, <em>compressargs=None</em>, <em>size=2</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/treebuilder.html#RuntimeBuilder.create_runtime"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.treebuilder.RuntimeBuilder.create_runtime" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="method">
<dt id="pylorax.treebuilder.RuntimeBuilder.finished">
<code class="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="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="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="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="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="descname">writepkglists</code><span class="sig-paren">(</span><em>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="descname">writepkgsizes</code><span class="sig-paren">(</span><em>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="descclassname">pylorax.treebuilder.</code><code class="descname">TreeBuilder</code><span class="sig-paren">(</span><em>product</em>, <em>arch</em>, <em>inroot</em>, <em>outroot</em>, <em>runtime</em>, <em>isolabel</em>, <em>domacboot=True</em>, <em>doupgrade=True</em>, <em>templatedir=None</em>, <em>add_templates=None</em>, <em>add_template_vars=None</em>, <em>workdir=None</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.6)"><code class="xref py py-class docutils literal"><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="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="descname">copy_dracut_hooks</code><span class="sig-paren">(</span><em>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 installroots /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. [(“99anaconda-copy-ks.sh”, “/lib/dracut/hooks/pre-pivot”)])</p>
</dd></dl>
<dl class="attribute">
<dt id="pylorax.treebuilder.TreeBuilder.dracut_hooks_path">
<code class="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="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="attribute">
<dt id="pylorax.treebuilder.TreeBuilder.kernels">
<code class="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="descname">rebuild_initrds</code><span class="sig-paren">(</span><em>add_args=None</em>, <em>backup=''</em>, <em>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 “${prefix}-${kernel.version}.img”</p>
<p>If the initrd doesnt 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="descclassname">pylorax.treebuilder.</code><code class="descname">findkernels</code><span class="sig-paren">(</span><em>root='/'</em>, <em>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="descclassname">pylorax.treebuilder.</code><code class="descname">generate_module_info</code><span class="sig-paren">(</span><em>moddir</em>, <em>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="descclassname">pylorax.treebuilder.</code><code class="descname">string_lower</code><span class="sig-paren">(</span><em>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>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>string</strong> String to lowercase</td>
</tr>
</tbody>
</table>
<p>This is used as a filter in the templates.</p>
</dd></dl>
<dl class="function">
<dt id="pylorax.treebuilder.udev_escape">
<code class="descclassname">pylorax.treebuilder.</code><code class="descname">udev_escape</code><span class="sig-paren">(</span><em>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="descclassname">pylorax.treeinfo.</code><code class="descname">TreeInfo</code><span class="sig-paren">(</span><em>product</em>, <em>version</em>, <em>variant</em>, <em>basearch</em>, <em>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.6)"><code class="xref py py-class docutils literal"><span class="pre">object</span></code></a></p>
<dl class="method">
<dt id="pylorax.treeinfo.TreeInfo.add_section">
<code class="descname">add_section</code><span class="sig-paren">(</span><em>section</em>, <em>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="descname">write</code><span class="sig-paren">(</span><em>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="descclassname">pylorax.</code><code class="descname">ArchData</code><span class="sig-paren">(</span><em>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"><span class="pre">pylorax.base.DataHolder</span></code></a></p>
<dl class="attribute">
<dt id="pylorax.ArchData.bcj_arch">
<code class="descname">bcj_arch</code><em class="property"> = {'arm': 'arm', 'armhfp': 'arm', 'i386': 'x86', 'ppc': 'powerpc', 'ppc64': 'powerpc', '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="descname">lib64_arches</code><em class="property"> = ('x86_64', 'ppc64', '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="descclassname">pylorax.</code><code class="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"><span class="pre">pylorax.base.BaseLoraxClass</span></code></a></p>
<dl class="method">
<dt id="pylorax.Lorax.configure">
<code class="descname">configure</code><span class="sig-paren">(</span><em>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="descname">init_file_logging</code><span class="sig-paren">(</span><em>logdir</em>, <em>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="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="descname">run</code><span class="sig-paren">(</span><em>dbo</em>, <em>product</em>, <em>version</em>, <em>release</em>, <em>variant=''</em>, <em>bugurl=''</em>, <em>isfinal=False</em>, <em>workdir=None</em>, <em>outputdir=None</em>, <em>buildarch=None</em>, <em>volid=None</em>, <em>domacboot=True</em>, <em>doupgrade=True</em>, <em>remove_temp=False</em>, <em>installpkgs=None</em>, <em>excludepkgs=None</em>, <em>size=2</em>, <em>add_templates=None</em>, <em>add_template_vars=None</em>, <em>add_arch_templates=None</em>, <em>add_arch_template_vars=None</em>, <em>verify=True</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="attribute">
<dt id="pylorax.Lorax.templatedir">
<code class="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="descclassname">pylorax.</code><code class="descname">find_templates</code><span class="sig-paren">(</span><em>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>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>templatedir</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.6)"><em>str</em></a>) Top directory to search for templates</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">Path to templates</td>
</tr>
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.6)">str</a></td>
</tr>
</tbody>
</table>
<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="descclassname">pylorax.</code><code class="descname">get_buildarch</code><span class="sig-paren">(</span><em>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.setup_logging">
<code class="descclassname">pylorax.</code><code class="descname">setup_logging</code><span class="sig-paren">(</span><em>logfile</em>, <em>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>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
<li><strong>logfile</strong> (<a class="reference external" href="https://docs.python.org/3/library/string.html#module-string" title="(in Python v3.6)"><em>string</em></a>) filename to write the log to</li>
<li><strong>theLogger</strong> (<a class="reference external" href="https://docs.python.org/3/library/logging.html#logging.Logger" title="(in Python v3.6)"><em>logging.Logger</em></a>) top-level logger</li>
</ul>
</td>
</tr>
</tbody>
</table>
</dd></dl>
</div>
</div>
</div>
<div class="articleComments">
</div>
</div>
<footer>
<div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
<a href="modules.html" class="btn btn-neutral" title="pylorax" 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/snide/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">
var DOCUMENTATION_OPTIONS = {
URL_ROOT:'./',
VERSION:'28.9',
COLLAPSE_INDEX:false,
FILE_SUFFIX:'.html',
HAS_SOURCE: true,
SOURCELINK_SUFFIX: '.txt'
};
</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/js/theme.js"></script>
<script type="text/javascript">
jQuery(function () {
SphinxRtdTheme.StickyNav.enable();
});
</script>
</body>
</html>