lorax/docs/html/pylorax.html

1614 lines
116 KiB
HTML
Raw Normal View History

<!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">
2016-11-29 17:27:44 +00:00
<title>pylorax package &mdash; Lorax 26.2 documentation</title>
<link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
2016-11-29 17:27:44 +00:00
<link rel="index" title="Index"
href="genindex.html"/>
<link rel="search" title="Search" href="search.html"/>
<link rel="top" title="Lorax 26.2 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">
2016-02-13 00:06:33 +00:00
<div class="wy-side-scroll">
<div class="wy-side-nav-search">
2016-02-13 00:06:33 +00:00
<a href="index.html" class="icon icon-home"> Lorax
2016-02-13 00:06:33 +00:00
</a>
2016-02-13 00:06:33 +00:00
<div class="version">
2016-11-29 17:27:44 +00:00
26.2
2016-02-13 00:06:33 +00:00
</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>
2016-02-13 00:06:33 +00:00
</div>
<div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
2016-02-13 00:06:33 +00:00
<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>
2016-02-13 00:06:33 +00:00
<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">
2016-11-29 17:27:44 +00:00
<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>
2016-03-18 23:30:48 +00:00
<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>
2016-02-13 00:06:33 +00:00
2016-02-13 00:06:33 +00:00
</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">
2016-02-13 00:06:33 +00:00
2016-11-29 17:27:44 +00:00
2016-02-13 00:06:33 +00:00
<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.txt" rel="nofollow"> View page source</a>
</li>
</ul>
<hr/>
</div>
2016-02-13 00:06:33 +00:00
<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">
2016-11-29 17:27:44 +00:00
<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.5)"><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">
2016-11-29 17:27:44 +00:00
<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">
2016-11-29 17:27:44 +00:00
<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">
2016-11-29 17:27:44 +00:00
<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">
2016-11-29 17:27:44 +00:00
<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">
2016-11-29 17:27:44 +00:00
<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">
2016-11-29 17:27:44 +00:00
<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.5)"><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">
2016-11-29 17:27:44 +00:00
<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">
2016-11-29 17:27:44 +00:00
<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><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.5)"><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">
2016-11-29 17:27:44 +00:00
<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>
2016-03-18 23:30:48 +00:00
</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">
2016-11-29 17:27:44 +00:00
<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>
2016-03-18 23:30:48 +00:00
<dd><p>Return a ArgumentParser object for live-media-creator.</p>
</dd></dl>
<dl class="function">
<dt id="pylorax.cmdline.lorax_parser">
2016-11-29 17:27:44 +00:00
<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>
2016-03-18 23:30:48 +00:00
<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">
2016-11-29 17:27:44 +00:00
<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">
2016-11-29 17:27:44 +00:00
<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.5)"><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">
2016-11-29 17:27:44 +00:00
<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">
2016-11-29 17:27:44 +00:00
<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">
2016-11-29 17:27:44 +00:00
<code class="descname">end</code><span class="sig-paren">(</span><em>payload</em>, <em>status</em>, <em>err_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">
2016-11-29 17:27:44 +00:00
<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">
2016-11-29 17:27:44 +00:00
<code class="descname">start</code><span class="sig-paren">(</span><em>total_files</em>, <em>total_size</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">
2016-11-29 17:27:44 +00:00
<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">
2015-10-07 18:25:53 +00:00
<dt id="pylorax.dnfhelper.LoraxRpmCallback.error">
2016-11-29 17:27:44 +00:00
<code class="descname">error</code><span class="sig-paren">(</span><em>err_msg</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>
2015-10-07 18:25:53 +00:00
<dd></dd></dl>
<dl class="method">
<dt id="pylorax.dnfhelper.LoraxRpmCallback.progress">
2016-11-29 17:27:44 +00:00
<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">
2016-11-29 17:27:44 +00:00
<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.5)"><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">
2016-11-29 17:27:44 +00:00
<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>
2015-08-25 22:51:32 +00:00
<dl class="function">
<dt id="pylorax.executils.execReadlines">
2016-11-29 17:27:44 +00:00
<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>
2015-08-25 22:51:32 +00:00
<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&#8217; there will be problems.</p>
<dl class="docutils">
<dt>NOTE/WARNING: UnicodeDecodeError will be raised if the output of the</dt>
<dd>external command can&#8217;t 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> &#8211; The command to run</li>
<li><strong>argv</strong> &#8211; The argument list</li>
<li><strong>stdin</strong> &#8211; The file object to read stdin from.</li>
<li><strong>stdout</strong> &#8211; Optional file object to redirect stdout and stderr to.</li>
<li><strong>root</strong> &#8211; The directory to chroot to before running command.</li>
<li><strong>env_prune</strong> &#8211; environment variable to remove before execution</li>
<li><strong>filter_stderr</strong> &#8211; Whether stderr should be excluded from the returned output</li>
<li><strong>callback</strong> &#8211; method to call while waiting for process to finish, passed Popen object</li>
<li><strong>env_add</strong> &#8211; environment variables to add before execution</li>
<li><strong>reset_handlers</strong> &#8211; whether to reset to SIG_DFL any signal handlers set to SIG_IGN</li>
<li><strong>reset_lang</strong> &#8211; 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">
2016-11-29 17:27:44 +00:00
<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>
2015-05-12 00:21:28 +00:00
<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> &#8211; The command to run</li>
<li><strong>argv</strong> &#8211; The argument list</li>
<li><strong>stdin</strong> &#8211; The file object to read stdin from.</li>
<li><strong>root</strong> &#8211; The directory to chroot to before running command.</li>
<li><strong>log_output</strong> &#8211; Whether to log the output of command</li>
<li><strong>filter_stderr</strong> &#8211; Whether stderr should be excluded from the returned output</li>
2015-08-25 22:51:32 +00:00
<li><strong>callback</strong> &#8211; method to call while waiting for process to finish, passed Popen object</li>
<li><strong>env_add</strong> &#8211; environment variables to add before execution</li>
<li><strong>reset_handlers</strong> &#8211; whether to reset to SIG_DFL any signal handlers set to SIG_IGN</li>
<li><strong>reset_lang</strong> &#8211; whether to set the locale of the child process to C</li>
2015-05-12 00:21:28 +00:00
</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">
2016-11-29 17:27:44 +00:00
<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>
2015-05-12 00:21:28 +00:00
<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> &#8211; The command to run</li>
<li><strong>argv</strong> &#8211; The argument list</li>
<li><strong>stdin</strong> &#8211; The file object to read stdin from.</li>
<li><strong>stdout</strong> &#8211; Optional file object to redirect stdout and stderr to.</li>
<li><strong>root</strong> &#8211; The directory to chroot to before running command.</li>
<li><strong>env_prune</strong> &#8211; environment variable to remove before execution</li>
<li><strong>log_output</strong> &#8211; whether to log the output of command</li>
<li><strong>binary_output</strong> &#8211; whether to treat the output of command as binary data</li>
<li><strong>raise_err</strong> &#8211; whether to raise a CalledProcessError if the returncode is non-zero</li>
<li><strong>callback</strong> &#8211; method to call while waiting for process to finish, passed Popen object</li>
2015-08-25 22:51:32 +00:00
<li><strong>env_add</strong> &#8211; environment variables to add before execution</li>
<li><strong>reset_handlers</strong> &#8211; whether to reset to SIG_DFL any signal handlers set to SIG_IGN</li>
<li><strong>reset_lang</strong> &#8211; whether to set the locale of the child process to C</li>
2015-05-12 00:21:28 +00:00
</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">
2016-11-29 17:27:44 +00:00
<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">
2016-11-29 17:27:44 +00:00
<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">
2016-11-29 17:27:44 +00:00
<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">
2015-10-07 18:25:53 +00:00
<li><strong>name</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.5)"><em>str</em></a>) &#8211; 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.5)"><em>str</em></a>) &#8211; The value of the environment variable</li>
</ul>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="function">
<dt id="pylorax.executils.startProgram">
2016-11-29 17:27:44 +00:00
<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> &#8211; The command to run and argument</li>
<li><strong>root</strong> &#8211; The directory to chroot to before running command.</li>
<li><strong>stdin</strong> &#8211; The file object to read stdin from.</li>
<li><strong>stdout</strong> &#8211; The file object to write stdout to.</li>
<li><strong>stderr</strong> &#8211; The file object to write stderr to.</li>
<li><strong>env_prune</strong> &#8211; environment variables to remove before execution</li>
<li><strong>env_add</strong> &#8211; environment variables to add before execution</li>
<li><strong>reset_handlers</strong> &#8211; whether to reset to SIG_DFL any signal handlers set to SIG_IGN</li>
<li><strong>reset_lang</strong> &#8211; whether to set the locale of the child process to C</li>
<li><strong>kwargs</strong> &#8211; Additional parameters to pass to subprocess.Popen</li>
2015-08-25 22:51:32 +00:00
<li><strong>preexec_fn</strong> &#8211; 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">
2016-11-29 17:27:44 +00:00
<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.5)"><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">
2016-11-29 17:27:44 +00:00
<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.5)"><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">
2016-11-29 17:27:44 +00:00
<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.5)"><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">
2016-11-29 17:27:44 +00:00
<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.5)"><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">
2016-11-29 17:27:44 +00:00
<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 &#8220;xz&#8221;, &#8220;gzip&#8221;, &#8220;lzma&#8221;, &#8220;bzip2&#8221;, or None.
compressargs will be used on the compression commandline.</p>
</dd></dl>
<dl class="function">
<dt id="pylorax.imgutils.copytree">
2016-11-29 17:27:44 +00:00
<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">
2016-11-29 17:27:44 +00:00
<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">
2016-11-29 17:27:44 +00:00
<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">
2016-11-29 17:27:44 +00:00
<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 &#8216;/&#8217; it&#8217;s assumed to be a directory which should be
created, otherwise just the leading directories will be created.</p>
</dd></dl>
<dl class="function">
<dt id="pylorax.imgutils.estimate_size">
2016-11-29 17:27:44 +00:00
<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">
2016-11-29 17:27:44 +00:00
<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">
2016-11-29 17:27:44 +00:00
<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">
2016-11-29 17:27:44 +00:00
<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.mkbtrfsimg">
2016-11-29 17:27:44 +00:00
<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">
2016-11-29 17:27:44 +00:00
<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">
2016-11-29 17:27:44 +00:00
<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">
2016-11-29 17:27:44 +00:00
<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">
2016-11-29 17:27:44 +00:00
<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 - &#8220;mkfs.${fstype}&#8221; must exist.
graft should be a dict: {&#8220;some/path/in/image&#8221;: &#8220;local/file/or/dir&#8221;};</p>
<blockquote>
<div>if the path ends with a &#8216;/&#8217; it&#8217;s 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">
2016-11-29 17:27:44 +00:00
<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">
2016-11-29 17:27:44 +00:00
<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 &#8220;-f&#8221;, fmt
in options.</p>
</dd></dl>
2016-02-13 00:06:33 +00:00
<dl class="function">
<dt id="pylorax.imgutils.mkqemu_img">
2016-11-29 17:27:44 +00:00
<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>
2016-02-13 00:06:33 +00:00
<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 &#8220;-f&#8221;, fmt
in options.</p>
</dd></dl>
<dl class="function">
<dt id="pylorax.imgutils.mkrootfsimg">
2016-11-29 17:27:44 +00:00
<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">
2015-10-07 18:25:53 +00:00
<li><strong>rootdir</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.5)"><em>str</em></a>) &#8211; 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.5)"><em>str</em></a>) &#8211; 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.5)"><em>str</em></a>) &#8211; 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.5)"><em>int</em></a>) &#8211; 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.5)"><em>str</em></a>) &#8211; 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">
2016-11-29 17:27:44 +00:00
<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">
2016-11-29 17:27:44 +00:00
<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">
2016-11-29 17:27:44 +00:00
<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">
2016-11-29 17:27:44 +00:00
<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">
2016-11-29 17:27:44 +00:00
<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 isn&#8217;t a multiple of blocksize, round up to the next multiple</p>
</dd></dl>
<dl class="function">
<dt id="pylorax.imgutils.umount">
2016-11-29 17:27:44 +00:00
<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">
2016-11-29 17:27:44 +00:00
<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.5)"><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">
2016-11-29 17:27:44 +00:00
<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">
2016-11-29 17:27:44 +00:00
<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.5)"><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(&#8220;install-packages.ltmpl&#8221;)</p>
<p># modify a runtime dir
runner = LoraxTemplateRunner(inroot=rundir, outroot=newrun)
runner.run(&#8220;runtime-transmogrify.ltmpl&#8221;)</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 can&#8217;t 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>&#8216;s copy of that program, which may cause problems if there&#8217;s a
big enough difference between the host and the image you&#8217;re 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 - don&#8217;t use sys.exit()</li>
</ul>
<dl class="method">
<dt id="pylorax.ltmpl.LoraxTemplateRunner.append">
2016-11-29 17:27:44 +00:00
<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 (&#8216;n&#8217;, &#8216;t&#8217;, etc.) will be
converted to the appropriate characters.
Examples:</p>
<blockquote class="last">
<div>append /etc/depmod.d/dd.conf &#8220;search updates built-in&#8221;
append /etc/resolv.conf &#8220;&#8221;</div></blockquote>
</dd>
</dl>
</dd></dl>
<dl class="method">
<dt id="pylorax.ltmpl.LoraxTemplateRunner.chmod">
2016-11-29 17:27:44 +00:00
<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">
2016-11-29 17:27:44 +00:00
<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 doesn&#8217;t 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">
2016-11-29 17:27:44 +00:00
<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">
2016-11-29 17:27:44 +00:00
<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">
2016-11-29 17:27:44 +00:00
<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">
2016-11-29 17:27:44 +00:00
<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 doesn&#8217;t exist, SRC will be copied to a file with that name,
assuming the rest of the path exists.
This is pretty much like how the &#8216;cp&#8217; 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">
2016-11-29 17:27:44 +00:00
<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">
2016-05-23 23:55:51 +00:00
<dt>installimg [&#8211;xz|&#8211;gzip|&#8211;bzip2|&#8211;lzma] [-ARG|&#8211;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 doesn&#8217;t exist or is empty nothing is created.</p>
2016-05-23 23:55:51 +00:00
<dl class="docutils">
<dt>Examples:</dt>
<dd>installimg ${LORAXDIR}/product/ images/product.img
2016-05-23 23:55:51 +00:00
installimg ${LORAXDIR}/updates/ images/updates.img
installimg &#8211;xz -6 ${LORAXDIR}/updates/ images/updates.img
installimg &#8211;xz -9 &#8211;memlimit-compress=3700MiB ${LORAXDIR}/updates/ images/updates.img</dd>
</dl>
2016-05-23 23:55:51 +00:00
<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">
2016-11-29 17:27:44 +00:00
<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 &#8220;initrd&#8221;.</dd>
</dl>
</dd></dl>
<dl class="method">
<dt id="pylorax.ltmpl.LoraxTemplateRunner.installkernel">
2016-11-29 17:27:44 +00:00
<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 &#8220;kernel&#8221; = 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">
2016-11-29 17:27:44 +00:00
<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">
2016-07-28 14:57:51 +00:00
<dt>installpkg [&#8211;required|&#8211;optional] [&#8211;except PKGGLOB [&#8211;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
2016-07-28 14:57:51 +00:00
until the &#8216;run_pkg_transaction&#8217; command is given.</p>
<p class="last">&#8211;required is now the default. If the PKGGLOB can be missing pass &#8211;optional</p>
</dd>
</dl>
</dd></dl>
<dl class="method">
<dt id="pylorax.ltmpl.LoraxTemplateRunner.installupgradeinitrd">
2016-11-29 17:27:44 +00:00
<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 &#8220;upgrade&#8221;.</dd>
</dl>
</dd></dl>
<dl class="method">
<dt id="pylorax.ltmpl.LoraxTemplateRunner.log">
2016-11-29 17:27:44 +00:00
<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 &#8220;Reticulating splines, please wait...&#8221;</div></blockquote>
</dd>
</dl>
</dd></dl>
<dl class="method">
<dt id="pylorax.ltmpl.LoraxTemplateRunner.mkdir">
2016-11-29 17:27:44 +00:00
<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">
2016-11-29 17:27:44 +00:00
<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">
2016-11-29 17:27:44 +00:00
<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">
2016-11-29 17:27:44 +00:00
<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 [&#8211;allbut] FILEGLOB [FILEGLOB...]</dt>
<dd><p class="first">Remove all files matching the given file globs from the package
(or packages) named.
If &#8216;&#8211;allbut&#8217; 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 &#8211;allbut /sbin/*</div></blockquote>
</dd>
</dl>
</dd></dl>
<dl class="method">
<dt id="pylorax.ltmpl.LoraxTemplateRunner.removekmod">
2016-11-29 17:27:44 +00:00
<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...] [&#8211;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 &#8216;&#8211;allbut&#8217; 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 &#8211;allbut virtio_console hw_random</dd>
</dl>
</dd>
</dl>
</dd></dl>
<dl class="method">
<dt id="pylorax.ltmpl.LoraxTemplateRunner.removepkg">
2016-11-29 17:27:44 +00:00
<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">
2016-11-29 17:27:44 +00:00
<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">
2016-11-29 17:27:44 +00:00
<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">
2016-11-29 17:27:44 +00:00
<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 &#8216;installpkg&#8217;
commands.</p>
</dd></dl>
<dl class="method">
<dt id="pylorax.ltmpl.LoraxTemplateRunner.runcmd">
2016-11-29 17:27:44 +00:00
<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 don&#8217;t do what you need, fix them!</p>
<dl class="last docutils">
<dt>Examples:</dt>
<dd><p class="first">(this should be replaced with a &#8220;find&#8221; function)
runcmd find ${root} -name &#8220;<em>.pyo&#8221; -type f -delete
%for f in find(root, name=&#8221;</em>.pyo&#8221;):</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">
2016-11-29 17:27:44 +00:00
<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">
2016-11-29 17:27:44 +00:00
<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">
2016-11-29 17:27:44 +00:00
<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">
2016-11-29 17:27:44 +00:00
<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">
2016-11-29 17:27:44 +00:00
<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">
2016-11-29 17:27:44 +00:00
<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">
2016-11-29 17:27:44 +00:00
<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">
2016-11-29 17:27:44 +00:00
<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.5)"><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">
2016-11-29 17:27:44 +00:00
<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">
2016-11-29 17:27:44 +00:00
<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.5)"><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">
2016-11-29 17:27:44 +00:00
<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">
2016-11-29 17:27:44 +00:00
<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">
2016-11-29 17:27:44 +00:00
<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">
2015-10-07 18:25:53 +00:00
<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.5)"><em>str</em></a>) &#8211; 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">
2016-11-29 17:27:44 +00:00
<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">
2016-11-29 17:27:44 +00:00
<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.5)"><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">
2016-11-29 17:27:44 +00:00
<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>
2016-11-29 17:27:44 +00:00
<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.5)">bool</a></td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="attribute">
<dt id="pylorax.monitor.LogServer.timeout">
2016-11-29 17:27:44 +00:00
<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">
2016-11-29 17:27:44 +00:00
<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.5)"><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
iso&#8217;s label.</p>
<p>stage2 can be either LiveOS/squashfs.img or images/install.img</p>
<dl class="method">
<dt id="pylorax.mount.IsoMountpoint.get_iso_label">
2016-11-29 17:27:44 +00:00
<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 iso&#8217;s label using isoinfo</p>
<p>Sets self.label if one is found</p>
</dd></dl>
<dl class="method">
<dt id="pylorax.mount.IsoMountpoint.umount">
2016-11-29 17:27:44 +00:00
<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">
2016-11-29 17:27:44 +00:00
<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">
2016-11-29 17:27:44 +00:00
<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">
2016-11-29 17:27:44 +00:00
<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_">
2016-11-29 17:27:44 +00:00
<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_">
2016-11-29 17:27:44 +00:00
<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">
2016-11-29 17:27:44 +00:00
<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">
2016-11-29 17:27:44 +00:00
<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">
2016-11-29 17:27:44 +00:00
<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.5)"><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">
2016-11-29 17:27:44 +00:00
<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">
2016-11-29 17:27:44 +00:00
<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">
2016-11-29 17:27:44 +00:00
<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">
2016-11-29 17:27:44 +00:00
<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">
2016-11-29 17:27:44 +00:00
<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">
2016-11-29 17:27:44 +00:00
<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>
2015-08-25 22:51:32 +00:00
<dl class="method">
<dt id="pylorax.treebuilder.RuntimeBuilder.verify">
2016-11-29 17:27:44 +00:00
<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>
2015-08-25 22:51:32 +00:00
<dd><p>Ensure that contents of the installroot can run</p>
</dd></dl>
<dl class="method">
<dt id="pylorax.treebuilder.RuntimeBuilder.writepkglists">
2016-11-29 17:27:44 +00:00
<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">
2016-11-29 17:27:44 +00:00
<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">
2016-11-29 17:27:44 +00:00
<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.5)"><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">
2016-11-29 17:27:44 +00:00
<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">
2016-11-29 17:27:44 +00:00
<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 installroot&#8217;s /tmp/
and return a list of commands to pass to dracut when creating the
initramfs</p>
<p>hooks is a list of tuples with the name of the hook script and the
target dracut hook directory
(eg. [(&#8220;99anaconda-copy-ks.sh&#8221;, &#8220;/lib/dracut/hooks/pre-pivot&#8221;)])</p>
</dd></dl>
<dl class="attribute">
<dt id="pylorax.treebuilder.TreeBuilder.dracut_hooks_path">
2016-11-29 17:27:44 +00:00
<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">
2016-11-29 17:27:44 +00:00
<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">
2016-11-29 17:27:44 +00:00
<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">
2016-11-29 17:27:44 +00:00
<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 &#8220;${prefix}-${kernel.version}.img&#8221;</p>
2016-05-23 23:55:51 +00:00
<p>If the initrd doesn&#8217;t exist its name will be created based on the
name of the kernel.</p>
</dd></dl>
</dd></dl>
<dl class="function">
<dt id="pylorax.treebuilder.findkernels">
2016-11-29 17:27:44 +00:00
<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">
2016-11-29 17:27:44 +00:00
<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">
2016-11-29 17:27:44 +00:00
<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> &#8211; 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">
2016-11-29 17:27:44 +00:00
<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">
2016-11-29 17:27:44 +00:00
<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.5)"><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">
2016-11-29 17:27:44 +00:00
<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">
2016-11-29 17:27:44 +00:00
<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">
2016-11-29 17:27:44 +00:00
<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">
2016-11-29 17:27:44 +00:00
<code class="descname">bcj_arch</code><em class="property"> = {'ppc': 'powerpc', 'armhfp': 'arm', 'ppc64le': 'powerpc', 'i386': 'x86', 'ppc64': 'powerpc', 'arm': 'arm', '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">
2016-11-29 17:27:44 +00:00
<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">
2016-11-29 17:27:44 +00:00
<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">
2016-11-29 17:27:44 +00:00
<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">
2016-11-29 17:27:44 +00:00
<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">
2016-11-29 17:27:44 +00:00
<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">
2016-11-29 17:27:44 +00:00
<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>
2016-02-13 00:06:33 +00:00
<dl class="attribute">
<dt id="pylorax.Lorax.templatedir">
2016-11-29 17:27:44 +00:00
<code class="descname">templatedir</code><a class="headerlink" href="#pylorax.Lorax.templatedir" title="Permalink to this definition"></a></dt>
2016-02-13 00:06:33 +00:00
<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">
2016-11-29 17:27:44 +00:00
<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>
2016-02-13 00:06:33 +00:00
<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.5)"><em>str</em></a>) &#8211; 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>
2016-11-29 17:27:44 +00:00
<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.5)">str</a></td>
2016-02-13 00:06:33 +00:00
</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">
2016-11-29 17:27:44 +00:00
<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">
2016-11-29 17:27:44 +00:00
<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">
2015-10-07 18:25:53 +00:00
<li><strong>logfile</strong> (<a class="reference external" href="https://docs.python.org/3/library/string.html#module-string" title="(in Python v3.5)"><em>string</em></a>) &#8211; 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.5)"><em>logging.Logger</em></a>) &#8211; top-level logger</li>
</ul>
</td>
</tr>
</tbody>
</table>
</dd></dl>
</div>
</div>
2016-02-13 00:06:33 +00:00
</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"><span class="fa fa-arrow-circle-left"></span> Previous</a>
</div>
<hr/>
<div role="contentinfo">
<p>
&copy; Copyright 2015, Red Hat, Inc..
2016-02-13 00:06:33 +00:00
</p>
</div>
2016-02-13 00:06:33 +00:00
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:'./',
2016-11-29 17:27:44 +00:00
VERSION:'26.2',
COLLAPSE_INDEX:false,
FILE_SUFFIX:'.html',
HAS_SOURCE: true
};
</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>