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