lorax/rhel8-branch/pylorax.html

2245 lines
183 KiB
HTML
Raw Normal View History

2019-12-19 22:07:51 +00:00
<!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">
2020-04-28 17:42:12 +00:00
<title>pylorax package &mdash; Lorax 28.14.42 documentation</title>
2019-12-19 22:07:51 +00:00
<script type="text/javascript" src="_static/js/modernizr.min.js"></script>
<script type="text/javascript" id="documentation_options" data-url_root="./" src="_static/documentation_options.js"></script>
<script type="text/javascript" src="_static/jquery.js"></script>
<script type="text/javascript" src="_static/underscore.js"></script>
<script type="text/javascript" src="_static/doctools.js"></script>
<script type="text/javascript" src="_static/language_data.js"></script>
<script type="text/javascript" src="_static/js/theme.js"></script>
<link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<link rel="index" title="Index" href="genindex.html" />
<link rel="search" title="Search" href="search.html" />
<link rel="next" title="pylorax.api package" href="pylorax.api.html" />
<link rel="prev" title="pylorax" href="modules.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">
2020-04-28 17:42:12 +00:00
28.14.42
2019-12-19 22:07:51 +00:00
</div>
<div role="search">
<form id="rtd-search-form" class="wy-form" action="search.html" method="get">
<input type="text" name="q" placeholder="Search docs" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
</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="product-images.html">Product and Updates Images</a></li>
<li class="toctree-l1 current"><a class="reference internal" href="modules.html">pylorax</a><ul class="current">
<li class="toctree-l2 current"><a class="current reference internal" href="#">pylorax package</a><ul>
<li class="toctree-l3"><a class="reference internal" href="#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>
2020-04-28 17:42:12 +00:00
<li class="toctree-l3"><a class="reference internal" href="#module-pylorax.dnfbase">pylorax.dnfbase module</a></li>
2019-12-19 22:07:51 +00:00
<li class="toctree-l3"><a class="reference internal" href="#module-pylorax.dnfhelper">pylorax.dnfhelper module</a></li>
<li class="toctree-l3"><a class="reference internal" href="#module-pylorax.executils">pylorax.executils module</a></li>
<li class="toctree-l3"><a class="reference internal" href="#module-pylorax.imgutils">pylorax.imgutils module</a></li>
<li class="toctree-l3"><a class="reference internal" href="#module-pylorax.installer">pylorax.installer module</a></li>
<li class="toctree-l3"><a class="reference internal" href="#module-pylorax.ltmpl">pylorax.ltmpl module</a></li>
<li class="toctree-l3"><a class="reference internal" href="#module-pylorax.monitor">pylorax.monitor module</a></li>
<li class="toctree-l3"><a class="reference internal" href="#module-pylorax.mount">pylorax.mount module</a></li>
<li class="toctree-l3"><a class="reference internal" href="#module-pylorax.output">pylorax.output module</a></li>
<li class="toctree-l3"><a class="reference internal" href="#module-pylorax.sysutils">pylorax.sysutils module</a></li>
<li class="toctree-l3"><a class="reference internal" href="#module-pylorax.treebuilder">pylorax.treebuilder module</a></li>
<li class="toctree-l3"><a class="reference internal" href="#module-pylorax.treeinfo">pylorax.treeinfo module</a></li>
<li class="toctree-l3"><a class="reference internal" href="#module-pylorax">Module contents</a></li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
</div>
</nav>
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
<nav class="wy-nav-top" aria-label="top navigation">
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="index.html">Lorax</a>
</nav>
<div class="wy-nav-content">
<div class="rst-content">
<div role="navigation" aria-label="breadcrumbs navigation">
<ul class="wy-breadcrumbs">
<li><a href="index.html">Docs</a> &raquo;</li>
<li><a href="modules.html">pylorax</a> &raquo;</li>
<li>pylorax package</li>
<li class="wy-breadcrumbs-aside">
<a href="_sources/pylorax.rst.txt" rel="nofollow"> View page source</a>
</li>
</ul>
<hr/>
</div>
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
<div itemprop="articleBody">
<div class="section" id="pylorax-package">
<h1>pylorax package<a class="headerlink" href="#pylorax-package" title="Permalink to this headline"></a></h1>
<div class="section" id="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.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.crossdomain">pylorax.api.crossdomain module</a></li>
<li class="toctree-l2"><a class="reference internal" href="pylorax.api.html#pylorax-api-dnfbase-module">pylorax.api.dnfbase 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.server">pylorax.api.server 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><ul>
<li class="toctree-l4"><a class="reference internal" href="pylorax.api.html#api-v0-blueprints-list"><cite>/api/v0/blueprints/list</cite></a></li>
<li class="toctree-l4"><a class="reference internal" href="pylorax.api.html#api-v0-blueprints-info-blueprint-names-format-json-toml"><cite>/api/v0/blueprints/info/&lt;blueprint_names&gt;[?format=&lt;json|toml&gt;]</cite></a></li>
<li class="toctree-l4"><a class="reference internal" href="pylorax.api.html#api-v0-blueprints-changes-blueprint-names-offset-0-limit-20"><cite>/api/v0/blueprints/changes/&lt;blueprint_names&gt;[?offset=0&amp;limit=20]</cite></a></li>
<li class="toctree-l4"><a class="reference internal" href="pylorax.api.html#post-api-v0-blueprints-new">POST <cite>/api/v0/blueprints/new</cite></a></li>
<li class="toctree-l4"><a class="reference internal" href="pylorax.api.html#delete-api-v0-blueprints-delete-blueprint-name">DELETE <cite>/api/v0/blueprints/delete/&lt;blueprint_name&gt;</cite></a></li>
<li class="toctree-l4"><a class="reference internal" href="pylorax.api.html#post-api-v0-blueprints-workspace">POST <cite>/api/v0/blueprints/workspace</cite></a></li>
<li class="toctree-l4"><a class="reference internal" href="pylorax.api.html#delete-api-v0-blueprints-workspace-blueprint-name">DELETE <cite>/api/v0/blueprints/workspace/&lt;blueprint_name&gt;</cite></a></li>
<li class="toctree-l4"><a class="reference internal" href="pylorax.api.html#post-api-v0-blueprints-undo-blueprint-name-commit">POST <cite>/api/v0/blueprints/undo/&lt;blueprint_name&gt;/&lt;commit&gt;</cite></a></li>
<li class="toctree-l4"><a class="reference internal" href="pylorax.api.html#post-api-v0-blueprints-tag-blueprint-name">POST <cite>/api/v0/blueprints/tag/&lt;blueprint_name&gt;</cite></a></li>
<li class="toctree-l4"><a class="reference internal" href="pylorax.api.html#api-v0-blueprints-diff-blueprint-name-from-commit-to-commit"><cite>/api/v0/blueprints/diff/&lt;blueprint_name&gt;/&lt;from_commit&gt;/&lt;to_commit&gt;</cite></a></li>
<li class="toctree-l4"><a class="reference internal" href="pylorax.api.html#api-v0-blueprints-freeze-blueprint-names"><cite>/api/v0/blueprints/freeze/&lt;blueprint_names&gt;</cite></a></li>
<li class="toctree-l4"><a class="reference internal" href="pylorax.api.html#api-v0-blueprints-depsolve-blueprint-names"><cite>/api/v0/blueprints/depsolve/&lt;blueprint_names&gt;</cite></a></li>
<li class="toctree-l4"><a class="reference internal" href="pylorax.api.html#api-v0-projects-list-offset-0-limit-20"><cite>/api/v0/projects/list[?offset=0&amp;limit=20]</cite></a></li>
<li class="toctree-l4"><a class="reference internal" href="pylorax.api.html#api-v0-projects-info-project-names"><cite>/api/v0/projects/info/&lt;project_names&gt;</cite></a></li>
<li class="toctree-l4"><a class="reference internal" href="pylorax.api.html#api-v0-projects-depsolve-project-names"><cite>/api/v0/projects/depsolve/&lt;project_names&gt;</cite></a></li>
<li class="toctree-l4"><a class="reference internal" href="pylorax.api.html#api-v0-projects-source-list"><cite>/api/v0/projects/source/list</cite></a></li>
<li class="toctree-l4"><a class="reference internal" href="pylorax.api.html#api-v0-projects-source-info-source-names"><cite>/api/v0/projects/source/info/&lt;source-names&gt;</cite></a></li>
<li class="toctree-l4"><a class="reference internal" href="pylorax.api.html#post-api-v0-projects-source-new">POST <cite>/api/v0/projects/source/new</cite></a></li>
<li class="toctree-l4"><a class="reference internal" href="pylorax.api.html#delete-api-v0-projects-source-delete-source-name">DELETE <cite>/api/v0/projects/source/delete/&lt;source-name&gt;</cite></a></li>
<li class="toctree-l4"><a class="reference internal" href="pylorax.api.html#api-v0-modules-list-offset-0-limit-20"><cite>/api/v0/modules/list[?offset=0&amp;limit=20]</cite></a></li>
<li class="toctree-l4"><a class="reference internal" href="pylorax.api.html#api-v0-modules-list-module-names-offset-0-limit-20"><cite>/api/v0/modules/list/&lt;module_names&gt;[?offset=0&amp;limit=20]</cite></a></li>
<li class="toctree-l4"><a class="reference internal" href="pylorax.api.html#api-v0-modules-info-module-names"><cite>/api/v0/modules/info/&lt;module_names&gt;</cite></a></li>
<li class="toctree-l4"><a class="reference internal" href="pylorax.api.html#post-api-v0-compose">POST <cite>/api/v0/compose</cite></a></li>
<li class="toctree-l4"><a class="reference internal" href="pylorax.api.html#api-v0-compose-types"><cite>/api/v0/compose/types</cite></a></li>
<li class="toctree-l4"><a class="reference internal" href="pylorax.api.html#api-v0-compose-queue"><cite>/api/v0/compose/queue</cite></a></li>
<li class="toctree-l4"><a class="reference internal" href="pylorax.api.html#api-v0-compose-finished"><cite>/api/v0/compose/finished</cite></a></li>
<li class="toctree-l4"><a class="reference internal" href="pylorax.api.html#api-v0-compose-failed"><cite>/api/v0/compose/failed</cite></a></li>
<li class="toctree-l4"><a class="reference internal" href="pylorax.api.html#api-v0-compose-status-uuids-blueprint-blueprint-name-status-compose-status-type-compose-type"><cite>/api/v0/compose/status/&lt;uuids&gt;[?blueprint=&lt;blueprint_name&gt;&amp;status=&lt;compose_status&gt;&amp;type=&lt;compose_type&gt;]</cite></a></li>
<li class="toctree-l4"><a class="reference internal" href="pylorax.api.html#delete-api-v0-compose-cancel-uuid">DELETE <cite>/api/v0/compose/cancel/&lt;uuid&gt;</cite></a></li>
<li class="toctree-l4"><a class="reference internal" href="pylorax.api.html#delete-api-v0-compose-delete-uuids">DELETE <cite>/api/v0/compose/delete/&lt;uuids&gt;</cite></a></li>
<li class="toctree-l4"><a class="reference internal" href="pylorax.api.html#api-v0-compose-info-uuid"><cite>/api/v0/compose/info/&lt;uuid&gt;</cite></a></li>
<li class="toctree-l4"><a class="reference internal" href="pylorax.api.html#api-v0-compose-metadata-uuid"><cite>/api/v0/compose/metadata/&lt;uuid&gt;</cite></a></li>
<li class="toctree-l4"><a class="reference internal" href="pylorax.api.html#api-v0-compose-results-uuid"><cite>/api/v0/compose/results/&lt;uuid&gt;</cite></a></li>
<li class="toctree-l4"><a class="reference internal" href="pylorax.api.html#api-v0-compose-logs-uuid"><cite>/api/v0/compose/logs/&lt;uuid&gt;</cite></a></li>
<li class="toctree-l4"><a class="reference internal" href="pylorax.api.html#api-v0-compose-image-uuid"><cite>/api/v0/compose/image/&lt;uuid&gt;</cite></a></li>
<li class="toctree-l4"><a class="reference internal" href="pylorax.api.html#api-v0-compose-log-uuid-size-kbytes"><cite>/api/v0/compose/log/&lt;uuid&gt;[?size=kbytes]</cite></a></li>
</ul>
</li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="pylorax.api.html#module-pylorax.api.workspace">pylorax.api.workspace module</a></li>
<li class="toctree-l2"><a class="reference internal" href="pylorax.api.html#module-pylorax.api">Module contents</a></li>
</ul>
</li>
</ul>
</div>
</div>
<div class="section" id="submodules">
<h2>Submodules<a class="headerlink" href="#submodules" title="Permalink to this headline"></a></h2>
</div>
<div class="section" id="module-pylorax.base">
<span id="pylorax-base-module"></span><h2>pylorax.base module<a class="headerlink" href="#module-pylorax.base" title="Permalink to this headline"></a></h2>
<dl class="class">
<dt id="pylorax.base.BaseLoraxClass">
2020-04-28 17:42:12 +00:00
<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>
2019-12-19 22:07:51 +00:00
<dd><p>Bases: <a class="reference external" href="https://docs.python.org/3/library/functions.html#object" title="(in Python v3.8)"><code class="xref py py-class docutils literal notranslate"><span class="pre">object</span></code></a></p>
<dl class="method">
<dt id="pylorax.base.BaseLoraxClass.pcritical">
2020-04-28 17:42:12 +00:00
<code class="sig-name descname">pcritical</code><span class="sig-paren">(</span><em class="sig-param">msg</em>, <em class="sig-param">fobj=&lt;_io.TextIOWrapper name='&lt;stdout&gt;' mode='w' encoding='UTF-8'&gt;</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/base.html#BaseLoraxClass.pcritical"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.base.BaseLoraxClass.pcritical" title="Permalink to this definition"></a></dt>
2019-12-19 22:07:51 +00:00
<dd></dd></dl>
<dl class="method">
<dt id="pylorax.base.BaseLoraxClass.pdebug">
2020-04-28 17:42:12 +00:00
<code class="sig-name descname">pdebug</code><span class="sig-paren">(</span><em class="sig-param">msg</em>, <em class="sig-param">fobj=&lt;_io.TextIOWrapper name='&lt;stdout&gt;' mode='w' encoding='UTF-8'&gt;</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/base.html#BaseLoraxClass.pdebug"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.base.BaseLoraxClass.pdebug" title="Permalink to this definition"></a></dt>
2019-12-19 22:07:51 +00:00
<dd></dd></dl>
<dl class="method">
<dt id="pylorax.base.BaseLoraxClass.perror">
2020-04-28 17:42:12 +00:00
<code class="sig-name descname">perror</code><span class="sig-paren">(</span><em class="sig-param">msg</em>, <em class="sig-param">fobj=&lt;_io.TextIOWrapper name='&lt;stdout&gt;' mode='w' encoding='UTF-8'&gt;</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/base.html#BaseLoraxClass.perror"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.base.BaseLoraxClass.perror" title="Permalink to this definition"></a></dt>
2019-12-19 22:07:51 +00:00
<dd></dd></dl>
<dl class="method">
<dt id="pylorax.base.BaseLoraxClass.pinfo">
2020-04-28 17:42:12 +00:00
<code class="sig-name descname">pinfo</code><span class="sig-paren">(</span><em class="sig-param">msg</em>, <em class="sig-param">fobj=&lt;_io.TextIOWrapper name='&lt;stdout&gt;' mode='w' encoding='UTF-8'&gt;</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/base.html#BaseLoraxClass.pinfo"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.base.BaseLoraxClass.pinfo" title="Permalink to this definition"></a></dt>
2019-12-19 22:07:51 +00:00
<dd></dd></dl>
<dl class="method">
<dt id="pylorax.base.BaseLoraxClass.pwarning">
2020-04-28 17:42:12 +00:00
<code class="sig-name descname">pwarning</code><span class="sig-paren">(</span><em class="sig-param">msg</em>, <em class="sig-param">fobj=&lt;_io.TextIOWrapper name='&lt;stdout&gt;' mode='w' encoding='UTF-8'&gt;</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/base.html#BaseLoraxClass.pwarning"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.base.BaseLoraxClass.pwarning" title="Permalink to this definition"></a></dt>
2019-12-19 22:07:51 +00:00
<dd></dd></dl>
</dd></dl>
<dl class="class">
<dt id="pylorax.base.DataHolder">
2020-04-28 17:42:12 +00:00
<em class="property">class </em><code class="sig-prename descclassname">pylorax.base.</code><code class="sig-name descname">DataHolder</code><span class="sig-paren">(</span><em class="sig-param">**kwargs</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/base.html#DataHolder"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.base.DataHolder" title="Permalink to this definition"></a></dt>
2019-12-19 22:07:51 +00:00
<dd><p>Bases: <a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#dict" title="(in Python v3.8)"><code class="xref py py-class docutils literal notranslate"><span class="pre">dict</span></code></a></p>
<dl class="method">
<dt id="pylorax.base.DataHolder.copy">
2020-04-28 17:42:12 +00:00
<code class="sig-name descname">copy</code><span class="sig-paren">(</span><span class="sig-paren">)</span> &#x2192; a shallow copy of D<a class="reference internal" href="_modules/pylorax/base.html#DataHolder.copy"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.base.DataHolder.copy" title="Permalink to this definition"></a></dt>
2019-12-19 22:07:51 +00:00
<dd></dd></dl>
</dd></dl>
</div>
<div class="section" id="module-pylorax.buildstamp">
<span id="pylorax-buildstamp-module"></span><h2>pylorax.buildstamp module<a class="headerlink" href="#module-pylorax.buildstamp" title="Permalink to this headline"></a></h2>
<dl class="class">
<dt id="pylorax.buildstamp.BuildStamp">
2020-04-28 17:42:12 +00:00
<em class="property">class </em><code class="sig-prename descclassname">pylorax.buildstamp.</code><code class="sig-name descname">BuildStamp</code><span class="sig-paren">(</span><em class="sig-param">product</em>, <em class="sig-param">version</em>, <em class="sig-param">bugurl</em>, <em class="sig-param">isfinal</em>, <em class="sig-param">buildarch</em>, <em class="sig-param">variant=''</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/buildstamp.html#BuildStamp"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.buildstamp.BuildStamp" title="Permalink to this definition"></a></dt>
2019-12-19 22:07:51 +00:00
<dd><p>Bases: <a class="reference external" href="https://docs.python.org/3/library/functions.html#object" title="(in Python v3.8)"><code class="xref py py-class docutils literal notranslate"><span class="pre">object</span></code></a></p>
<dl class="method">
<dt id="pylorax.buildstamp.BuildStamp.write">
2020-04-28 17:42:12 +00:00
<code class="sig-name descname">write</code><span class="sig-paren">(</span><em class="sig-param">outfile</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/buildstamp.html#BuildStamp.write"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.buildstamp.BuildStamp.write" title="Permalink to this definition"></a></dt>
2019-12-19 22:07:51 +00:00
<dd></dd></dl>
</dd></dl>
</div>
<div class="section" id="module-pylorax.cmdline">
<span id="pylorax-cmdline-module"></span><h2>pylorax.cmdline module<a class="headerlink" href="#module-pylorax.cmdline" title="Permalink to this headline"></a></h2>
<dl class="function">
<dt id="pylorax.cmdline.lmc_parser">
2020-04-28 17:42:12 +00:00
<code class="sig-prename descclassname">pylorax.cmdline.</code><code class="sig-name descname">lmc_parser</code><span class="sig-paren">(</span><em class="sig-param">dracut_default=''</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/cmdline.html#lmc_parser"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.cmdline.lmc_parser" title="Permalink to this definition"></a></dt>
2019-12-19 22:07:51 +00:00
<dd><p>Return a ArgumentParser object for live-media-creator.</p>
</dd></dl>
<dl class="function">
<dt id="pylorax.cmdline.lorax_parser">
2020-04-28 17:42:12 +00:00
<code class="sig-prename descclassname">pylorax.cmdline.</code><code class="sig-name descname">lorax_parser</code><span class="sig-paren">(</span><em class="sig-param">dracut_default=''</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/cmdline.html#lorax_parser"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.cmdline.lorax_parser" title="Permalink to this definition"></a></dt>
2019-12-19 22:07:51 +00:00
<dd><p>Return the ArgumentParser for lorax</p>
</dd></dl>
</div>
<div class="section" id="module-pylorax.creator">
<span id="pylorax-creator-module"></span><h2>pylorax.creator module<a class="headerlink" href="#module-pylorax.creator" title="Permalink to this headline"></a></h2>
<dl class="class">
<dt id="pylorax.creator.FakeDNF">
2020-04-28 17:42:12 +00:00
<em class="property">class </em><code class="sig-prename descclassname">pylorax.creator.</code><code class="sig-name descname">FakeDNF</code><span class="sig-paren">(</span><em class="sig-param">conf</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/creator.html#FakeDNF"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.creator.FakeDNF" title="Permalink to this definition"></a></dt>
2019-12-19 22:07:51 +00:00
<dd><p>Bases: <a class="reference external" href="https://docs.python.org/3/library/functions.html#object" title="(in Python v3.8)"><code class="xref py py-class docutils literal notranslate"><span class="pre">object</span></code></a></p>
<p>A minimal DNF object suitable for passing to RuntimeBuilder</p>
<p>lmc uses RuntimeBuilder to run the arch specific iso creation
templates, so the the installroot config value is the important part of
this. Everything else should be a nop.</p>
<dl class="method">
<dt id="pylorax.creator.FakeDNF.reset">
2020-04-28 17:42:12 +00:00
<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>
2019-12-19 22:07:51 +00:00
<dd></dd></dl>
</dd></dl>
<dl class="function">
<dt id="pylorax.creator.calculate_disk_size">
2020-04-28 17:42:12 +00:00
<code class="sig-prename descclassname">pylorax.creator.</code><code class="sig-name descname">calculate_disk_size</code><span class="sig-paren">(</span><em class="sig-param">opts</em>, <em class="sig-param">ks</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/creator.html#calculate_disk_size"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.creator.calculate_disk_size" title="Permalink to this definition"></a></dt>
2019-12-19 22:07:51 +00:00
<dd><p>Calculate the disk size from the kickstart</p>
2020-04-28 17:42:12 +00:00
<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>
2019-12-19 22:07:51 +00:00
</ul>
2020-04-28 17:42:12 +00:00
</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>
2019-12-19 22:07:51 +00:00
<p>Also takes into account the use of reqpart or reqpart add-boot</p>
</dd></dl>
<dl class="function">
<dt id="pylorax.creator.check_kickstart">
2020-04-28 17:42:12 +00:00
<code class="sig-prename descclassname">pylorax.creator.</code><code class="sig-name descname">check_kickstart</code><span class="sig-paren">(</span><em class="sig-param">ks</em>, <em class="sig-param">opts</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/creator.html#check_kickstart"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.creator.check_kickstart" title="Permalink to this definition"></a></dt>
2019-12-19 22:07:51 +00:00
<dd><p>Check the parsed kickstart object for errors</p>
2020-04-28 17:42:12 +00:00
<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>
2019-12-19 22:07:51 +00:00
</ul>
2020-04-28 17:42:12 +00:00
</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>
2019-12-19 22:07:51 +00:00
</dd></dl>
<dl class="function">
<dt id="pylorax.creator.create_pxe_config">
2020-04-28 17:42:12 +00:00
<code class="sig-prename descclassname">pylorax.creator.</code><code class="sig-name descname">create_pxe_config</code><span class="sig-paren">(</span><em class="sig-param">template</em>, <em class="sig-param">images_dir</em>, <em class="sig-param">live_image_name</em>, <em class="sig-param">add_args=None</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/creator.html#create_pxe_config"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.creator.create_pxe_config" title="Permalink to this definition"></a></dt>
2019-12-19 22:07:51 +00:00
<dd><p>Create template for pxe to live configuration</p>
2020-04-28 17:42:12 +00:00
<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>
2019-12-19 22:07:51 +00:00
</ul>
2020-04-28 17:42:12 +00:00
</dd>
</dl>
2019-12-19 22:07:51 +00:00
</dd></dl>
<dl class="function">
<dt id="pylorax.creator.find_ostree_root">
2020-04-28 17:42:12 +00:00
<code class="sig-prename descclassname">pylorax.creator.</code><code class="sig-name descname">find_ostree_root</code><span class="sig-paren">(</span><em class="sig-param">phys_root</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/creator.html#find_ostree_root"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.creator.find_ostree_root" title="Permalink to this definition"></a></dt>
2019-12-19 22:07:51 +00:00
<dd><p>Find root of ostree deployment</p>
2020-04-28 17:42:12 +00:00
<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>
2019-12-19 22:07:51 +00:00
</dd></dl>
<dl class="function">
<dt id="pylorax.creator.get_arch">
2020-04-28 17:42:12 +00:00
<code class="sig-prename descclassname">pylorax.creator.</code><code class="sig-name descname">get_arch</code><span class="sig-paren">(</span><em class="sig-param">mount_dir</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/creator.html#get_arch"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.creator.get_arch" title="Permalink to this definition"></a></dt>
2019-12-19 22:07:51 +00:00
<dd><p>Get the kernel arch</p>
2020-04-28 17:42:12 +00:00
<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>
2019-12-19 22:07:51 +00:00
</dd></dl>
<dl class="function">
<dt id="pylorax.creator.is_image_mounted">
2020-04-28 17:42:12 +00:00
<code class="sig-prename descclassname">pylorax.creator.</code><code class="sig-name descname">is_image_mounted</code><span class="sig-paren">(</span><em class="sig-param">disk_img</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/creator.html#is_image_mounted"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.creator.is_image_mounted" title="Permalink to this definition"></a></dt>
2019-12-19 22:07:51 +00:00
<dd><p>Check to see if the disk_img is mounted</p>
2020-04-28 17:42:12 +00:00
<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>
2019-12-19 22:07:51 +00:00
</dd></dl>
<dl class="function">
<dt id="pylorax.creator.make_appliance">
2020-04-28 17:42:12 +00:00
<code class="sig-prename descclassname">pylorax.creator.</code><code class="sig-name descname">make_appliance</code><span class="sig-paren">(</span><em class="sig-param">disk_img</em>, <em class="sig-param">name</em>, <em class="sig-param">template</em>, <em class="sig-param">outfile</em>, <em class="sig-param">networks=None</em>, <em class="sig-param">ram=1024</em>, <em class="sig-param">vcpus=1</em>, <em class="sig-param">arch=None</em>, <em class="sig-param">title='Linux'</em>, <em class="sig-param">project='Linux'</em>, <em class="sig-param">releasever='29'</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>
2019-12-19 22:07:51 +00:00
<dd><p>Generate an appliance description file</p>
2020-04-28 17:42:12 +00:00
<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 29</p></li>
2019-12-19 22:07:51 +00:00
</ul>
2020-04-28 17:42:12 +00:00
</dd>
</dl>
2019-12-19 22:07:51 +00:00
</dd></dl>
<dl class="function">
<dt id="pylorax.creator.make_image">
2020-04-28 17:42:12 +00:00
<code class="sig-prename descclassname">pylorax.creator.</code><code class="sig-name descname">make_image</code><span class="sig-paren">(</span><em class="sig-param">opts</em>, <em class="sig-param">ks</em>, <em class="sig-param">cancel_func=None</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/creator.html#make_image"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.creator.make_image" title="Permalink to this definition"></a></dt>
2019-12-19 22:07:51 +00:00
<dd><p>Install to a disk image</p>
2020-04-28 17:42:12 +00:00
<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>
2019-12-19 22:07:51 +00:00
</ul>
2020-04-28 17:42:12 +00:00
</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>
2019-12-19 22:07:51 +00:00
<p>Use qemu+boot.iso or anaconda to install to a disk image.</p>
</dd></dl>
<dl class="function">
<dt id="pylorax.creator.make_live_images">
2020-04-28 17:42:12 +00:00
<code class="sig-prename descclassname">pylorax.creator.</code><code class="sig-name descname">make_live_images</code><span class="sig-paren">(</span><em class="sig-param">opts</em>, <em class="sig-param">work_dir</em>, <em class="sig-param">disk_img</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/creator.html#make_live_images"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.creator.make_live_images" title="Permalink to this definition"></a></dt>
2019-12-19 22:07:51 +00:00
<dd><p>Create live images from direcory or rootfs image</p>
2020-04-28 17:42:12 +00:00
<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>
2019-12-19 22:07:51 +00:00
</ul>
2020-04-28 17:42:12 +00:00
</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>
2019-12-19 22:07:51 +00:00
<p>fsck.ext4 is run on the rootfs_image to make sure there are no errors and to zero
out any deleted blocks to make it compress better. If this fails for any reason
it will return None and log the error.</p>
</dd></dl>
<dl class="function">
<dt id="pylorax.creator.make_livecd">
2020-04-28 17:42:12 +00:00
<code class="sig-prename descclassname">pylorax.creator.</code><code class="sig-name descname">make_livecd</code><span class="sig-paren">(</span><em class="sig-param">opts</em>, <em class="sig-param">mount_dir</em>, <em class="sig-param">work_dir</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/creator.html#make_livecd"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.creator.make_livecd" title="Permalink to this definition"></a></dt>
2019-12-19 22:07:51 +00:00
<dd><p>Take the content from the disk image and make a livecd out of it</p>
2020-04-28 17:42:12 +00:00
<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>
2019-12-19 22:07:51 +00:00
</ul>
2020-04-28 17:42:12 +00:00
</dd>
</dl>
<dl class="simple">
<dt>This uses wwoods squashfs live initramfs method:</dt><dd><ul class="simple">
<li><p>put the real / into LiveOS/rootfs.img</p></li>
<li><p>make a squashfs of the LiveOS/rootfs.img tree</p></li>
<li><p>This is loaded by dracut when the cmdline is passed to the kernel:
root=live:CDLABEL=&lt;volid&gt; rd.live.image</p></li>
2019-12-19 22:07:51 +00:00
</ul>
</dd>
</dl>
</dd></dl>
<dl class="function">
<dt id="pylorax.creator.make_runtime">
2020-04-28 17:42:12 +00:00
<code class="sig-prename descclassname">pylorax.creator.</code><code class="sig-name descname">make_runtime</code><span class="sig-paren">(</span><em class="sig-param">opts</em>, <em class="sig-param">mount_dir</em>, <em class="sig-param">work_dir</em>, <em class="sig-param">size=None</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/creator.html#make_runtime"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.creator.make_runtime" title="Permalink to this definition"></a></dt>
2019-12-19 22:07:51 +00:00
<dd><p>Make the squashfs image from a directory</p>
2020-04-28 17:42:12 +00:00
<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>
2019-12-19 22:07:51 +00:00
</ul>
2020-04-28 17:42:12 +00:00
</dd>
</dl>
2019-12-19 22:07:51 +00:00
</dd></dl>
<dl class="function">
<dt id="pylorax.creator.make_squashfs">
2020-04-28 17:42:12 +00:00
<code class="sig-prename descclassname">pylorax.creator.</code><code class="sig-name descname">make_squashfs</code><span class="sig-paren">(</span><em class="sig-param">opts</em>, <em class="sig-param">disk_img</em>, <em class="sig-param">work_dir</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/creator.html#make_squashfs"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.creator.make_squashfs" title="Permalink to this definition"></a></dt>
2019-12-19 22:07:51 +00:00
<dd><p>Create a squashfs image of an unpartitioned filesystem disk image</p>
2020-04-28 17:42:12 +00:00
<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>) Path to the unpartitioned filesystem disk image</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>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 to use</p></li>
2019-12-19 22:07:51 +00:00
</ul>
2020-04-28 17:42:12 +00:00
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>True if squashfs creation was successful. False if there was an error.</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#bool" title="(in Python v3.8)">bool</a></p>
</dd>
</dl>
2019-12-19 22:07:51 +00:00
<p>Take disk_img and put it into LiveOS/rootfs.img and squashfs this
tree into work_dir+images/install.img</p>
<p>fsck.ext4 is run on the disk 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 False and log the error.</p>
</dd></dl>
<dl class="function">
<dt id="pylorax.creator.mount_boot_part_over_root">
2020-04-28 17:42:12 +00:00
<code class="sig-prename descclassname">pylorax.creator.</code><code class="sig-name descname">mount_boot_part_over_root</code><span class="sig-paren">(</span><em class="sig-param">img_mount</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/creator.html#mount_boot_part_over_root"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.creator.mount_boot_part_over_root" title="Permalink to this definition"></a></dt>
2019-12-19 22:07:51 +00:00
<dd><p>Mount boot partition to /boot of root fs mounted in img_mount</p>
<p>Used for OSTree so it finds deployment configurations on live rootfs</p>
<p>param img_mount: object with mounted disk image root partition
type img_mount: imgutils.PartitionMount</p>
</dd></dl>
<dl class="function">
<dt id="pylorax.creator.rebuild_initrds_for_live">
2020-04-28 17:42:12 +00:00
<code class="sig-prename descclassname">pylorax.creator.</code><code class="sig-name descname">rebuild_initrds_for_live</code><span class="sig-paren">(</span><em class="sig-param">opts</em>, <em class="sig-param">sys_root_dir</em>, <em class="sig-param">results_dir</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/creator.html#rebuild_initrds_for_live"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.creator.rebuild_initrds_for_live" title="Permalink to this definition"></a></dt>
2019-12-19 22:07:51 +00:00
<dd><p>Rebuild intrds for pxe live image (root=live:<a class="reference external" href="http://">http://</a>)</p>
2020-04-28 17:42:12 +00:00
<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>
2019-12-19 22:07:51 +00:00
</ul>
2020-04-28 17:42:12 +00:00
</dd>
</dl>
2019-12-19 22:07:51 +00:00
</dd></dl>
<dl class="function">
<dt id="pylorax.creator.run_creator">
2020-04-28 17:42:12 +00:00
<code class="sig-prename descclassname">pylorax.creator.</code><code class="sig-name descname">run_creator</code><span class="sig-paren">(</span><em class="sig-param">opts</em>, <em class="sig-param">cancel_func=None</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/creator.html#run_creator"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.creator.run_creator" title="Permalink to this definition"></a></dt>
2019-12-19 22:07:51 +00:00
<dd><p>Run the image creator process</p>
2020-04-28 17:42:12 +00:00
<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>
2019-12-19 22:07:51 +00:00
</ul>
2020-04-28 17:42:12 +00:00
</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>
2019-12-19 22:07:51 +00:00
<p>This function takes the opts arguments and creates the selected output image.
See the cmdline help for livemedia-creator for the possible options</p>
<p>(Yes, this is not ideal, but we can fix that later)</p>
</dd></dl>
<dl class="function">
<dt id="pylorax.creator.squashfs_args">
2020-04-28 17:42:12 +00:00
<code class="sig-prename descclassname">pylorax.creator.</code><code class="sig-name descname">squashfs_args</code><span class="sig-paren">(</span><em class="sig-param">opts</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/creator.html#squashfs_args"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.creator.squashfs_args" title="Permalink to this definition"></a></dt>
2019-12-19 22:07:51 +00:00
<dd><p>Returns the compression type and args to use when making squashfs</p>
2020-04-28 17:42:12 +00:00
<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>
2019-12-19 22:07:51 +00:00
</dd></dl>
</div>
<div class="section" id="module-pylorax.decorators">
<span id="pylorax-decorators-module"></span><h2>pylorax.decorators module<a class="headerlink" href="#module-pylorax.decorators" title="Permalink to this headline"></a></h2>
<dl class="function">
<dt id="pylorax.decorators.singleton">
2020-04-28 17:42:12 +00:00
<code class="sig-prename descclassname">pylorax.decorators.</code><code class="sig-name descname">singleton</code><span class="sig-paren">(</span><em class="sig-param">cls</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/decorators.html#singleton"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.decorators.singleton" title="Permalink to this definition"></a></dt>
2019-12-19 22:07:51 +00:00
<dd></dd></dl>
</div>
<div class="section" id="module-pylorax.discinfo">
<span id="pylorax-discinfo-module"></span><h2>pylorax.discinfo module<a class="headerlink" href="#module-pylorax.discinfo" title="Permalink to this headline"></a></h2>
<dl class="class">
<dt id="pylorax.discinfo.DiscInfo">
2020-04-28 17:42:12 +00:00
<em class="property">class </em><code class="sig-prename descclassname">pylorax.discinfo.</code><code class="sig-name descname">DiscInfo</code><span class="sig-paren">(</span><em class="sig-param">release</em>, <em class="sig-param">basearch</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/discinfo.html#DiscInfo"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.discinfo.DiscInfo" title="Permalink to this definition"></a></dt>
2019-12-19 22:07:51 +00:00
<dd><p>Bases: <a class="reference external" href="https://docs.python.org/3/library/functions.html#object" title="(in Python v3.8)"><code class="xref py py-class docutils literal notranslate"><span class="pre">object</span></code></a></p>
<dl class="method">
<dt id="pylorax.discinfo.DiscInfo.write">
2020-04-28 17:42:12 +00:00
<code class="sig-name descname">write</code><span class="sig-paren">(</span><em class="sig-param">outfile</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/discinfo.html#DiscInfo.write"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.discinfo.DiscInfo.write" title="Permalink to this definition"></a></dt>
2019-12-19 22:07:51 +00:00
<dd></dd></dl>
</dd></dl>
2020-04-28 17:42:12 +00:00
</div>
<div class="section" id="module-pylorax.dnfbase">
<span id="pylorax-dnfbase-module"></span><h2>pylorax.dnfbase module<a class="headerlink" href="#module-pylorax.dnfbase" title="Permalink to this headline"></a></h2>
<dl class="function">
<dt id="pylorax.dnfbase.get_dnf_base_object">
<code class="sig-prename descclassname">pylorax.dnfbase.</code><code class="sig-name descname">get_dnf_base_object</code><span class="sig-paren">(</span><em class="sig-param">installroot</em>, <em class="sig-param">sources</em>, <em class="sig-param">mirrorlists=None</em>, <em class="sig-param">repos=None</em>, <em class="sig-param">enablerepos=None</em>, <em class="sig-param">disablerepos=None</em>, <em class="sig-param">tempdir='/var/tmp'</em>, <em class="sig-param">proxy=None</em>, <em class="sig-param">releasever='8'</em>, <em class="sig-param">cachedir=None</em>, <em class="sig-param">logdir=None</em>, <em class="sig-param">sslverify=True</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>
2019-12-19 22:07:51 +00:00
</div>
<div class="section" id="module-pylorax.dnfhelper">
<span id="pylorax-dnfhelper-module"></span><h2>pylorax.dnfhelper module<a class="headerlink" href="#module-pylorax.dnfhelper" title="Permalink to this headline"></a></h2>
<dl class="class">
<dt id="pylorax.dnfhelper.LoraxDownloadCallback">
2020-04-28 17:42:12 +00:00
<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>
2019-12-19 22:07:51 +00:00
<dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">DownloadProgress</span></code></p>
<dl class="method">
<dt id="pylorax.dnfhelper.LoraxDownloadCallback.end">
2020-04-28 17:42:12 +00:00
<code class="sig-name descname">end</code><span class="sig-paren">(</span><em class="sig-param">payload</em>, <em class="sig-param">status</em>, <em class="sig-param">msg</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/dnfhelper.html#LoraxDownloadCallback.end"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.dnfhelper.LoraxDownloadCallback.end" title="Permalink to this definition"></a></dt>
2019-12-19 22:07:51 +00:00
<dd></dd></dl>
<dl class="method">
<dt id="pylorax.dnfhelper.LoraxDownloadCallback.progress">
2020-04-28 17:42:12 +00:00
<code class="sig-name descname">progress</code><span class="sig-paren">(</span><em class="sig-param">payload</em>, <em class="sig-param">done</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/dnfhelper.html#LoraxDownloadCallback.progress"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.dnfhelper.LoraxDownloadCallback.progress" title="Permalink to this definition"></a></dt>
2019-12-19 22:07:51 +00:00
<dd></dd></dl>
<dl class="method">
<dt id="pylorax.dnfhelper.LoraxDownloadCallback.start">
2020-04-28 17:42:12 +00:00
<code class="sig-name descname">start</code><span class="sig-paren">(</span><em class="sig-param">total_files</em>, <em class="sig-param">total_size</em>, <em class="sig-param">total_drpms=0</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/dnfhelper.html#LoraxDownloadCallback.start"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.dnfhelper.LoraxDownloadCallback.start" title="Permalink to this definition"></a></dt>
2019-12-19 22:07:51 +00:00
<dd></dd></dl>
</dd></dl>
<dl class="class">
<dt id="pylorax.dnfhelper.LoraxRpmCallback">
2020-04-28 17:42:12 +00:00
<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>
2019-12-19 22:07:51 +00:00
<dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">TransactionProgress</span></code></p>
<dl class="method">
<dt id="pylorax.dnfhelper.LoraxRpmCallback.error">
2020-04-28 17:42:12 +00:00
<code class="sig-name descname">error</code><span class="sig-paren">(</span><em class="sig-param">message</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/dnfhelper.html#LoraxRpmCallback.error"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.dnfhelper.LoraxRpmCallback.error" title="Permalink to this definition"></a></dt>
2019-12-19 22:07:51 +00:00
<dd></dd></dl>
<dl class="method">
<dt id="pylorax.dnfhelper.LoraxRpmCallback.progress">
2020-04-28 17:42:12 +00:00
<code class="sig-name descname">progress</code><span class="sig-paren">(</span><em class="sig-param">package</em>, <em class="sig-param">action</em>, <em class="sig-param">ti_done</em>, <em class="sig-param">ti_total</em>, <em class="sig-param">ts_done</em>, <em class="sig-param">ts_total</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/dnfhelper.html#LoraxRpmCallback.progress"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.dnfhelper.LoraxRpmCallback.progress" title="Permalink to this definition"></a></dt>
2019-12-19 22:07:51 +00:00
<dd></dd></dl>
</dd></dl>
</div>
<div class="section" id="module-pylorax.executils">
<span id="pylorax-executils-module"></span><h2>pylorax.executils module<a class="headerlink" href="#module-pylorax.executils" title="Permalink to this headline"></a></h2>
<dl class="class">
<dt id="pylorax.executils.ExecProduct">
2020-04-28 17:42:12 +00:00
<em class="property">class </em><code class="sig-prename descclassname">pylorax.executils.</code><code class="sig-name descname">ExecProduct</code><span class="sig-paren">(</span><em class="sig-param">rc</em>, <em class="sig-param">stdout</em>, <em class="sig-param">stderr</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/executils.html#ExecProduct"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.executils.ExecProduct" title="Permalink to this definition"></a></dt>
2019-12-19 22:07:51 +00:00
<dd><p>Bases: <a class="reference external" href="https://docs.python.org/3/library/functions.html#object" title="(in Python v3.8)"><code class="xref py py-class docutils literal notranslate"><span class="pre">object</span></code></a></p>
</dd></dl>
<dl class="function">
<dt id="pylorax.executils.augmentEnv">
2020-04-28 17:42:12 +00:00
<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>
2019-12-19 22:07:51 +00:00
<dd></dd></dl>
<dl class="function">
<dt id="pylorax.executils.execReadlines">
2020-04-28 17:42:12 +00:00
<code class="sig-prename descclassname">pylorax.executils.</code><code class="sig-name descname">execReadlines</code><span class="sig-paren">(</span><em class="sig-param">command</em>, <em class="sig-param">argv</em>, <em class="sig-param">stdin=None</em>, <em class="sig-param">root='/'</em>, <em class="sig-param">env_prune=None</em>, <em class="sig-param">filter_stderr=False</em>, <em class="sig-param">callback=&lt;function &lt;lambda&gt;&gt;</em>, <em class="sig-param">env_add=None</em>, <em class="sig-param">reset_handlers=True</em>, <em class="sig-param">reset_lang=True</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/executils.html#execReadlines"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.executils.execReadlines" title="Permalink to this definition"></a></dt>
2019-12-19 22:07:51 +00:00
<dd><p>Execute an external command and return the line output of the command
in real-time.</p>
<p>This method assumes that there is a reasonably low delay between the
end of output and the process exiting. If the child process closes
stdout and then keeps on truckin there will be problems.</p>
2020-04-28 17:42:12 +00:00
<dl class="simple">
<dt>NOTE/WARNING: UnicodeDecodeError will be raised if the output of the</dt><dd><p>external command cant 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>
2019-12-19 22:07:51 +00:00
</ul>
2020-04-28 17:42:12 +00:00
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>Iterator of the lines from the command</p>
</dd>
</dl>
2019-12-19 22:07:51 +00:00
<p>Output from the file is not logged to program.log
This returns an iterator with the lines from the command until it has finished</p>
</dd></dl>
<dl class="function">
<dt id="pylorax.executils.execWithCapture">
2020-04-28 17:42:12 +00:00
<code class="sig-prename descclassname">pylorax.executils.</code><code class="sig-name descname">execWithCapture</code><span class="sig-paren">(</span><em class="sig-param">command</em>, <em class="sig-param">argv</em>, <em class="sig-param">stdin=None</em>, <em class="sig-param">root='/'</em>, <em class="sig-param">log_output=True</em>, <em class="sig-param">filter_stderr=False</em>, <em class="sig-param">raise_err=False</em>, <em class="sig-param">callback=None</em>, <em class="sig-param">env_add=None</em>, <em class="sig-param">reset_handlers=True</em>, <em class="sig-param">reset_lang=True</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/executils.html#execWithCapture"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.executils.execWithCapture" title="Permalink to this definition"></a></dt>
2019-12-19 22:07:51 +00:00
<dd><p>Run an external program and capture standard out and err.</p>
2020-04-28 17:42:12 +00:00
<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>
2019-12-19 22:07:51 +00:00
</ul>
2020-04-28 17:42:12 +00:00
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>The output of the command</p>
</dd>
</dl>
2019-12-19 22:07:51 +00:00
</dd></dl>
<dl class="function">
<dt id="pylorax.executils.execWithRedirect">
2020-04-28 17:42:12 +00:00
<code class="sig-prename descclassname">pylorax.executils.</code><code class="sig-name descname">execWithRedirect</code><span class="sig-paren">(</span><em class="sig-param">command</em>, <em class="sig-param">argv</em>, <em class="sig-param">stdin=None</em>, <em class="sig-param">stdout=None</em>, <em class="sig-param">root='/'</em>, <em class="sig-param">env_prune=None</em>, <em class="sig-param">log_output=True</em>, <em class="sig-param">binary_output=False</em>, <em class="sig-param">raise_err=False</em>, <em class="sig-param">callback=None</em>, <em class="sig-param">env_add=None</em>, <em class="sig-param">reset_handlers=True</em>, <em class="sig-param">reset_lang=True</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/executils.html#execWithRedirect"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.executils.execWithRedirect" title="Permalink to this definition"></a></dt>
2019-12-19 22:07:51 +00:00
<dd><p>Run an external program and redirect the output to a file.</p>
2020-04-28 17:42:12 +00:00
<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>
2019-12-19 22:07:51 +00:00
</ul>
2020-04-28 17:42:12 +00:00
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>The return code of the command</p>
</dd>
</dl>
2019-12-19 22:07:51 +00:00
</dd></dl>
<dl class="function">
<dt id="pylorax.executils.runcmd">
2020-04-28 17:42:12 +00:00
<code class="sig-prename descclassname">pylorax.executils.</code><code class="sig-name descname">runcmd</code><span class="sig-paren">(</span><em class="sig-param">cmd</em>, <em class="sig-param">**kwargs</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/executils.html#runcmd"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.executils.runcmd" title="Permalink to this definition"></a></dt>
2019-12-19 22:07:51 +00:00
<dd><p>run execWithRedirect with raise_err=True</p>
</dd></dl>
<dl class="function">
<dt id="pylorax.executils.runcmd_output">
2020-04-28 17:42:12 +00:00
<code class="sig-prename descclassname">pylorax.executils.</code><code class="sig-name descname">runcmd_output</code><span class="sig-paren">(</span><em class="sig-param">cmd</em>, <em class="sig-param">**kwargs</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/executils.html#runcmd_output"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.executils.runcmd_output" title="Permalink to this definition"></a></dt>
2019-12-19 22:07:51 +00:00
<dd><p>run execWithCapture with raise_err=True</p>
</dd></dl>
<dl class="function">
<dt id="pylorax.executils.setenv">
2020-04-28 17:42:12 +00:00
<code class="sig-prename descclassname">pylorax.executils.</code><code class="sig-name descname">setenv</code><span class="sig-paren">(</span><em class="sig-param">name</em>, <em class="sig-param">value</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/executils.html#setenv"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.executils.setenv" title="Permalink to this definition"></a></dt>
2019-12-19 22:07:51 +00:00
<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>
2020-04-28 17:42:12 +00:00
<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>
2019-12-19 22:07:51 +00:00
</ul>
2020-04-28 17:42:12 +00:00
</dd>
</dl>
2019-12-19 22:07:51 +00:00
</dd></dl>
<dl class="function">
<dt id="pylorax.executils.startProgram">
2020-04-28 17:42:12 +00:00
<code class="sig-prename descclassname">pylorax.executils.</code><code class="sig-name descname">startProgram</code><span class="sig-paren">(</span><em class="sig-param">argv</em>, <em class="sig-param">root='/'</em>, <em class="sig-param">stdin=None</em>, <em class="sig-param">stdout=-1</em>, <em class="sig-param">stderr=-2</em>, <em class="sig-param">env_prune=None</em>, <em class="sig-param">env_add=None</em>, <em class="sig-param">reset_handlers=True</em>, <em class="sig-param">reset_lang=True</em>, <em class="sig-param">**kwargs</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/executils.html#startProgram"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.executils.startProgram" title="Permalink to this definition"></a></dt>
2019-12-19 22:07:51 +00:00
<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>
2020-04-28 17:42:12 +00:00
<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>
2019-12-19 22:07:51 +00:00
</ul>
2020-04-28 17:42:12 +00:00
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>A Popen object for the running command.</p>
</dd>
</dl>
2019-12-19 22:07:51 +00:00
</dd></dl>
</div>
<div class="section" id="module-pylorax.imgutils">
<span id="pylorax-imgutils-module"></span><h2>pylorax.imgutils module<a class="headerlink" href="#module-pylorax.imgutils" title="Permalink to this headline"></a></h2>
<dl class="class">
<dt id="pylorax.imgutils.DMDev">
2020-04-28 17:42:12 +00:00
<em class="property">class </em><code class="sig-prename descclassname">pylorax.imgutils.</code><code class="sig-name descname">DMDev</code><span class="sig-paren">(</span><em class="sig-param">dev</em>, <em class="sig-param">size</em>, <em class="sig-param">name=None</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/imgutils.html#DMDev"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.imgutils.DMDev" title="Permalink to this definition"></a></dt>
2019-12-19 22:07:51 +00:00
<dd><p>Bases: <a class="reference external" href="https://docs.python.org/3/library/functions.html#object" title="(in Python v3.8)"><code class="xref py py-class docutils literal notranslate"><span class="pre">object</span></code></a></p>
</dd></dl>
<dl class="class">
<dt id="pylorax.imgutils.LoopDev">
2020-04-28 17:42:12 +00:00
<em class="property">class </em><code class="sig-prename descclassname">pylorax.imgutils.</code><code class="sig-name descname">LoopDev</code><span class="sig-paren">(</span><em class="sig-param">filename</em>, <em class="sig-param">size=None</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/imgutils.html#LoopDev"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.imgutils.LoopDev" title="Permalink to this definition"></a></dt>
2019-12-19 22:07:51 +00:00
<dd><p>Bases: <a class="reference external" href="https://docs.python.org/3/library/functions.html#object" title="(in Python v3.8)"><code class="xref py py-class docutils literal notranslate"><span class="pre">object</span></code></a></p>
</dd></dl>
<dl class="class">
<dt id="pylorax.imgutils.Mount">
2020-04-28 17:42:12 +00:00
<em class="property">class </em><code class="sig-prename descclassname">pylorax.imgutils.</code><code class="sig-name descname">Mount</code><span class="sig-paren">(</span><em class="sig-param">dev</em>, <em class="sig-param">opts=''</em>, <em class="sig-param">mnt=None</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/imgutils.html#Mount"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.imgutils.Mount" title="Permalink to this definition"></a></dt>
2019-12-19 22:07:51 +00:00
<dd><p>Bases: <a class="reference external" href="https://docs.python.org/3/library/functions.html#object" title="(in Python v3.8)"><code class="xref py py-class docutils literal notranslate"><span class="pre">object</span></code></a></p>
</dd></dl>
<dl class="class">
<dt id="pylorax.imgutils.PartitionMount">
2020-04-28 17:42:12 +00:00
<em class="property">class </em><code class="sig-prename descclassname">pylorax.imgutils.</code><code class="sig-name descname">PartitionMount</code><span class="sig-paren">(</span><em class="sig-param">disk_img</em>, <em class="sig-param">mount_ok=None</em>, <em class="sig-param">submount=None</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/imgutils.html#PartitionMount"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.imgutils.PartitionMount" title="Permalink to this definition"></a></dt>
2019-12-19 22:07:51 +00:00
<dd><p>Bases: <a class="reference external" href="https://docs.python.org/3/library/functions.html#object" title="(in Python v3.8)"><code class="xref py py-class docutils literal notranslate"><span class="pre">object</span></code></a></p>
<p>Mount a partitioned image file using kpartx</p>
</dd></dl>
<dl class="function">
<dt id="pylorax.imgutils.compress">
2020-04-28 17:42:12 +00:00
<code class="sig-prename descclassname">pylorax.imgutils.</code><code class="sig-name descname">compress</code><span class="sig-paren">(</span><em class="sig-param">command</em>, <em class="sig-param">root</em>, <em class="sig-param">outfile</em>, <em class="sig-param">compression='xz'</em>, <em class="sig-param">compressargs=None</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/imgutils.html#compress"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.imgutils.compress" title="Permalink to this definition"></a></dt>
2019-12-19 22:07:51 +00:00
<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="function">
<dt id="pylorax.imgutils.copytree">
2020-04-28 17:42:12 +00:00
<code class="sig-prename descclassname">pylorax.imgutils.</code><code class="sig-name descname">copytree</code><span class="sig-paren">(</span><em class="sig-param">src</em>, <em class="sig-param">dest</em>, <em class="sig-param">preserve=True</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/imgutils.html#copytree"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.imgutils.copytree" title="Permalink to this definition"></a></dt>
2019-12-19 22:07:51 +00:00
<dd><p>Copy a tree of files using cp -a, thus preserving modes, timestamps,
links, acls, sparse files, xattrs, selinux contexts, etc.
If preserve is False, uses cp -R (useful for modeless filesystems)
raises CalledProcessError if copy fails.</p>
</dd></dl>
<dl class="function">
<dt id="pylorax.imgutils.default_image_name">
2020-04-28 17:42:12 +00:00
<code class="sig-prename descclassname">pylorax.imgutils.</code><code class="sig-name descname">default_image_name</code><span class="sig-paren">(</span><em class="sig-param">compression</em>, <em class="sig-param">basename</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/imgutils.html#default_image_name"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.imgutils.default_image_name" title="Permalink to this definition"></a></dt>
2019-12-19 22:07:51 +00:00
<dd><p>Return a default image name with the correct suffix for the compression type.</p>
2020-04-28 17:42:12 +00:00
<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>
2019-12-19 22:07:51 +00:00
</ul>
2020-04-28 17:42:12 +00:00
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>basename with compression suffix</p>
</dd>
</dl>
2019-12-19 22:07:51 +00:00
<p>If the compression is unknown it defaults to xz</p>
</dd></dl>
<dl class="function">
<dt id="pylorax.imgutils.dm_attach">
2020-04-28 17:42:12 +00:00
<code class="sig-prename descclassname">pylorax.imgutils.</code><code class="sig-name descname">dm_attach</code><span class="sig-paren">(</span><em class="sig-param">dev</em>, <em class="sig-param">size</em>, <em class="sig-param">name=None</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/imgutils.html#dm_attach"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.imgutils.dm_attach" title="Permalink to this definition"></a></dt>
2019-12-19 22:07:51 +00:00
<dd><p>Attach a devicemapper device to the given device, with the given size.
If name is None, a random name will be chosen. Returns the device name.
raises CalledProcessError if dmsetup fails.</p>
</dd></dl>
<dl class="function">
<dt id="pylorax.imgutils.dm_detach">
2020-04-28 17:42:12 +00:00
<code class="sig-prename descclassname">pylorax.imgutils.</code><code class="sig-name descname">dm_detach</code><span class="sig-paren">(</span><em class="sig-param">dev</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/imgutils.html#dm_detach"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.imgutils.dm_detach" title="Permalink to this definition"></a></dt>
2019-12-19 22:07:51 +00:00
<dd><p>Detach the named devicemapper device. Returns False if dmsetup fails.</p>
</dd></dl>
<dl class="function">
<dt id="pylorax.imgutils.do_grafts">
2020-04-28 17:42:12 +00:00
<code class="sig-prename descclassname">pylorax.imgutils.</code><code class="sig-name descname">do_grafts</code><span class="sig-paren">(</span><em class="sig-param">grafts</em>, <em class="sig-param">dest</em>, <em class="sig-param">preserve=True</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/imgutils.html#do_grafts"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.imgutils.do_grafts" title="Permalink to this definition"></a></dt>
2019-12-19 22:07:51 +00:00
<dd><p>Copy each of the items listed in grafts into dest.
If the key ends with / its assumed to be a directory which should be
created, otherwise just the leading directories will be created.</p>
</dd></dl>
<dl class="function">
<dt id="pylorax.imgutils.estimate_size">
2020-04-28 17:42:12 +00:00
<code class="sig-prename descclassname">pylorax.imgutils.</code><code class="sig-name descname">estimate_size</code><span class="sig-paren">(</span><em class="sig-param">rootdir</em>, <em class="sig-param">graft=None</em>, <em class="sig-param">fstype=None</em>, <em class="sig-param">blocksize=4096</em>, <em class="sig-param">overhead=256</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/imgutils.html#estimate_size"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.imgutils.estimate_size" title="Permalink to this definition"></a></dt>
2019-12-19 22:07:51 +00:00
<dd></dd></dl>
<dl class="function">
<dt id="pylorax.imgutils.get_loop_name">
2020-04-28 17:42:12 +00:00
<code class="sig-prename descclassname">pylorax.imgutils.</code><code class="sig-name descname">get_loop_name</code><span class="sig-paren">(</span><em class="sig-param">path</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/imgutils.html#get_loop_name"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.imgutils.get_loop_name" title="Permalink to this definition"></a></dt>
2019-12-19 22:07:51 +00:00
<dd><p>Return the loop device associated with the path.
Raises RuntimeError if more than one loop is associated</p>
</dd></dl>
<dl class="function">
<dt id="pylorax.imgutils.loop_attach">
2020-04-28 17:42:12 +00:00
<code class="sig-prename descclassname">pylorax.imgutils.</code><code class="sig-name descname">loop_attach</code><span class="sig-paren">(</span><em class="sig-param">outfile</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/imgutils.html#loop_attach"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.imgutils.loop_attach" title="Permalink to this definition"></a></dt>
2019-12-19 22:07:51 +00:00
<dd><p>Attach a loop device to the given file. Return the loop device name.
Raises CalledProcessError if losetup fails.</p>
</dd></dl>
<dl class="function">
<dt id="pylorax.imgutils.loop_detach">
2020-04-28 17:42:12 +00:00
<code class="sig-prename descclassname">pylorax.imgutils.</code><code class="sig-name descname">loop_detach</code><span class="sig-paren">(</span><em class="sig-param">loopdev</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/imgutils.html#loop_detach"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.imgutils.loop_detach" title="Permalink to this definition"></a></dt>
2019-12-19 22:07:51 +00:00
<dd><p>Detach the given loop device. Return False on failure.</p>
</dd></dl>
<dl class="function">
<dt id="pylorax.imgutils.loop_waitfor">
2020-04-28 17:42:12 +00:00
<code class="sig-prename descclassname">pylorax.imgutils.</code><code class="sig-name descname">loop_waitfor</code><span class="sig-paren">(</span><em class="sig-param">loop_dev</em>, <em class="sig-param">outfile</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/imgutils.html#loop_waitfor"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.imgutils.loop_waitfor" title="Permalink to this definition"></a></dt>
2019-12-19 22:07:51 +00:00
<dd><p>Make sure the loop device is attached to the outfile.</p>
<p>It seems that on rare occasions losetup can return before the /dev/loopX is
ready for use, causing problems with mkfs. This tries to make sure that the
loop device really is associated with the backing file before continuing.</p>
<p>Raise RuntimeError if it isnt setup after 5 tries.</p>
</dd></dl>
<dl class="function">
<dt id="pylorax.imgutils.mkbtrfsimg">
2020-04-28 17:42:12 +00:00
<code class="sig-prename descclassname">pylorax.imgutils.</code><code class="sig-name descname">mkbtrfsimg</code><span class="sig-paren">(</span><em class="sig-param">rootdir</em>, <em class="sig-param">outfile</em>, <em class="sig-param">size=None</em>, <em class="sig-param">label=''</em>, <em class="sig-param">mountargs=''</em>, <em class="sig-param">graft=None</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/imgutils.html#mkbtrfsimg"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.imgutils.mkbtrfsimg" title="Permalink to this definition"></a></dt>
2019-12-19 22:07:51 +00:00
<dd></dd></dl>
<dl class="function">
<dt id="pylorax.imgutils.mkcpio">
2020-04-28 17:42:12 +00:00
<code class="sig-prename descclassname">pylorax.imgutils.</code><code class="sig-name descname">mkcpio</code><span class="sig-paren">(</span><em class="sig-param">root</em>, <em class="sig-param">outfile</em>, <em class="sig-param">compression='xz'</em>, <em class="sig-param">compressargs=None</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/imgutils.html#mkcpio"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.imgutils.mkcpio" title="Permalink to this definition"></a></dt>
2019-12-19 22:07:51 +00:00
<dd></dd></dl>
<dl class="function">
<dt id="pylorax.imgutils.mkdosimg">
2020-04-28 17:42:12 +00:00
<code class="sig-prename descclassname">pylorax.imgutils.</code><code class="sig-name descname">mkdosimg</code><span class="sig-paren">(</span><em class="sig-param">rootdir</em>, <em class="sig-param">outfile</em>, <em class="sig-param">size=None</em>, <em class="sig-param">label=''</em>, <em class="sig-param">mountargs='shortname=winnt</em>, <em class="sig-param">umask=0077'</em>, <em class="sig-param">graft=None</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/imgutils.html#mkdosimg"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.imgutils.mkdosimg" title="Permalink to this definition"></a></dt>
2019-12-19 22:07:51 +00:00
<dd></dd></dl>
<dl class="function">
<dt id="pylorax.imgutils.mkext4img">
2020-04-28 17:42:12 +00:00
<code class="sig-prename descclassname">pylorax.imgutils.</code><code class="sig-name descname">mkext4img</code><span class="sig-paren">(</span><em class="sig-param">rootdir</em>, <em class="sig-param">outfile</em>, <em class="sig-param">size=None</em>, <em class="sig-param">label=''</em>, <em class="sig-param">mountargs=''</em>, <em class="sig-param">graft=None</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/imgutils.html#mkext4img"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.imgutils.mkext4img" title="Permalink to this definition"></a></dt>
2019-12-19 22:07:51 +00:00
<dd></dd></dl>
<dl class="function">
<dt id="pylorax.imgutils.mkfsimage">
2020-04-28 17:42:12 +00:00
<code class="sig-prename descclassname">pylorax.imgutils.</code><code class="sig-name descname">mkfsimage</code><span class="sig-paren">(</span><em class="sig-param">fstype</em>, <em class="sig-param">rootdir</em>, <em class="sig-param">outfile</em>, <em class="sig-param">size=None</em>, <em class="sig-param">mkfsargs=None</em>, <em class="sig-param">mountargs=''</em>, <em class="sig-param">graft=None</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/imgutils.html#mkfsimage"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.imgutils.mkfsimage" title="Permalink to this definition"></a></dt>
2019-12-19 22:07:51 +00:00
<dd><p>Generic filesystem image creation function.
fstype should be a filesystem type - “mkfs.${fstype}” must exist.
graft should be a dict: {“some/path/in/image”: “local/file/or/dir”};</p>
<blockquote>
2020-04-28 17:42:12 +00:00
<div><p>if the path ends with a / its assumed to be a directory.</p>
</div></blockquote>
2019-12-19 22:07:51 +00:00
<p>Will raise CalledProcessError if something goes wrong.</p>
</dd></dl>
<dl class="function">
<dt id="pylorax.imgutils.mkfsimage_from_disk">
2020-04-28 17:42:12 +00:00
<code class="sig-prename descclassname">pylorax.imgutils.</code><code class="sig-name descname">mkfsimage_from_disk</code><span class="sig-paren">(</span><em class="sig-param">diskimage</em>, <em class="sig-param">fsimage</em>, <em class="sig-param">img_size=None</em>, <em class="sig-param">label='Anaconda'</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/imgutils.html#mkfsimage_from_disk"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.imgutils.mkfsimage_from_disk" title="Permalink to this definition"></a></dt>
2019-12-19 22:07:51 +00:00
<dd><p>Copy the / partition of a partitioned disk image to an un-partitioned
disk image.</p>
2020-04-28 17:42:12 +00:00
<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>
2019-12-19 22:07:51 +00:00
</ul>
2020-04-28 17:42:12 +00:00
</dd>
</dl>
2019-12-19 22:07:51 +00:00
</dd></dl>
<dl class="function">
<dt id="pylorax.imgutils.mkhfsimg">
2020-04-28 17:42:12 +00:00
<code class="sig-prename descclassname">pylorax.imgutils.</code><code class="sig-name descname">mkhfsimg</code><span class="sig-paren">(</span><em class="sig-param">rootdir</em>, <em class="sig-param">outfile</em>, <em class="sig-param">size=None</em>, <em class="sig-param">label=''</em>, <em class="sig-param">mountargs=''</em>, <em class="sig-param">graft=None</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/imgutils.html#mkhfsimg"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.imgutils.mkhfsimg" title="Permalink to this definition"></a></dt>
2019-12-19 22:07:51 +00:00
<dd></dd></dl>
<dl class="function">
<dt id="pylorax.imgutils.mkqcow2">
2020-04-28 17:42:12 +00:00
<code class="sig-prename descclassname">pylorax.imgutils.</code><code class="sig-name descname">mkqcow2</code><span class="sig-paren">(</span><em class="sig-param">outfile</em>, <em class="sig-param">size</em>, <em class="sig-param">options=None</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/imgutils.html#mkqcow2"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.imgutils.mkqcow2" title="Permalink to this definition"></a></dt>
2019-12-19 22:07:51 +00:00
<dd><p>use qemu-img to create a file of the given size.
options is a list of options passed to qemu-img</p>
<p>Default format is qcow2, override by passing “-f”, fmt
in options.</p>
</dd></dl>
<dl class="function">
<dt id="pylorax.imgutils.mkqemu_img">
2020-04-28 17:42:12 +00:00
<code class="sig-prename descclassname">pylorax.imgutils.</code><code class="sig-name descname">mkqemu_img</code><span class="sig-paren">(</span><em class="sig-param">outfile</em>, <em class="sig-param">size</em>, <em class="sig-param">options=None</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/imgutils.html#mkqemu_img"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.imgutils.mkqemu_img" title="Permalink to this definition"></a></dt>
2019-12-19 22:07:51 +00:00
<dd><p>use qemu-img to create a file of the given size.
options is a list of options passed to qemu-img</p>
<p>Default format is qcow2, override by passing “-f”, fmt
in options.</p>
</dd></dl>
<dl class="function">
<dt id="pylorax.imgutils.mkrootfsimg">
2020-04-28 17:42:12 +00:00
<code class="sig-prename descclassname">pylorax.imgutils.</code><code class="sig-name descname">mkrootfsimg</code><span class="sig-paren">(</span><em class="sig-param">rootdir</em>, <em class="sig-param">outfile</em>, <em class="sig-param">label</em>, <em class="sig-param">size=2</em>, <em class="sig-param">sysroot=''</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/imgutils.html#mkrootfsimg"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.imgutils.mkrootfsimg" title="Permalink to this definition"></a></dt>
2019-12-19 22:07:51 +00:00
<dd><p>Make rootfs image from a directory</p>
2020-04-28 17:42:12 +00:00
<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>
2019-12-19 22:07:51 +00:00
</ul>
2020-04-28 17:42:12 +00:00
</dd>
</dl>
2019-12-19 22:07:51 +00:00
</dd></dl>
<dl class="function">
<dt id="pylorax.imgutils.mksparse">
2020-04-28 17:42:12 +00:00
<code class="sig-prename descclassname">pylorax.imgutils.</code><code class="sig-name descname">mksparse</code><span class="sig-paren">(</span><em class="sig-param">outfile</em>, <em class="sig-param">size</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/imgutils.html#mksparse"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.imgutils.mksparse" title="Permalink to this definition"></a></dt>
2019-12-19 22:07:51 +00:00
<dd><p>use os.ftruncate to create a sparse file of the given size.</p>
</dd></dl>
<dl class="function">
<dt id="pylorax.imgutils.mksquashfs">
2020-04-28 17:42:12 +00:00
<code class="sig-prename descclassname">pylorax.imgutils.</code><code class="sig-name descname">mksquashfs</code><span class="sig-paren">(</span><em class="sig-param">rootdir</em>, <em class="sig-param">outfile</em>, <em class="sig-param">compression='default'</em>, <em class="sig-param">compressargs=None</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/imgutils.html#mksquashfs"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.imgutils.mksquashfs" title="Permalink to this definition"></a></dt>
2019-12-19 22:07:51 +00:00
<dd><p>Make a squashfs image containing the given rootdir.</p>
</dd></dl>
<dl class="function">
<dt id="pylorax.imgutils.mktar">
2020-04-28 17:42:12 +00:00
<code class="sig-prename descclassname">pylorax.imgutils.</code><code class="sig-name descname">mktar</code><span class="sig-paren">(</span><em class="sig-param">root</em>, <em class="sig-param">outfile</em>, <em class="sig-param">compression='xz'</em>, <em class="sig-param">compressargs=None</em>, <em class="sig-param">selinux=True</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/imgutils.html#mktar"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.imgutils.mktar" title="Permalink to this definition"></a></dt>
2019-12-19 22:07:51 +00:00
<dd></dd></dl>
<dl class="function">
<dt id="pylorax.imgutils.mount">
2020-04-28 17:42:12 +00:00
<code class="sig-prename descclassname">pylorax.imgutils.</code><code class="sig-name descname">mount</code><span class="sig-paren">(</span><em class="sig-param">dev</em>, <em class="sig-param">opts=''</em>, <em class="sig-param">mnt=None</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/imgutils.html#mount"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.imgutils.mount" title="Permalink to this definition"></a></dt>
2019-12-19 22:07:51 +00:00
<dd><p>Mount the given device at the given mountpoint, using the given opts.
opts should be a comma-separated string of mount options.
if mnt is none, a temporary directory will be created and its path will be
returned.
raises CalledProcessError if mount fails.</p>
</dd></dl>
<dl class="function">
<dt id="pylorax.imgutils.round_to_blocks">
2020-04-28 17:42:12 +00:00
<code class="sig-prename descclassname">pylorax.imgutils.</code><code class="sig-name descname">round_to_blocks</code><span class="sig-paren">(</span><em class="sig-param">size</em>, <em class="sig-param">blocksize</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/imgutils.html#round_to_blocks"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.imgutils.round_to_blocks" title="Permalink to this definition"></a></dt>
2019-12-19 22:07:51 +00:00
<dd><p>If size isnt a multiple of blocksize, round up to the next multiple</p>
</dd></dl>
<dl class="function">
<dt id="pylorax.imgutils.umount">
2020-04-28 17:42:12 +00:00
<code class="sig-prename descclassname">pylorax.imgutils.</code><code class="sig-name descname">umount</code><span class="sig-paren">(</span><em class="sig-param">mnt</em>, <em class="sig-param">lazy=False</em>, <em class="sig-param">maxretry=3</em>, <em class="sig-param">retrysleep=1.0</em>, <em class="sig-param">delete=True</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/imgutils.html#umount"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.imgutils.umount" title="Permalink to this definition"></a></dt>
2019-12-19 22:07:51 +00:00
<dd><p>Unmount the given mountpoint. If lazy is True, do a lazy umount (-l).
If the mount was a temporary dir created by mount, it will be deleted.
raises CalledProcessError if umount fails.</p>
</dd></dl>
</div>
<div class="section" id="module-pylorax.installer">
<span id="pylorax-installer-module"></span><h2>pylorax.installer module<a class="headerlink" href="#module-pylorax.installer" title="Permalink to this headline"></a></h2>
<dl class="exception">
<dt id="pylorax.installer.InstallError">
2020-04-28 17:42:12 +00:00
<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>
2019-12-19 22:07:51 +00:00
<dd><p>Bases: <a class="reference external" href="https://docs.python.org/3/library/exceptions.html#Exception" title="(in Python v3.8)"><code class="xref py py-class docutils literal notranslate"><span class="pre">Exception</span></code></a></p>
</dd></dl>
<dl class="class">
<dt id="pylorax.installer.QEMUInstall">
2020-04-28 17:42:12 +00:00
<em class="property">class </em><code class="sig-prename descclassname">pylorax.installer.</code><code class="sig-name descname">QEMUInstall</code><span class="sig-paren">(</span><em class="sig-param">opts</em>, <em class="sig-param">iso</em>, <em class="sig-param">ks_paths</em>, <em class="sig-param">disk_img</em>, <em class="sig-param">img_size=2048</em>, <em class="sig-param">kernel_args=None</em>, <em class="sig-param">memory=1024</em>, <em class="sig-param">vcpus=None</em>, <em class="sig-param">vnc=None</em>, <em class="sig-param">arch=None</em>, <em class="sig-param">cancel_func=None</em>, <em class="sig-param">virtio_host='127.0.0.1'</em>, <em class="sig-param">virtio_port=6080</em>, <em class="sig-param">image_type=None</em>, <em class="sig-param">boot_uefi=False</em>, <em class="sig-param">ovmf_path=None</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/installer.html#QEMUInstall"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.installer.QEMUInstall" title="Permalink to this definition"></a></dt>
2019-12-19 22:07:51 +00:00
<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>
</dd></dl>
<dl class="function">
<dt id="pylorax.installer.anaconda_cleanup">
2020-04-28 17:42:12 +00:00
<code class="sig-prename descclassname">pylorax.installer.</code><code class="sig-name descname">anaconda_cleanup</code><span class="sig-paren">(</span><em class="sig-param">dirinstall_path</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/installer.html#anaconda_cleanup"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.installer.anaconda_cleanup" title="Permalink to this definition"></a></dt>
2019-12-19 22:07:51 +00:00
<dd><p>Cleanup any leftover mounts from anaconda</p>
2020-04-28 17:42:12 +00:00
<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>
2019-12-19 22:07:51 +00:00
<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>
</dd></dl>
<dl class="function">
<dt id="pylorax.installer.append_initrd">
2020-04-28 17:42:12 +00:00
<code class="sig-prename descclassname">pylorax.installer.</code><code class="sig-name descname">append_initrd</code><span class="sig-paren">(</span><em class="sig-param">initrd</em>, <em class="sig-param">files</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/installer.html#append_initrd"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.installer.append_initrd" title="Permalink to this definition"></a></dt>
2019-12-19 22:07:51 +00:00
<dd><p>Append files to an initrd.</p>
2020-04-28 17:42:12 +00:00
<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>
2019-12-19 22:07:51 +00:00
</ul>
2020-04-28 17:42:12 +00:00
</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>
2019-12-19 22:07:51 +00:00
<p>The files are added to the initrd by creating a cpio image
of the files (stored at /) and writing the cpio to the end of a
copy of the initrd.</p>
<p>The initrd is not changed, a copy is made before appending the
cpio archive.</p>
</dd></dl>
<dl class="function">
<dt id="pylorax.installer.create_vagrant_metadata">
2020-04-28 17:42:12 +00:00
<code class="sig-prename descclassname">pylorax.installer.</code><code class="sig-name descname">create_vagrant_metadata</code><span class="sig-paren">(</span><em class="sig-param">path</em>, <em class="sig-param">size=0</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/installer.html#create_vagrant_metadata"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.installer.create_vagrant_metadata" title="Permalink to this definition"></a></dt>
2019-12-19 22:07:51 +00:00
<dd><p>Create a default Vagrant metadata.json file</p>
2020-04-28 17:42:12 +00:00
<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>
2019-12-19 22:07:51 +00:00
</ul>
2020-04-28 17:42:12 +00:00
</dd>
</dl>
2019-12-19 22:07:51 +00:00
</dd></dl>
<dl class="function">
<dt id="pylorax.installer.find_free_port">
2020-04-28 17:42:12 +00:00
<code class="sig-prename descclassname">pylorax.installer.</code><code class="sig-name descname">find_free_port</code><span class="sig-paren">(</span><em class="sig-param">start=5900</em>, <em class="sig-param">end=5999</em>, <em class="sig-param">host='127.0.0.1'</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/installer.html#find_free_port"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.installer.find_free_port" title="Permalink to this definition"></a></dt>
2019-12-19 22:07:51 +00:00
<dd><p>Return first free port in range.</p>
2020-04-28 17:42:12 +00:00
<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>
2019-12-19 22:07:51 +00:00
</ul>
2020-04-28 17:42:12 +00:00
</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>
2019-12-19 22:07:51 +00:00
</dd></dl>
<dl class="function">
<dt id="pylorax.installer.novirt_cancel_check">
2020-04-28 17:42:12 +00:00
<code class="sig-prename descclassname">pylorax.installer.</code><code class="sig-name descname">novirt_cancel_check</code><span class="sig-paren">(</span><em class="sig-param">cancel_funcs</em>, <em class="sig-param">proc</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/installer.html#novirt_cancel_check"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.installer.novirt_cancel_check" title="Permalink to this definition"></a></dt>
2019-12-19 22:07:51 +00:00
<dd><p>Check to see if there has been an error in the logs</p>
2020-04-28 17:42:12 +00:00
<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>
2019-12-19 22:07:51 +00:00
</ul>
2020-04-28 17:42:12 +00:00
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>True if the process has been terminated</p>
</dd>
</dl>
2019-12-19 22:07:51 +00:00
<p>The cancel_funcs functions should return a True if an error has been detected.
When an error is detected the process is terminated and this returns True</p>
</dd></dl>
<dl class="function">
<dt id="pylorax.installer.novirt_install">
2020-04-28 17:42:12 +00:00
<code class="sig-prename descclassname">pylorax.installer.</code><code class="sig-name descname">novirt_install</code><span class="sig-paren">(</span><em class="sig-param">opts</em>, <em class="sig-param">disk_img</em>, <em class="sig-param">disk_size</em>, <em class="sig-param">cancel_func=None</em>, <em class="sig-param">tar_img=None</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/installer.html#novirt_install"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.installer.novirt_install" title="Permalink to this definition"></a></dt>
2019-12-19 22:07:51 +00:00
<dd><p>Use Anaconda to install to a disk image</p>
2020-04-28 17:42:12 +00:00
<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>
2019-12-19 22:07:51 +00:00
</ul>
2020-04-28 17:42:12 +00:00
</dd>
</dl>
2019-12-19 22:07:51 +00:00
<p>This method runs anaconda to create the image and then based on the opts
passed creates a qemu disk image or tarfile.</p>
</dd></dl>
<dl class="function">
<dt id="pylorax.installer.update_vagrant_metadata">
2020-04-28 17:42:12 +00:00
<code class="sig-prename descclassname">pylorax.installer.</code><code class="sig-name descname">update_vagrant_metadata</code><span class="sig-paren">(</span><em class="sig-param">path</em>, <em class="sig-param">size</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/installer.html#update_vagrant_metadata"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.installer.update_vagrant_metadata" title="Permalink to this definition"></a></dt>
2019-12-19 22:07:51 +00:00
<dd><p>Update the Vagrant metadata.json file</p>
2020-04-28 17:42:12 +00:00
<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>
2019-12-19 22:07:51 +00:00
</ul>
2020-04-28 17:42:12 +00:00
</dd>
</dl>
2019-12-19 22:07:51 +00:00
<p>This function makes sure that the provider, format and virtual size of the
metadata file are set correctly. All other values are left untouched.</p>
</dd></dl>
<dl class="function">
<dt id="pylorax.installer.virt_install">
2020-04-28 17:42:12 +00:00
<code class="sig-prename descclassname">pylorax.installer.</code><code class="sig-name descname">virt_install</code><span class="sig-paren">(</span><em class="sig-param">opts</em>, <em class="sig-param">install_log</em>, <em class="sig-param">disk_img</em>, <em class="sig-param">disk_size</em>, <em class="sig-param">cancel_func=None</em>, <em class="sig-param">tar_img=None</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/installer.html#virt_install"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.installer.virt_install" title="Permalink to this definition"></a></dt>
2019-12-19 22:07:51 +00:00
<dd><p>Use qemu to install to a disk image</p>
2020-04-28 17:42:12 +00:00
<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>
2019-12-19 22:07:51 +00:00
</ul>
2020-04-28 17:42:12 +00:00
</dd>
</dl>
2019-12-19 22:07:51 +00:00
<p>This uses qemu with a boot.iso and a kickstart to create a disk
image and then optionally, based on the opts passed, creates tarfile.</p>
</dd></dl>
</div>
<div class="section" id="module-pylorax.ltmpl">
<span id="pylorax-ltmpl-module"></span><h2>pylorax.ltmpl module<a class="headerlink" href="#module-pylorax.ltmpl" title="Permalink to this headline"></a></h2>
<dl class="class">
<dt id="pylorax.ltmpl.LiveTemplateRunner">
2020-04-28 17:42:12 +00:00
<em class="property">class </em><code class="sig-prename descclassname">pylorax.ltmpl.</code><code class="sig-name descname">LiveTemplateRunner</code><span class="sig-paren">(</span><em class="sig-param">dbo</em>, <em class="sig-param">fatalerrors=True</em>, <em class="sig-param">templatedir=None</em>, <em class="sig-param">defaults=None</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/ltmpl.html#LiveTemplateRunner"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.ltmpl.LiveTemplateRunner" title="Permalink to this definition"></a></dt>
2019-12-19 22:07:51 +00:00
<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="method">
<dt id="pylorax.ltmpl.LiveTemplateRunner.installpkg">
2020-04-28 17:42:12 +00:00
<code class="sig-name descname">installpkg</code><span class="sig-paren">(</span><em class="sig-param">*pkgs</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/ltmpl.html#LiveTemplateRunner.installpkg"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.ltmpl.LiveTemplateRunner.installpkg" title="Permalink to this definition"></a></dt>
<dd><dl>
<dt>installpkg [required|optional] [except PKGGLOB [except PKGGLOB …]] PKGGLOB [PKGGLOB …]</dt><dd><p>Request installation of all packages matching the given globs.
2019-12-19 22:07:51 +00:00
Note that this is just a <em>request</em> - nothing is <em>actually</em> installed
until the run_pkg_transaction command is given.</p>
2020-04-28 17:42:12 +00:00
<p>required is now the default. If the PKGGLOB can be missing pass optional</p>
2019-12-19 22:07:51 +00:00
</dd>
</dl>
</dd></dl>
</dd></dl>
<dl class="class">
<dt id="pylorax.ltmpl.LoraxTemplate">
2020-04-28 17:42:12 +00:00
<em class="property">class </em><code class="sig-prename descclassname">pylorax.ltmpl.</code><code class="sig-name descname">LoraxTemplate</code><span class="sig-paren">(</span><em class="sig-param">directories=None</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/ltmpl.html#LoraxTemplate"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.ltmpl.LoraxTemplate" title="Permalink to this definition"></a></dt>
2019-12-19 22:07:51 +00:00
<dd><p>Bases: <a class="reference external" href="https://docs.python.org/3/library/functions.html#object" title="(in Python v3.8)"><code class="xref py py-class docutils literal notranslate"><span class="pre">object</span></code></a></p>
<dl class="method">
<dt id="pylorax.ltmpl.LoraxTemplate.parse">
2020-04-28 17:42:12 +00:00
<code class="sig-name descname">parse</code><span class="sig-paren">(</span><em class="sig-param">template_file</em>, <em class="sig-param">variables</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/ltmpl.html#LoraxTemplate.parse"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.ltmpl.LoraxTemplate.parse" title="Permalink to this definition"></a></dt>
2019-12-19 22:07:51 +00:00
<dd></dd></dl>
</dd></dl>
<dl class="class">
<dt id="pylorax.ltmpl.LoraxTemplateRunner">
2020-04-28 17:42:12 +00:00
<em class="property">class </em><code class="sig-prename descclassname">pylorax.ltmpl.</code><code class="sig-name descname">LoraxTemplateRunner</code><span class="sig-paren">(</span><em class="sig-param">inroot</em>, <em class="sig-param">outroot</em>, <em class="sig-param">dbo=None</em>, <em class="sig-param">fatalerrors=True</em>, <em class="sig-param">templatedir=None</em>, <em class="sig-param">defaults=None</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/ltmpl.html#LoraxTemplateRunner"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.ltmpl.LoraxTemplateRunner" title="Permalink to this definition"></a></dt>
2019-12-19 22:07:51 +00:00
<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">
2020-04-28 17:42:12 +00:00
<li><p>Commands that run external programs (e.g. systemctl) currently use
2019-12-19 22:07:51 +00:00
the <em>host</em>s copy of that program, which may cause problems if theres a
2020-04-28 17:42:12 +00:00
big enough difference between the host and the image youre 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>
2019-12-19 22:07:51 +00:00
</ul>
<p>ADDING NEW COMMANDS:</p>
<ul class="simple">
2020-04-28 17:42:12 +00:00
<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 - dont use sys.exit()</p></li>
2019-12-19 22:07:51 +00:00
</ul>
<dl class="method">
<dt id="pylorax.ltmpl.LoraxTemplateRunner.append">
2020-04-28 17:42:12 +00:00
<code class="sig-name descname">append</code><span class="sig-paren">(</span><em class="sig-param">filename</em>, <em class="sig-param">data</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/ltmpl.html#LoraxTemplateRunner.append"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.ltmpl.LoraxTemplateRunner.append" title="Permalink to this definition"></a></dt>
<dd><dl>
<dt>append FILE STRING</dt><dd><p>Append STRING (followed by a newline character) to FILE.
2019-12-19 22:07:51 +00:00
Python character escape sequences (n, t, etc.) will be
converted to the appropriate characters.</p>
<p>Examples:</p>
2020-04-28 17:42:12 +00:00
<blockquote>
<div><p>append /etc/depmod.d/dd.conf “search updates built-in”
append /etc/resolv.conf “”</p>
</div></blockquote>
2019-12-19 22:07:51 +00:00
</dd>
</dl>
</dd></dl>
<dl class="method">
<dt id="pylorax.ltmpl.LoraxTemplateRunner.chmod">
2020-04-28 17:42:12 +00:00
<code class="sig-name descname">chmod</code><span class="sig-paren">(</span><em class="sig-param">fileglob</em>, <em class="sig-param">mode</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/ltmpl.html#LoraxTemplateRunner.chmod"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.ltmpl.LoraxTemplateRunner.chmod" title="Permalink to this definition"></a></dt>
<dd><dl class="simple">
<dt>chmod FILEGLOB OCTALMODE</dt><dd><p>Change the mode of all the files matching FILEGLOB to OCTALMODE.</p>
</dd>
2019-12-19 22:07:51 +00:00
</dl>
</dd></dl>
<dl class="method">
<dt id="pylorax.ltmpl.LoraxTemplateRunner.copy">
2020-04-28 17:42:12 +00:00
<code class="sig-name descname">copy</code><span class="sig-paren">(</span><em class="sig-param">src</em>, <em class="sig-param">dest</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/ltmpl.html#LoraxTemplateRunner.copy"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.ltmpl.LoraxTemplateRunner.copy" title="Permalink to this definition"></a></dt>
<dd><dl class="simple">
<dt>copy SRC DEST</dt><dd><p>Copy SRC to DEST.
2019-12-19 22:07:51 +00:00
If DEST is a directory, SRC will be copied inside it.
If DEST doesnt exist, SRC will be copied to a file with
2020-04-28 17:42:12 +00:00
that name, if the path leading to it exists.</p>
</dd>
2019-12-19 22:07:51 +00:00
</dl>
</dd></dl>
<dl class="method">
<dt id="pylorax.ltmpl.LoraxTemplateRunner.createaddrsize">
2020-04-28 17:42:12 +00:00
<code class="sig-name descname">createaddrsize</code><span class="sig-paren">(</span><em class="sig-param">addr</em>, <em class="sig-param">src</em>, <em class="sig-param">dest</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/ltmpl.html#LoraxTemplateRunner.createaddrsize"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.ltmpl.LoraxTemplateRunner.createaddrsize" title="Permalink to this definition"></a></dt>
<dd><dl>
<dt>createaddrsize INITRD_ADDRESS INITRD ADDRSIZE</dt><dd><p>Create the initrd.addrsize file required in LPAR boot process.</p>
<dl class="simple">
<dt>Examples:</dt><dd><p>createaddrsize ${INITRD_ADDRESS} ${outroot}/${BOOTDIR}/initrd.img ${outroot}/${BOOTDIR}/initrd.addrsize</p>
</dd>
2019-12-19 22:07:51 +00:00
</dl>
</dd>
</dl>
</dd></dl>
<dl class="method">
<dt id="pylorax.ltmpl.LoraxTemplateRunner.hardlink">
2020-04-28 17:42:12 +00:00
<code class="sig-name descname">hardlink</code><span class="sig-paren">(</span><em class="sig-param">src</em>, <em class="sig-param">dest</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/ltmpl.html#LoraxTemplateRunner.hardlink"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.ltmpl.LoraxTemplateRunner.hardlink" title="Permalink to this definition"></a></dt>
<dd><dl class="simple">
<dt>hardlink SRC DEST</dt><dd><p>Create a hardlink at DEST which is linked to SRC.</p>
</dd>
2019-12-19 22:07:51 +00:00
</dl>
</dd></dl>
<dl class="method">
<dt id="pylorax.ltmpl.LoraxTemplateRunner.install">
2020-04-28 17:42:12 +00:00
<code class="sig-name descname">install</code><span class="sig-paren">(</span><em class="sig-param">srcglob</em>, <em class="sig-param">dest</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/ltmpl.html#LoraxTemplateRunner.install"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.ltmpl.LoraxTemplateRunner.install" title="Permalink to this definition"></a></dt>
<dd><dl>
<dt>install SRC DEST</dt><dd><p>Copy the given file (or files, if a glob is used) from the input
2019-12-19 22:07:51 +00:00
tree to the given destination in the output tree.
The path to DEST must exist in the output tree.
If DEST is a directory, SRC will be copied into that directory.
If DEST doesnt exist, SRC will be copied to a file with that name,
assuming the rest of the path exists.
This is pretty much like how the cp command works.</p>
2020-04-28 17:42:12 +00:00
<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>
2019-12-19 22:07:51 +00:00
</dl>
</dd>
</dl>
</dd></dl>
<dl class="method">
<dt id="pylorax.ltmpl.LoraxTemplateRunner.installimg">
2020-04-28 17:42:12 +00:00
<code class="sig-name descname">installimg</code><span class="sig-paren">(</span><em class="sig-param">*args</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/ltmpl.html#LoraxTemplateRunner.installimg"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.ltmpl.LoraxTemplateRunner.installimg" title="Permalink to this definition"></a></dt>
<dd><dl>
<dt>installimg [xz|gzip|bzip2|lzma] [-ARG|ARG=OPTION] SRCDIR DESTFILE</dt><dd><p>Create a compressed cpio archive of the contents of SRCDIR and place
2019-12-19 22:07:51 +00:00
it in DESTFILE.</p>
<p>If SRCDIR doesnt exist or is empty nothing is created.</p>
2020-04-28 17:42:12 +00:00
<dl class="simple">
<dt>Examples:</dt><dd><p>installimg ${LORAXDIR}/product/ images/product.img
2019-12-19 22:07:51 +00:00
installimg ${LORAXDIR}/updates/ images/updates.img
installimg xz -6 ${LORAXDIR}/updates/ images/updates.img
2020-04-28 17:42:12 +00:00
installimg xz -9 memlimit-compress=3700MiB ${LORAXDIR}/updates/ images/updates.img</p>
</dd>
2019-12-19 22:07:51 +00:00
</dl>
2020-04-28 17:42:12 +00:00
<p>Optionally use a different compression type and override the default args
2019-12-19 22:07:51 +00:00
passed to it. The default is xz -9</p>
</dd>
</dl>
</dd></dl>
<dl class="method">
<dt id="pylorax.ltmpl.LoraxTemplateRunner.installinitrd">
2020-04-28 17:42:12 +00:00
<code class="sig-name descname">installinitrd</code><span class="sig-paren">(</span><em class="sig-param">section</em>, <em class="sig-param">src</em>, <em class="sig-param">dest</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/ltmpl.html#LoraxTemplateRunner.installinitrd"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.ltmpl.LoraxTemplateRunner.installinitrd" title="Permalink to this definition"></a></dt>
<dd><dl class="simple">
<dt>installinitrd SECTION SRC DEST</dt><dd><p>Same as installkernel, but for “initrd”.</p>
</dd>
2019-12-19 22:07:51 +00:00
</dl>
</dd></dl>
<dl class="method">
<dt id="pylorax.ltmpl.LoraxTemplateRunner.installkernel">
2020-04-28 17:42:12 +00:00
<code class="sig-name descname">installkernel</code><span class="sig-paren">(</span><em class="sig-param">section</em>, <em class="sig-param">src</em>, <em class="sig-param">dest</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/ltmpl.html#LoraxTemplateRunner.installkernel"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.ltmpl.LoraxTemplateRunner.installkernel" title="Permalink to this definition"></a></dt>
<dd><dl>
<dt>installkernel SECTION SRC DEST</dt><dd><p>Install the kernel from SRC in the input tree to DEST in the output
2019-12-19 22:07:51 +00:00
tree, and then add an item to the treeinfo data store, in the named
SECTION, where “kernel” = DEST.</p>
2020-04-28 17:42:12 +00:00
<dl class="simple">
<dt>Equivalent to:</dt><dd><p>install SRC DEST
treeinfo SECTION kernel DEST</p>
</dd>
2019-12-19 22:07:51 +00:00
</dl>
</dd>
</dl>
</dd></dl>
<dl class="method">
<dt id="pylorax.ltmpl.LoraxTemplateRunner.installpkg">
2020-04-28 17:42:12 +00:00
<code class="sig-name descname">installpkg</code><span class="sig-paren">(</span><em class="sig-param">*pkgs</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/ltmpl.html#LoraxTemplateRunner.installpkg"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.ltmpl.LoraxTemplateRunner.installpkg" title="Permalink to this definition"></a></dt>
<dd><dl>
<dt>installpkg [required|optional] [except PKGGLOB [except PKGGLOB …]] PKGGLOB [PKGGLOB …]</dt><dd><p>Request installation of all packages matching the given globs.
2019-12-19 22:07:51 +00:00
Note that this is just a <em>request</em> - nothing is <em>actually</em> installed
until the run_pkg_transaction command is given.</p>
2020-04-28 17:42:12 +00:00
<p>required is now the default. If the PKGGLOB can be missing pass optional</p>
2019-12-19 22:07:51 +00:00
</dd>
</dl>
</dd></dl>
<dl class="method">
<dt id="pylorax.ltmpl.LoraxTemplateRunner.installupgradeinitrd">
2020-04-28 17:42:12 +00:00
<code class="sig-name descname">installupgradeinitrd</code><span class="sig-paren">(</span><em class="sig-param">section</em>, <em class="sig-param">src</em>, <em class="sig-param">dest</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/ltmpl.html#LoraxTemplateRunner.installupgradeinitrd"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.ltmpl.LoraxTemplateRunner.installupgradeinitrd" title="Permalink to this definition"></a></dt>
<dd><dl class="simple">
<dt>installupgradeinitrd SECTION SRC DEST</dt><dd><p>Same as installkernel, but for “upgrade”.</p>
</dd>
2019-12-19 22:07:51 +00:00
</dl>
</dd></dl>
<dl class="method">
<dt id="pylorax.ltmpl.LoraxTemplateRunner.log">
2020-04-28 17:42:12 +00:00
<code class="sig-name descname">log</code><span class="sig-paren">(</span><em class="sig-param">msg</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/ltmpl.html#LoraxTemplateRunner.log"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.ltmpl.LoraxTemplateRunner.log" title="Permalink to this definition"></a></dt>
<dd><dl>
<dt>log MESSAGE</dt><dd><p>Emit the given log message. Be sure to put it in quotes!</p>
<dl class="simple">
<dt>Example:</dt><dd><p>log “Reticulating splines, please wait…”</p>
</dd>
2019-12-19 22:07:51 +00:00
</dl>
</dd>
</dl>
</dd></dl>
<dl class="method">
<dt id="pylorax.ltmpl.LoraxTemplateRunner.mkdir">
2020-04-28 17:42:12 +00:00
<code class="sig-name descname">mkdir</code><span class="sig-paren">(</span><em class="sig-param">*dirs</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/ltmpl.html#LoraxTemplateRunner.mkdir"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.ltmpl.LoraxTemplateRunner.mkdir" title="Permalink to this definition"></a></dt>
<dd><dl>
<dt>mkdir DIR [DIR …]</dt><dd><p>Create the named DIR(s). Will create leading directories as needed.</p>
<dl class="simple">
<dt>Example:</dt><dd><p>mkdir /images</p>
</dd>
2019-12-19 22:07:51 +00:00
</dl>
</dd>
</dl>
</dd></dl>
<dl class="method">
<dt id="pylorax.ltmpl.LoraxTemplateRunner.move">
2020-04-28 17:42:12 +00:00
<code class="sig-name descname">move</code><span class="sig-paren">(</span><em class="sig-param">src</em>, <em class="sig-param">dest</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/ltmpl.html#LoraxTemplateRunner.move"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.ltmpl.LoraxTemplateRunner.move" title="Permalink to this definition"></a></dt>
<dd><dl class="simple">
<dt>move SRC DEST</dt><dd><p>Move SRC to DEST.</p>
</dd>
2019-12-19 22:07:51 +00:00
</dl>
</dd></dl>
<dl class="method">
<dt id="pylorax.ltmpl.LoraxTemplateRunner.remove">
2020-04-28 17:42:12 +00:00
<code class="sig-name descname">remove</code><span class="sig-paren">(</span><em class="sig-param">*fileglobs</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/ltmpl.html#LoraxTemplateRunner.remove"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.ltmpl.LoraxTemplateRunner.remove" title="Permalink to this definition"></a></dt>
<dd><dl class="simple">
<dt>remove FILEGLOB [FILEGLOB …]</dt><dd><p>Remove all the named files or directories.
Will <em>not</em> raise exceptions if the file(s) are not found.</p>
</dd>
2019-12-19 22:07:51 +00:00
</dl>
</dd></dl>
<dl class="method">
<dt id="pylorax.ltmpl.LoraxTemplateRunner.removefrom">
2020-04-28 17:42:12 +00:00
<code class="sig-name descname">removefrom</code><span class="sig-paren">(</span><em class="sig-param">pkg</em>, <em class="sig-param">*globs</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/ltmpl.html#LoraxTemplateRunner.removefrom"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.ltmpl.LoraxTemplateRunner.removefrom" title="Permalink to this definition"></a></dt>
<dd><dl>
<dt>removefrom PKGGLOB [allbut] FILEGLOB [FILEGLOB…]</dt><dd><p>Remove all files matching the given file globs from the package
2019-12-19 22:07:51 +00:00
(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>
2020-04-28 17:42:12 +00:00
<dl class="simple">
<dt>Examples:</dt><dd><p>removefrom usbutils /usr/bin/*
removefrom xfsprogs allbut /sbin/*</p>
</dd>
2019-12-19 22:07:51 +00:00
</dl>
</dd>
</dl>
</dd></dl>
<dl class="method">
<dt id="pylorax.ltmpl.LoraxTemplateRunner.removekmod">
2020-04-28 17:42:12 +00:00
<code class="sig-name descname">removekmod</code><span class="sig-paren">(</span><em class="sig-param">*globs</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/ltmpl.html#LoraxTemplateRunner.removekmod"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.ltmpl.LoraxTemplateRunner.removekmod" title="Permalink to this definition"></a></dt>
<dd><dl>
<dt>removekmod GLOB [GLOB…] [allbut] KEEPGLOB [KEEPGLOB…]</dt><dd><p>Remove all files and directories matching the given file globs from the kernel
2019-12-19 22:07:51 +00:00
modules directory.</p>
<p>If allbut is used, all the files from the modules will be removed <em>except</em>
the ones which match the file globs. There must be at least one initial GLOB
to search and one KEEPGLOB to keep. The KEEPGLOB is expanded to be <em>KEEPGLOB</em>
so that it will match anywhere in the path.</p>
<p>This only removes files from under /lib/modules/<a href="#id1"><span class="problematic" id="id2">*</span></a>/kernel/</p>
2020-04-28 17:42:12 +00:00
<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>
2019-12-19 22:07:51 +00:00
</dl>
</dd>
</dl>
</dd></dl>
<dl class="method">
<dt id="pylorax.ltmpl.LoraxTemplateRunner.removepkg">
2020-04-28 17:42:12 +00:00
<code class="sig-name descname">removepkg</code><span class="sig-paren">(</span><em class="sig-param">*pkgs</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/ltmpl.html#LoraxTemplateRunner.removepkg"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.ltmpl.LoraxTemplateRunner.removepkg" title="Permalink to this definition"></a></dt>
<dd><dl>
<dt>removepkg PKGGLOB [PKGGLOB…]</dt><dd><p>Delete the named package(s).</p>
<dl class="simple">
<dt>IMPLEMENTATION NOTES:</dt><dd><p>RPM scriptlets (%preun/%postun) are <em>not</em> run.
Files are deleted, but directories are left behind.</p>
</dd>
2019-12-19 22:07:51 +00:00
</dl>
</dd>
</dl>
</dd></dl>
<dl class="method">
<dt id="pylorax.ltmpl.LoraxTemplateRunner.replace">
2020-04-28 17:42:12 +00:00
<code class="sig-name descname">replace</code><span class="sig-paren">(</span><em class="sig-param">pat</em>, <em class="sig-param">repl</em>, <em class="sig-param">*fileglobs</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/ltmpl.html#LoraxTemplateRunner.replace"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.ltmpl.LoraxTemplateRunner.replace" title="Permalink to this definition"></a></dt>
<dd><dl>
<dt>replace PATTERN REPLACEMENT FILEGLOB [FILEGLOB …]</dt><dd><p>Find-and-replace the given PATTERN (Python-style regex) with the given
2019-12-19 22:07:51 +00:00
REPLACEMENT string for each of the files listed.</p>
2020-04-28 17:42:12 +00:00
<dl class="simple">
<dt>Example:</dt><dd><p>replace &#64;VERSION&#64; ${product.version} /boot/grub.conf /boot/isolinux.cfg</p>
</dd>
2019-12-19 22:07:51 +00:00
</dl>
</dd>
</dl>
</dd></dl>
<dl class="method">
<dt id="pylorax.ltmpl.LoraxTemplateRunner.run_pkg_transaction">
2020-04-28 17:42:12 +00:00
<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>
2019-12-19 22:07:51 +00:00
<dd><p>Actually install all the packages requested by previous installpkg
commands.</p>
</dd></dl>
<dl class="method">
<dt id="pylorax.ltmpl.LoraxTemplateRunner.runcmd">
2020-04-28 17:42:12 +00:00
<code class="sig-name descname">runcmd</code><span class="sig-paren">(</span><em class="sig-param">*cmdlist</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/ltmpl.html#LoraxTemplateRunner.runcmd"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.ltmpl.LoraxTemplateRunner.runcmd" title="Permalink to this definition"></a></dt>
<dd><dl>
<dt>runcmd CMD [ARG …]</dt><dd><p>Run the given command with the given arguments.</p>
2019-12-19 22:07:51 +00:00
<p>NOTE: All paths given MUST be COMPLETE, ABSOLUTE PATHS to the file
or files mentioned. ${root}/${inroot}/${outroot} are good for
constructing these paths.</p>
<p>FURTHER NOTE: Please use this command only as a last resort!
Whenever possible, you should use the existing template commands.
If the existing commands dont do what you need, fix them!</p>
2020-04-28 17:42:12 +00:00
<dl>
<dt>Examples:</dt><dd><p>(this should be replaced with a “find” function)
2019-12-19 22:07:51 +00:00
runcmd find ${root} -name “<em>.pyo” -type f -delete
%for f in find(root, name=”</em>.pyo”):</p>
<blockquote>
2020-04-28 17:42:12 +00:00
<div><p>remove ${f}</p>
</div></blockquote>
<p>%endfor</p>
2019-12-19 22:07:51 +00:00
</dd>
</dl>
</dd>
</dl>
</dd></dl>
<dl class="method">
<dt id="pylorax.ltmpl.LoraxTemplateRunner.symlink">
2020-04-28 17:42:12 +00:00
<code class="sig-name descname">symlink</code><span class="sig-paren">(</span><em class="sig-param">target</em>, <em class="sig-param">dest</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/ltmpl.html#LoraxTemplateRunner.symlink"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.ltmpl.LoraxTemplateRunner.symlink" title="Permalink to this definition"></a></dt>
<dd><dl class="simple">
<dt>symlink SRC DEST</dt><dd><p>Create a symlink at DEST which points to SRC.</p>
</dd>
2019-12-19 22:07:51 +00:00
</dl>
</dd></dl>
<dl class="method">
<dt id="pylorax.ltmpl.LoraxTemplateRunner.systemctl">
2020-04-28 17:42:12 +00:00
<code class="sig-name descname">systemctl</code><span class="sig-paren">(</span><em class="sig-param">cmd</em>, <em class="sig-param">*units</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/ltmpl.html#LoraxTemplateRunner.systemctl"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.ltmpl.LoraxTemplateRunner.systemctl" title="Permalink to this definition"></a></dt>
<dd><dl>
<dt>systemctl [enable|disable|mask] UNIT [UNIT…]</dt><dd><p>Enable, disable, or mask the given systemd units.</p>
<dl class="simple">
<dt>Examples:</dt><dd><p>systemctl disable lvm2-monitor.service
systemctl mask fedora-storage-init.service fedora-configure.service</p>
</dd>
2019-12-19 22:07:51 +00:00
</dl>
</dd>
</dl>
</dd></dl>
<dl class="method">
<dt id="pylorax.ltmpl.LoraxTemplateRunner.treeinfo">
2020-04-28 17:42:12 +00:00
<code class="sig-name descname">treeinfo</code><span class="sig-paren">(</span><em class="sig-param">section</em>, <em class="sig-param">key</em>, <em class="sig-param">*valuetoks</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/ltmpl.html#LoraxTemplateRunner.treeinfo"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.ltmpl.LoraxTemplateRunner.treeinfo" title="Permalink to this definition"></a></dt>
<dd><dl>
<dt>treeinfo SECTION KEY ARG [ARG …]</dt><dd><p>Add an item to the treeinfo data store.
2019-12-19 22:07:51 +00:00
The given SECTION will have a new item added where
KEY = ARG ARG …</p>
2020-04-28 17:42:12 +00:00
<dl class="simple">
<dt>Example:</dt><dd><p>treeinfo images-${kernel.arch} boot.iso images/boot.iso</p>
</dd>
2019-12-19 22:07:51 +00:00
</dl>
</dd>
</dl>
</dd></dl>
</dd></dl>
<dl class="class">
<dt id="pylorax.ltmpl.TemplateRunner">
2020-04-28 17:42:12 +00:00
<em class="property">class </em><code class="sig-prename descclassname">pylorax.ltmpl.</code><code class="sig-name descname">TemplateRunner</code><span class="sig-paren">(</span><em class="sig-param">fatalerrors=True</em>, <em class="sig-param">templatedir=None</em>, <em class="sig-param">defaults=None</em>, <em class="sig-param">builtins=None</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/ltmpl.html#TemplateRunner"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.ltmpl.TemplateRunner" title="Permalink to this definition"></a></dt>
2019-12-19 22:07:51 +00:00
<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>
2020-04-28 17:42:12 +00:00
<div><p># install a bunch of packages
2019-12-19 22:07:51 +00:00
runner = LoraxTemplateRunner(inroot=rundir, outroot=rundir, dbo=dnf_obj)
2020-04-28 17:42:12 +00:00
runner.run(“install-packages.ltmpl”)</p>
</div></blockquote>
2019-12-19 22:07:51 +00:00
<p>NOTES:</p>
<ul>
2020-04-28 17:42:12 +00:00
<li><p>Parsing procedure is roughly:
2019-12-19 22:07:51 +00:00
1. Mako template expansion (on the whole file)
2. For each line of the result,</p>
<blockquote>
<div><ol class="loweralpha simple">
2020-04-28 17:42:12 +00:00
<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>
2019-12-19 22:07:51 +00:00
</ol>
</div></blockquote>
</li>
2020-04-28 17:42:12 +00:00
<li><p>Parsing and execution are <em>separate</em> passes - so you cant use the result
of a command in an %if statement (or any other control statements)!</p></li>
2019-12-19 22:07:51 +00:00
</ul>
<dl class="method">
<dt id="pylorax.ltmpl.TemplateRunner.run">
2020-04-28 17:42:12 +00:00
<code class="sig-name descname">run</code><span class="sig-paren">(</span><em class="sig-param">templatefile</em>, <em class="sig-param">**variables</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/ltmpl.html#TemplateRunner.run"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.ltmpl.TemplateRunner.run" title="Permalink to this definition"></a></dt>
2019-12-19 22:07:51 +00:00
<dd></dd></dl>
</dd></dl>
<dl class="function">
<dt id="pylorax.ltmpl.brace_expand">
2020-04-28 17:42:12 +00:00
<code class="sig-prename descclassname">pylorax.ltmpl.</code><code class="sig-name descname">brace_expand</code><span class="sig-paren">(</span><em class="sig-param">s</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/ltmpl.html#brace_expand"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.ltmpl.brace_expand" title="Permalink to this definition"></a></dt>
2019-12-19 22:07:51 +00:00
<dd></dd></dl>
<dl class="function">
<dt id="pylorax.ltmpl.rexists">
2020-04-28 17:42:12 +00:00
<code class="sig-prename descclassname">pylorax.ltmpl.</code><code class="sig-name descname">rexists</code><span class="sig-paren">(</span><em class="sig-param">pathname</em>, <em class="sig-param">root=''</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/ltmpl.html#rexists"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.ltmpl.rexists" title="Permalink to this definition"></a></dt>
2019-12-19 22:07:51 +00:00
<dd></dd></dl>
<dl class="function">
<dt id="pylorax.ltmpl.rglob">
2020-04-28 17:42:12 +00:00
<code class="sig-prename descclassname">pylorax.ltmpl.</code><code class="sig-name descname">rglob</code><span class="sig-paren">(</span><em class="sig-param">pathname</em>, <em class="sig-param">root='/'</em>, <em class="sig-param">fatal=False</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/ltmpl.html#rglob"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.ltmpl.rglob" title="Permalink to this definition"></a></dt>
2019-12-19 22:07:51 +00:00
<dd></dd></dl>
<dl class="function">
<dt id="pylorax.ltmpl.split_and_expand">
2020-04-28 17:42:12 +00:00
<code class="sig-prename descclassname">pylorax.ltmpl.</code><code class="sig-name descname">split_and_expand</code><span class="sig-paren">(</span><em class="sig-param">line</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/ltmpl.html#split_and_expand"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.ltmpl.split_and_expand" title="Permalink to this definition"></a></dt>
2019-12-19 22:07:51 +00:00
<dd></dd></dl>
</div>
<div class="section" id="module-pylorax.monitor">
<span id="pylorax-monitor-module"></span><h2>pylorax.monitor module<a class="headerlink" href="#module-pylorax.monitor" title="Permalink to this headline"></a></h2>
<dl class="class">
<dt id="pylorax.monitor.LogMonitor">
2020-04-28 17:42:12 +00:00
<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><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>
2019-12-19 22:07:51 +00:00
<dd><p>Bases: <a class="reference external" href="https://docs.python.org/3/library/functions.html#object" title="(in Python v3.8)"><code class="xref py py-class docutils literal notranslate"><span class="pre">object</span></code></a></p>
<p>Setup a server to monitor the logs output by the installation</p>
<p>This needs to be running before the virt-install runs, it expects
there to be a listener on the port used for the virtio log port.</p>
<dl class="method">
<dt id="pylorax.monitor.LogMonitor.shutdown">
2020-04-28 17:42:12 +00:00
<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>
2019-12-19 22:07:51 +00:00
<dd><p>Force shutdown of the monitoring thread</p>
</dd></dl>
</dd></dl>
<dl class="class">
<dt id="pylorax.monitor.LogRequestHandler">
2020-04-28 17:42:12 +00:00
<em class="property">class </em><code class="sig-prename descclassname">pylorax.monitor.</code><code class="sig-name descname">LogRequestHandler</code><span class="sig-paren">(</span><em class="sig-param">request</em>, <em class="sig-param">client_address</em>, <em class="sig-param">server</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/monitor.html#LogRequestHandler"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.monitor.LogRequestHandler" title="Permalink to this definition"></a></dt>
2019-12-19 22:07:51 +00:00
<dd><p>Bases: <a class="reference external" href="https://docs.python.org/3/library/socketserver.html#socketserver.BaseRequestHandler" title="(in Python v3.8)"><code class="xref py py-class docutils literal notranslate"><span class="pre">socketserver.BaseRequestHandler</span></code></a></p>
<p>Handle monitoring and saving the logfiles from the virtual install</p>
<p>Incoming data is written to self.server.log_path and each line is checked
for patterns that would indicate that the installation failed.
self.server.log_error is set True when this happens.</p>
<dl class="method">
<dt id="pylorax.monitor.LogRequestHandler.finish">
2020-04-28 17:42:12 +00:00
<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>
2019-12-19 22:07:51 +00:00
<dd></dd></dl>
<dl class="method">
<dt id="pylorax.monitor.LogRequestHandler.handle">
2020-04-28 17:42:12 +00:00
<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>
2019-12-19 22:07:51 +00:00
<dd><p>Write incoming data to a logfile and check for errors</p>
<p>Split incoming data into lines and check for any Tracebacks or other
errors that indicate that the install failed.</p>
<p>Loops until self.server.kill is True</p>
</dd></dl>
<dl class="method">
<dt id="pylorax.monitor.LogRequestHandler.iserror">
2020-04-28 17:42:12 +00:00
<code class="sig-name descname">iserror</code><span class="sig-paren">(</span><em class="sig-param">line</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/monitor.html#LogRequestHandler.iserror"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.monitor.LogRequestHandler.iserror" title="Permalink to this definition"></a></dt>
2019-12-19 22:07:51 +00:00
<dd><p>Check a line to see if it contains an error indicating installation failure</p>
2020-04-28 17:42:12 +00:00
<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>
2019-12-19 22:07:51 +00:00
<p>If the line contains IGNORED it will be skipped.</p>
</dd></dl>
<dl class="method">
<dt id="pylorax.monitor.LogRequestHandler.setup">
2020-04-28 17:42:12 +00:00
<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>
2019-12-19 22:07:51 +00:00
<dd><p>Start writing to self.server.log_path</p>
</dd></dl>
</dd></dl>
<dl class="class">
<dt id="pylorax.monitor.LogServer">
2020-04-28 17:42:12 +00:00
<em class="property">class </em><code class="sig-prename descclassname">pylorax.monitor.</code><code class="sig-name descname">LogServer</code><span class="sig-paren">(</span><em class="sig-param">log_path</em>, <em class="sig-param">*args</em>, <em class="sig-param">**kwargs</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/monitor.html#LogServer"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.monitor.LogServer" title="Permalink to this definition"></a></dt>
2019-12-19 22:07:51 +00:00
<dd><p>Bases: <a class="reference external" href="https://docs.python.org/3/library/socketserver.html#socketserver.TCPServer" title="(in Python v3.8)"><code class="xref py py-class docutils literal notranslate"><span class="pre">socketserver.TCPServer</span></code></a></p>
<p>A TCP Server that listens for log data</p>
<dl class="method">
<dt id="pylorax.monitor.LogServer.log_check">
2020-04-28 17:42:12 +00:00
<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>
2019-12-19 22:07:51 +00:00
<dd><p>Check to see if an error has been found in the log</p>
2020-04-28 17:42:12 +00:00
<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>
2019-12-19 22:07:51 +00:00
</dd></dl>
<dl class="attribute">
<dt id="pylorax.monitor.LogServer.timeout">
2020-04-28 17:42:12 +00:00
<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>
2019-12-19 22:07:51 +00:00
<dd></dd></dl>
</dd></dl>
</div>
<div class="section" id="module-pylorax.mount">
<span id="pylorax-mount-module"></span><h2>pylorax.mount module<a class="headerlink" href="#module-pylorax.mount" title="Permalink to this headline"></a></h2>
<dl class="class">
<dt id="pylorax.mount.IsoMountpoint">
2020-04-28 17:42:12 +00:00
<em class="property">class </em><code class="sig-prename descclassname">pylorax.mount.</code><code class="sig-name descname">IsoMountpoint</code><span class="sig-paren">(</span><em class="sig-param">iso_path</em>, <em class="sig-param">initrd_path=None</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/mount.html#IsoMountpoint"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.mount.IsoMountpoint" title="Permalink to this definition"></a></dt>
2019-12-19 22:07:51 +00:00
<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
isos label.</p>
<p>stage2 can be either LiveOS/squashfs.img or images/install.img</p>
<dl class="method">
<dt id="pylorax.mount.IsoMountpoint.get_iso_label">
2020-04-28 17:42:12 +00:00
<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>
2019-12-19 22:07:51 +00:00
<dd><p>Get the isos label using isoinfo</p>
<p>Sets self.label if one is found</p>
</dd></dl>
<dl class="method">
<dt id="pylorax.mount.IsoMountpoint.umount">
2020-04-28 17:42:12 +00:00
<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>
2019-12-19 22:07:51 +00:00
<dd><p>Unmount the iso</p>
</dd></dl>
</dd></dl>
</div>
<div class="section" id="module-pylorax.output">
<span id="pylorax-output-module"></span><h2>pylorax.output module<a class="headerlink" href="#module-pylorax.output" title="Permalink to this headline"></a></h2>
</div>
<div class="section" id="module-pylorax.sysutils">
<span id="pylorax-sysutils-module"></span><h2>pylorax.sysutils module<a class="headerlink" href="#module-pylorax.sysutils" title="Permalink to this headline"></a></h2>
<dl class="function">
<dt id="pylorax.sysutils.joinpaths">
2020-04-28 17:42:12 +00:00
<code class="sig-prename descclassname">pylorax.sysutils.</code><code class="sig-name descname">joinpaths</code><span class="sig-paren">(</span><em class="sig-param">*args</em>, <em class="sig-param">**kwargs</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/sysutils.html#joinpaths"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.sysutils.joinpaths" title="Permalink to this definition"></a></dt>
2019-12-19 22:07:51 +00:00
<dd></dd></dl>
<dl class="function">
<dt id="pylorax.sysutils.touch">
2020-04-28 17:42:12 +00:00
<code class="sig-prename descclassname">pylorax.sysutils.</code><code class="sig-name descname">touch</code><span class="sig-paren">(</span><em class="sig-param">fname</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/sysutils.html#touch"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.sysutils.touch" title="Permalink to this definition"></a></dt>
2019-12-19 22:07:51 +00:00
<dd></dd></dl>
<dl class="function">
<dt id="pylorax.sysutils.replace">
2020-04-28 17:42:12 +00:00
<code class="sig-prename descclassname">pylorax.sysutils.</code><code class="sig-name descname">replace</code><span class="sig-paren">(</span><em class="sig-param">fname</em>, <em class="sig-param">find</em>, <em class="sig-param">sub</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/sysutils.html#replace"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.sysutils.replace" title="Permalink to this definition"></a></dt>
2019-12-19 22:07:51 +00:00
<dd></dd></dl>
<dl class="function">
<dt id="pylorax.sysutils.chown_">
2020-04-28 17:42:12 +00:00
<code class="sig-prename descclassname">pylorax.sysutils.</code><code class="sig-name descname">chown_</code><span class="sig-paren">(</span><em class="sig-param">path</em>, <em class="sig-param">user=None</em>, <em class="sig-param">group=None</em>, <em class="sig-param">recursive=False</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/sysutils.html#chown_"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.sysutils.chown_" title="Permalink to this definition"></a></dt>
2019-12-19 22:07:51 +00:00
<dd></dd></dl>
<dl class="function">
<dt id="pylorax.sysutils.chmod_">
2020-04-28 17:42:12 +00:00
<code class="sig-prename descclassname">pylorax.sysutils.</code><code class="sig-name descname">chmod_</code><span class="sig-paren">(</span><em class="sig-param">path</em>, <em class="sig-param">mode</em>, <em class="sig-param">recursive=False</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/sysutils.html#chmod_"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.sysutils.chmod_" title="Permalink to this definition"></a></dt>
2019-12-19 22:07:51 +00:00
<dd></dd></dl>
<dl class="function">
<dt id="pylorax.sysutils.remove">
2020-04-28 17:42:12 +00:00
<code class="sig-prename descclassname">pylorax.sysutils.</code><code class="sig-name descname">remove</code><span class="sig-paren">(</span><em class="sig-param">target</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/sysutils.html#remove"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.sysutils.remove" title="Permalink to this definition"></a></dt>
2019-12-19 22:07:51 +00:00
<dd></dd></dl>
<dl class="function">
<dt id="pylorax.sysutils.linktree">
2020-04-28 17:42:12 +00:00
<code class="sig-prename descclassname">pylorax.sysutils.</code><code class="sig-name descname">linktree</code><span class="sig-paren">(</span><em class="sig-param">src</em>, <em class="sig-param">dst</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/sysutils.html#linktree"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.sysutils.linktree" title="Permalink to this definition"></a></dt>
2019-12-19 22:07:51 +00:00
<dd></dd></dl>
</div>
<div class="section" id="module-pylorax.treebuilder">
<span id="pylorax-treebuilder-module"></span><h2>pylorax.treebuilder module<a class="headerlink" href="#module-pylorax.treebuilder" title="Permalink to this headline"></a></h2>
<dl class="class">
<dt id="pylorax.treebuilder.RuntimeBuilder">
2020-04-28 17:42:12 +00:00
<em class="property">class </em><code class="sig-prename descclassname">pylorax.treebuilder.</code><code class="sig-name descname">RuntimeBuilder</code><span class="sig-paren">(</span><em class="sig-param">product</em>, <em class="sig-param">arch</em>, <em class="sig-param">dbo</em>, <em class="sig-param">templatedir=None</em>, <em class="sig-param">installpkgs=None</em>, <em class="sig-param">excludepkgs=None</em>, <em class="sig-param">add_templates=None</em>, <em class="sig-param">add_template_vars=None</em>, <em class="sig-param">skip_branding=False</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/treebuilder.html#RuntimeBuilder"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.treebuilder.RuntimeBuilder" title="Permalink to this definition"></a></dt>
2019-12-19 22:07:51 +00:00
<dd><p>Bases: <a class="reference external" href="https://docs.python.org/3/library/functions.html#object" title="(in Python v3.8)"><code class="xref py py-class docutils literal notranslate"><span class="pre">object</span></code></a></p>
<p>Builds the anaconda runtime image.</p>
<dl class="method">
<dt id="pylorax.treebuilder.RuntimeBuilder.cleanup">
2020-04-28 17:42:12 +00:00
<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>
2019-12-19 22:07:51 +00:00
<dd><p>Remove unneeded packages and files with runtime-cleanup.tmpl</p>
</dd></dl>
<dl class="method">
<dt id="pylorax.treebuilder.RuntimeBuilder.create_runtime">
2020-04-28 17:42:12 +00:00
<code class="sig-name descname">create_runtime</code><span class="sig-paren">(</span><em class="sig-param">outfile='/var/tmp/squashfs.img'</em>, <em class="sig-param">compression='xz'</em>, <em class="sig-param">compressargs=None</em>, <em class="sig-param">size=2</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/treebuilder.html#RuntimeBuilder.create_runtime"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.treebuilder.RuntimeBuilder.create_runtime" title="Permalink to this definition"></a></dt>
2019-12-19 22:07:51 +00:00
<dd></dd></dl>
<dl class="method">
<dt id="pylorax.treebuilder.RuntimeBuilder.finished">
2020-04-28 17:42:12 +00:00
<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>
2019-12-19 22:07:51 +00:00
<dd><p>Done using RuntimeBuilder</p>
<p>Close the dnf base object</p>
</dd></dl>
<dl class="method">
<dt id="pylorax.treebuilder.RuntimeBuilder.generate_module_data">
2020-04-28 17:42:12 +00:00
<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>
2019-12-19 22:07:51 +00:00
<dd></dd></dl>
<dl class="method">
<dt id="pylorax.treebuilder.RuntimeBuilder.install">
2020-04-28 17:42:12 +00:00
<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>
2019-12-19 22:07:51 +00:00
<dd><p>Install packages and do initial setup with runtime-install.tmpl</p>
</dd></dl>
<dl class="method">
<dt id="pylorax.treebuilder.RuntimeBuilder.postinstall">
2020-04-28 17:42:12 +00:00
<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>
2019-12-19 22:07:51 +00:00
<dd><p>Do some post-install setup work with runtime-postinstall.tmpl</p>
</dd></dl>
<dl class="method">
<dt id="pylorax.treebuilder.RuntimeBuilder.verify">
2020-04-28 17:42:12 +00:00
<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>
2019-12-19 22:07:51 +00:00
<dd><p>Ensure that contents of the installroot can run</p>
</dd></dl>
<dl class="method">
<dt id="pylorax.treebuilder.RuntimeBuilder.writepkglists">
2020-04-28 17:42:12 +00:00
<code class="sig-name descname">writepkglists</code><span class="sig-paren">(</span><em class="sig-param">pkglistdir</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/treebuilder.html#RuntimeBuilder.writepkglists"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.treebuilder.RuntimeBuilder.writepkglists" title="Permalink to this definition"></a></dt>
2019-12-19 22:07:51 +00:00
<dd><p>debugging data: write out lists of package contents</p>
</dd></dl>
<dl class="method">
<dt id="pylorax.treebuilder.RuntimeBuilder.writepkgsizes">
2020-04-28 17:42:12 +00:00
<code class="sig-name descname">writepkgsizes</code><span class="sig-paren">(</span><em class="sig-param">pkgsizefile</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/treebuilder.html#RuntimeBuilder.writepkgsizes"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.treebuilder.RuntimeBuilder.writepkgsizes" title="Permalink to this definition"></a></dt>
2019-12-19 22:07:51 +00:00
<dd><p>debugging data: write a big list of pkg sizes</p>
</dd></dl>
</dd></dl>
<dl class="class">
<dt id="pylorax.treebuilder.TreeBuilder">
2020-04-28 17:42:12 +00:00
<em class="property">class </em><code class="sig-prename descclassname">pylorax.treebuilder.</code><code class="sig-name descname">TreeBuilder</code><span class="sig-paren">(</span><em class="sig-param">product</em>, <em class="sig-param">arch</em>, <em class="sig-param">inroot</em>, <em class="sig-param">outroot</em>, <em class="sig-param">runtime</em>, <em class="sig-param">isolabel</em>, <em class="sig-param">domacboot=True</em>, <em class="sig-param">doupgrade=True</em>, <em class="sig-param">templatedir=None</em>, <em class="sig-param">add_templates=None</em>, <em class="sig-param">add_template_vars=None</em>, <em class="sig-param">workdir=None</em>, <em class="sig-param">extra_boot_args=''</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/treebuilder.html#TreeBuilder"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.treebuilder.TreeBuilder" title="Permalink to this definition"></a></dt>
2019-12-19 22:07:51 +00:00
<dd><p>Bases: <a class="reference external" href="https://docs.python.org/3/library/functions.html#object" title="(in Python v3.8)"><code class="xref py py-class docutils literal notranslate"><span class="pre">object</span></code></a></p>
<p>Builds the arch-specific boot images.
inroot should be the installtree root (the newly-built runtime dir)</p>
<dl class="method">
<dt id="pylorax.treebuilder.TreeBuilder.build">
2020-04-28 17:42:12 +00:00
<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>
2019-12-19 22:07:51 +00:00
<dd></dd></dl>
<dl class="method">
<dt id="pylorax.treebuilder.TreeBuilder.copy_dracut_hooks">
2020-04-28 17:42:12 +00:00
<code class="sig-name descname">copy_dracut_hooks</code><span class="sig-paren">(</span><em class="sig-param">hooks</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/treebuilder.html#TreeBuilder.copy_dracut_hooks"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.treebuilder.TreeBuilder.copy_dracut_hooks" title="Permalink to this definition"></a></dt>
2019-12-19 22:07:51 +00:00
<dd><p>Copy the hook scripts in hooks into the installroots /tmp/
and return a list of commands to pass to dracut when creating the
initramfs</p>
<p>hooks is a list of tuples with the name of the hook script and the
target dracut hook directory
(eg. [(“99anaconda-copy-ks.sh”, “/lib/dracut/hooks/pre-pivot”)])</p>
</dd></dl>
2020-04-28 17:42:12 +00:00
<dl class="method">
2019-12-19 22:07:51 +00:00
<dt id="pylorax.treebuilder.TreeBuilder.dracut_hooks_path">
2020-04-28 17:42:12 +00:00
<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>
2019-12-19 22:07:51 +00:00
<dd><p>Return the path to the lorax dracut hooks scripts</p>
<p>Use the configured share dir if it is setup,
otherwise default to /usr/share/lorax/dracut_hooks</p>
</dd></dl>
<dl class="method">
<dt id="pylorax.treebuilder.TreeBuilder.implantisomd5">
2020-04-28 17:42:12 +00:00
<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>
2019-12-19 22:07:51 +00:00
<dd></dd></dl>
2020-04-28 17:42:12 +00:00
<dl class="method">
2019-12-19 22:07:51 +00:00
<dt id="pylorax.treebuilder.TreeBuilder.kernels">
2020-04-28 17:42:12 +00:00
<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>
2019-12-19 22:07:51 +00:00
<dd></dd></dl>
<dl class="method">
<dt id="pylorax.treebuilder.TreeBuilder.rebuild_initrds">
2020-04-28 17:42:12 +00:00
<code class="sig-name descname">rebuild_initrds</code><span class="sig-paren">(</span><em class="sig-param">add_args=None</em>, <em class="sig-param">backup=''</em>, <em class="sig-param">prefix=''</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/treebuilder.html#TreeBuilder.rebuild_initrds"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.treebuilder.TreeBuilder.rebuild_initrds" title="Permalink to this definition"></a></dt>
2019-12-19 22:07:51 +00:00
<dd><p>Rebuild all the initrds in the tree. If backup is specified, each
initrd will be renamed with backup as a suffix before rebuilding.
If backup is empty, the existing initrd files will be overwritten.
If suffix is specified, the existing initrd is untouched and a new
image is built with the filename “${prefix}-${kernel.version}.img”</p>
<p>If the initrd doesnt exist its name will be created based on the
name of the kernel.</p>
</dd></dl>
</dd></dl>
<dl class="function">
<dt id="pylorax.treebuilder.findkernels">
2020-04-28 17:42:12 +00:00
<code class="sig-prename descclassname">pylorax.treebuilder.</code><code class="sig-name descname">findkernels</code><span class="sig-paren">(</span><em class="sig-param">root='/'</em>, <em class="sig-param">kdir='boot'</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/treebuilder.html#findkernels"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.treebuilder.findkernels" title="Permalink to this definition"></a></dt>
2019-12-19 22:07:51 +00:00
<dd></dd></dl>
<dl class="function">
<dt id="pylorax.treebuilder.generate_module_info">
2020-04-28 17:42:12 +00:00
<code class="sig-prename descclassname">pylorax.treebuilder.</code><code class="sig-name descname">generate_module_info</code><span class="sig-paren">(</span><em class="sig-param">moddir</em>, <em class="sig-param">outfile=None</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/treebuilder.html#generate_module_info"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.treebuilder.generate_module_info" title="Permalink to this definition"></a></dt>
2019-12-19 22:07:51 +00:00
<dd></dd></dl>
<dl class="function">
<dt id="pylorax.treebuilder.string_lower">
2020-04-28 17:42:12 +00:00
<code class="sig-prename descclassname">pylorax.treebuilder.</code><code class="sig-name descname">string_lower</code><span class="sig-paren">(</span><em class="sig-param">string</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/treebuilder.html#string_lower"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.treebuilder.string_lower" title="Permalink to this definition"></a></dt>
2019-12-19 22:07:51 +00:00
<dd><p>Return a lowercase string.</p>
2020-04-28 17:42:12 +00:00
<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>
2019-12-19 22:07:51 +00:00
<p>This is used as a filter in the templates.</p>
</dd></dl>
<dl class="function">
<dt id="pylorax.treebuilder.udev_escape">
2020-04-28 17:42:12 +00:00
<code class="sig-prename descclassname">pylorax.treebuilder.</code><code class="sig-name descname">udev_escape</code><span class="sig-paren">(</span><em class="sig-param">label</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/treebuilder.html#udev_escape"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.treebuilder.udev_escape" title="Permalink to this definition"></a></dt>
2019-12-19 22:07:51 +00:00
<dd></dd></dl>
</div>
<div class="section" id="module-pylorax.treeinfo">
<span id="pylorax-treeinfo-module"></span><h2>pylorax.treeinfo module<a class="headerlink" href="#module-pylorax.treeinfo" title="Permalink to this headline"></a></h2>
<dl class="class">
<dt id="pylorax.treeinfo.TreeInfo">
2020-04-28 17:42:12 +00:00
<em class="property">class </em><code class="sig-prename descclassname">pylorax.treeinfo.</code><code class="sig-name descname">TreeInfo</code><span class="sig-paren">(</span><em class="sig-param">product</em>, <em class="sig-param">version</em>, <em class="sig-param">variant</em>, <em class="sig-param">basearch</em>, <em class="sig-param">packagedir=''</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/treeinfo.html#TreeInfo"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.treeinfo.TreeInfo" title="Permalink to this definition"></a></dt>
2019-12-19 22:07:51 +00:00
<dd><p>Bases: <a class="reference external" href="https://docs.python.org/3/library/functions.html#object" title="(in Python v3.8)"><code class="xref py py-class docutils literal notranslate"><span class="pre">object</span></code></a></p>
<dl class="method">
<dt id="pylorax.treeinfo.TreeInfo.add_section">
2020-04-28 17:42:12 +00:00
<code class="sig-name descname">add_section</code><span class="sig-paren">(</span><em class="sig-param">section</em>, <em class="sig-param">data</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/treeinfo.html#TreeInfo.add_section"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.treeinfo.TreeInfo.add_section" title="Permalink to this definition"></a></dt>
2019-12-19 22:07:51 +00:00
<dd></dd></dl>
<dl class="method">
<dt id="pylorax.treeinfo.TreeInfo.write">
2020-04-28 17:42:12 +00:00
<code class="sig-name descname">write</code><span class="sig-paren">(</span><em class="sig-param">outfile</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/treeinfo.html#TreeInfo.write"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.treeinfo.TreeInfo.write" title="Permalink to this definition"></a></dt>
2019-12-19 22:07:51 +00:00
<dd></dd></dl>
</dd></dl>
</div>
<div class="section" id="module-pylorax">
<span id="module-contents"></span><h2>Module contents<a class="headerlink" href="#module-pylorax" title="Permalink to this headline"></a></h2>
<dl class="class">
<dt id="pylorax.ArchData">
2020-04-28 17:42:12 +00:00
<em class="property">class </em><code class="sig-prename descclassname">pylorax.</code><code class="sig-name descname">ArchData</code><span class="sig-paren">(</span><em class="sig-param">buildarch</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax.html#ArchData"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.ArchData" title="Permalink to this definition"></a></dt>
2019-12-19 22:07:51 +00:00
<dd><p>Bases: <a class="reference internal" href="#pylorax.base.DataHolder" title="pylorax.base.DataHolder"><code class="xref py py-class docutils literal notranslate"><span class="pre">pylorax.base.DataHolder</span></code></a></p>
<dl class="attribute">
<dt id="pylorax.ArchData.bcj_arch">
2020-04-28 17:42:12 +00:00
<code class="sig-name descname">bcj_arch</code><em class="property"> = {'arm': 'arm', 'armhfp': 'arm', 'i386': 'x86', 'ppc': 'powerpc', 'ppc64': 'powerpc', 'ppc64le': 'powerpc', 'x86_64': 'x86'}</em><a class="headerlink" href="#pylorax.ArchData.bcj_arch" title="Permalink to this definition"></a></dt>
2019-12-19 22:07:51 +00:00
<dd></dd></dl>
<dl class="attribute">
<dt id="pylorax.ArchData.lib64_arches">
2020-04-28 17:42:12 +00:00
<code class="sig-name descname">lib64_arches</code><em class="property"> = ('x86_64', 'ppc64', 'ppc64le', 's390x', 'ia64', 'aarch64')</em><a class="headerlink" href="#pylorax.ArchData.lib64_arches" title="Permalink to this definition"></a></dt>
2019-12-19 22:07:51 +00:00
<dd></dd></dl>
</dd></dl>
<dl class="class">
<dt id="pylorax.Lorax">
2020-04-28 17:42:12 +00:00
<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>
2019-12-19 22:07:51 +00:00
<dd><p>Bases: <a class="reference internal" href="#pylorax.base.BaseLoraxClass" title="pylorax.base.BaseLoraxClass"><code class="xref py py-class docutils literal notranslate"><span class="pre">pylorax.base.BaseLoraxClass</span></code></a></p>
<dl class="method">
<dt id="pylorax.Lorax.configure">
2020-04-28 17:42:12 +00:00
<code class="sig-name descname">configure</code><span class="sig-paren">(</span><em class="sig-param">conf_file='/etc/lorax/lorax.conf'</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax.html#Lorax.configure"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.Lorax.configure" title="Permalink to this definition"></a></dt>
2019-12-19 22:07:51 +00:00
<dd></dd></dl>
<dl class="method">
<dt id="pylorax.Lorax.init_file_logging">
2020-04-28 17:42:12 +00:00
<code class="sig-name descname">init_file_logging</code><span class="sig-paren">(</span><em class="sig-param">logdir</em>, <em class="sig-param">logname='pylorax.log'</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax.html#Lorax.init_file_logging"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.Lorax.init_file_logging" title="Permalink to this definition"></a></dt>
2019-12-19 22:07:51 +00:00
<dd></dd></dl>
<dl class="method">
<dt id="pylorax.Lorax.init_stream_logging">
2020-04-28 17:42:12 +00:00
<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>
2019-12-19 22:07:51 +00:00
<dd></dd></dl>
<dl class="method">
<dt id="pylorax.Lorax.run">
2020-04-28 17:42:12 +00:00
<code class="sig-name descname">run</code><span class="sig-paren">(</span><em class="sig-param">dbo</em>, <em class="sig-param">product</em>, <em class="sig-param">version</em>, <em class="sig-param">release</em>, <em class="sig-param">variant=''</em>, <em class="sig-param">bugurl=''</em>, <em class="sig-param">isfinal=False</em>, <em class="sig-param">workdir=None</em>, <em class="sig-param">outputdir=None</em>, <em class="sig-param">buildarch=None</em>, <em class="sig-param">volid=None</em>, <em class="sig-param">domacboot=True</em>, <em class="sig-param">doupgrade=True</em>, <em class="sig-param">remove_temp=False</em>, <em class="sig-param">installpkgs=None</em>, <em class="sig-param">excludepkgs=None</em>, <em class="sig-param">size=2</em>, <em class="sig-param">add_templates=None</em>, <em class="sig-param">add_template_vars=None</em>, <em class="sig-param">add_arch_templates=None</em>, <em class="sig-param">add_arch_template_vars=None</em>, <em class="sig-param">verify=True</em>, <em class="sig-param">user_dracut_args=None</em>, <em class="sig-param">skip_branding=False</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax.html#Lorax.run"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.Lorax.run" title="Permalink to this definition"></a></dt>
2019-12-19 22:07:51 +00:00
<dd></dd></dl>
2020-04-28 17:42:12 +00:00
<dl class="method">
2019-12-19 22:07:51 +00:00
<dt id="pylorax.Lorax.templatedir">
2020-04-28 17:42:12 +00:00
<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>
2019-12-19 22:07:51 +00:00
<dd><p>Find the template directory.</p>
<p>Pick the first directory under sharedir/templates.d/ if it exists.
Otherwise use the sharedir</p>
</dd></dl>
</dd></dl>
<dl class="function">
<dt id="pylorax.find_templates">
2020-04-28 17:42:12 +00:00
<code class="sig-prename descclassname">pylorax.</code><code class="sig-name descname">find_templates</code><span class="sig-paren">(</span><em class="sig-param">templatedir='/usr/share/lorax'</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax.html#find_templates"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.find_templates" title="Permalink to this definition"></a></dt>
2019-12-19 22:07:51 +00:00
<dd><p>Find the templates to use.</p>
2020-04-28 17:42:12 +00:00
<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>
2019-12-19 22:07:51 +00:00
<p>If there is a templates.d directory under templatedir the
lowest numbered directory entry is returned.</p>
<p>eg. /usr/share/lorax/templates.d/99-generic/</p>
</dd></dl>
<dl class="function">
<dt id="pylorax.get_buildarch">
2020-04-28 17:42:12 +00:00
<code class="sig-prename descclassname">pylorax.</code><code class="sig-name descname">get_buildarch</code><span class="sig-paren">(</span><em class="sig-param">dbo</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax.html#get_buildarch"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.get_buildarch" title="Permalink to this definition"></a></dt>
2019-12-19 22:07:51 +00:00
<dd></dd></dl>
<dl class="function">
<dt id="pylorax.log_selinux_state">
2020-04-28 17:42:12 +00:00
<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>
2019-12-19 22:07:51 +00:00
<dd><p>Log the current state of selinux</p>
</dd></dl>
<dl class="function">
<dt id="pylorax.setup_logging">
2020-04-28 17:42:12 +00:00
<code class="sig-prename descclassname">pylorax.</code><code class="sig-name descname">setup_logging</code><span class="sig-paren">(</span><em class="sig-param">logfile</em>, <em class="sig-param">theLogger</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax.html#setup_logging"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.setup_logging" title="Permalink to this definition"></a></dt>
2019-12-19 22:07:51 +00:00
<dd><p>Setup the various logs</p>
2020-04-28 17:42:12 +00:00
<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>
2019-12-19 22:07:51 +00:00
</ul>
2020-04-28 17:42:12 +00:00
</dd>
</dl>
2019-12-19 22:07:51 +00:00
</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="modules.html" class="btn btn-neutral float-left" title="pylorax" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left"></span> Previous</a>
</div>
<hr/>
<div role="contentinfo">
<p>
&copy; Copyright 2018-2019, 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>