Update the generated html docs

This commit is contained in:
Brian C. Lane 2018-05-16 13:15:10 -07:00
parent dcb5c5b59a
commit 140a736518
73 changed files with 25517 additions and 1468 deletions

View File

@ -1,4 +1,4 @@
# Sphinx build info version 1 # Sphinx build info version 1
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done. # This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done.
config: a191c75fd1f5041e8ca7029874dc82a4 config: 83a0a0ce5b2aa0a173e2890240b2a7a0
tags: 645f666f9bcd5a90fca523b33c5a78b7 tags: 645f666f9bcd5a90fca523b33c5a78b7

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -8,8 +8,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Overview: module code &mdash; Lorax 28.9 documentation</title> <title>Overview: module code &mdash; Lorax 28.10 documentation</title>
@ -27,22 +26,16 @@
<link rel="stylesheet" href="../_static/css/theme.css" type="text/css" /> <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="index" title="Index"
href="../genindex.html"/>
<link rel="search" title="Search" href="../search.html" /> <link rel="search" title="Search" href="../search.html" />
<link rel="top" title="Lorax 28.9 documentation" href="../index.html"/>
<script src="../_static/js/modernizr.min.js"></script> <script src="../_static/js/modernizr.min.js"></script>
</head> </head>
<body class="wy-body-for-nav" role="document"> <body class="wy-body-for-nav">
<div class="wy-grid-for-nav"> <div class="wy-grid-for-nav">
@ -64,7 +57,7 @@
<div class="version"> <div class="version">
28.9 28.10
</div> </div>
@ -93,6 +86,8 @@
<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="../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="../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="../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"><a class="reference internal" href="../product-images.html">Product and Updates Images</a></li>
<li class="toctree-l1"><a class="reference internal" href="../modules.html">pylorax</a></li> <li class="toctree-l1"><a class="reference internal" href="../modules.html">pylorax</a></li>
</ul> </ul>
@ -106,7 +101,7 @@
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"> <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
<nav class="wy-nav-top" role="navigation" aria-label="top navigation"> <nav class="wy-nav-top" aria-label="top navigation">
<i data-toggle="wy-nav-top" class="fa fa-bars"></i> <i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="../index.html">Lorax</a> <a href="../index.html">Lorax</a>
@ -114,8 +109,8 @@
</nav> </nav>
<div class="wy-nav-content"> <div class="wy-nav-content">
<div class="rst-content"> <div class="rst-content">
@ -133,6 +128,7 @@
<div role="navigation" aria-label="breadcrumbs navigation"> <div role="navigation" aria-label="breadcrumbs navigation">
<ul class="wy-breadcrumbs"> <ul class="wy-breadcrumbs">
@ -144,8 +140,6 @@
<li class="wy-breadcrumbs-aside"> <li class="wy-breadcrumbs-aside">
</li> </li>
</ul> </ul>
@ -158,14 +152,26 @@
<h1>All modules for which code is available</h1> <h1>All modules for which code is available</h1>
<ul><li><a href="pylorax.html">pylorax</a></li> <ul><li><a href="pylorax.html">pylorax</a></li>
<ul><li><a href="pylorax/base.html">pylorax.base</a></li> <ul><li><a href="pylorax/api/cmdline.html">pylorax.api.cmdline</a></li>
<li><a href="pylorax/api/compose.html">pylorax.api.compose</a></li>
<li><a href="pylorax/api/config.html">pylorax.api.config</a></li>
<li><a href="pylorax/api/crossdomain.html">pylorax.api.crossdomain</a></li>
<li><a href="pylorax/api/projects.html">pylorax.api.projects</a></li>
<li><a href="pylorax/api/queue.html">pylorax.api.queue</a></li>
<li><a href="pylorax/api/recipes.html">pylorax.api.recipes</a></li>
<li><a href="pylorax/api/server.html">pylorax.api.server</a></li>
<li><a href="pylorax/api/v0.html">pylorax.api.v0</a></li>
<li><a href="pylorax/api/workspace.html">pylorax.api.workspace</a></li>
<li><a href="pylorax/base.html">pylorax.base</a></li>
<li><a href="pylorax/buildstamp.html">pylorax.buildstamp</a></li> <li><a href="pylorax/buildstamp.html">pylorax.buildstamp</a></li>
<li><a href="pylorax/cmdline.html">pylorax.cmdline</a></li> <li><a href="pylorax/cmdline.html">pylorax.cmdline</a></li>
<li><a href="pylorax/creator.html">pylorax.creator</a></li>
<li><a href="pylorax/decorators.html">pylorax.decorators</a></li> <li><a href="pylorax/decorators.html">pylorax.decorators</a></li>
<li><a href="pylorax/discinfo.html">pylorax.discinfo</a></li> <li><a href="pylorax/discinfo.html">pylorax.discinfo</a></li>
<li><a href="pylorax/dnfhelper.html">pylorax.dnfhelper</a></li> <li><a href="pylorax/dnfhelper.html">pylorax.dnfhelper</a></li>
<li><a href="pylorax/executils.html">pylorax.executils</a></li> <li><a href="pylorax/executils.html">pylorax.executils</a></li>
<li><a href="pylorax/imgutils.html">pylorax.imgutils</a></li> <li><a href="pylorax/imgutils.html">pylorax.imgutils</a></li>
<li><a href="pylorax/installer.html">pylorax.installer</a></li>
<li><a href="pylorax/ltmpl.html">pylorax.ltmpl</a></li> <li><a href="pylorax/ltmpl.html">pylorax.ltmpl</a></li>
<li><a href="pylorax/monitor.html">pylorax.monitor</a></li> <li><a href="pylorax/monitor.html">pylorax.monitor</a></li>
<li><a href="pylorax/mount.html">pylorax.mount</a></li> <li><a href="pylorax/mount.html">pylorax.mount</a></li>
@ -175,10 +181,8 @@
</ul></ul> </ul></ul>
</div> </div>
<div class="articleComments">
</div> </div>
</div>
<footer> <footer>
@ -190,7 +194,7 @@
</p> </p>
</div> </div>
Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/snide/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>. 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> </footer>
@ -208,7 +212,8 @@
<script type="text/javascript"> <script type="text/javascript">
var DOCUMENTATION_OPTIONS = { var DOCUMENTATION_OPTIONS = {
URL_ROOT:'../', URL_ROOT:'../',
VERSION:'28.9', VERSION:'28.10',
LANGUAGE:'None',
COLLAPSE_INDEX:false, COLLAPSE_INDEX:false,
FILE_SUFFIX:'.html', FILE_SUFFIX:'.html',
HAS_SOURCE: true, HAS_SOURCE: true,
@ -226,14 +231,13 @@
<script type="text/javascript" src="../_static/js/theme.js"></script> <script type="text/javascript" src="../_static/js/theme.js"></script>
<script type="text/javascript"> <script type="text/javascript">
jQuery(function () { jQuery(function () {
SphinxRtdTheme.StickyNav.enable();
SphinxRtdTheme.Navigation.enableSticky();
}); });
</script> </script>
</body> </body>
</html> </html>

View File

@ -8,8 +8,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>pylorax &mdash; Lorax 28.9 documentation</title> <title>pylorax &mdash; Lorax 28.10 documentation</title>
@ -27,23 +26,16 @@
<link rel="stylesheet" href="../_static/css/theme.css" type="text/css" /> <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="index" title="Index"
href="../genindex.html"/>
<link rel="search" title="Search" href="../search.html" /> <link rel="search" title="Search" href="../search.html" />
<link rel="top" title="Lorax 28.9 documentation" href="../index.html"/>
<link rel="up" title="Module code" href="index.html"/>
<script src="../_static/js/modernizr.min.js"></script> <script src="../_static/js/modernizr.min.js"></script>
</head> </head>
<body class="wy-body-for-nav" role="document"> <body class="wy-body-for-nav">
<div class="wy-grid-for-nav"> <div class="wy-grid-for-nav">
@ -65,7 +57,7 @@
<div class="version"> <div class="version">
28.9 28.10
</div> </div>
@ -94,6 +86,8 @@
<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="../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="../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="../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"><a class="reference internal" href="../product-images.html">Product and Updates Images</a></li>
<li class="toctree-l1"><a class="reference internal" href="../modules.html">pylorax</a></li> <li class="toctree-l1"><a class="reference internal" href="../modules.html">pylorax</a></li>
</ul> </ul>
@ -107,7 +101,7 @@
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"> <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
<nav class="wy-nav-top" role="navigation" aria-label="top navigation"> <nav class="wy-nav-top" aria-label="top navigation">
<i data-toggle="wy-nav-top" class="fa fa-bars"></i> <i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="../index.html">Lorax</a> <a href="../index.html">Lorax</a>
@ -115,8 +109,8 @@
</nav> </nav>
<div class="wy-nav-content"> <div class="wy-nav-content">
<div class="rst-content"> <div class="rst-content">
@ -134,6 +128,7 @@
<div role="navigation" aria-label="breadcrumbs navigation"> <div role="navigation" aria-label="breadcrumbs navigation">
<ul class="wy-breadcrumbs"> <ul class="wy-breadcrumbs">
@ -147,8 +142,6 @@
<li class="wy-breadcrumbs-aside"> <li class="wy-breadcrumbs-aside">
</li> </li>
</ul> </ul>
@ -607,10 +600,8 @@
</pre></div> </pre></div>
</div> </div>
<div class="articleComments">
</div> </div>
</div>
<footer> <footer>
@ -622,7 +613,7 @@
</p> </p>
</div> </div>
Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/snide/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>. 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> </footer>
@ -640,7 +631,8 @@
<script type="text/javascript"> <script type="text/javascript">
var DOCUMENTATION_OPTIONS = { var DOCUMENTATION_OPTIONS = {
URL_ROOT:'../', URL_ROOT:'../',
VERSION:'28.9', VERSION:'28.10',
LANGUAGE:'None',
COLLAPSE_INDEX:false, COLLAPSE_INDEX:false,
FILE_SUFFIX:'.html', FILE_SUFFIX:'.html',
HAS_SOURCE: true, HAS_SOURCE: true,
@ -658,14 +650,13 @@
<script type="text/javascript" src="../_static/js/theme.js"></script> <script type="text/javascript" src="../_static/js/theme.js"></script>
<script type="text/javascript"> <script type="text/javascript">
jQuery(function () { jQuery(function () {
SphinxRtdTheme.StickyNav.enable();
SphinxRtdTheme.Navigation.enableSticky();
}); });
</script> </script>
</body> </body>
</html> </html>

View File

@ -0,0 +1,278 @@
<!DOCTYPE html>
<!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]-->
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>pylorax.api.cmdline &mdash; Lorax 28.10 documentation</title>
<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" />
<script src="../../../_static/js/modernizr.min.js"></script>
</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">
28.10
</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>
<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"><a class="reference internal" href="../../../modules.html">pylorax</a></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="../../index.html">Module code</a> &raquo;</li>
<li><a href="../../pylorax.html">pylorax</a> &raquo;</li>
<li>pylorax.api.cmdline</li>
<li class="wy-breadcrumbs-aside">
</li>
</ul>
<hr/>
</div>
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
<div itemprop="articleBody">
<h1>Source code for pylorax.api.cmdline</h1><div class="highlight"><pre>
<span></span><span class="c1">#</span>
<span class="c1"># cmdline.py</span>
<span class="c1">#</span>
<span class="c1"># Copyright (C) 2018 Red Hat, Inc.</span>
<span class="c1">#</span>
<span class="c1"># This program is free software; you can redistribute it and/or modify</span>
<span class="c1"># it under the terms of the GNU General Public License as published by</span>
<span class="c1"># the Free Software Foundation; either version 2 of the License, or</span>
<span class="c1"># (at your option) any later version.</span>
<span class="c1">#</span>
<span class="c1"># This program is distributed in the hope that it will be useful,</span>
<span class="c1"># but WITHOUT ANY WARRANTY; without even the implied warranty of</span>
<span class="c1"># MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the</span>
<span class="c1"># GNU General Public License for more details.</span>
<span class="c1">#</span>
<span class="c1"># You should have received a copy of the GNU General Public License</span>
<span class="c1"># along with this program. If not, see &lt;http://www.gnu.org/licenses/&gt;.</span>
<span class="c1">#</span>
<span class="kn">import</span> <span class="nn">os</span>
<span class="kn">import</span> <span class="nn">sys</span>
<span class="kn">import</span> <span class="nn">argparse</span>
<span class="kn">from</span> <span class="nn">pylorax</span> <span class="k">import</span> <span class="n">vernum</span>
<span class="n">version</span> <span class="o">=</span> <span class="s2">&quot;</span><span class="si">{0}</span><span class="s2">-</span><span class="si">{1}</span><span class="s2">&quot;</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">basename</span><span class="p">(</span><span class="n">sys</span><span class="o">.</span><span class="n">argv</span><span class="p">[</span><span class="mi">0</span><span class="p">]),</span> <span class="n">vernum</span><span class="p">)</span>
<div class="viewcode-block" id="lorax_composer_parser"><a class="viewcode-back" href="../../../pylorax.api.html#pylorax.api.cmdline.lorax_composer_parser">[docs]</a><span class="k">def</span> <span class="nf">lorax_composer_parser</span><span class="p">():</span>
<span class="sd">&quot;&quot;&quot; Return the ArgumentParser for lorax-composer&quot;&quot;&quot;</span>
<span class="n">parser</span> <span class="o">=</span> <span class="n">argparse</span><span class="o">.</span><span class="n">ArgumentParser</span><span class="p">(</span><span class="n">description</span><span class="o">=</span><span class="s2">&quot;Lorax Composer API Server&quot;</span><span class="p">,</span>
<span class="n">fromfile_prefix_chars</span><span class="o">=</span><span class="s2">&quot;@&quot;</span><span class="p">)</span>
<span class="n">parser</span><span class="o">.</span><span class="n">add_argument</span><span class="p">(</span><span class="s2">&quot;--socket&quot;</span><span class="p">,</span> <span class="n">default</span><span class="o">=</span><span class="s2">&quot;/run/weldr/api.socket&quot;</span><span class="p">,</span> <span class="n">metavar</span><span class="o">=</span><span class="s2">&quot;SOCKET&quot;</span><span class="p">,</span>
<span class="n">help</span><span class="o">=</span><span class="s2">&quot;Path to the socket file to listen on&quot;</span><span class="p">)</span>
<span class="n">parser</span><span class="o">.</span><span class="n">add_argument</span><span class="p">(</span><span class="s2">&quot;--user&quot;</span><span class="p">,</span> <span class="n">default</span><span class="o">=</span><span class="s2">&quot;weldr&quot;</span><span class="p">,</span> <span class="n">metavar</span><span class="o">=</span><span class="s2">&quot;USER&quot;</span><span class="p">,</span>
<span class="n">help</span><span class="o">=</span><span class="s2">&quot;User to use for reduced permissions&quot;</span><span class="p">)</span>
<span class="n">parser</span><span class="o">.</span><span class="n">add_argument</span><span class="p">(</span><span class="s2">&quot;--group&quot;</span><span class="p">,</span> <span class="n">default</span><span class="o">=</span><span class="s2">&quot;weldr&quot;</span><span class="p">,</span> <span class="n">metavar</span><span class="o">=</span><span class="s2">&quot;GROUP&quot;</span><span class="p">,</span>
<span class="n">help</span><span class="o">=</span><span class="s2">&quot;Group to set ownership of the socket to&quot;</span><span class="p">)</span>
<span class="n">parser</span><span class="o">.</span><span class="n">add_argument</span><span class="p">(</span><span class="s2">&quot;--log&quot;</span><span class="p">,</span> <span class="n">dest</span><span class="o">=</span><span class="s2">&quot;logfile&quot;</span><span class="p">,</span> <span class="n">default</span><span class="o">=</span><span class="s2">&quot;/var/log/lorax-composer/composer.log&quot;</span><span class="p">,</span> <span class="n">metavar</span><span class="o">=</span><span class="s2">&quot;LOG&quot;</span><span class="p">,</span>
<span class="n">help</span><span class="o">=</span><span class="s2">&quot;Path to logfile (/var/log/lorax-composer/composer.log)&quot;</span><span class="p">)</span>
<span class="n">parser</span><span class="o">.</span><span class="n">add_argument</span><span class="p">(</span><span class="s2">&quot;--mockfiles&quot;</span><span class="p">,</span> <span class="n">default</span><span class="o">=</span><span class="s2">&quot;/var/tmp/bdcs-mockfiles/&quot;</span><span class="p">,</span> <span class="n">metavar</span><span class="o">=</span><span class="s2">&quot;MOCKFILES&quot;</span><span class="p">,</span>
<span class="n">help</span><span class="o">=</span><span class="s2">&quot;Path to JSON files used for /api/mock/ paths (/var/tmp/bdcs-mockfiles/)&quot;</span><span class="p">)</span>
<span class="n">parser</span><span class="o">.</span><span class="n">add_argument</span><span class="p">(</span><span class="s2">&quot;--sharedir&quot;</span><span class="p">,</span> <span class="nb">type</span><span class="o">=</span><span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">abspath</span><span class="p">,</span> <span class="n">metavar</span><span class="o">=</span><span class="s2">&quot;SHAREDIR&quot;</span><span class="p">,</span>
<span class="n">help</span><span class="o">=</span><span class="s2">&quot;Directory containing all the templates. Overrides config file sharedir&quot;</span><span class="p">)</span>
<span class="n">parser</span><span class="o">.</span><span class="n">add_argument</span><span class="p">(</span><span class="s2">&quot;-V&quot;</span><span class="p">,</span> <span class="n">action</span><span class="o">=</span><span class="s2">&quot;store_true&quot;</span><span class="p">,</span> <span class="n">dest</span><span class="o">=</span><span class="s2">&quot;showver&quot;</span><span class="p">,</span>
<span class="n">help</span><span class="o">=</span><span class="s2">&quot;show program&#39;s version number and exit&quot;</span><span class="p">)</span>
<span class="n">parser</span><span class="o">.</span><span class="n">add_argument</span><span class="p">(</span><span class="s2">&quot;-c&quot;</span><span class="p">,</span> <span class="s2">&quot;--config&quot;</span><span class="p">,</span> <span class="n">default</span><span class="o">=</span><span class="s2">&quot;/etc/lorax/composer.conf&quot;</span><span class="p">,</span> <span class="n">metavar</span><span class="o">=</span><span class="s2">&quot;CONFIG&quot;</span><span class="p">,</span>
<span class="n">help</span><span class="o">=</span><span class="s2">&quot;Path to lorax-composer configuration file.&quot;</span><span class="p">)</span>
<span class="n">parser</span><span class="o">.</span><span class="n">add_argument</span><span class="p">(</span><span class="s2">&quot;--releasever&quot;</span><span class="p">,</span> <span class="n">default</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">metavar</span><span class="o">=</span><span class="s2">&quot;STRING&quot;</span><span class="p">,</span>
<span class="n">help</span><span class="o">=</span><span class="s2">&quot;Release version to use for $releasever in dnf repository urls&quot;</span><span class="p">)</span>
<span class="n">parser</span><span class="o">.</span><span class="n">add_argument</span><span class="p">(</span><span class="s2">&quot;--tmp&quot;</span><span class="p">,</span> <span class="n">default</span><span class="o">=</span><span class="s2">&quot;/var/tmp&quot;</span><span class="p">,</span>
<span class="n">help</span><span class="o">=</span><span class="s2">&quot;Top level temporary directory&quot;</span><span class="p">)</span>
<span class="n">parser</span><span class="o">.</span><span class="n">add_argument</span><span class="p">(</span><span class="s2">&quot;--proxy&quot;</span><span class="p">,</span> <span class="n">default</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">metavar</span><span class="o">=</span><span class="s2">&quot;PROXY&quot;</span><span class="p">,</span>
<span class="n">help</span><span class="o">=</span><span class="s2">&quot;Set proxy for DNF, overrides configuration file setting.&quot;</span><span class="p">)</span>
<span class="n">parser</span><span class="o">.</span><span class="n">add_argument</span><span class="p">(</span><span class="s2">&quot;BLUEPRINTS&quot;</span><span class="p">,</span> <span class="n">metavar</span><span class="o">=</span><span class="s2">&quot;BLUEPRINTS&quot;</span><span class="p">,</span>
<span class="n">help</span><span class="o">=</span><span class="s2">&quot;Path to the blueprints&quot;</span><span class="p">)</span>
<span class="k">return</span> <span class="n">parser</span></div>
</pre></div>
</div>
</div>
<footer>
<hr/>
<div role="contentinfo">
<p>
&copy; Copyright 2018, Red Hat, Inc..
</p>
</div>
Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/rtfd/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>.
</footer>
</div>
</div>
</section>
</div>
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT:'../../../',
VERSION:'28.10',
LANGUAGE:'None',
COLLAPSE_INDEX:false,
FILE_SUFFIX:'.html',
HAS_SOURCE: true,
SOURCELINK_SUFFIX: '.txt'
};
</script>
<script type="text/javascript" src="../../../_static/jquery.js"></script>
<script type="text/javascript" src="../../../_static/underscore.js"></script>
<script type="text/javascript" src="../../../_static/doctools.js"></script>
<script type="text/javascript" src="../../../_static/js/theme.js"></script>
<script type="text/javascript">
jQuery(function () {
SphinxRtdTheme.Navigation.enableSticky();
});
</script>
</body>
</html>

View File

@ -0,0 +1,728 @@
<!DOCTYPE html>
<!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]-->
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>pylorax.api.compose &mdash; Lorax 28.10 documentation</title>
<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" />
<script src="../../../_static/js/modernizr.min.js"></script>
</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">
28.10
</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>
<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"><a class="reference internal" href="../../../modules.html">pylorax</a></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="../../index.html">Module code</a> &raquo;</li>
<li><a href="../../pylorax.html">pylorax</a> &raquo;</li>
<li>pylorax.api.compose</li>
<li class="wy-breadcrumbs-aside">
</li>
</ul>
<hr/>
</div>
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
<div itemprop="articleBody">
<h1>Source code for pylorax.api.compose</h1><div class="highlight"><pre>
<span></span><span class="c1"># Copyright (C) 2018 Red Hat, Inc.</span>
<span class="c1">#</span>
<span class="c1"># This program is free software; you can redistribute it and/or modify</span>
<span class="c1"># it under the terms of the GNU General Public License as published by</span>
<span class="c1"># the Free Software Foundation; either version 2 of the License, or</span>
<span class="c1"># (at your option) any later version.</span>
<span class="c1">#</span>
<span class="c1"># This program is distributed in the hope that it will be useful,</span>
<span class="c1"># but WITHOUT ANY WARRANTY; without even the implied warranty of</span>
<span class="c1"># MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the</span>
<span class="c1"># GNU General Public License for more details.</span>
<span class="c1">#</span>
<span class="c1"># You should have received a copy of the GNU General Public License</span>
<span class="c1"># along with this program. If not, see &lt;http://www.gnu.org/licenses/&gt;.</span>
<span class="c1">#</span>
<span class="sd">&quot;&quot;&quot; Setup for composing an image</span>
<span class="sd">Adding New Output Types</span>
<span class="sd">-----------------------</span>
<span class="sd">The new output type must add a kickstart template to ./share/composer/ where the</span>
<span class="sd">name of the kickstart (without the trailing .ks) matches the entry in compose_args.</span>
<span class="sd">The kickstart should not have any url or repo entries, these will be added at build</span>
<span class="sd">time. The %packages section should be the last thing, and while it can contain mandatory</span>
<span class="sd">packages required by the output type, it should not have the trailing %end because the</span>
<span class="sd">package NEVRAs will be appended to it at build time.</span>
<span class="sd">compose_args should have a name matching the kickstart, and it should set the novirt_install</span>
<span class="sd">parameters needed to generate the desired output. Other types should be set to False.</span>
<span class="sd">&quot;&quot;&quot;</span>
<span class="kn">import</span> <span class="nn">logging</span>
<span class="n">log</span> <span class="o">=</span> <span class="n">logging</span><span class="o">.</span><span class="n">getLogger</span><span class="p">(</span><span class="s2">&quot;lorax-composer&quot;</span><span class="p">)</span>
<span class="kn">import</span> <span class="nn">os</span>
<span class="kn">from</span> <span class="nn">glob</span> <span class="k">import</span> <span class="n">glob</span>
<span class="kn">from</span> <span class="nn">math</span> <span class="k">import</span> <span class="n">ceil</span>
<span class="kn">import</span> <span class="nn">pytoml</span> <span class="k">as</span> <span class="nn">toml</span>
<span class="kn">import</span> <span class="nn">shutil</span>
<span class="kn">from</span> <span class="nn">uuid</span> <span class="k">import</span> <span class="n">uuid4</span>
<span class="kn">from</span> <span class="nn">pyanaconda.simpleconfig</span> <span class="k">import</span> <span class="n">SimpleConfigFile</span>
<span class="c1"># Use pykickstart to calculate disk image size</span>
<span class="kn">from</span> <span class="nn">pykickstart.parser</span> <span class="k">import</span> <span class="n">KickstartParser</span>
<span class="kn">from</span> <span class="nn">pykickstart.version</span> <span class="k">import</span> <span class="n">makeVersion</span>
<span class="kn">from</span> <span class="nn">pylorax.api.projects</span> <span class="k">import</span> <span class="n">projects_depsolve_with_size</span><span class="p">,</span> <span class="n">dep_nevra</span>
<span class="kn">from</span> <span class="nn">pylorax.api.projects</span> <span class="k">import</span> <span class="n">ProjectsError</span>
<span class="kn">from</span> <span class="nn">pylorax.api.recipes</span> <span class="k">import</span> <span class="n">read_recipe_and_id</span>
<span class="kn">from</span> <span class="nn">pylorax.imgutils</span> <span class="k">import</span> <span class="n">default_image_name</span>
<span class="kn">from</span> <span class="nn">pylorax.sysutils</span> <span class="k">import</span> <span class="n">joinpaths</span>
<div class="viewcode-block" id="repo_to_ks"><a class="viewcode-back" href="../../../pylorax.api.html#pylorax.api.compose.repo_to_ks">[docs]</a><span class="k">def</span> <span class="nf">repo_to_ks</span><span class="p">(</span><span class="n">r</span><span class="p">,</span> <span class="n">url</span><span class="o">=</span><span class="s2">&quot;url&quot;</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot; Return a kickstart line with the correct args.</span>
<span class="sd"> :param r: DNF repository information</span>
<span class="sd"> :type r: dnf.Repo</span>
<span class="sd"> :param url: &quot;url&quot; or &quot;baseurl&quot; to use for the baseurl parameter</span>
<span class="sd"> :type url: str</span>
<span class="sd"> :returns: kickstart command arguments for url/repo command</span>
<span class="sd"> :rtype: str</span>
<span class="sd"> Set url to &quot;baseurl&quot; if it is a repo, leave it as &quot;url&quot; for the installation url.</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="n">cmd</span> <span class="o">=</span> <span class="s2">&quot;&quot;</span>
<span class="c1"># url uses --url not --baseurl</span>
<span class="k">if</span> <span class="n">r</span><span class="o">.</span><span class="n">baseurl</span><span class="p">:</span>
<span class="n">cmd</span> <span class="o">+=</span> <span class="s1">&#39;--</span><span class="si">%s</span><span class="s1">=&quot;</span><span class="si">%s</span><span class="s1">&quot; &#39;</span> <span class="o">%</span> <span class="p">(</span><span class="n">url</span><span class="p">,</span> <span class="n">r</span><span class="o">.</span><span class="n">baseurl</span><span class="p">[</span><span class="mi">0</span><span class="p">])</span>
<span class="k">elif</span> <span class="n">r</span><span class="o">.</span><span class="n">metalink</span><span class="p">:</span>
<span class="n">cmd</span> <span class="o">+=</span> <span class="s1">&#39;--metalink=&quot;</span><span class="si">%s</span><span class="s1">&quot; &#39;</span> <span class="o">%</span> <span class="n">r</span><span class="o">.</span><span class="n">metalink</span>
<span class="k">elif</span> <span class="n">r</span><span class="o">.</span><span class="n">mirrorlist</span><span class="p">:</span>
<span class="n">cmd</span> <span class="o">+=</span> <span class="s1">&#39;--mirrorlist=&quot;</span><span class="si">%s</span><span class="s1">&quot; &#39;</span> <span class="o">%</span> <span class="n">r</span><span class="o">.</span><span class="n">mirrorlist</span>
<span class="k">else</span><span class="p">:</span>
<span class="k">raise</span> <span class="ne">RuntimeError</span><span class="p">(</span><span class="s2">&quot;Repo has no baseurl, metalink, or mirrorlist&quot;</span><span class="p">)</span>
<span class="k">if</span> <span class="n">r</span><span class="o">.</span><span class="n">proxy</span><span class="p">:</span>
<span class="n">cmd</span> <span class="o">+=</span> <span class="s1">&#39;--proxy=&quot;</span><span class="si">%s</span><span class="s1">&quot; &#39;</span> <span class="o">%</span> <span class="n">r</span><span class="o">.</span><span class="n">proxy</span>
<span class="k">if</span> <span class="ow">not</span> <span class="n">r</span><span class="o">.</span><span class="n">sslverify</span><span class="p">:</span>
<span class="n">cmd</span> <span class="o">+=</span> <span class="s1">&#39;--noverifyssl&#39;</span>
<span class="k">return</span> <span class="n">cmd</span></div>
<div class="viewcode-block" id="write_ks_user"><a class="viewcode-back" href="../../../pylorax.api.html#pylorax.api.compose.write_ks_user">[docs]</a><span class="k">def</span> <span class="nf">write_ks_user</span><span class="p">(</span><span class="n">f</span><span class="p">,</span> <span class="n">user</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot; Write kickstart user and sshkey entry</span>
<span class="sd"> :param f: kickstart file object</span>
<span class="sd"> :type f: open file object</span>
<span class="sd"> :param user: A blueprint user dictionary</span>
<span class="sd"> :type user: dict</span>
<span class="sd"> If the entry contains a ssh key, use sshkey to write it</span>
<span class="sd"> All of the user fields are optional, except name, write out a kickstart user entry</span>
<span class="sd"> with whatever options are relevant.</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="k">if</span> <span class="s2">&quot;name&quot;</span> <span class="ow">not</span> <span class="ow">in</span> <span class="n">user</span><span class="p">:</span>
<span class="k">raise</span> <span class="ne">RuntimeError</span><span class="p">(</span><span class="s2">&quot;user entry requires a name&quot;</span><span class="p">)</span>
<span class="c1"># ssh key uses the sshkey kickstart command</span>
<span class="k">if</span> <span class="s2">&quot;key&quot;</span> <span class="ow">in</span> <span class="n">user</span><span class="p">:</span>
<span class="n">f</span><span class="o">.</span><span class="n">write</span><span class="p">(</span><span class="s1">&#39;sshkey --user </span><span class="si">%s</span><span class="s1"> &quot;</span><span class="si">%s</span><span class="s1">&quot;</span><span class="se">\n</span><span class="s1">&#39;</span> <span class="o">%</span> <span class="p">(</span><span class="n">user</span><span class="p">[</span><span class="s2">&quot;name&quot;</span><span class="p">],</span> <span class="n">user</span><span class="p">[</span><span class="s2">&quot;key&quot;</span><span class="p">]))</span>
<span class="c1"># Write out the user kickstart command, much of it is optional</span>
<span class="n">f</span><span class="o">.</span><span class="n">write</span><span class="p">(</span><span class="s2">&quot;user --name </span><span class="si">%s</span><span class="s2">&quot;</span> <span class="o">%</span> <span class="n">user</span><span class="p">[</span><span class="s2">&quot;name&quot;</span><span class="p">])</span>
<span class="k">if</span> <span class="s2">&quot;home&quot;</span> <span class="ow">in</span> <span class="n">user</span><span class="p">:</span>
<span class="n">f</span><span class="o">.</span><span class="n">write</span><span class="p">(</span><span class="s2">&quot; --homedir </span><span class="si">%s</span><span class="s2">&quot;</span> <span class="o">%</span> <span class="n">user</span><span class="p">[</span><span class="s2">&quot;home&quot;</span><span class="p">])</span>
<span class="k">if</span> <span class="s2">&quot;password&quot;</span> <span class="ow">in</span> <span class="n">user</span><span class="p">:</span>
<span class="k">if</span> <span class="nb">any</span><span class="p">(</span><span class="n">user</span><span class="p">[</span><span class="s2">&quot;password&quot;</span><span class="p">]</span><span class="o">.</span><span class="n">startswith</span><span class="p">(</span><span class="n">prefix</span><span class="p">)</span> <span class="k">for</span> <span class="n">prefix</span> <span class="ow">in</span> <span class="p">[</span><span class="s2">&quot;$2b$&quot;</span><span class="p">,</span> <span class="s2">&quot;$6$&quot;</span><span class="p">,</span> <span class="s2">&quot;$5$&quot;</span><span class="p">]):</span>
<span class="n">log</span><span class="o">.</span><span class="n">debug</span><span class="p">(</span><span class="s2">&quot;Detected pre-crypted password&quot;</span><span class="p">)</span>
<span class="n">f</span><span class="o">.</span><span class="n">write</span><span class="p">(</span><span class="s2">&quot; --iscrypted&quot;</span><span class="p">)</span>
<span class="k">else</span><span class="p">:</span>
<span class="n">log</span><span class="o">.</span><span class="n">debug</span><span class="p">(</span><span class="s2">&quot;Detected plaintext password&quot;</span><span class="p">)</span>
<span class="n">f</span><span class="o">.</span><span class="n">write</span><span class="p">(</span><span class="s2">&quot; --plaintext&quot;</span><span class="p">)</span>
<span class="n">f</span><span class="o">.</span><span class="n">write</span><span class="p">(</span><span class="s2">&quot; --password </span><span class="se">\&quot;</span><span class="si">%s</span><span class="se">\&quot;</span><span class="s2">&quot;</span> <span class="o">%</span> <span class="n">user</span><span class="p">[</span><span class="s2">&quot;password&quot;</span><span class="p">])</span>
<span class="k">if</span> <span class="s2">&quot;shell&quot;</span> <span class="ow">in</span> <span class="n">user</span><span class="p">:</span>
<span class="n">f</span><span class="o">.</span><span class="n">write</span><span class="p">(</span><span class="s2">&quot; --shell </span><span class="si">%s</span><span class="s2">&quot;</span> <span class="o">%</span> <span class="n">user</span><span class="p">[</span><span class="s2">&quot;shell&quot;</span><span class="p">])</span>
<span class="k">if</span> <span class="s2">&quot;uid&quot;</span> <span class="ow">in</span> <span class="n">user</span><span class="p">:</span>
<span class="n">f</span><span class="o">.</span><span class="n">write</span><span class="p">(</span><span class="s2">&quot; --uid </span><span class="si">%d</span><span class="s2">&quot;</span> <span class="o">%</span> <span class="nb">int</span><span class="p">(</span><span class="n">user</span><span class="p">[</span><span class="s2">&quot;uid&quot;</span><span class="p">]))</span>
<span class="k">if</span> <span class="s2">&quot;gid&quot;</span> <span class="ow">in</span> <span class="n">user</span><span class="p">:</span>
<span class="n">f</span><span class="o">.</span><span class="n">write</span><span class="p">(</span><span class="s2">&quot; --gid </span><span class="si">%d</span><span class="s2">&quot;</span> <span class="o">%</span> <span class="nb">int</span><span class="p">(</span><span class="n">user</span><span class="p">[</span><span class="s2">&quot;gid&quot;</span><span class="p">]))</span>
<span class="k">if</span> <span class="s2">&quot;description&quot;</span> <span class="ow">in</span> <span class="n">user</span><span class="p">:</span>
<span class="n">f</span><span class="o">.</span><span class="n">write</span><span class="p">(</span><span class="s2">&quot; --gecos </span><span class="se">\&quot;</span><span class="si">%s</span><span class="se">\&quot;</span><span class="s2">&quot;</span> <span class="o">%</span> <span class="n">user</span><span class="p">[</span><span class="s2">&quot;description&quot;</span><span class="p">])</span>
<span class="k">if</span> <span class="s2">&quot;groups&quot;</span> <span class="ow">in</span> <span class="n">user</span><span class="p">:</span>
<span class="n">f</span><span class="o">.</span><span class="n">write</span><span class="p">(</span><span class="s2">&quot; --groups </span><span class="si">%s</span><span class="s2">&quot;</span> <span class="o">%</span> <span class="s2">&quot;,&quot;</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="n">user</span><span class="p">[</span><span class="s2">&quot;groups&quot;</span><span class="p">]))</span>
<span class="n">f</span><span class="o">.</span><span class="n">write</span><span class="p">(</span><span class="s2">&quot;</span><span class="se">\n</span><span class="s2">&quot;</span><span class="p">)</span></div>
<div class="viewcode-block" id="write_ks_group"><a class="viewcode-back" href="../../../pylorax.api.html#pylorax.api.compose.write_ks_group">[docs]</a><span class="k">def</span> <span class="nf">write_ks_group</span><span class="p">(</span><span class="n">f</span><span class="p">,</span> <span class="n">group</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot; Write kickstart group entry</span>
<span class="sd"> :param f: kickstart file object</span>
<span class="sd"> :type f: open file object</span>
<span class="sd"> :param group: A blueprint group dictionary</span>
<span class="sd"> :type user: dict</span>
<span class="sd"> gid is optional</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="k">if</span> <span class="s2">&quot;name&quot;</span> <span class="ow">not</span> <span class="ow">in</span> <span class="n">group</span><span class="p">:</span>
<span class="k">raise</span> <span class="ne">RuntimeError</span><span class="p">(</span><span class="s2">&quot;group entry requires a name&quot;</span><span class="p">)</span>
<span class="n">f</span><span class="o">.</span><span class="n">write</span><span class="p">(</span><span class="s2">&quot;group --name </span><span class="si">%s</span><span class="s2">&quot;</span> <span class="o">%</span> <span class="n">group</span><span class="p">[</span><span class="s2">&quot;name&quot;</span><span class="p">])</span>
<span class="k">if</span> <span class="s2">&quot;gid&quot;</span> <span class="ow">in</span> <span class="n">group</span><span class="p">:</span>
<span class="n">f</span><span class="o">.</span><span class="n">write</span><span class="p">(</span><span class="s2">&quot; --gid </span><span class="si">%d</span><span class="s2">&quot;</span> <span class="o">%</span> <span class="nb">int</span><span class="p">(</span><span class="n">group</span><span class="p">[</span><span class="s2">&quot;gid&quot;</span><span class="p">]))</span>
<span class="n">f</span><span class="o">.</span><span class="n">write</span><span class="p">(</span><span class="s2">&quot;</span><span class="se">\n</span><span class="s2">&quot;</span><span class="p">)</span></div>
<div class="viewcode-block" id="add_customizations"><a class="viewcode-back" href="../../../pylorax.api.html#pylorax.api.compose.add_customizations">[docs]</a><span class="k">def</span> <span class="nf">add_customizations</span><span class="p">(</span><span class="n">f</span><span class="p">,</span> <span class="n">recipe</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot; Add customizations to the kickstart file</span>
<span class="sd"> :param f: kickstart file object</span>
<span class="sd"> :type f: open file object</span>
<span class="sd"> :param recipe:</span>
<span class="sd"> :type recipe: Recipe object</span>
<span class="sd"> :returns: None</span>
<span class="sd"> :raises: RuntimeError if there was a problem writing to the kickstart</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="k">if</span> <span class="s2">&quot;customizations&quot;</span> <span class="ow">not</span> <span class="ow">in</span> <span class="n">recipe</span><span class="p">:</span>
<span class="k">return</span>
<span class="n">customizations</span> <span class="o">=</span> <span class="n">recipe</span><span class="p">[</span><span class="s2">&quot;customizations&quot;</span><span class="p">]</span>
<span class="k">if</span> <span class="s2">&quot;hostname&quot;</span> <span class="ow">in</span> <span class="n">customizations</span><span class="p">:</span>
<span class="n">f</span><span class="o">.</span><span class="n">write</span><span class="p">(</span><span class="s2">&quot;network --hostname=</span><span class="si">%s</span><span class="se">\n</span><span class="s2">&quot;</span> <span class="o">%</span> <span class="n">customizations</span><span class="p">[</span><span class="s2">&quot;hostname&quot;</span><span class="p">])</span>
<span class="c1"># TODO - remove this, should use user section to define this</span>
<span class="k">if</span> <span class="s2">&quot;sshkey&quot;</span> <span class="ow">in</span> <span class="n">customizations</span><span class="p">:</span>
<span class="c1"># This is a list of entries</span>
<span class="k">for</span> <span class="n">sshkey</span> <span class="ow">in</span> <span class="n">customizations</span><span class="p">[</span><span class="s2">&quot;sshkey&quot;</span><span class="p">]:</span>
<span class="k">if</span> <span class="s2">&quot;user&quot;</span> <span class="ow">not</span> <span class="ow">in</span> <span class="n">sshkey</span> <span class="ow">or</span> <span class="s2">&quot;key&quot;</span> <span class="ow">not</span> <span class="ow">in</span> <span class="n">sshkey</span><span class="p">:</span>
<span class="n">log</span><span class="o">.</span><span class="n">error</span><span class="p">(</span><span class="s2">&quot;</span><span class="si">%s</span><span class="s2"> is incorrect, skipping&quot;</span><span class="p">,</span> <span class="n">sshkey</span><span class="p">)</span>
<span class="k">continue</span>
<span class="n">f</span><span class="o">.</span><span class="n">write</span><span class="p">(</span><span class="s1">&#39;sshkey --user </span><span class="si">%s</span><span class="s1"> &quot;</span><span class="si">%s</span><span class="s1">&quot;</span><span class="se">\n</span><span class="s1">&#39;</span> <span class="o">%</span> <span class="p">(</span><span class="n">sshkey</span><span class="p">[</span><span class="s2">&quot;user&quot;</span><span class="p">],</span> <span class="n">sshkey</span><span class="p">[</span><span class="s2">&quot;key&quot;</span><span class="p">]))</span>
<span class="c1"># Creating a user also creates a group. Make a list of the names for later</span>
<span class="n">user_groups</span> <span class="o">=</span> <span class="p">[]</span>
<span class="k">if</span> <span class="s2">&quot;user&quot;</span> <span class="ow">in</span> <span class="n">customizations</span><span class="p">:</span>
<span class="c1"># only name is required, everything else is optional</span>
<span class="k">for</span> <span class="n">user</span> <span class="ow">in</span> <span class="n">customizations</span><span class="p">[</span><span class="s2">&quot;user&quot;</span><span class="p">]:</span>
<span class="n">write_ks_user</span><span class="p">(</span><span class="n">f</span><span class="p">,</span> <span class="n">user</span><span class="p">)</span>
<span class="n">user_groups</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">user</span><span class="p">[</span><span class="s2">&quot;name&quot;</span><span class="p">])</span>
<span class="k">if</span> <span class="s2">&quot;group&quot;</span> <span class="ow">in</span> <span class="n">customizations</span><span class="p">:</span>
<span class="k">for</span> <span class="n">group</span> <span class="ow">in</span> <span class="n">customizations</span><span class="p">[</span><span class="s2">&quot;group&quot;</span><span class="p">]:</span>
<span class="k">if</span> <span class="n">group</span><span class="p">[</span><span class="s2">&quot;name&quot;</span><span class="p">]</span> <span class="ow">not</span> <span class="ow">in</span> <span class="n">user_groups</span><span class="p">:</span>
<span class="n">write_ks_group</span><span class="p">(</span><span class="n">f</span><span class="p">,</span> <span class="n">group</span><span class="p">)</span>
<span class="k">else</span><span class="p">:</span>
<span class="n">log</span><span class="o">.</span><span class="n">warning</span><span class="p">(</span><span class="s2">&quot;Skipping group </span><span class="si">%s</span><span class="s2">, already created by user&quot;</span><span class="p">,</span> <span class="n">group</span><span class="p">[</span><span class="s2">&quot;name&quot;</span><span class="p">])</span></div>
<div class="viewcode-block" id="start_build"><a class="viewcode-back" href="../../../pylorax.api.html#pylorax.api.compose.start_build">[docs]</a><span class="k">def</span> <span class="nf">start_build</span><span class="p">(</span><span class="n">cfg</span><span class="p">,</span> <span class="n">dnflock</span><span class="p">,</span> <span class="n">gitlock</span><span class="p">,</span> <span class="n">branch</span><span class="p">,</span> <span class="n">recipe_name</span><span class="p">,</span> <span class="n">compose_type</span><span class="p">,</span> <span class="n">test_mode</span><span class="o">=</span><span class="mi">0</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot; Start the build</span>
<span class="sd"> :param cfg: Configuration object</span>
<span class="sd"> :type cfg: ComposerConfig</span>
<span class="sd"> :param dnflock: Lock and YumBase for depsolving</span>
<span class="sd"> :type dnflock: YumLock</span>
<span class="sd"> :param recipe: The recipe to build</span>
<span class="sd"> :type recipe: str</span>
<span class="sd"> :param compose_type: The type of output to create from the recipe</span>
<span class="sd"> :type compose_type: str</span>
<span class="sd"> :returns: Unique ID for the build that can be used to track its status</span>
<span class="sd"> :rtype: str</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="n">share_dir</span> <span class="o">=</span> <span class="n">cfg</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">&quot;composer&quot;</span><span class="p">,</span> <span class="s2">&quot;share_dir&quot;</span><span class="p">)</span>
<span class="n">lib_dir</span> <span class="o">=</span> <span class="n">cfg</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">&quot;composer&quot;</span><span class="p">,</span> <span class="s2">&quot;lib_dir&quot;</span><span class="p">)</span>
<span class="c1"># Make sure compose_type is valid</span>
<span class="k">if</span> <span class="n">compose_type</span> <span class="ow">not</span> <span class="ow">in</span> <span class="n">compose_types</span><span class="p">(</span><span class="n">share_dir</span><span class="p">):</span>
<span class="k">raise</span> <span class="ne">RuntimeError</span><span class="p">(</span><span class="s2">&quot;Invalid compose type (</span><span class="si">%s</span><span class="s2">), must be one of </span><span class="si">%s</span><span class="s2">&quot;</span> <span class="o">%</span> <span class="p">(</span><span class="n">compose_type</span><span class="p">,</span> <span class="n">compose_types</span><span class="p">(</span><span class="n">share_dir</span><span class="p">)))</span>
<span class="k">with</span> <span class="n">gitlock</span><span class="o">.</span><span class="n">lock</span><span class="p">:</span>
<span class="p">(</span><span class="n">commit_id</span><span class="p">,</span> <span class="n">recipe</span><span class="p">)</span> <span class="o">=</span> <span class="n">read_recipe_and_id</span><span class="p">(</span><span class="n">gitlock</span><span class="o">.</span><span class="n">repo</span><span class="p">,</span> <span class="n">branch</span><span class="p">,</span> <span class="n">recipe_name</span><span class="p">)</span>
<span class="c1"># Combine modules and packages and depsolve the list</span>
<span class="c1"># TODO include the version/glob in the depsolving</span>
<span class="n">module_names</span> <span class="o">=</span> <span class="p">[</span><span class="n">m</span><span class="p">[</span><span class="s2">&quot;name&quot;</span><span class="p">]</span> <span class="k">for</span> <span class="n">m</span> <span class="ow">in</span> <span class="n">recipe</span><span class="p">[</span><span class="s2">&quot;modules&quot;</span><span class="p">]</span> <span class="ow">or</span> <span class="p">[]]</span>
<span class="n">package_names</span> <span class="o">=</span> <span class="p">[</span><span class="n">p</span><span class="p">[</span><span class="s2">&quot;name&quot;</span><span class="p">]</span> <span class="k">for</span> <span class="n">p</span> <span class="ow">in</span> <span class="n">recipe</span><span class="p">[</span><span class="s2">&quot;packages&quot;</span><span class="p">]</span> <span class="ow">or</span> <span class="p">[]]</span>
<span class="n">projects</span> <span class="o">=</span> <span class="nb">sorted</span><span class="p">(</span><span class="nb">set</span><span class="p">(</span><span class="n">module_names</span><span class="o">+</span><span class="n">package_names</span><span class="p">),</span> <span class="n">key</span><span class="o">=</span><span class="k">lambda</span> <span class="n">n</span><span class="p">:</span> <span class="n">n</span><span class="o">.</span><span class="n">lower</span><span class="p">())</span>
<span class="n">deps</span> <span class="o">=</span> <span class="p">[]</span>
<span class="k">try</span><span class="p">:</span>
<span class="k">with</span> <span class="n">dnflock</span><span class="o">.</span><span class="n">lock</span><span class="p">:</span>
<span class="p">(</span><span class="n">installed_size</span><span class="p">,</span> <span class="n">deps</span><span class="p">)</span> <span class="o">=</span> <span class="n">projects_depsolve_with_size</span><span class="p">(</span><span class="n">dnflock</span><span class="o">.</span><span class="n">dbo</span><span class="p">,</span> <span class="n">projects</span><span class="p">,</span> <span class="n">with_core</span><span class="o">=</span><span class="kc">False</span><span class="p">)</span>
<span class="k">except</span> <span class="n">ProjectsError</span> <span class="k">as</span> <span class="n">e</span><span class="p">:</span>
<span class="n">log</span><span class="o">.</span><span class="n">error</span><span class="p">(</span><span class="s2">&quot;start_build depsolve: </span><span class="si">%s</span><span class="s2">&quot;</span><span class="p">,</span> <span class="nb">str</span><span class="p">(</span><span class="n">e</span><span class="p">))</span>
<span class="k">raise</span> <span class="ne">RuntimeError</span><span class="p">(</span><span class="s2">&quot;Problem depsolving </span><span class="si">%s</span><span class="s2">: </span><span class="si">%s</span><span class="s2">&quot;</span> <span class="o">%</span> <span class="p">(</span><span class="n">recipe</span><span class="p">[</span><span class="s2">&quot;name&quot;</span><span class="p">],</span> <span class="nb">str</span><span class="p">(</span><span class="n">e</span><span class="p">)))</span>
<span class="c1"># Read the kickstart template for this type</span>
<span class="n">ks_template_path</span> <span class="o">=</span> <span class="n">joinpaths</span><span class="p">(</span><span class="n">share_dir</span><span class="p">,</span> <span class="s2">&quot;composer&quot;</span><span class="p">,</span> <span class="n">compose_type</span><span class="p">)</span> <span class="o">+</span> <span class="s2">&quot;.ks&quot;</span>
<span class="n">ks_template</span> <span class="o">=</span> <span class="nb">open</span><span class="p">(</span><span class="n">ks_template_path</span><span class="p">,</span> <span class="s2">&quot;r&quot;</span><span class="p">)</span><span class="o">.</span><span class="n">read</span><span class="p">()</span>
<span class="c1"># How much space will the packages in the default template take?</span>
<span class="n">ks_version</span> <span class="o">=</span> <span class="n">makeVersion</span><span class="p">()</span>
<span class="n">ks</span> <span class="o">=</span> <span class="n">KickstartParser</span><span class="p">(</span><span class="n">ks_version</span><span class="p">,</span> <span class="n">errorsAreFatal</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="n">missingIncludeIsFatal</span><span class="o">=</span><span class="kc">False</span><span class="p">)</span>
<span class="n">ks</span><span class="o">.</span><span class="n">readKickstartFromString</span><span class="p">(</span><span class="n">ks_template</span><span class="o">+</span><span class="s2">&quot;</span><span class="se">\n</span><span class="si">%e</span><span class="s2">nd</span><span class="se">\n</span><span class="s2">&quot;</span><span class="p">)</span>
<span class="k">try</span><span class="p">:</span>
<span class="k">with</span> <span class="n">dnflock</span><span class="o">.</span><span class="n">lock</span><span class="p">:</span>
<span class="p">(</span><span class="n">template_size</span><span class="p">,</span> <span class="n">_</span><span class="p">)</span> <span class="o">=</span> <span class="n">projects_depsolve_with_size</span><span class="p">(</span><span class="n">dnflock</span><span class="o">.</span><span class="n">dbo</span><span class="p">,</span> <span class="n">ks</span><span class="o">.</span><span class="n">handler</span><span class="o">.</span><span class="n">packages</span><span class="o">.</span><span class="n">packageList</span><span class="p">,</span>
<span class="n">with_core</span><span class="o">=</span><span class="ow">not</span> <span class="n">ks</span><span class="o">.</span><span class="n">handler</span><span class="o">.</span><span class="n">packages</span><span class="o">.</span><span class="n">nocore</span><span class="p">)</span>
<span class="k">except</span> <span class="n">ProjectsError</span> <span class="k">as</span> <span class="n">e</span><span class="p">:</span>
<span class="n">log</span><span class="o">.</span><span class="n">error</span><span class="p">(</span><span class="s2">&quot;start_build depsolve: </span><span class="si">%s</span><span class="s2">&quot;</span><span class="p">,</span> <span class="nb">str</span><span class="p">(</span><span class="n">e</span><span class="p">))</span>
<span class="k">raise</span> <span class="ne">RuntimeError</span><span class="p">(</span><span class="s2">&quot;Problem depsolving </span><span class="si">%s</span><span class="s2">: </span><span class="si">%s</span><span class="s2">&quot;</span> <span class="o">%</span> <span class="p">(</span><span class="n">recipe</span><span class="p">[</span><span class="s2">&quot;name&quot;</span><span class="p">],</span> <span class="nb">str</span><span class="p">(</span><span class="n">e</span><span class="p">)))</span>
<span class="n">log</span><span class="o">.</span><span class="n">debug</span><span class="p">(</span><span class="s2">&quot;installed_size = </span><span class="si">%d</span><span class="s2">, template_size=</span><span class="si">%d</span><span class="s2">&quot;</span><span class="p">,</span> <span class="n">installed_size</span><span class="p">,</span> <span class="n">template_size</span><span class="p">)</span>
<span class="c1"># Minimum LMC disk size is 1GiB, and anaconda bumps the estimated size up by 10% (which doesn&#39;t always work).</span>
<span class="c1"># XXX BUT Anaconda has a bug, it won&#39;t execute a kickstart on a disk smaller than 3000 MB</span>
<span class="c1"># XXX There is an upstream patch pending, but until then, use that as the minimum</span>
<span class="n">installed_size</span> <span class="o">=</span> <span class="nb">max</span><span class="p">(</span><span class="mf">3e9</span><span class="p">,</span> <span class="nb">int</span><span class="p">((</span><span class="n">installed_size</span><span class="o">+</span><span class="n">template_size</span><span class="p">)))</span> <span class="o">*</span> <span class="mf">1.2</span>
<span class="n">log</span><span class="o">.</span><span class="n">debug</span><span class="p">(</span><span class="s2">&quot;/ partition size = </span><span class="si">%d</span><span class="s2">&quot;</span><span class="p">,</span> <span class="n">installed_size</span><span class="p">)</span>
<span class="c1"># Create the results directory</span>
<span class="n">build_id</span> <span class="o">=</span> <span class="nb">str</span><span class="p">(</span><span class="n">uuid4</span><span class="p">())</span>
<span class="n">results_dir</span> <span class="o">=</span> <span class="n">joinpaths</span><span class="p">(</span><span class="n">lib_dir</span><span class="p">,</span> <span class="s2">&quot;results&quot;</span><span class="p">,</span> <span class="n">build_id</span><span class="p">)</span>
<span class="n">os</span><span class="o">.</span><span class="n">makedirs</span><span class="p">(</span><span class="n">results_dir</span><span class="p">)</span>
<span class="c1"># Write the recipe commit hash</span>
<span class="n">commit_path</span> <span class="o">=</span> <span class="n">joinpaths</span><span class="p">(</span><span class="n">results_dir</span><span class="p">,</span> <span class="s2">&quot;COMMIT&quot;</span><span class="p">)</span>
<span class="k">with</span> <span class="nb">open</span><span class="p">(</span><span class="n">commit_path</span><span class="p">,</span> <span class="s2">&quot;w&quot;</span><span class="p">)</span> <span class="k">as</span> <span class="n">f</span><span class="p">:</span>
<span class="n">f</span><span class="o">.</span><span class="n">write</span><span class="p">(</span><span class="n">commit_id</span><span class="p">)</span>
<span class="c1"># Write the original recipe</span>
<span class="n">recipe_path</span> <span class="o">=</span> <span class="n">joinpaths</span><span class="p">(</span><span class="n">results_dir</span><span class="p">,</span> <span class="s2">&quot;blueprint.toml&quot;</span><span class="p">)</span>
<span class="k">with</span> <span class="nb">open</span><span class="p">(</span><span class="n">recipe_path</span><span class="p">,</span> <span class="s2">&quot;w&quot;</span><span class="p">)</span> <span class="k">as</span> <span class="n">f</span><span class="p">:</span>
<span class="n">f</span><span class="o">.</span><span class="n">write</span><span class="p">(</span><span class="n">recipe</span><span class="o">.</span><span class="n">toml</span><span class="p">())</span>
<span class="c1"># Write the frozen recipe</span>
<span class="n">frozen_recipe</span> <span class="o">=</span> <span class="n">recipe</span><span class="o">.</span><span class="n">freeze</span><span class="p">(</span><span class="n">deps</span><span class="p">)</span>
<span class="n">recipe_path</span> <span class="o">=</span> <span class="n">joinpaths</span><span class="p">(</span><span class="n">results_dir</span><span class="p">,</span> <span class="s2">&quot;frozen.toml&quot;</span><span class="p">)</span>
<span class="k">with</span> <span class="nb">open</span><span class="p">(</span><span class="n">recipe_path</span><span class="p">,</span> <span class="s2">&quot;w&quot;</span><span class="p">)</span> <span class="k">as</span> <span class="n">f</span><span class="p">:</span>
<span class="n">f</span><span class="o">.</span><span class="n">write</span><span class="p">(</span><span class="n">frozen_recipe</span><span class="o">.</span><span class="n">toml</span><span class="p">())</span>
<span class="c1"># Write out the dependencies to the results dir</span>
<span class="n">deps_path</span> <span class="o">=</span> <span class="n">joinpaths</span><span class="p">(</span><span class="n">results_dir</span><span class="p">,</span> <span class="s2">&quot;deps.toml&quot;</span><span class="p">)</span>
<span class="k">with</span> <span class="nb">open</span><span class="p">(</span><span class="n">deps_path</span><span class="p">,</span> <span class="s2">&quot;w&quot;</span><span class="p">)</span> <span class="k">as</span> <span class="n">f</span><span class="p">:</span>
<span class="n">f</span><span class="o">.</span><span class="n">write</span><span class="p">(</span><span class="n">toml</span><span class="o">.</span><span class="n">dumps</span><span class="p">({</span><span class="s2">&quot;packages&quot;</span><span class="p">:</span><span class="n">deps</span><span class="p">}))</span>
<span class="c1"># Save a copy of the original kickstart</span>
<span class="n">shutil</span><span class="o">.</span><span class="n">copy</span><span class="p">(</span><span class="n">ks_template_path</span><span class="p">,</span> <span class="n">results_dir</span><span class="p">)</span>
<span class="k">with</span> <span class="n">dnflock</span><span class="o">.</span><span class="n">lock</span><span class="p">:</span>
<span class="n">repos</span> <span class="o">=</span> <span class="nb">list</span><span class="p">(</span><span class="n">dnflock</span><span class="o">.</span><span class="n">dbo</span><span class="o">.</span><span class="n">repos</span><span class="o">.</span><span class="n">iter_enabled</span><span class="p">())</span>
<span class="k">if</span> <span class="ow">not</span> <span class="n">repos</span><span class="p">:</span>
<span class="k">raise</span> <span class="ne">RuntimeError</span><span class="p">(</span><span class="s2">&quot;No enabled repos, canceling build.&quot;</span><span class="p">)</span>
<span class="c1"># Create the final kickstart with repos and package list</span>
<span class="n">ks_path</span> <span class="o">=</span> <span class="n">joinpaths</span><span class="p">(</span><span class="n">results_dir</span><span class="p">,</span> <span class="s2">&quot;final-kickstart.ks&quot;</span><span class="p">)</span>
<span class="k">with</span> <span class="nb">open</span><span class="p">(</span><span class="n">ks_path</span><span class="p">,</span> <span class="s2">&quot;w&quot;</span><span class="p">)</span> <span class="k">as</span> <span class="n">f</span><span class="p">:</span>
<span class="n">ks_url</span> <span class="o">=</span> <span class="n">repo_to_ks</span><span class="p">(</span><span class="n">repos</span><span class="p">[</span><span class="mi">0</span><span class="p">],</span> <span class="s2">&quot;url&quot;</span><span class="p">)</span>
<span class="n">log</span><span class="o">.</span><span class="n">debug</span><span class="p">(</span><span class="s2">&quot;url = </span><span class="si">%s</span><span class="s2">&quot;</span><span class="p">,</span> <span class="n">ks_url</span><span class="p">)</span>
<span class="n">f</span><span class="o">.</span><span class="n">write</span><span class="p">(</span><span class="s1">&#39;url </span><span class="si">%s</span><span class="se">\n</span><span class="s1">&#39;</span> <span class="o">%</span> <span class="n">ks_url</span><span class="p">)</span>
<span class="k">for</span> <span class="n">idx</span><span class="p">,</span> <span class="n">r</span> <span class="ow">in</span> <span class="nb">enumerate</span><span class="p">(</span><span class="n">repos</span><span class="p">[</span><span class="mi">1</span><span class="p">:]):</span>
<span class="n">ks_repo</span> <span class="o">=</span> <span class="n">repo_to_ks</span><span class="p">(</span><span class="n">r</span><span class="p">,</span> <span class="s2">&quot;baseurl&quot;</span><span class="p">)</span>
<span class="n">log</span><span class="o">.</span><span class="n">debug</span><span class="p">(</span><span class="s2">&quot;repo composer-</span><span class="si">%s</span><span class="s2"> = </span><span class="si">%s</span><span class="s2">&quot;</span><span class="p">,</span> <span class="n">idx</span><span class="p">,</span> <span class="n">ks_repo</span><span class="p">)</span>
<span class="n">f</span><span class="o">.</span><span class="n">write</span><span class="p">(</span><span class="s1">&#39;repo --name=&quot;composer-</span><span class="si">%s</span><span class="s1">&quot; </span><span class="si">%s</span><span class="se">\n</span><span class="s1">&#39;</span> <span class="o">%</span> <span class="p">(</span><span class="n">idx</span><span class="p">,</span> <span class="n">ks_repo</span><span class="p">))</span>
<span class="c1"># Write the root partition and it&#39;s size in MB (rounded up)</span>
<span class="n">f</span><span class="o">.</span><span class="n">write</span><span class="p">(</span><span class="s1">&#39;part / --fstype=&quot;ext4&quot; --size=</span><span class="si">%d</span><span class="se">\n</span><span class="s1">&#39;</span> <span class="o">%</span> <span class="n">ceil</span><span class="p">(</span><span class="n">installed_size</span> <span class="o">/</span> <span class="mi">1024</span><span class="o">**</span><span class="mi">2</span><span class="p">))</span>
<span class="n">f</span><span class="o">.</span><span class="n">write</span><span class="p">(</span><span class="n">ks_template</span><span class="p">)</span>
<span class="k">for</span> <span class="n">d</span> <span class="ow">in</span> <span class="n">deps</span><span class="p">:</span>
<span class="n">f</span><span class="o">.</span><span class="n">write</span><span class="p">(</span><span class="n">dep_nevra</span><span class="p">(</span><span class="n">d</span><span class="p">)</span><span class="o">+</span><span class="s2">&quot;</span><span class="se">\n</span><span class="s2">&quot;</span><span class="p">)</span>
<span class="n">f</span><span class="o">.</span><span class="n">write</span><span class="p">(</span><span class="s2">&quot;</span><span class="si">%e</span><span class="s2">nd</span><span class="se">\n</span><span class="s2">&quot;</span><span class="p">)</span>
<span class="n">add_customizations</span><span class="p">(</span><span class="n">f</span><span class="p">,</span> <span class="n">recipe</span><span class="p">)</span>
<span class="c1"># Setup the config to pass to novirt_install</span>
<span class="n">log_dir</span> <span class="o">=</span> <span class="n">joinpaths</span><span class="p">(</span><span class="n">results_dir</span><span class="p">,</span> <span class="s2">&quot;logs/&quot;</span><span class="p">)</span>
<span class="n">cfg_args</span> <span class="o">=</span> <span class="n">compose_args</span><span class="p">(</span><span class="n">compose_type</span><span class="p">)</span>
<span class="c1"># Get the title, project, and release version from the host</span>
<span class="k">if</span> <span class="ow">not</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">exists</span><span class="p">(</span><span class="s2">&quot;/etc/os-release&quot;</span><span class="p">):</span>
<span class="n">log</span><span class="o">.</span><span class="n">error</span><span class="p">(</span><span class="s2">&quot;/etc/os-release is missing, cannot determine product or release version&quot;</span><span class="p">)</span>
<span class="n">os_release</span> <span class="o">=</span> <span class="n">SimpleConfigFile</span><span class="p">(</span><span class="s2">&quot;/etc/os-release&quot;</span><span class="p">)</span>
<span class="n">os_release</span><span class="o">.</span><span class="n">read</span><span class="p">()</span>
<span class="n">log</span><span class="o">.</span><span class="n">debug</span><span class="p">(</span><span class="s2">&quot;os_release = </span><span class="si">%s</span><span class="s2">&quot;</span><span class="p">,</span> <span class="n">os_release</span><span class="p">)</span>
<span class="n">cfg_args</span><span class="p">[</span><span class="s2">&quot;title&quot;</span><span class="p">]</span> <span class="o">=</span> <span class="n">os_release</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">&quot;PRETTY_NAME&quot;</span><span class="p">)</span>
<span class="n">cfg_args</span><span class="p">[</span><span class="s2">&quot;project&quot;</span><span class="p">]</span> <span class="o">=</span> <span class="n">os_release</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">&quot;NAME&quot;</span><span class="p">)</span>
<span class="n">cfg_args</span><span class="p">[</span><span class="s2">&quot;releasever&quot;</span><span class="p">]</span> <span class="o">=</span> <span class="n">os_release</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">&quot;VERSION_ID&quot;</span><span class="p">)</span>
<span class="n">cfg_args</span><span class="p">[</span><span class="s2">&quot;volid&quot;</span><span class="p">]</span> <span class="o">=</span> <span class="s2">&quot;&quot;</span>
<span class="n">cfg_args</span><span class="o">.</span><span class="n">update</span><span class="p">({</span>
<span class="s2">&quot;compression&quot;</span><span class="p">:</span> <span class="s2">&quot;xz&quot;</span><span class="p">,</span>
<span class="s2">&quot;compress_args&quot;</span><span class="p">:</span> <span class="p">[],</span>
<span class="s2">&quot;ks&quot;</span><span class="p">:</span> <span class="p">[</span><span class="n">ks_path</span><span class="p">],</span>
<span class="s2">&quot;logfile&quot;</span><span class="p">:</span> <span class="n">log_dir</span><span class="p">,</span>
<span class="s2">&quot;timeout&quot;</span><span class="p">:</span> <span class="mi">60</span><span class="p">,</span> <span class="c1"># 60 minute timeout</span>
<span class="p">})</span>
<span class="k">with</span> <span class="nb">open</span><span class="p">(</span><span class="n">joinpaths</span><span class="p">(</span><span class="n">results_dir</span><span class="p">,</span> <span class="s2">&quot;config.toml&quot;</span><span class="p">),</span> <span class="s2">&quot;w&quot;</span><span class="p">)</span> <span class="k">as</span> <span class="n">f</span><span class="p">:</span>
<span class="n">f</span><span class="o">.</span><span class="n">write</span><span class="p">(</span><span class="n">toml</span><span class="o">.</span><span class="n">dumps</span><span class="p">(</span><span class="n">cfg_args</span><span class="p">))</span>
<span class="c1"># Set the initial status</span>
<span class="nb">open</span><span class="p">(</span><span class="n">joinpaths</span><span class="p">(</span><span class="n">results_dir</span><span class="p">,</span> <span class="s2">&quot;STATUS&quot;</span><span class="p">),</span> <span class="s2">&quot;w&quot;</span><span class="p">)</span><span class="o">.</span><span class="n">write</span><span class="p">(</span><span class="s2">&quot;WAITING&quot;</span><span class="p">)</span>
<span class="c1"># Set the test mode, if requested</span>
<span class="k">if</span> <span class="n">test_mode</span> <span class="o">&gt;</span> <span class="mi">0</span><span class="p">:</span>
<span class="nb">open</span><span class="p">(</span><span class="n">joinpaths</span><span class="p">(</span><span class="n">results_dir</span><span class="p">,</span> <span class="s2">&quot;TEST&quot;</span><span class="p">),</span> <span class="s2">&quot;w&quot;</span><span class="p">)</span><span class="o">.</span><span class="n">write</span><span class="p">(</span><span class="s2">&quot;</span><span class="si">%s</span><span class="s2">&quot;</span> <span class="o">%</span> <span class="n">test_mode</span><span class="p">)</span>
<span class="n">log</span><span class="o">.</span><span class="n">info</span><span class="p">(</span><span class="s2">&quot;Adding </span><span class="si">%s</span><span class="s2"> (</span><span class="si">%s</span><span class="s2"> </span><span class="si">%s</span><span class="s2">) to compose queue&quot;</span><span class="p">,</span> <span class="n">build_id</span><span class="p">,</span> <span class="n">recipe</span><span class="p">[</span><span class="s2">&quot;name&quot;</span><span class="p">],</span> <span class="n">compose_type</span><span class="p">)</span>
<span class="n">os</span><span class="o">.</span><span class="n">symlink</span><span class="p">(</span><span class="n">results_dir</span><span class="p">,</span> <span class="n">joinpaths</span><span class="p">(</span><span class="n">lib_dir</span><span class="p">,</span> <span class="s2">&quot;queue/new/&quot;</span><span class="p">,</span> <span class="n">build_id</span><span class="p">))</span>
<span class="k">return</span> <span class="n">build_id</span></div>
<span class="c1"># Supported output types</span>
<div class="viewcode-block" id="compose_types"><a class="viewcode-back" href="../../../pylorax.api.html#pylorax.api.compose.compose_types">[docs]</a><span class="k">def</span> <span class="nf">compose_types</span><span class="p">(</span><span class="n">share_dir</span><span class="p">):</span>
<span class="sa">r</span><span class="sd">&quot;&quot;&quot; Returns a list of the supported output types</span>
<span class="sd"> The output types come from the kickstart names in /usr/share/lorax/composer/\*ks</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="k">return</span> <span class="nb">sorted</span><span class="p">([</span><span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">basename</span><span class="p">(</span><span class="n">ks</span><span class="p">)[:</span><span class="o">-</span><span class="mi">3</span><span class="p">]</span> <span class="k">for</span> <span class="n">ks</span> <span class="ow">in</span> <span class="n">glob</span><span class="p">(</span><span class="n">joinpaths</span><span class="p">(</span><span class="n">share_dir</span><span class="p">,</span> <span class="s2">&quot;composer/*.ks&quot;</span><span class="p">))])</span></div>
<div class="viewcode-block" id="compose_args"><a class="viewcode-back" href="../../../pylorax.api.html#pylorax.api.compose.compose_args">[docs]</a><span class="k">def</span> <span class="nf">compose_args</span><span class="p">(</span><span class="n">compose_type</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot; Returns the settings to pass to novirt_install for the compose type</span>
<span class="sd"> :param compose_type: The type of compose to create, from `compose_types()`</span>
<span class="sd"> :type compose_type: str</span>
<span class="sd"> This will return a dict of options that match the ArgumentParser options for livemedia-creator.</span>
<span class="sd"> These are the ones the define the type of output, it&#39;s filename, etc.</span>
<span class="sd"> Other options will be filled in by `make_compose()`</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="n">_MAP</span> <span class="o">=</span> <span class="p">{</span><span class="s2">&quot;tar&quot;</span><span class="p">:</span> <span class="p">{</span><span class="s2">&quot;make_iso&quot;</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span>
<span class="s2">&quot;make_disk&quot;</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span>
<span class="s2">&quot;make_fsimage&quot;</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span>
<span class="s2">&quot;make_appliance&quot;</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span>
<span class="s2">&quot;make_ami&quot;</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span>
<span class="s2">&quot;make_tar&quot;</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span>
<span class="s2">&quot;make_pxe_live&quot;</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span>
<span class="s2">&quot;make_ostree_live&quot;</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span>
<span class="s2">&quot;make_oci&quot;</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span>
<span class="s2">&quot;make_vagrant&quot;</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span>
<span class="s2">&quot;ostree&quot;</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span>
<span class="s2">&quot;live_rootfs_keep_size&quot;</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span>
<span class="s2">&quot;live_rootfs_size&quot;</span><span class="p">:</span> <span class="mi">0</span><span class="p">,</span>
<span class="s2">&quot;image_type&quot;</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> <span class="c1"># False instead of None because of TOML</span>
<span class="s2">&quot;qemu_args&quot;</span><span class="p">:</span> <span class="p">[],</span>
<span class="s2">&quot;image_name&quot;</span><span class="p">:</span> <span class="n">default_image_name</span><span class="p">(</span><span class="s2">&quot;xz&quot;</span><span class="p">,</span> <span class="s2">&quot;root.tar&quot;</span><span class="p">),</span>
<span class="s2">&quot;image_only&quot;</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span>
<span class="s2">&quot;app_name&quot;</span><span class="p">:</span> <span class="kc">None</span><span class="p">,</span>
<span class="s2">&quot;app_template&quot;</span><span class="p">:</span> <span class="kc">None</span><span class="p">,</span>
<span class="s2">&quot;app_file&quot;</span><span class="p">:</span> <span class="kc">None</span><span class="p">,</span>
<span class="p">},</span>
<span class="s2">&quot;live-iso&quot;</span><span class="p">:</span> <span class="p">{</span><span class="s2">&quot;make_iso&quot;</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span>
<span class="s2">&quot;make_disk&quot;</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span>
<span class="s2">&quot;make_fsimage&quot;</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span>
<span class="s2">&quot;make_appliance&quot;</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span>
<span class="s2">&quot;make_ami&quot;</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span>
<span class="s2">&quot;make_tar&quot;</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span>
<span class="s2">&quot;make_pxe_live&quot;</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span>
<span class="s2">&quot;make_ostree_live&quot;</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span>
<span class="s2">&quot;make_oci&quot;</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span>
<span class="s2">&quot;make_vagrant&quot;</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span>
<span class="s2">&quot;ostree&quot;</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span>
<span class="s2">&quot;live_rootfs_keep_size&quot;</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span>
<span class="s2">&quot;live_rootfs_size&quot;</span><span class="p">:</span> <span class="mi">0</span><span class="p">,</span>
<span class="s2">&quot;image_type&quot;</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> <span class="c1"># False instead of None because of TOML</span>
<span class="s2">&quot;qemu_args&quot;</span><span class="p">:</span> <span class="p">[],</span>
<span class="s2">&quot;image_name&quot;</span><span class="p">:</span> <span class="s2">&quot;live.iso&quot;</span><span class="p">,</span>
<span class="s2">&quot;fs_label&quot;</span><span class="p">:</span> <span class="s2">&quot;Anaconda&quot;</span><span class="p">,</span> <span class="c1"># Live booting may expect this to be &#39;Anaconda&#39;</span>
<span class="s2">&quot;image_only&quot;</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span>
<span class="s2">&quot;app_name&quot;</span><span class="p">:</span> <span class="kc">None</span><span class="p">,</span>
<span class="s2">&quot;app_template&quot;</span><span class="p">:</span> <span class="kc">None</span><span class="p">,</span>
<span class="s2">&quot;app_file&quot;</span><span class="p">:</span> <span class="kc">None</span><span class="p">,</span>
<span class="s2">&quot;iso_only&quot;</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span>
<span class="s2">&quot;iso_name&quot;</span><span class="p">:</span> <span class="s2">&quot;live.iso&quot;</span><span class="p">,</span>
<span class="p">},</span>
<span class="s2">&quot;partitioned-disk&quot;</span><span class="p">:</span> <span class="p">{</span><span class="s2">&quot;make_iso&quot;</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span>
<span class="s2">&quot;make_disk&quot;</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span>
<span class="s2">&quot;make_fsimage&quot;</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span>
<span class="s2">&quot;make_appliance&quot;</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span>
<span class="s2">&quot;make_ami&quot;</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span>
<span class="s2">&quot;make_tar&quot;</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span>
<span class="s2">&quot;make_pxe_live&quot;</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span>
<span class="s2">&quot;make_ostree_live&quot;</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span>
<span class="s2">&quot;make_oci&quot;</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span>
<span class="s2">&quot;make_vagrant&quot;</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span>
<span class="s2">&quot;ostree&quot;</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span>
<span class="s2">&quot;live_rootfs_keep_size&quot;</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span>
<span class="s2">&quot;live_rootfs_size&quot;</span><span class="p">:</span> <span class="mi">0</span><span class="p">,</span>
<span class="s2">&quot;image_type&quot;</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> <span class="c1"># False instead of None because of TOML</span>
<span class="s2">&quot;qemu_args&quot;</span><span class="p">:</span> <span class="p">[],</span>
<span class="s2">&quot;image_name&quot;</span><span class="p">:</span> <span class="s2">&quot;disk.img&quot;</span><span class="p">,</span>
<span class="s2">&quot;fs_label&quot;</span><span class="p">:</span> <span class="s2">&quot;&quot;</span><span class="p">,</span>
<span class="s2">&quot;image_only&quot;</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span>
<span class="s2">&quot;app_name&quot;</span><span class="p">:</span> <span class="kc">None</span><span class="p">,</span>
<span class="s2">&quot;app_template&quot;</span><span class="p">:</span> <span class="kc">None</span><span class="p">,</span>
<span class="s2">&quot;app_file&quot;</span><span class="p">:</span> <span class="kc">None</span><span class="p">,</span>
<span class="p">},</span>
<span class="s2">&quot;qcow2&quot;</span><span class="p">:</span> <span class="p">{</span><span class="s2">&quot;make_iso&quot;</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span>
<span class="s2">&quot;make_disk&quot;</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span>
<span class="s2">&quot;make_fsimage&quot;</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span>
<span class="s2">&quot;make_appliance&quot;</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span>
<span class="s2">&quot;make_ami&quot;</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span>
<span class="s2">&quot;make_tar&quot;</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span>
<span class="s2">&quot;make_pxe_live&quot;</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span>
<span class="s2">&quot;make_ostree_live&quot;</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span>
<span class="s2">&quot;make_oci&quot;</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span>
<span class="s2">&quot;make_vagrant&quot;</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span>
<span class="s2">&quot;ostree&quot;</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span>
<span class="s2">&quot;live_rootfs_keep_size&quot;</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span>
<span class="s2">&quot;live_rootfs_size&quot;</span><span class="p">:</span> <span class="mi">0</span><span class="p">,</span>
<span class="s2">&quot;image_type&quot;</span><span class="p">:</span> <span class="s2">&quot;qcow2&quot;</span><span class="p">,</span>
<span class="s2">&quot;qemu_args&quot;</span><span class="p">:</span> <span class="p">[],</span>
<span class="s2">&quot;image_name&quot;</span><span class="p">:</span> <span class="s2">&quot;disk.qcow2&quot;</span><span class="p">,</span>
<span class="s2">&quot;fs_label&quot;</span><span class="p">:</span> <span class="s2">&quot;&quot;</span><span class="p">,</span>
<span class="s2">&quot;image_only&quot;</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span>
<span class="s2">&quot;app_name&quot;</span><span class="p">:</span> <span class="kc">None</span><span class="p">,</span>
<span class="s2">&quot;app_template&quot;</span><span class="p">:</span> <span class="kc">None</span><span class="p">,</span>
<span class="s2">&quot;app_file&quot;</span><span class="p">:</span> <span class="kc">None</span><span class="p">,</span>
<span class="p">},</span>
<span class="s2">&quot;ext4-filesystem&quot;</span><span class="p">:</span> <span class="p">{</span><span class="s2">&quot;make_iso&quot;</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span>
<span class="s2">&quot;make_disk&quot;</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span>
<span class="s2">&quot;make_fsimage&quot;</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span>
<span class="s2">&quot;make_appliance&quot;</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span>
<span class="s2">&quot;make_ami&quot;</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span>
<span class="s2">&quot;make_tar&quot;</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span>
<span class="s2">&quot;make_pxe_live&quot;</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span>
<span class="s2">&quot;make_ostree_live&quot;</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span>
<span class="s2">&quot;make_oci&quot;</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span>
<span class="s2">&quot;make_vagrant&quot;</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span>
<span class="s2">&quot;ostree&quot;</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span>
<span class="s2">&quot;live_rootfs_keep_size&quot;</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span>
<span class="s2">&quot;live_rootfs_size&quot;</span><span class="p">:</span> <span class="mi">0</span><span class="p">,</span>
<span class="s2">&quot;image_type&quot;</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> <span class="c1"># False instead of None because of TOML</span>
<span class="s2">&quot;qemu_args&quot;</span><span class="p">:</span> <span class="p">[],</span>
<span class="s2">&quot;image_name&quot;</span><span class="p">:</span> <span class="s2">&quot;filesystem.img&quot;</span><span class="p">,</span>
<span class="s2">&quot;fs_label&quot;</span><span class="p">:</span> <span class="s2">&quot;&quot;</span><span class="p">,</span>
<span class="s2">&quot;image_only&quot;</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span>
<span class="s2">&quot;app_name&quot;</span><span class="p">:</span> <span class="kc">None</span><span class="p">,</span>
<span class="s2">&quot;app_template&quot;</span><span class="p">:</span> <span class="kc">None</span><span class="p">,</span>
<span class="s2">&quot;app_file&quot;</span><span class="p">:</span> <span class="kc">None</span><span class="p">,</span>
<span class="p">},</span>
<span class="p">}</span>
<span class="k">return</span> <span class="n">_MAP</span><span class="p">[</span><span class="n">compose_type</span><span class="p">]</span></div>
<div class="viewcode-block" id="move_compose_results"><a class="viewcode-back" href="../../../pylorax.api.html#pylorax.api.compose.move_compose_results">[docs]</a><span class="k">def</span> <span class="nf">move_compose_results</span><span class="p">(</span><span class="n">cfg</span><span class="p">,</span> <span class="n">results_dir</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;Move the final image to the results_dir and cleanup the unneeded compose files</span>
<span class="sd"> :param cfg: Build configuration</span>
<span class="sd"> :type cfg: DataHolder</span>
<span class="sd"> :param results_dir: Directory to put the results into</span>
<span class="sd"> :type results_dir: str</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="k">if</span> <span class="n">cfg</span><span class="p">[</span><span class="s2">&quot;make_tar&quot;</span><span class="p">]:</span>
<span class="n">shutil</span><span class="o">.</span><span class="n">move</span><span class="p">(</span><span class="n">joinpaths</span><span class="p">(</span><span class="n">cfg</span><span class="p">[</span><span class="s2">&quot;result_dir&quot;</span><span class="p">],</span> <span class="n">cfg</span><span class="p">[</span><span class="s2">&quot;image_name&quot;</span><span class="p">]),</span> <span class="n">results_dir</span><span class="p">)</span>
<span class="k">elif</span> <span class="n">cfg</span><span class="p">[</span><span class="s2">&quot;make_iso&quot;</span><span class="p">]:</span>
<span class="c1"># Output from live iso is always a boot.iso under images/, move and rename it</span>
<span class="n">shutil</span><span class="o">.</span><span class="n">move</span><span class="p">(</span><span class="n">joinpaths</span><span class="p">(</span><span class="n">cfg</span><span class="p">[</span><span class="s2">&quot;result_dir&quot;</span><span class="p">],</span> <span class="n">cfg</span><span class="p">[</span><span class="s2">&quot;iso_name&quot;</span><span class="p">]),</span> <span class="n">joinpaths</span><span class="p">(</span><span class="n">results_dir</span><span class="p">,</span> <span class="n">cfg</span><span class="p">[</span><span class="s2">&quot;image_name&quot;</span><span class="p">]))</span>
<span class="k">elif</span> <span class="n">cfg</span><span class="p">[</span><span class="s2">&quot;make_disk&quot;</span><span class="p">]</span> <span class="ow">or</span> <span class="n">cfg</span><span class="p">[</span><span class="s2">&quot;make_fsimage&quot;</span><span class="p">]:</span>
<span class="n">shutil</span><span class="o">.</span><span class="n">move</span><span class="p">(</span><span class="n">joinpaths</span><span class="p">(</span><span class="n">cfg</span><span class="p">[</span><span class="s2">&quot;result_dir&quot;</span><span class="p">],</span> <span class="n">cfg</span><span class="p">[</span><span class="s2">&quot;image_name&quot;</span><span class="p">]),</span> <span class="n">joinpaths</span><span class="p">(</span><span class="n">results_dir</span><span class="p">,</span> <span class="n">cfg</span><span class="p">[</span><span class="s2">&quot;image_name&quot;</span><span class="p">]))</span>
<span class="c1"># Cleanup the compose directory, but only if it looks like a compose directory</span>
<span class="k">if</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">basename</span><span class="p">(</span><span class="n">cfg</span><span class="p">[</span><span class="s2">&quot;result_dir&quot;</span><span class="p">])</span> <span class="o">==</span> <span class="s2">&quot;compose&quot;</span><span class="p">:</span>
<span class="n">shutil</span><span class="o">.</span><span class="n">rmtree</span><span class="p">(</span><span class="n">cfg</span><span class="p">[</span><span class="s2">&quot;result_dir&quot;</span><span class="p">])</span>
<span class="k">else</span><span class="p">:</span>
<span class="n">log</span><span class="o">.</span><span class="n">error</span><span class="p">(</span><span class="s2">&quot;Incorrect compose directory, not cleaning up&quot;</span><span class="p">)</span></div>
</pre></div>
</div>
</div>
<footer>
<hr/>
<div role="contentinfo">
<p>
&copy; Copyright 2018, Red Hat, Inc..
</p>
</div>
Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/rtfd/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>.
</footer>
</div>
</div>
</section>
</div>
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT:'../../../',
VERSION:'28.10',
LANGUAGE:'None',
COLLAPSE_INDEX:false,
FILE_SUFFIX:'.html',
HAS_SOURCE: true,
SOURCELINK_SUFFIX: '.txt'
};
</script>
<script type="text/javascript" src="../../../_static/jquery.js"></script>
<script type="text/javascript" src="../../../_static/underscore.js"></script>
<script type="text/javascript" src="../../../_static/doctools.js"></script>
<script type="text/javascript" src="../../../_static/js/theme.js"></script>
<script type="text/javascript">
jQuery(function () {
SphinxRtdTheme.Navigation.enableSticky();
});
</script>
</body>
</html>

View File

@ -0,0 +1,330 @@
<!DOCTYPE html>
<!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]-->
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>pylorax.api.config &mdash; Lorax 28.10 documentation</title>
<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" />
<script src="../../../_static/js/modernizr.min.js"></script>
</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">
28.10
</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>
<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"><a class="reference internal" href="../../../modules.html">pylorax</a></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="../../index.html">Module code</a> &raquo;</li>
<li><a href="../../pylorax.html">pylorax</a> &raquo;</li>
<li>pylorax.api.config</li>
<li class="wy-breadcrumbs-aside">
</li>
</ul>
<hr/>
</div>
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
<div itemprop="articleBody">
<h1>Source code for pylorax.api.config</h1><div class="highlight"><pre>
<span></span><span class="c1">#</span>
<span class="c1"># Copyright (C) 2017 Red Hat, Inc.</span>
<span class="c1">#</span>
<span class="c1"># This program is free software; you can redistribute it and/or modify</span>
<span class="c1"># it under the terms of the GNU General Public License as published by</span>
<span class="c1"># the Free Software Foundation; either version 2 of the License, or</span>
<span class="c1"># (at your option) any later version.</span>
<span class="c1">#</span>
<span class="c1"># This program is distributed in the hope that it will be useful,</span>
<span class="c1"># but WITHOUT ANY WARRANTY; without even the implied warranty of</span>
<span class="c1"># MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the</span>
<span class="c1"># GNU General Public License for more details.</span>
<span class="c1">#</span>
<span class="c1"># You should have received a copy of the GNU General Public License</span>
<span class="c1"># along with this program. If not, see &lt;http://www.gnu.org/licenses/&gt;.</span>
<span class="c1">#</span>
<span class="kn">import</span> <span class="nn">configparser</span>
<span class="kn">import</span> <span class="nn">grp</span>
<span class="kn">import</span> <span class="nn">os</span>
<span class="kn">from</span> <span class="nn">pylorax.sysutils</span> <span class="k">import</span> <span class="n">joinpaths</span>
<div class="viewcode-block" id="ComposerConfig"><a class="viewcode-back" href="../../../pylorax.api.html#pylorax.api.config.ComposerConfig">[docs]</a><span class="k">class</span> <span class="nc">ComposerConfig</span><span class="p">(</span><span class="n">configparser</span><span class="o">.</span><span class="n">SafeConfigParser</span><span class="p">):</span>
<div class="viewcode-block" id="ComposerConfig.get_default"><a class="viewcode-back" href="../../../pylorax.api.html#pylorax.api.config.ComposerConfig.get_default">[docs]</a> <span class="k">def</span> <span class="nf">get_default</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">section</span><span class="p">,</span> <span class="n">option</span><span class="p">,</span> <span class="n">default</span><span class="p">):</span>
<span class="k">try</span><span class="p">:</span>
<span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="n">section</span><span class="p">,</span> <span class="n">option</span><span class="p">)</span>
<span class="k">except</span> <span class="n">configparser</span><span class="o">.</span><span class="n">Error</span><span class="p">:</span>
<span class="k">return</span> <span class="n">default</span></div></div>
<div class="viewcode-block" id="configure"><a class="viewcode-back" href="../../../pylorax.api.html#pylorax.api.config.configure">[docs]</a><span class="k">def</span> <span class="nf">configure</span><span class="p">(</span><span class="n">conf_file</span><span class="o">=</span><span class="s2">&quot;/etc/lorax/composer.conf&quot;</span><span class="p">,</span> <span class="n">root_dir</span><span class="o">=</span><span class="s2">&quot;/&quot;</span><span class="p">,</span> <span class="n">test_config</span><span class="o">=</span><span class="kc">False</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;lorax-composer configuration</span>
<span class="sd"> :param conf_file: Path to the config file overriding the default settings</span>
<span class="sd"> :type conf_file: str</span>
<span class="sd"> :param root_dir: Directory to prepend to paths, defaults to /</span>
<span class="sd"> :type root_dir: str</span>
<span class="sd"> :param test_config: Set to True to skip reading conf_file</span>
<span class="sd"> :type test_config: bool</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="n">conf</span> <span class="o">=</span> <span class="n">ComposerConfig</span><span class="p">()</span>
<span class="c1"># set defaults</span>
<span class="n">conf</span><span class="o">.</span><span class="n">add_section</span><span class="p">(</span><span class="s2">&quot;composer&quot;</span><span class="p">)</span>
<span class="n">conf</span><span class="o">.</span><span class="n">set</span><span class="p">(</span><span class="s2">&quot;composer&quot;</span><span class="p">,</span> <span class="s2">&quot;share_dir&quot;</span><span class="p">,</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">realpath</span><span class="p">(</span><span class="n">joinpaths</span><span class="p">(</span><span class="n">root_dir</span><span class="p">,</span> <span class="s2">&quot;/usr/share/lorax/&quot;</span><span class="p">)))</span>
<span class="n">conf</span><span class="o">.</span><span class="n">set</span><span class="p">(</span><span class="s2">&quot;composer&quot;</span><span class="p">,</span> <span class="s2">&quot;lib_dir&quot;</span><span class="p">,</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">realpath</span><span class="p">(</span><span class="n">joinpaths</span><span class="p">(</span><span class="n">root_dir</span><span class="p">,</span> <span class="s2">&quot;/var/lib/lorax/composer/&quot;</span><span class="p">)))</span>
<span class="n">conf</span><span class="o">.</span><span class="n">set</span><span class="p">(</span><span class="s2">&quot;composer&quot;</span><span class="p">,</span> <span class="s2">&quot;dnf_conf&quot;</span><span class="p">,</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">realpath</span><span class="p">(</span><span class="n">joinpaths</span><span class="p">(</span><span class="n">root_dir</span><span class="p">,</span> <span class="s2">&quot;/var/tmp/composer/dnf.conf&quot;</span><span class="p">)))</span>
<span class="n">conf</span><span class="o">.</span><span class="n">set</span><span class="p">(</span><span class="s2">&quot;composer&quot;</span><span class="p">,</span> <span class="s2">&quot;dnf_root&quot;</span><span class="p">,</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">realpath</span><span class="p">(</span><span class="n">joinpaths</span><span class="p">(</span><span class="n">root_dir</span><span class="p">,</span> <span class="s2">&quot;/var/tmp/composer/dnf/root/&quot;</span><span class="p">)))</span>
<span class="n">conf</span><span class="o">.</span><span class="n">set</span><span class="p">(</span><span class="s2">&quot;composer&quot;</span><span class="p">,</span> <span class="s2">&quot;repo_dir&quot;</span><span class="p">,</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">realpath</span><span class="p">(</span><span class="n">joinpaths</span><span class="p">(</span><span class="n">root_dir</span><span class="p">,</span> <span class="s2">&quot;/var/tmp/composer/repos.d/&quot;</span><span class="p">)))</span>
<span class="n">conf</span><span class="o">.</span><span class="n">set</span><span class="p">(</span><span class="s2">&quot;composer&quot;</span><span class="p">,</span> <span class="s2">&quot;cache_dir&quot;</span><span class="p">,</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">realpath</span><span class="p">(</span><span class="n">joinpaths</span><span class="p">(</span><span class="n">root_dir</span><span class="p">,</span> <span class="s2">&quot;/var/tmp/composer/cache/&quot;</span><span class="p">)))</span>
<span class="n">conf</span><span class="o">.</span><span class="n">set</span><span class="p">(</span><span class="s2">&quot;composer&quot;</span><span class="p">,</span> <span class="s2">&quot;tmp&quot;</span><span class="p">,</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">realpath</span><span class="p">(</span><span class="n">joinpaths</span><span class="p">(</span><span class="n">root_dir</span><span class="p">,</span> <span class="s2">&quot;/var/tmp/&quot;</span><span class="p">)))</span>
<span class="n">conf</span><span class="o">.</span><span class="n">add_section</span><span class="p">(</span><span class="s2">&quot;users&quot;</span><span class="p">)</span>
<span class="n">conf</span><span class="o">.</span><span class="n">set</span><span class="p">(</span><span class="s2">&quot;users&quot;</span><span class="p">,</span> <span class="s2">&quot;root&quot;</span><span class="p">,</span> <span class="s2">&quot;1&quot;</span><span class="p">)</span>
<span class="c1"># Enable all available repo files by default</span>
<span class="n">conf</span><span class="o">.</span><span class="n">add_section</span><span class="p">(</span><span class="s2">&quot;repos&quot;</span><span class="p">)</span>
<span class="n">conf</span><span class="o">.</span><span class="n">set</span><span class="p">(</span><span class="s2">&quot;repos&quot;</span><span class="p">,</span> <span class="s2">&quot;use_system_repos&quot;</span><span class="p">,</span> <span class="s2">&quot;1&quot;</span><span class="p">)</span>
<span class="n">conf</span><span class="o">.</span><span class="n">set</span><span class="p">(</span><span class="s2">&quot;repos&quot;</span><span class="p">,</span> <span class="s2">&quot;enabled&quot;</span><span class="p">,</span> <span class="s2">&quot;*&quot;</span><span class="p">)</span>
<span class="n">conf</span><span class="o">.</span><span class="n">add_section</span><span class="p">(</span><span class="s2">&quot;dnf&quot;</span><span class="p">)</span>
<span class="k">if</span> <span class="ow">not</span> <span class="n">test_config</span><span class="p">:</span>
<span class="c1"># read the config file</span>
<span class="k">if</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">isfile</span><span class="p">(</span><span class="n">conf_file</span><span class="p">):</span>
<span class="n">conf</span><span class="o">.</span><span class="n">read</span><span class="p">(</span><span class="n">conf_file</span><span class="p">)</span>
<span class="k">return</span> <span class="n">conf</span></div>
<div class="viewcode-block" id="make_dnf_dirs"><a class="viewcode-back" href="../../../pylorax.api.html#pylorax.api.config.make_dnf_dirs">[docs]</a><span class="k">def</span> <span class="nf">make_dnf_dirs</span><span class="p">(</span><span class="n">conf</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;Make any missing dnf directories</span>
<span class="sd"> :param conf: The configuration to use</span>
<span class="sd"> :type conf: ComposerConfig</span>
<span class="sd"> :returns: None</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="k">for</span> <span class="n">p</span> <span class="ow">in</span> <span class="p">[</span><span class="s2">&quot;dnf_conf&quot;</span><span class="p">,</span> <span class="s2">&quot;repo_dir&quot;</span><span class="p">,</span> <span class="s2">&quot;cache_dir&quot;</span><span class="p">,</span> <span class="s2">&quot;dnf_root&quot;</span><span class="p">]:</span>
<span class="n">p_dir</span> <span class="o">=</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">dirname</span><span class="p">(</span><span class="n">conf</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">&quot;composer&quot;</span><span class="p">,</span> <span class="n">p</span><span class="p">))</span>
<span class="k">if</span> <span class="ow">not</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">exists</span><span class="p">(</span><span class="n">p_dir</span><span class="p">):</span>
<span class="n">os</span><span class="o">.</span><span class="n">makedirs</span><span class="p">(</span><span class="n">p_dir</span><span class="p">)</span></div>
<div class="viewcode-block" id="make_queue_dirs"><a class="viewcode-back" href="../../../pylorax.api.html#pylorax.api.config.make_queue_dirs">[docs]</a><span class="k">def</span> <span class="nf">make_queue_dirs</span><span class="p">(</span><span class="n">conf</span><span class="p">,</span> <span class="n">gid</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;Make any missing queue directories</span>
<span class="sd"> :param conf: The configuration to use</span>
<span class="sd"> :type conf: ComposerConfig</span>
<span class="sd"> :param gid: Group ID that has access to the queue directories</span>
<span class="sd"> :type gid: int</span>
<span class="sd"> :returns: list of errors</span>
<span class="sd"> :rtype: list of str</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="n">errors</span> <span class="o">=</span> <span class="p">[]</span>
<span class="n">lib_dir</span> <span class="o">=</span> <span class="n">conf</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">&quot;composer&quot;</span><span class="p">,</span> <span class="s2">&quot;lib_dir&quot;</span><span class="p">)</span>
<span class="k">for</span> <span class="n">p</span> <span class="ow">in</span> <span class="p">[</span><span class="s2">&quot;queue/run&quot;</span><span class="p">,</span> <span class="s2">&quot;queue/new&quot;</span><span class="p">,</span> <span class="s2">&quot;results&quot;</span><span class="p">]:</span>
<span class="n">p_dir</span> <span class="o">=</span> <span class="n">joinpaths</span><span class="p">(</span><span class="n">lib_dir</span><span class="p">,</span> <span class="n">p</span><span class="p">)</span>
<span class="k">if</span> <span class="ow">not</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">exists</span><span class="p">(</span><span class="n">p_dir</span><span class="p">):</span>
<span class="n">orig_umask</span> <span class="o">=</span> <span class="n">os</span><span class="o">.</span><span class="n">umask</span><span class="p">(</span><span class="mi">0</span><span class="p">)</span>
<span class="n">os</span><span class="o">.</span><span class="n">makedirs</span><span class="p">(</span><span class="n">p_dir</span><span class="p">,</span> <span class="mo">0o771</span><span class="p">)</span>
<span class="n">os</span><span class="o">.</span><span class="n">chown</span><span class="p">(</span><span class="n">p_dir</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="n">gid</span><span class="p">)</span>
<span class="n">os</span><span class="o">.</span><span class="n">umask</span><span class="p">(</span><span class="n">orig_umask</span><span class="p">)</span>
<span class="k">else</span><span class="p">:</span>
<span class="n">p_stat</span> <span class="o">=</span> <span class="n">os</span><span class="o">.</span><span class="n">stat</span><span class="p">(</span><span class="n">p_dir</span><span class="p">)</span>
<span class="k">if</span> <span class="n">p_stat</span><span class="o">.</span><span class="n">st_mode</span> <span class="o">&amp;</span> <span class="mo">0o006</span> <span class="o">!=</span> <span class="mi">0</span><span class="p">:</span>
<span class="n">errors</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="s2">&quot;Incorrect permissions on </span><span class="si">%s</span><span class="s2">, no o+rw permissions are allowed.&quot;</span> <span class="o">%</span> <span class="n">p_dir</span><span class="p">)</span>
<span class="k">if</span> <span class="n">p_stat</span><span class="o">.</span><span class="n">st_gid</span> <span class="o">!=</span> <span class="n">gid</span> <span class="ow">or</span> <span class="n">p_stat</span><span class="o">.</span><span class="n">st_uid</span> <span class="o">!=</span> <span class="mi">0</span><span class="p">:</span>
<span class="n">gr_name</span> <span class="o">=</span> <span class="n">grp</span><span class="o">.</span><span class="n">getgrgid</span><span class="p">(</span><span class="n">gid</span><span class="p">)</span><span class="o">.</span><span class="n">gr_name</span>
<span class="n">errors</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="s2">&quot;</span><span class="si">%s</span><span class="s2"> should be owned by root:</span><span class="si">%s</span><span class="s2">&quot;</span> <span class="o">%</span> <span class="p">(</span><span class="n">p_dir</span><span class="p">,</span> <span class="n">gr_name</span><span class="p">))</span>
<span class="k">return</span> <span class="n">errors</span></div>
</pre></div>
</div>
</div>
<footer>
<hr/>
<div role="contentinfo">
<p>
&copy; Copyright 2018, Red Hat, Inc..
</p>
</div>
Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/rtfd/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>.
</footer>
</div>
</div>
</section>
</div>
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT:'../../../',
VERSION:'28.10',
LANGUAGE:'None',
COLLAPSE_INDEX:false,
FILE_SUFFIX:'.html',
HAS_SOURCE: true,
SOURCELINK_SUFFIX: '.txt'
};
</script>
<script type="text/javascript" src="../../../_static/jquery.js"></script>
<script type="text/javascript" src="../../../_static/underscore.js"></script>
<script type="text/javascript" src="../../../_static/doctools.js"></script>
<script type="text/javascript" src="../../../_static/js/theme.js"></script>
<script type="text/javascript">
jQuery(function () {
SphinxRtdTheme.Navigation.enableSticky();
});
</script>
</body>
</html>

View File

@ -0,0 +1,284 @@
<!DOCTYPE html>
<!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]-->
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>pylorax.api.crossdomain &mdash; Lorax 28.10 documentation</title>
<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" />
<script src="../../../_static/js/modernizr.min.js"></script>
</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">
28.10
</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>
<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"><a class="reference internal" href="../../../modules.html">pylorax</a></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="../../index.html">Module code</a> &raquo;</li>
<li><a href="../../pylorax.html">pylorax</a> &raquo;</li>
<li>pylorax.api.crossdomain</li>
<li class="wy-breadcrumbs-aside">
</li>
</ul>
<hr/>
</div>
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
<div itemprop="articleBody">
<h1>Source code for pylorax.api.crossdomain</h1><div class="highlight"><pre>
<span></span><span class="c1">#</span>
<span class="c1"># Copyright (C) 2017 Red Hat, Inc.</span>
<span class="c1">#</span>
<span class="c1"># This program is free software; you can redistribute it and/or modify</span>
<span class="c1"># it under the terms of the GNU General Public License as published by</span>
<span class="c1"># the Free Software Foundation; either version 2 of the License, or</span>
<span class="c1"># (at your option) any later version.</span>
<span class="c1">#</span>
<span class="c1"># This program is distributed in the hope that it will be useful,</span>
<span class="c1"># but WITHOUT ANY WARRANTY; without even the implied warranty of</span>
<span class="c1"># MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the</span>
<span class="c1"># GNU General Public License for more details.</span>
<span class="c1">#</span>
<span class="c1"># You should have received a copy of the GNU General Public License</span>
<span class="c1"># along with this program. If not, see &lt;http://www.gnu.org/licenses/&gt;.</span>
<span class="c1">#</span>
<span class="c1"># crossdomain decorator from - http://flask.pocoo.org/snippets/56/</span>
<span class="kn">from</span> <span class="nn">datetime</span> <span class="k">import</span> <span class="n">timedelta</span>
<span class="kn">from</span> <span class="nn">flask</span> <span class="k">import</span> <span class="n">make_response</span><span class="p">,</span> <span class="n">request</span><span class="p">,</span> <span class="n">current_app</span>
<span class="kn">from</span> <span class="nn">functools</span> <span class="k">import</span> <span class="n">update_wrapper</span>
<div class="viewcode-block" id="crossdomain"><a class="viewcode-back" href="../../../pylorax.api.html#pylorax.api.crossdomain.crossdomain">[docs]</a><span class="k">def</span> <span class="nf">crossdomain</span><span class="p">(</span><span class="n">origin</span><span class="p">,</span> <span class="n">methods</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">headers</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span>
<span class="n">max_age</span><span class="o">=</span><span class="mi">21600</span><span class="p">,</span> <span class="n">attach_to_all</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span>
<span class="n">automatic_options</span><span class="o">=</span><span class="kc">True</span><span class="p">):</span>
<span class="k">if</span> <span class="n">methods</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span><span class="p">:</span>
<span class="n">methods</span> <span class="o">=</span> <span class="s1">&#39;, &#39;</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="nb">sorted</span><span class="p">(</span><span class="n">x</span><span class="o">.</span><span class="n">upper</span><span class="p">()</span> <span class="k">for</span> <span class="n">x</span> <span class="ow">in</span> <span class="n">methods</span><span class="p">))</span>
<span class="k">if</span> <span class="n">headers</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span> <span class="ow">and</span> <span class="ow">not</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">headers</span><span class="p">,</span> <span class="nb">str</span><span class="p">):</span>
<span class="n">headers</span> <span class="o">=</span> <span class="s1">&#39;, &#39;</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="n">x</span><span class="o">.</span><span class="n">upper</span><span class="p">()</span> <span class="k">for</span> <span class="n">x</span> <span class="ow">in</span> <span class="n">headers</span><span class="p">)</span>
<span class="k">if</span> <span class="ow">not</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">origin</span><span class="p">,</span> <span class="nb">list</span><span class="p">):</span>
<span class="n">origin</span> <span class="o">=</span> <span class="p">[</span><span class="n">origin</span><span class="p">]</span>
<span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">max_age</span><span class="p">,</span> <span class="n">timedelta</span><span class="p">):</span>
<span class="n">max_age</span> <span class="o">=</span> <span class="nb">int</span><span class="p">(</span><span class="n">max_age</span><span class="o">.</span><span class="n">total_seconds</span><span class="p">())</span>
<span class="k">def</span> <span class="nf">get_methods</span><span class="p">():</span>
<span class="k">if</span> <span class="n">methods</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span><span class="p">:</span>
<span class="k">return</span> <span class="n">methods</span>
<span class="n">options_resp</span> <span class="o">=</span> <span class="n">current_app</span><span class="o">.</span><span class="n">make_default_options_response</span><span class="p">()</span>
<span class="k">return</span> <span class="n">options_resp</span><span class="o">.</span><span class="n">headers</span><span class="p">[</span><span class="s1">&#39;allow&#39;</span><span class="p">]</span>
<span class="k">def</span> <span class="nf">decorator</span><span class="p">(</span><span class="n">f</span><span class="p">):</span>
<span class="k">def</span> <span class="nf">wrapped_function</span><span class="p">(</span><span class="o">*</span><span class="n">args</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">):</span>
<span class="k">if</span> <span class="n">automatic_options</span> <span class="ow">and</span> <span class="n">request</span><span class="o">.</span><span class="n">method</span> <span class="o">==</span> <span class="s1">&#39;OPTIONS&#39;</span><span class="p">:</span>
<span class="n">resp</span> <span class="o">=</span> <span class="n">current_app</span><span class="o">.</span><span class="n">make_default_options_response</span><span class="p">()</span>
<span class="k">else</span><span class="p">:</span>
<span class="n">resp</span> <span class="o">=</span> <span class="n">make_response</span><span class="p">(</span><span class="n">f</span><span class="p">(</span><span class="o">*</span><span class="n">args</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">))</span>
<span class="k">if</span> <span class="ow">not</span> <span class="n">attach_to_all</span> <span class="ow">and</span> <span class="n">request</span><span class="o">.</span><span class="n">method</span> <span class="o">!=</span> <span class="s1">&#39;OPTIONS&#39;</span><span class="p">:</span>
<span class="k">return</span> <span class="n">resp</span>
<span class="n">h</span> <span class="o">=</span> <span class="n">resp</span><span class="o">.</span><span class="n">headers</span>
<span class="n">h</span><span class="o">.</span><span class="n">extend</span><span class="p">([(</span><span class="s2">&quot;Access-Control-Allow-Origin&quot;</span><span class="p">,</span> <span class="n">orig</span><span class="p">)</span> <span class="k">for</span> <span class="n">orig</span> <span class="ow">in</span> <span class="n">origin</span><span class="p">])</span>
<span class="n">h</span><span class="p">[</span><span class="s1">&#39;Access-Control-Allow-Methods&#39;</span><span class="p">]</span> <span class="o">=</span> <span class="n">get_methods</span><span class="p">()</span>
<span class="n">h</span><span class="p">[</span><span class="s1">&#39;Access-Control-Max-Age&#39;</span><span class="p">]</span> <span class="o">=</span> <span class="nb">str</span><span class="p">(</span><span class="n">max_age</span><span class="p">)</span>
<span class="k">if</span> <span class="n">headers</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span><span class="p">:</span>
<span class="n">h</span><span class="p">[</span><span class="s1">&#39;Access-Control-Allow-Headers&#39;</span><span class="p">]</span> <span class="o">=</span> <span class="n">headers</span>
<span class="k">return</span> <span class="n">resp</span>
<span class="n">f</span><span class="o">.</span><span class="n">provide_automatic_options</span> <span class="o">=</span> <span class="kc">False</span>
<span class="n">f</span><span class="o">.</span><span class="n">required_methods</span> <span class="o">=</span> <span class="p">[</span><span class="s1">&#39;OPTIONS&#39;</span><span class="p">]</span>
<span class="k">return</span> <span class="n">update_wrapper</span><span class="p">(</span><span class="n">wrapped_function</span><span class="p">,</span> <span class="n">f</span><span class="p">)</span>
<span class="k">return</span> <span class="n">decorator</span></div>
</pre></div>
</div>
</div>
<footer>
<hr/>
<div role="contentinfo">
<p>
&copy; Copyright 2018, Red Hat, Inc..
</p>
</div>
Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/rtfd/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>.
</footer>
</div>
</div>
</section>
</div>
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT:'../../../',
VERSION:'28.10',
LANGUAGE:'None',
COLLAPSE_INDEX:false,
FILE_SUFFIX:'.html',
HAS_SOURCE: true,
SOURCELINK_SUFFIX: '.txt'
};
</script>
<script type="text/javascript" src="../../../_static/jquery.js"></script>
<script type="text/javascript" src="../../../_static/underscore.js"></script>
<script type="text/javascript" src="../../../_static/doctools.js"></script>
<script type="text/javascript" src="../../../_static/js/theme.js"></script>
<script type="text/javascript">
jQuery(function () {
SphinxRtdTheme.Navigation.enableSticky();
});
</script>
</body>
</html>

View File

@ -0,0 +1,524 @@
<!DOCTYPE html>
<!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]-->
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>pylorax.api.projects &mdash; Lorax 28.10 documentation</title>
<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" />
<script src="../../../_static/js/modernizr.min.js"></script>
</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">
28.10
</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>
<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"><a class="reference internal" href="../../../modules.html">pylorax</a></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="../../index.html">Module code</a> &raquo;</li>
<li><a href="../../pylorax.html">pylorax</a> &raquo;</li>
<li>pylorax.api.projects</li>
<li class="wy-breadcrumbs-aside">
</li>
</ul>
<hr/>
</div>
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
<div itemprop="articleBody">
<h1>Source code for pylorax.api.projects</h1><div class="highlight"><pre>
<span></span><span class="c1">#</span>
<span class="c1"># Copyright (C) 2017 Red Hat, Inc.</span>
<span class="c1">#</span>
<span class="c1"># This program is free software; you can redistribute it and/or modify</span>
<span class="c1"># it under the terms of the GNU General Public License as published by</span>
<span class="c1"># the Free Software Foundation; either version 2 of the License, or</span>
<span class="c1"># (at your option) any later version.</span>
<span class="c1">#</span>
<span class="c1"># This program is distributed in the hope that it will be useful,</span>
<span class="c1"># but WITHOUT ANY WARRANTY; without even the implied warranty of</span>
<span class="c1"># MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the</span>
<span class="c1"># GNU General Public License for more details.</span>
<span class="c1">#</span>
<span class="c1"># You should have received a copy of the GNU General Public License</span>
<span class="c1"># along with this program. If not, see &lt;http://www.gnu.org/licenses/&gt;.</span>
<span class="c1">#</span>
<span class="kn">import</span> <span class="nn">logging</span>
<span class="n">log</span> <span class="o">=</span> <span class="n">logging</span><span class="o">.</span><span class="n">getLogger</span><span class="p">(</span><span class="s2">&quot;lorax-composer&quot;</span><span class="p">)</span>
<span class="kn">import</span> <span class="nn">dnf</span>
<span class="kn">import</span> <span class="nn">time</span>
<span class="n">TIME_FORMAT</span> <span class="o">=</span> <span class="s2">&quot;%Y-%m-</span><span class="si">%d</span><span class="s2">T%H:%M:%S&quot;</span>
<div class="viewcode-block" id="ProjectsError"><a class="viewcode-back" href="../../../pylorax.api.html#pylorax.api.projects.ProjectsError">[docs]</a><span class="k">class</span> <span class="nc">ProjectsError</span><span class="p">(</span><span class="ne">Exception</span><span class="p">):</span>
<span class="k">pass</span></div>
<div class="viewcode-block" id="api_time"><a class="viewcode-back" href="../../../pylorax.api.html#pylorax.api.projects.api_time">[docs]</a><span class="k">def</span> <span class="nf">api_time</span><span class="p">(</span><span class="n">t</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;Convert time since epoch to a string</span>
<span class="sd"> :param t: Seconds since epoch</span>
<span class="sd"> :type t: int</span>
<span class="sd"> :returns: Time string</span>
<span class="sd"> :rtype: str</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="k">return</span> <span class="n">time</span><span class="o">.</span><span class="n">strftime</span><span class="p">(</span><span class="n">TIME_FORMAT</span><span class="p">,</span> <span class="n">time</span><span class="o">.</span><span class="n">localtime</span><span class="p">(</span><span class="n">t</span><span class="p">))</span></div>
<div class="viewcode-block" id="api_changelog"><a class="viewcode-back" href="../../../pylorax.api.html#pylorax.api.projects.api_changelog">[docs]</a><span class="k">def</span> <span class="nf">api_changelog</span><span class="p">(</span><span class="n">changelog</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;Convert the changelog to a string</span>
<span class="sd"> :param changelog: A list of time, author, string tuples.</span>
<span class="sd"> :type changelog: tuple</span>
<span class="sd"> :returns: The most recent changelog text or &quot;&quot;</span>
<span class="sd"> :rtype: str</span>
<span class="sd"> This returns only the most recent changelog entry.</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="k">try</span><span class="p">:</span>
<span class="n">entry</span> <span class="o">=</span> <span class="n">changelog</span><span class="p">[</span><span class="mi">0</span><span class="p">][</span><span class="mi">2</span><span class="p">]</span>
<span class="k">except</span> <span class="ne">IndexError</span><span class="p">:</span>
<span class="n">entry</span> <span class="o">=</span> <span class="s2">&quot;&quot;</span>
<span class="k">return</span> <span class="n">entry</span></div>
<div class="viewcode-block" id="pkg_to_project"><a class="viewcode-back" href="../../../pylorax.api.html#pylorax.api.projects.pkg_to_project">[docs]</a><span class="k">def</span> <span class="nf">pkg_to_project</span><span class="p">(</span><span class="n">pkg</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;Extract the details from a hawkey.Package object</span>
<span class="sd"> :param pkgs: hawkey.Package object with package details</span>
<span class="sd"> :type pkgs: hawkey.Package</span>
<span class="sd"> :returns: A dict with the name, summary, description, and url.</span>
<span class="sd"> :rtype: dict</span>
<span class="sd"> upstream_vcs is hard-coded to UPSTREAM_VCS</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="k">return</span> <span class="p">{</span><span class="s2">&quot;name&quot;</span><span class="p">:</span> <span class="n">pkg</span><span class="o">.</span><span class="n">name</span><span class="p">,</span>
<span class="s2">&quot;summary&quot;</span><span class="p">:</span> <span class="n">pkg</span><span class="o">.</span><span class="n">summary</span><span class="p">,</span>
<span class="s2">&quot;description&quot;</span><span class="p">:</span> <span class="n">pkg</span><span class="o">.</span><span class="n">description</span><span class="p">,</span>
<span class="s2">&quot;homepage&quot;</span><span class="p">:</span> <span class="n">pkg</span><span class="o">.</span><span class="n">url</span><span class="p">,</span>
<span class="s2">&quot;upstream_vcs&quot;</span><span class="p">:</span> <span class="s2">&quot;UPSTREAM_VCS&quot;</span><span class="p">}</span></div>
<div class="viewcode-block" id="pkg_to_project_info"><a class="viewcode-back" href="../../../pylorax.api.html#pylorax.api.projects.pkg_to_project_info">[docs]</a><span class="k">def</span> <span class="nf">pkg_to_project_info</span><span class="p">(</span><span class="n">pkg</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;Extract the details from a hawkey.Package object</span>
<span class="sd"> :param pkg: hawkey.Package object with package details</span>
<span class="sd"> :type pkg: hawkey.Package</span>
<span class="sd"> :returns: A dict with the project details, as well as epoch, release, arch, build_time, changelog, ...</span>
<span class="sd"> :rtype: dict</span>
<span class="sd"> metadata entries are hard-coded to {}</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="n">build</span> <span class="o">=</span> <span class="p">{</span><span class="s2">&quot;epoch&quot;</span><span class="p">:</span> <span class="n">pkg</span><span class="o">.</span><span class="n">epoch</span><span class="p">,</span>
<span class="s2">&quot;release&quot;</span><span class="p">:</span> <span class="n">pkg</span><span class="o">.</span><span class="n">release</span><span class="p">,</span>
<span class="s2">&quot;arch&quot;</span><span class="p">:</span> <span class="n">pkg</span><span class="o">.</span><span class="n">arch</span><span class="p">,</span>
<span class="s2">&quot;build_time&quot;</span><span class="p">:</span> <span class="n">api_time</span><span class="p">(</span><span class="n">pkg</span><span class="o">.</span><span class="n">buildtime</span><span class="p">),</span>
<span class="s2">&quot;changelog&quot;</span><span class="p">:</span> <span class="s2">&quot;CHANGELOG_NEEDED&quot;</span><span class="p">,</span> <span class="c1"># XXX Not in hawkey.Package</span>
<span class="s2">&quot;build_config_ref&quot;</span><span class="p">:</span> <span class="s2">&quot;BUILD_CONFIG_REF&quot;</span><span class="p">,</span>
<span class="s2">&quot;build_env_ref&quot;</span><span class="p">:</span> <span class="s2">&quot;BUILD_ENV_REF&quot;</span><span class="p">,</span>
<span class="s2">&quot;metadata&quot;</span><span class="p">:</span> <span class="p">{},</span>
<span class="s2">&quot;source&quot;</span><span class="p">:</span> <span class="p">{</span><span class="s2">&quot;license&quot;</span><span class="p">:</span> <span class="n">pkg</span><span class="o">.</span><span class="n">license</span><span class="p">,</span>
<span class="s2">&quot;version&quot;</span><span class="p">:</span> <span class="n">pkg</span><span class="o">.</span><span class="n">version</span><span class="p">,</span>
<span class="s2">&quot;source_ref&quot;</span><span class="p">:</span> <span class="s2">&quot;SOURCE_REF&quot;</span><span class="p">,</span>
<span class="s2">&quot;metadata&quot;</span><span class="p">:</span> <span class="p">{}}}</span>
<span class="k">return</span> <span class="p">{</span><span class="s2">&quot;name&quot;</span><span class="p">:</span> <span class="n">pkg</span><span class="o">.</span><span class="n">name</span><span class="p">,</span>
<span class="s2">&quot;summary&quot;</span><span class="p">:</span> <span class="n">pkg</span><span class="o">.</span><span class="n">summary</span><span class="p">,</span>
<span class="s2">&quot;description&quot;</span><span class="p">:</span> <span class="n">pkg</span><span class="o">.</span><span class="n">description</span><span class="p">,</span>
<span class="s2">&quot;homepage&quot;</span><span class="p">:</span> <span class="n">pkg</span><span class="o">.</span><span class="n">url</span><span class="p">,</span>
<span class="s2">&quot;upstream_vcs&quot;</span><span class="p">:</span> <span class="s2">&quot;UPSTREAM_VCS&quot;</span><span class="p">,</span>
<span class="s2">&quot;builds&quot;</span><span class="p">:</span> <span class="p">[</span><span class="n">build</span><span class="p">]}</span></div>
<div class="viewcode-block" id="pkg_to_dep"><a class="viewcode-back" href="../../../pylorax.api.html#pylorax.api.projects.pkg_to_dep">[docs]</a><span class="k">def</span> <span class="nf">pkg_to_dep</span><span class="p">(</span><span class="n">pkg</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;Extract the info from a hawkey.Package object</span>
<span class="sd"> :param pkg: A hawkey.Package object</span>
<span class="sd"> :type pkg: hawkey.Package</span>
<span class="sd"> :returns: A dict with name, epoch, version, release, arch</span>
<span class="sd"> :rtype: dict</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="k">return</span> <span class="p">{</span><span class="s2">&quot;name&quot;</span><span class="p">:</span> <span class="n">pkg</span><span class="o">.</span><span class="n">name</span><span class="p">,</span>
<span class="s2">&quot;epoch&quot;</span><span class="p">:</span> <span class="n">pkg</span><span class="o">.</span><span class="n">epoch</span><span class="p">,</span>
<span class="s2">&quot;version&quot;</span><span class="p">:</span> <span class="n">pkg</span><span class="o">.</span><span class="n">version</span><span class="p">,</span>
<span class="s2">&quot;release&quot;</span><span class="p">:</span> <span class="n">pkg</span><span class="o">.</span><span class="n">release</span><span class="p">,</span>
<span class="s2">&quot;arch&quot;</span><span class="p">:</span> <span class="n">pkg</span><span class="o">.</span><span class="n">arch</span><span class="p">}</span></div>
<div class="viewcode-block" id="proj_to_module"><a class="viewcode-back" href="../../../pylorax.api.html#pylorax.api.projects.proj_to_module">[docs]</a><span class="k">def</span> <span class="nf">proj_to_module</span><span class="p">(</span><span class="n">proj</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;Extract the name from a project_info dict</span>
<span class="sd"> :param pkg: dict with package details</span>
<span class="sd"> :type pkg: dict</span>
<span class="sd"> :returns: A dict with name, and group_type</span>
<span class="sd"> :rtype: dict</span>
<span class="sd"> group_type is hard-coded to &quot;rpm&quot;</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="k">return</span> <span class="p">{</span><span class="s2">&quot;name&quot;</span><span class="p">:</span> <span class="n">proj</span><span class="p">[</span><span class="s2">&quot;name&quot;</span><span class="p">],</span>
<span class="s2">&quot;group_type&quot;</span><span class="p">:</span> <span class="s2">&quot;rpm&quot;</span><span class="p">}</span></div>
<div class="viewcode-block" id="dep_evra"><a class="viewcode-back" href="../../../pylorax.api.html#pylorax.api.projects.dep_evra">[docs]</a><span class="k">def</span> <span class="nf">dep_evra</span><span class="p">(</span><span class="n">dep</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;Return the epoch:version-release.arch for the dep</span>
<span class="sd"> :param dep: dependency dict</span>
<span class="sd"> :type dep: dict</span>
<span class="sd"> :returns: epoch:version-release.arch</span>
<span class="sd"> :rtype: str</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="k">if</span> <span class="n">dep</span><span class="p">[</span><span class="s2">&quot;epoch&quot;</span><span class="p">]</span> <span class="o">==</span> <span class="mi">0</span><span class="p">:</span>
<span class="k">return</span> <span class="n">dep</span><span class="p">[</span><span class="s2">&quot;version&quot;</span><span class="p">]</span><span class="o">+</span><span class="s2">&quot;-&quot;</span><span class="o">+</span><span class="n">dep</span><span class="p">[</span><span class="s2">&quot;release&quot;</span><span class="p">]</span><span class="o">+</span><span class="s2">&quot;.&quot;</span><span class="o">+</span><span class="n">dep</span><span class="p">[</span><span class="s2">&quot;arch&quot;</span><span class="p">]</span>
<span class="k">else</span><span class="p">:</span>
<span class="k">return</span> <span class="nb">str</span><span class="p">(</span><span class="n">dep</span><span class="p">[</span><span class="s2">&quot;epoch&quot;</span><span class="p">])</span><span class="o">+</span><span class="s2">&quot;:&quot;</span><span class="o">+</span><span class="n">dep</span><span class="p">[</span><span class="s2">&quot;version&quot;</span><span class="p">]</span><span class="o">+</span><span class="s2">&quot;-&quot;</span><span class="o">+</span><span class="n">dep</span><span class="p">[</span><span class="s2">&quot;release&quot;</span><span class="p">]</span><span class="o">+</span><span class="s2">&quot;.&quot;</span><span class="o">+</span><span class="n">dep</span><span class="p">[</span><span class="s2">&quot;arch&quot;</span><span class="p">]</span></div>
<div class="viewcode-block" id="dep_nevra"><a class="viewcode-back" href="../../../pylorax.api.html#pylorax.api.projects.dep_nevra">[docs]</a><span class="k">def</span> <span class="nf">dep_nevra</span><span class="p">(</span><span class="n">dep</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;Return the name-epoch:version-release.arch&quot;&quot;&quot;</span>
<span class="k">return</span> <span class="n">dep</span><span class="p">[</span><span class="s2">&quot;name&quot;</span><span class="p">]</span><span class="o">+</span><span class="s2">&quot;-&quot;</span><span class="o">+</span><span class="n">dep_evra</span><span class="p">(</span><span class="n">dep</span><span class="p">)</span></div>
<div class="viewcode-block" id="projects_list"><a class="viewcode-back" href="../../../pylorax.api.html#pylorax.api.projects.projects_list">[docs]</a><span class="k">def</span> <span class="nf">projects_list</span><span class="p">(</span><span class="n">dbo</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;Return a list of projects</span>
<span class="sd"> :param dbo: dnf base object</span>
<span class="sd"> :type dbo: dnf.Base</span>
<span class="sd"> :returns: List of project info dicts with name, summary, description, homepage, upstream_vcs</span>
<span class="sd"> :rtype: list of dicts</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="k">return</span> <span class="n">projects_info</span><span class="p">(</span><span class="n">dbo</span><span class="p">,</span> <span class="kc">None</span><span class="p">)</span></div>
<div class="viewcode-block" id="projects_info"><a class="viewcode-back" href="../../../pylorax.api.html#pylorax.api.projects.projects_info">[docs]</a><span class="k">def</span> <span class="nf">projects_info</span><span class="p">(</span><span class="n">dbo</span><span class="p">,</span> <span class="n">project_names</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;Return details about specific projects</span>
<span class="sd"> :param dbo: dnf base object</span>
<span class="sd"> :type dbo: dnf.Base</span>
<span class="sd"> :param project_names: List of names of projects to get info about</span>
<span class="sd"> :type project_names: str</span>
<span class="sd"> :returns: List of project info dicts with pkg_to_project as well as epoch, version, release, etc.</span>
<span class="sd"> :rtype: list of dicts</span>
<span class="sd"> If project_names is None it will return the full list of available packages</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="k">if</span> <span class="n">project_names</span><span class="p">:</span>
<span class="n">pkgs</span> <span class="o">=</span> <span class="n">dbo</span><span class="o">.</span><span class="n">sack</span><span class="o">.</span><span class="n">query</span><span class="p">()</span><span class="o">.</span><span class="n">available</span><span class="p">()</span><span class="o">.</span><span class="n">filter</span><span class="p">(</span><span class="n">name__glob</span><span class="o">=</span><span class="n">project_names</span><span class="p">)</span>
<span class="k">else</span><span class="p">:</span>
<span class="n">pkgs</span> <span class="o">=</span> <span class="n">dbo</span><span class="o">.</span><span class="n">sack</span><span class="o">.</span><span class="n">query</span><span class="p">()</span><span class="o">.</span><span class="n">available</span><span class="p">()</span>
<span class="k">return</span> <span class="nb">sorted</span><span class="p">(</span><span class="nb">map</span><span class="p">(</span><span class="n">pkg_to_project_info</span><span class="p">,</span> <span class="n">pkgs</span><span class="p">),</span> <span class="n">key</span><span class="o">=</span><span class="k">lambda</span> <span class="n">p</span><span class="p">:</span> <span class="n">p</span><span class="p">[</span><span class="s2">&quot;name&quot;</span><span class="p">]</span><span class="o">.</span><span class="n">lower</span><span class="p">())</span></div>
<div class="viewcode-block" id="projects_depsolve"><a class="viewcode-back" href="../../../pylorax.api.html#pylorax.api.projects.projects_depsolve">[docs]</a><span class="k">def</span> <span class="nf">projects_depsolve</span><span class="p">(</span><span class="n">dbo</span><span class="p">,</span> <span class="n">project_names</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;Return the dependencies for a list of projects</span>
<span class="sd"> :param dbo: dnf base object</span>
<span class="sd"> :type dbo: dnf.Base</span>
<span class="sd"> :param project_names: The projects to find the dependencies for</span>
<span class="sd"> :type project_names: List of Strings</span>
<span class="sd"> :returns: NEVRA&#39;s of the project and its dependencies</span>
<span class="sd"> :rtype: list of dicts</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="c1"># This resets the transaction</span>
<span class="n">dbo</span><span class="o">.</span><span class="n">reset</span><span class="p">(</span><span class="n">goal</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span>
<span class="k">for</span> <span class="n">p</span> <span class="ow">in</span> <span class="n">project_names</span><span class="p">:</span>
<span class="k">try</span><span class="p">:</span>
<span class="n">dbo</span><span class="o">.</span><span class="n">install</span><span class="p">(</span><span class="n">p</span><span class="p">)</span>
<span class="k">except</span> <span class="n">dnf</span><span class="o">.</span><span class="n">exceptions</span><span class="o">.</span><span class="n">MarkingError</span><span class="p">:</span>
<span class="k">raise</span> <span class="n">ProjectsError</span><span class="p">(</span><span class="s2">&quot;No match for </span><span class="si">%s</span><span class="s2">&quot;</span> <span class="o">%</span> <span class="n">p</span><span class="p">)</span>
<span class="k">try</span><span class="p">:</span>
<span class="n">dbo</span><span class="o">.</span><span class="n">resolve</span><span class="p">()</span>
<span class="k">except</span> <span class="n">dnf</span><span class="o">.</span><span class="n">exceptions</span><span class="o">.</span><span class="n">DepsolveError</span> <span class="k">as</span> <span class="n">e</span><span class="p">:</span>
<span class="k">raise</span> <span class="n">ProjectsError</span><span class="p">(</span><span class="s2">&quot;There was a problem depsolving </span><span class="si">%s</span><span class="s2">: </span><span class="si">%s</span><span class="s2">&quot;</span> <span class="o">%</span> <span class="p">(</span><span class="n">project_names</span><span class="p">,</span> <span class="nb">str</span><span class="p">(</span><span class="n">e</span><span class="p">)))</span>
<span class="k">if</span> <span class="nb">len</span><span class="p">(</span><span class="n">dbo</span><span class="o">.</span><span class="n">transaction</span><span class="p">)</span> <span class="o">==</span> <span class="mi">0</span><span class="p">:</span>
<span class="k">return</span> <span class="p">[]</span>
<span class="k">return</span> <span class="nb">sorted</span><span class="p">(</span><span class="nb">map</span><span class="p">(</span><span class="n">pkg_to_dep</span><span class="p">,</span> <span class="n">dbo</span><span class="o">.</span><span class="n">transaction</span><span class="o">.</span><span class="n">install_set</span><span class="p">),</span> <span class="n">key</span><span class="o">=</span><span class="k">lambda</span> <span class="n">p</span><span class="p">:</span> <span class="n">p</span><span class="p">[</span><span class="s2">&quot;name&quot;</span><span class="p">]</span><span class="o">.</span><span class="n">lower</span><span class="p">())</span></div>
<div class="viewcode-block" id="estimate_size"><a class="viewcode-back" href="../../../pylorax.api.html#pylorax.api.projects.estimate_size">[docs]</a><span class="k">def</span> <span class="nf">estimate_size</span><span class="p">(</span><span class="n">packages</span><span class="p">,</span> <span class="n">block_size</span><span class="o">=</span><span class="mi">6144</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;Estimate the installed size of a package list</span>
<span class="sd"> :param packages: The packages to be installed</span>
<span class="sd"> :type packages: list of hawkey.Package objects</span>
<span class="sd"> :param block_size: The block size to use for rounding up file sizes.</span>
<span class="sd"> :type block_size: int</span>
<span class="sd"> :returns: The estimated size of installed packages</span>
<span class="sd"> :rtype: int</span>
<span class="sd"> Estimating actual requirements is difficult without the actual file sizes, which</span>
<span class="sd"> dnf doesn&#39;t provide access to. So use the file count and block size to estimate</span>
<span class="sd"> a minimum size for each package.</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="n">installed_size</span> <span class="o">=</span> <span class="mi">0</span>
<span class="k">for</span> <span class="n">p</span> <span class="ow">in</span> <span class="n">packages</span><span class="p">:</span>
<span class="n">installed_size</span> <span class="o">+=</span> <span class="nb">len</span><span class="p">(</span><span class="n">p</span><span class="o">.</span><span class="n">files</span><span class="p">)</span> <span class="o">*</span> <span class="n">block_size</span>
<span class="n">installed_size</span> <span class="o">+=</span> <span class="n">p</span><span class="o">.</span><span class="n">installsize</span>
<span class="k">return</span> <span class="n">installed_size</span></div>
<div class="viewcode-block" id="projects_depsolve_with_size"><a class="viewcode-back" href="../../../pylorax.api.html#pylorax.api.projects.projects_depsolve_with_size">[docs]</a><span class="k">def</span> <span class="nf">projects_depsolve_with_size</span><span class="p">(</span><span class="n">dbo</span><span class="p">,</span> <span class="n">project_names</span><span class="p">,</span> <span class="n">with_core</span><span class="o">=</span><span class="kc">True</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;Return the dependencies and installed size for a list of projects</span>
<span class="sd"> :param dbo: dnf base object</span>
<span class="sd"> :type dbo: dnf.Base</span>
<span class="sd"> :param project_names: The projects to find the dependencies for</span>
<span class="sd"> :type project_names: List of Strings</span>
<span class="sd"> :returns: installed size and a list of NEVRA&#39;s of the project and its dependencies</span>
<span class="sd"> :rtype: tuple of (int, list of dicts)</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="c1"># This resets the transaction</span>
<span class="n">dbo</span><span class="o">.</span><span class="n">reset</span><span class="p">(</span><span class="n">goal</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span>
<span class="k">for</span> <span class="n">p</span> <span class="ow">in</span> <span class="n">project_names</span><span class="p">:</span>
<span class="k">try</span><span class="p">:</span>
<span class="n">dbo</span><span class="o">.</span><span class="n">install</span><span class="p">(</span><span class="n">p</span><span class="p">)</span>
<span class="k">except</span> <span class="n">dnf</span><span class="o">.</span><span class="n">exceptions</span><span class="o">.</span><span class="n">MarkingError</span><span class="p">:</span>
<span class="k">raise</span> <span class="n">ProjectsError</span><span class="p">(</span><span class="s2">&quot;No match for </span><span class="si">%s</span><span class="s2">&quot;</span> <span class="o">%</span> <span class="n">p</span><span class="p">)</span>
<span class="k">if</span> <span class="n">with_core</span><span class="p">:</span>
<span class="n">dbo</span><span class="o">.</span><span class="n">group_install</span><span class="p">(</span><span class="s2">&quot;core&quot;</span><span class="p">,</span> <span class="p">[</span><span class="s1">&#39;mandatory&#39;</span><span class="p">,</span> <span class="s1">&#39;default&#39;</span><span class="p">,</span> <span class="s1">&#39;optional&#39;</span><span class="p">])</span>
<span class="k">try</span><span class="p">:</span>
<span class="n">dbo</span><span class="o">.</span><span class="n">resolve</span><span class="p">()</span>
<span class="k">except</span> <span class="n">dnf</span><span class="o">.</span><span class="n">exceptions</span><span class="o">.</span><span class="n">DepsolveError</span> <span class="k">as</span> <span class="n">e</span><span class="p">:</span>
<span class="k">raise</span> <span class="n">ProjectsError</span><span class="p">(</span><span class="s2">&quot;There was a problem depsolving </span><span class="si">%s</span><span class="s2">: </span><span class="si">%s</span><span class="s2">&quot;</span> <span class="o">%</span> <span class="p">(</span><span class="n">project_names</span><span class="p">,</span> <span class="nb">str</span><span class="p">(</span><span class="n">e</span><span class="p">)))</span>
<span class="k">if</span> <span class="nb">len</span><span class="p">(</span><span class="n">dbo</span><span class="o">.</span><span class="n">transaction</span><span class="p">)</span> <span class="o">==</span> <span class="mi">0</span><span class="p">:</span>
<span class="k">return</span> <span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="p">[])</span>
<span class="n">installed_size</span> <span class="o">=</span> <span class="n">estimate_size</span><span class="p">(</span><span class="n">dbo</span><span class="o">.</span><span class="n">transaction</span><span class="o">.</span><span class="n">install_set</span><span class="p">)</span>
<span class="n">deps</span> <span class="o">=</span> <span class="nb">sorted</span><span class="p">(</span><span class="nb">map</span><span class="p">(</span><span class="n">pkg_to_dep</span><span class="p">,</span> <span class="n">dbo</span><span class="o">.</span><span class="n">transaction</span><span class="o">.</span><span class="n">install_set</span><span class="p">),</span> <span class="n">key</span><span class="o">=</span><span class="k">lambda</span> <span class="n">p</span><span class="p">:</span> <span class="n">p</span><span class="p">[</span><span class="s2">&quot;name&quot;</span><span class="p">]</span><span class="o">.</span><span class="n">lower</span><span class="p">())</span>
<span class="k">return</span> <span class="p">(</span><span class="n">installed_size</span><span class="p">,</span> <span class="n">deps</span><span class="p">)</span></div>
<div class="viewcode-block" id="modules_list"><a class="viewcode-back" href="../../../pylorax.api.html#pylorax.api.projects.modules_list">[docs]</a><span class="k">def</span> <span class="nf">modules_list</span><span class="p">(</span><span class="n">dbo</span><span class="p">,</span> <span class="n">module_names</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;Return a list of modules</span>
<span class="sd"> :param dbo: dnf base object</span>
<span class="sd"> :type dbo: dnf.Base</span>
<span class="sd"> :param offset: Number of modules to skip</span>
<span class="sd"> :type limit: int</span>
<span class="sd"> :param limit: Maximum number of modules to return</span>
<span class="sd"> :type limit: int</span>
<span class="sd"> :returns: List of module information and total count</span>
<span class="sd"> :rtype: tuple of a list of dicts and an Int</span>
<span class="sd"> Modules don&#39;t exist in RHEL7 so this only returns projects</span>
<span class="sd"> and sets the type to &quot;rpm&quot;</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="c1"># TODO - Figure out what to do with this for Fedora &#39;modules&#39;</span>
<span class="n">projs</span> <span class="o">=</span> <span class="n">projects_info</span><span class="p">(</span><span class="n">dbo</span><span class="p">,</span> <span class="n">module_names</span><span class="p">)</span>
<span class="k">return</span> <span class="nb">sorted</span><span class="p">(</span><span class="nb">map</span><span class="p">(</span><span class="n">proj_to_module</span><span class="p">,</span> <span class="n">projs</span><span class="p">),</span> <span class="n">key</span><span class="o">=</span><span class="k">lambda</span> <span class="n">p</span><span class="p">:</span> <span class="n">p</span><span class="p">[</span><span class="s2">&quot;name&quot;</span><span class="p">]</span><span class="o">.</span><span class="n">lower</span><span class="p">())</span></div>
<div class="viewcode-block" id="modules_info"><a class="viewcode-back" href="../../../pylorax.api.html#pylorax.api.projects.modules_info">[docs]</a><span class="k">def</span> <span class="nf">modules_info</span><span class="p">(</span><span class="n">dbo</span><span class="p">,</span> <span class="n">module_names</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;Return details about a module, including dependencies</span>
<span class="sd"> :param dbo: dnf base object</span>
<span class="sd"> :type dbo: dnf.Base</span>
<span class="sd"> :param module_names: Names of the modules to get info about</span>
<span class="sd"> :type module_names: str</span>
<span class="sd"> :returns: List of dicts with module details and dependencies.</span>
<span class="sd"> :rtype: list of dicts</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="n">modules</span> <span class="o">=</span> <span class="n">projects_info</span><span class="p">(</span><span class="n">dbo</span><span class="p">,</span> <span class="n">module_names</span><span class="p">)</span>
<span class="c1"># Add the dependency info to each one</span>
<span class="k">for</span> <span class="n">module</span> <span class="ow">in</span> <span class="n">modules</span><span class="p">:</span>
<span class="n">module</span><span class="p">[</span><span class="s2">&quot;dependencies&quot;</span><span class="p">]</span> <span class="o">=</span> <span class="n">projects_depsolve</span><span class="p">(</span><span class="n">dbo</span><span class="p">,</span> <span class="p">[</span><span class="n">module</span><span class="p">[</span><span class="s2">&quot;name&quot;</span><span class="p">]])</span>
<span class="k">return</span> <span class="n">modules</span></div>
</pre></div>
</div>
</div>
<footer>
<hr/>
<div role="contentinfo">
<p>
&copy; Copyright 2018, Red Hat, Inc..
</p>
</div>
Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/rtfd/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>.
</footer>
</div>
</div>
</section>
</div>
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT:'../../../',
VERSION:'28.10',
LANGUAGE:'None',
COLLAPSE_INDEX:false,
FILE_SUFFIX:'.html',
HAS_SOURCE: true,
SOURCELINK_SUFFIX: '.txt'
};
</script>
<script type="text/javascript" src="../../../_static/jquery.js"></script>
<script type="text/javascript" src="../../../_static/underscore.js"></script>
<script type="text/javascript" src="../../../_static/doctools.js"></script>
<script type="text/javascript" src="../../../_static/js/theme.js"></script>
<script type="text/javascript">
jQuery(function () {
SphinxRtdTheme.Navigation.enableSticky();
});
</script>
</body>
</html>

View File

@ -0,0 +1,836 @@
<!DOCTYPE html>
<!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]-->
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>pylorax.api.queue &mdash; Lorax 28.10 documentation</title>
<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" />
<script src="../../../_static/js/modernizr.min.js"></script>
</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">
28.10
</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>
<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"><a class="reference internal" href="../../../modules.html">pylorax</a></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="../../index.html">Module code</a> &raquo;</li>
<li><a href="../../pylorax.html">pylorax</a> &raquo;</li>
<li>pylorax.api.queue</li>
<li class="wy-breadcrumbs-aside">
</li>
</ul>
<hr/>
</div>
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
<div itemprop="articleBody">
<h1>Source code for pylorax.api.queue</h1><div class="highlight"><pre>
<span></span><span class="c1"># Copyright (C) 2018 Red Hat, Inc.</span>
<span class="c1">#</span>
<span class="c1"># This program is free software; you can redistribute it and/or modify</span>
<span class="c1"># it under the terms of the GNU General Public License as published by</span>
<span class="c1"># the Free Software Foundation; either version 2 of the License, or</span>
<span class="c1"># (at your option) any later version.</span>
<span class="c1">#</span>
<span class="c1"># This program is distributed in the hope that it will be useful,</span>
<span class="c1"># but WITHOUT ANY WARRANTY; without even the implied warranty of</span>
<span class="c1"># MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the</span>
<span class="c1"># GNU General Public License for more details.</span>
<span class="c1">#</span>
<span class="c1"># You should have received a copy of the GNU General Public License</span>
<span class="c1"># along with this program. If not, see &lt;http://www.gnu.org/licenses/&gt;.</span>
<span class="c1">#</span>
<span class="sd">&quot;&quot;&quot; Functions to monitor compose queue and run anaconda&quot;&quot;&quot;</span>
<span class="kn">import</span> <span class="nn">logging</span>
<span class="n">log</span> <span class="o">=</span> <span class="n">logging</span><span class="o">.</span><span class="n">getLogger</span><span class="p">(</span><span class="s2">&quot;pylorax&quot;</span><span class="p">)</span>
<span class="kn">import</span> <span class="nn">os</span>
<span class="kn">import</span> <span class="nn">grp</span>
<span class="kn">from</span> <span class="nn">glob</span> <span class="k">import</span> <span class="n">glob</span>
<span class="kn">import</span> <span class="nn">multiprocessing</span> <span class="k">as</span> <span class="nn">mp</span>
<span class="kn">import</span> <span class="nn">pytoml</span> <span class="k">as</span> <span class="nn">toml</span>
<span class="kn">import</span> <span class="nn">pwd</span>
<span class="kn">import</span> <span class="nn">shutil</span>
<span class="kn">import</span> <span class="nn">subprocess</span>
<span class="kn">from</span> <span class="nn">subprocess</span> <span class="k">import</span> <span class="n">Popen</span><span class="p">,</span> <span class="n">PIPE</span>
<span class="kn">import</span> <span class="nn">time</span>
<span class="kn">from</span> <span class="nn">pylorax</span> <span class="k">import</span> <span class="n">find_templates</span>
<span class="kn">from</span> <span class="nn">pylorax.api.compose</span> <span class="k">import</span> <span class="n">move_compose_results</span>
<span class="kn">from</span> <span class="nn">pylorax.api.recipes</span> <span class="k">import</span> <span class="n">recipe_from_file</span>
<span class="kn">from</span> <span class="nn">pylorax.base</span> <span class="k">import</span> <span class="n">DataHolder</span>
<span class="kn">from</span> <span class="nn">pylorax.creator</span> <span class="k">import</span> <span class="n">run_creator</span>
<span class="kn">from</span> <span class="nn">pylorax.sysutils</span> <span class="k">import</span> <span class="n">joinpaths</span>
<div class="viewcode-block" id="start_queue_monitor"><a class="viewcode-back" href="../../../pylorax.api.html#pylorax.api.queue.start_queue_monitor">[docs]</a><span class="k">def</span> <span class="nf">start_queue_monitor</span><span class="p">(</span><span class="n">cfg</span><span class="p">,</span> <span class="n">uid</span><span class="p">,</span> <span class="n">gid</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;Start the queue monitor as a mp process</span>
<span class="sd"> :param cfg: Configuration settings</span>
<span class="sd"> :type cfg: ComposerConfig</span>
<span class="sd"> :param uid: User ID that owns the queue</span>
<span class="sd"> :type uid: int</span>
<span class="sd"> :param gid: Group ID that owns the queue</span>
<span class="sd"> :type gid: int</span>
<span class="sd"> :returns: None</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="n">lib_dir</span> <span class="o">=</span> <span class="n">cfg</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">&quot;composer&quot;</span><span class="p">,</span> <span class="s2">&quot;lib_dir&quot;</span><span class="p">)</span>
<span class="n">share_dir</span> <span class="o">=</span> <span class="n">cfg</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">&quot;composer&quot;</span><span class="p">,</span> <span class="s2">&quot;share_dir&quot;</span><span class="p">)</span>
<span class="n">tmp</span> <span class="o">=</span> <span class="n">cfg</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">&quot;composer&quot;</span><span class="p">,</span> <span class="s2">&quot;tmp&quot;</span><span class="p">)</span>
<span class="n">monitor_cfg</span> <span class="o">=</span> <span class="n">DataHolder</span><span class="p">(</span><span class="n">composer_dir</span><span class="o">=</span><span class="n">lib_dir</span><span class="p">,</span> <span class="n">share_dir</span><span class="o">=</span><span class="n">share_dir</span><span class="p">,</span> <span class="n">uid</span><span class="o">=</span><span class="n">uid</span><span class="p">,</span> <span class="n">gid</span><span class="o">=</span><span class="n">gid</span><span class="p">,</span> <span class="n">tmp</span><span class="o">=</span><span class="n">tmp</span><span class="p">)</span>
<span class="n">p</span> <span class="o">=</span> <span class="n">mp</span><span class="o">.</span><span class="n">Process</span><span class="p">(</span><span class="n">target</span><span class="o">=</span><span class="n">monitor</span><span class="p">,</span> <span class="n">args</span><span class="o">=</span><span class="p">(</span><span class="n">monitor_cfg</span><span class="p">,))</span>
<span class="n">p</span><span class="o">.</span><span class="n">daemon</span> <span class="o">=</span> <span class="kc">True</span>
<span class="n">p</span><span class="o">.</span><span class="n">start</span><span class="p">()</span></div>
<div class="viewcode-block" id="monitor"><a class="viewcode-back" href="../../../pylorax.api.html#pylorax.api.queue.monitor">[docs]</a><span class="k">def</span> <span class="nf">monitor</span><span class="p">(</span><span class="n">cfg</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;Monitor the queue for new compose requests</span>
<span class="sd"> :param cfg: Configuration settings</span>
<span class="sd"> :type cfg: DataHolder</span>
<span class="sd"> :returns: Does not return</span>
<span class="sd"> The queue has 2 subdirectories, new and run. When a compose is ready to be run</span>
<span class="sd"> a symlink to the uniquely named results directory should be placed in ./queue/new/</span>
<span class="sd"> When the it is ready to be run (it is checked every 30 seconds or after a previous</span>
<span class="sd"> compose is finished) the symlink will be moved into ./queue/run/ and a STATUS file</span>
<span class="sd"> will be created in the results directory.</span>
<span class="sd"> STATUS can contain one of: RUNNING, FINISHED, FAILED</span>
<span class="sd"> If the system is restarted while a compose is running it will move any old symlinks</span>
<span class="sd"> from ./queue/run/ to ./queue/new/ and rerun them.</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="k">def</span> <span class="nf">queue_sort</span><span class="p">(</span><span class="n">uuid</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;Sort the queue entries by their mtime, not their names&quot;&quot;&quot;</span>
<span class="k">return</span> <span class="n">os</span><span class="o">.</span><span class="n">stat</span><span class="p">(</span><span class="n">joinpaths</span><span class="p">(</span><span class="n">cfg</span><span class="o">.</span><span class="n">composer_dir</span><span class="p">,</span> <span class="s2">&quot;queue/new&quot;</span><span class="p">,</span> <span class="n">uuid</span><span class="p">))</span><span class="o">.</span><span class="n">st_mtime</span>
<span class="c1"># Move any symlinks in the run queue back to the new queue</span>
<span class="k">for</span> <span class="n">link</span> <span class="ow">in</span> <span class="n">os</span><span class="o">.</span><span class="n">listdir</span><span class="p">(</span><span class="n">joinpaths</span><span class="p">(</span><span class="n">cfg</span><span class="o">.</span><span class="n">composer_dir</span><span class="p">,</span> <span class="s2">&quot;queue/run&quot;</span><span class="p">)):</span>
<span class="n">src</span> <span class="o">=</span> <span class="n">joinpaths</span><span class="p">(</span><span class="n">cfg</span><span class="o">.</span><span class="n">composer_dir</span><span class="p">,</span> <span class="s2">&quot;queue/run&quot;</span><span class="p">,</span> <span class="n">link</span><span class="p">)</span>
<span class="n">dst</span> <span class="o">=</span> <span class="n">joinpaths</span><span class="p">(</span><span class="n">cfg</span><span class="o">.</span><span class="n">composer_dir</span><span class="p">,</span> <span class="s2">&quot;queue/new&quot;</span><span class="p">,</span> <span class="n">link</span><span class="p">)</span>
<span class="n">os</span><span class="o">.</span><span class="n">rename</span><span class="p">(</span><span class="n">src</span><span class="p">,</span> <span class="n">dst</span><span class="p">)</span>
<span class="n">log</span><span class="o">.</span><span class="n">debug</span><span class="p">(</span><span class="s2">&quot;Moved unfinished compose </span><span class="si">%s</span><span class="s2"> back to new state&quot;</span><span class="p">,</span> <span class="n">src</span><span class="p">)</span>
<span class="k">while</span> <span class="kc">True</span><span class="p">:</span>
<span class="n">uuids</span> <span class="o">=</span> <span class="nb">sorted</span><span class="p">(</span><span class="n">os</span><span class="o">.</span><span class="n">listdir</span><span class="p">(</span><span class="n">joinpaths</span><span class="p">(</span><span class="n">cfg</span><span class="o">.</span><span class="n">composer_dir</span><span class="p">,</span> <span class="s2">&quot;queue/new&quot;</span><span class="p">)),</span> <span class="n">key</span><span class="o">=</span><span class="n">queue_sort</span><span class="p">)</span>
<span class="c1"># Pick the oldest and move it into ./run/</span>
<span class="k">if</span> <span class="ow">not</span> <span class="n">uuids</span><span class="p">:</span>
<span class="c1"># No composes left to process, sleep for a bit</span>
<span class="n">time</span><span class="o">.</span><span class="n">sleep</span><span class="p">(</span><span class="mi">30</span><span class="p">)</span>
<span class="k">else</span><span class="p">:</span>
<span class="n">src</span> <span class="o">=</span> <span class="n">joinpaths</span><span class="p">(</span><span class="n">cfg</span><span class="o">.</span><span class="n">composer_dir</span><span class="p">,</span> <span class="s2">&quot;queue/new&quot;</span><span class="p">,</span> <span class="n">uuids</span><span class="p">[</span><span class="mi">0</span><span class="p">])</span>
<span class="n">dst</span> <span class="o">=</span> <span class="n">joinpaths</span><span class="p">(</span><span class="n">cfg</span><span class="o">.</span><span class="n">composer_dir</span><span class="p">,</span> <span class="s2">&quot;queue/run&quot;</span><span class="p">,</span> <span class="n">uuids</span><span class="p">[</span><span class="mi">0</span><span class="p">])</span>
<span class="k">try</span><span class="p">:</span>
<span class="n">os</span><span class="o">.</span><span class="n">rename</span><span class="p">(</span><span class="n">src</span><span class="p">,</span> <span class="n">dst</span><span class="p">)</span>
<span class="k">except</span> <span class="ne">OSError</span><span class="p">:</span>
<span class="c1"># The symlink may vanish if uuid_cancel() has been called</span>
<span class="k">continue</span>
<span class="n">log</span><span class="o">.</span><span class="n">info</span><span class="p">(</span><span class="s2">&quot;Starting new compose: </span><span class="si">%s</span><span class="s2">&quot;</span><span class="p">,</span> <span class="n">dst</span><span class="p">)</span>
<span class="nb">open</span><span class="p">(</span><span class="n">joinpaths</span><span class="p">(</span><span class="n">dst</span><span class="p">,</span> <span class="s2">&quot;STATUS&quot;</span><span class="p">),</span> <span class="s2">&quot;w&quot;</span><span class="p">)</span><span class="o">.</span><span class="n">write</span><span class="p">(</span><span class="s2">&quot;RUNNING</span><span class="se">\n</span><span class="s2">&quot;</span><span class="p">)</span>
<span class="k">try</span><span class="p">:</span>
<span class="n">make_compose</span><span class="p">(</span><span class="n">cfg</span><span class="p">,</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">realpath</span><span class="p">(</span><span class="n">dst</span><span class="p">))</span>
<span class="n">log</span><span class="o">.</span><span class="n">info</span><span class="p">(</span><span class="s2">&quot;Finished building </span><span class="si">%s</span><span class="s2">, results are in </span><span class="si">%s</span><span class="s2">&quot;</span><span class="p">,</span> <span class="n">dst</span><span class="p">,</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">realpath</span><span class="p">(</span><span class="n">dst</span><span class="p">))</span>
<span class="nb">open</span><span class="p">(</span><span class="n">joinpaths</span><span class="p">(</span><span class="n">dst</span><span class="p">,</span> <span class="s2">&quot;STATUS&quot;</span><span class="p">),</span> <span class="s2">&quot;w&quot;</span><span class="p">)</span><span class="o">.</span><span class="n">write</span><span class="p">(</span><span class="s2">&quot;FINISHED</span><span class="se">\n</span><span class="s2">&quot;</span><span class="p">)</span>
<span class="k">except</span> <span class="ne">Exception</span><span class="p">:</span>
<span class="kn">import</span> <span class="nn">traceback</span>
<span class="n">log</span><span class="o">.</span><span class="n">error</span><span class="p">(</span><span class="s2">&quot;traceback: </span><span class="si">%s</span><span class="s2">&quot;</span><span class="p">,</span> <span class="n">traceback</span><span class="o">.</span><span class="n">format_exc</span><span class="p">())</span>
<span class="c1"># TODO - Write the error message to an ERROR-LOG file to include with the status</span>
<span class="c1"># log.error(&quot;Error running compose: %s&quot;, e)</span>
<span class="nb">open</span><span class="p">(</span><span class="n">joinpaths</span><span class="p">(</span><span class="n">dst</span><span class="p">,</span> <span class="s2">&quot;STATUS&quot;</span><span class="p">),</span> <span class="s2">&quot;w&quot;</span><span class="p">)</span><span class="o">.</span><span class="n">write</span><span class="p">(</span><span class="s2">&quot;FAILED</span><span class="se">\n</span><span class="s2">&quot;</span><span class="p">)</span>
<span class="n">os</span><span class="o">.</span><span class="n">unlink</span><span class="p">(</span><span class="n">dst</span><span class="p">)</span></div>
<div class="viewcode-block" id="make_compose"><a class="viewcode-back" href="../../../pylorax.api.html#pylorax.api.queue.make_compose">[docs]</a><span class="k">def</span> <span class="nf">make_compose</span><span class="p">(</span><span class="n">cfg</span><span class="p">,</span> <span class="n">results_dir</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;Run anaconda with the final-kickstart.ks from results_dir</span>
<span class="sd"> :param cfg: Configuration settings</span>
<span class="sd"> :type cfg: DataHolder</span>
<span class="sd"> :param results_dir: The directory containing the metadata and results for the build</span>
<span class="sd"> :type results_dir: str</span>
<span class="sd"> :returns: Nothing</span>
<span class="sd"> :raises: May raise various exceptions</span>
<span class="sd"> This takes the final-kickstart.ks, and the settings in config.toml and runs Anaconda</span>
<span class="sd"> in no-virt mode (directly on the host operating system). Exceptions should be caught</span>
<span class="sd"> at the higer level.</span>
<span class="sd"> If there is a failure, the build artifacts will be cleaned up, and any logs will be</span>
<span class="sd"> moved into logs/anaconda/ and their ownership will be set to the user from the cfg</span>
<span class="sd"> object.</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="c1"># Check on the ks&#39;s presence</span>
<span class="n">ks_path</span> <span class="o">=</span> <span class="n">joinpaths</span><span class="p">(</span><span class="n">results_dir</span><span class="p">,</span> <span class="s2">&quot;final-kickstart.ks&quot;</span><span class="p">)</span>
<span class="k">if</span> <span class="ow">not</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">exists</span><span class="p">(</span><span class="n">ks_path</span><span class="p">):</span>
<span class="k">raise</span> <span class="ne">RuntimeError</span><span class="p">(</span><span class="s2">&quot;Missing kickstart file at </span><span class="si">%s</span><span class="s2">&quot;</span> <span class="o">%</span> <span class="n">ks_path</span><span class="p">)</span>
<span class="c1"># The anaconda logs are copied into ./anaconda/ in this directory</span>
<span class="n">log_dir</span> <span class="o">=</span> <span class="n">joinpaths</span><span class="p">(</span><span class="n">results_dir</span><span class="p">,</span> <span class="s2">&quot;logs/&quot;</span><span class="p">)</span>
<span class="k">if</span> <span class="ow">not</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">exists</span><span class="p">(</span><span class="n">log_dir</span><span class="p">):</span>
<span class="n">os</span><span class="o">.</span><span class="n">makedirs</span><span class="p">(</span><span class="n">log_dir</span><span class="p">)</span>
<span class="c1"># Load the compose configuration</span>
<span class="n">cfg_path</span> <span class="o">=</span> <span class="n">joinpaths</span><span class="p">(</span><span class="n">results_dir</span><span class="p">,</span> <span class="s2">&quot;config.toml&quot;</span><span class="p">)</span>
<span class="k">if</span> <span class="ow">not</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">exists</span><span class="p">(</span><span class="n">cfg_path</span><span class="p">):</span>
<span class="k">raise</span> <span class="ne">RuntimeError</span><span class="p">(</span><span class="s2">&quot;Missing config.toml for </span><span class="si">%s</span><span class="s2">&quot;</span> <span class="o">%</span> <span class="n">results_dir</span><span class="p">)</span>
<span class="n">cfg_dict</span> <span class="o">=</span> <span class="n">toml</span><span class="o">.</span><span class="n">loads</span><span class="p">(</span><span class="nb">open</span><span class="p">(</span><span class="n">cfg_path</span><span class="p">,</span> <span class="s2">&quot;r&quot;</span><span class="p">)</span><span class="o">.</span><span class="n">read</span><span class="p">())</span>
<span class="c1"># The keys in cfg_dict correspond to the arguments setup in livemedia-creator</span>
<span class="c1"># keys that define what to build should be setup in compose_args, and keys with</span>
<span class="c1"># defaults should be setup here.</span>
<span class="c1"># Make sure that image_name contains no path components</span>
<span class="n">cfg_dict</span><span class="p">[</span><span class="s2">&quot;image_name&quot;</span><span class="p">]</span> <span class="o">=</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">basename</span><span class="p">(</span><span class="n">cfg_dict</span><span class="p">[</span><span class="s2">&quot;image_name&quot;</span><span class="p">])</span>
<span class="c1"># Only support novirt installation, set some other defaults</span>
<span class="n">cfg_dict</span><span class="p">[</span><span class="s2">&quot;no_virt&quot;</span><span class="p">]</span> <span class="o">=</span> <span class="kc">True</span>
<span class="n">cfg_dict</span><span class="p">[</span><span class="s2">&quot;disk_image&quot;</span><span class="p">]</span> <span class="o">=</span> <span class="kc">None</span>
<span class="n">cfg_dict</span><span class="p">[</span><span class="s2">&quot;fs_image&quot;</span><span class="p">]</span> <span class="o">=</span> <span class="kc">None</span>
<span class="n">cfg_dict</span><span class="p">[</span><span class="s2">&quot;keep_image&quot;</span><span class="p">]</span> <span class="o">=</span> <span class="kc">False</span>
<span class="n">cfg_dict</span><span class="p">[</span><span class="s2">&quot;domacboot&quot;</span><span class="p">]</span> <span class="o">=</span> <span class="kc">False</span>
<span class="n">cfg_dict</span><span class="p">[</span><span class="s2">&quot;anaconda_args&quot;</span><span class="p">]</span> <span class="o">=</span> <span class="s2">&quot;&quot;</span>
<span class="n">cfg_dict</span><span class="p">[</span><span class="s2">&quot;proxy&quot;</span><span class="p">]</span> <span class="o">=</span> <span class="s2">&quot;&quot;</span>
<span class="n">cfg_dict</span><span class="p">[</span><span class="s2">&quot;armplatform&quot;</span><span class="p">]</span> <span class="o">=</span> <span class="s2">&quot;&quot;</span>
<span class="n">cfg_dict</span><span class="p">[</span><span class="s2">&quot;squashfs_args&quot;</span><span class="p">]</span> <span class="o">=</span> <span class="kc">None</span>
<span class="n">cfg_dict</span><span class="p">[</span><span class="s2">&quot;lorax_templates&quot;</span><span class="p">]</span> <span class="o">=</span> <span class="n">find_templates</span><span class="p">(</span><span class="n">cfg</span><span class="o">.</span><span class="n">share_dir</span><span class="p">)</span>
<span class="n">cfg_dict</span><span class="p">[</span><span class="s2">&quot;tmp&quot;</span><span class="p">]</span> <span class="o">=</span> <span class="n">cfg</span><span class="o">.</span><span class="n">tmp</span>
<span class="n">cfg_dict</span><span class="p">[</span><span class="s2">&quot;dracut_args&quot;</span><span class="p">]</span> <span class="o">=</span> <span class="kc">None</span> <span class="c1"># Use default args for dracut</span>
<span class="c1"># TODO How to support other arches?</span>
<span class="n">cfg_dict</span><span class="p">[</span><span class="s2">&quot;arch&quot;</span><span class="p">]</span> <span class="o">=</span> <span class="kc">None</span>
<span class="c1"># Compose things in a temporary directory inside the results directory</span>
<span class="n">cfg_dict</span><span class="p">[</span><span class="s2">&quot;result_dir&quot;</span><span class="p">]</span> <span class="o">=</span> <span class="n">joinpaths</span><span class="p">(</span><span class="n">results_dir</span><span class="p">,</span> <span class="s2">&quot;compose&quot;</span><span class="p">)</span>
<span class="n">os</span><span class="o">.</span><span class="n">makedirs</span><span class="p">(</span><span class="n">cfg_dict</span><span class="p">[</span><span class="s2">&quot;result_dir&quot;</span><span class="p">])</span>
<span class="n">install_cfg</span> <span class="o">=</span> <span class="n">DataHolder</span><span class="p">(</span><span class="o">**</span><span class="n">cfg_dict</span><span class="p">)</span>
<span class="c1"># Some kludges for the 99-copy-logs %post, failure in it will crash the build</span>
<span class="k">for</span> <span class="n">f</span> <span class="ow">in</span> <span class="p">[</span><span class="s2">&quot;/tmp/NOSAVE_INPUT_KS&quot;</span><span class="p">,</span> <span class="s2">&quot;/tmp/NOSAVE_LOGS&quot;</span><span class="p">]:</span>
<span class="nb">open</span><span class="p">(</span><span class="n">f</span><span class="p">,</span> <span class="s2">&quot;w&quot;</span><span class="p">)</span>
<span class="c1"># Placing a CANCEL file in the results directory will make execWithRedirect send anaconda a SIGTERM</span>
<span class="k">def</span> <span class="nf">cancel_build</span><span class="p">():</span>
<span class="k">return</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">exists</span><span class="p">(</span><span class="n">joinpaths</span><span class="p">(</span><span class="n">results_dir</span><span class="p">,</span> <span class="s2">&quot;CANCEL&quot;</span><span class="p">))</span>
<span class="n">log</span><span class="o">.</span><span class="n">debug</span><span class="p">(</span><span class="s2">&quot;cfg = </span><span class="si">%s</span><span class="s2">&quot;</span><span class="p">,</span> <span class="n">install_cfg</span><span class="p">)</span>
<span class="k">try</span><span class="p">:</span>
<span class="n">test_path</span> <span class="o">=</span> <span class="n">joinpaths</span><span class="p">(</span><span class="n">results_dir</span><span class="p">,</span> <span class="s2">&quot;TEST&quot;</span><span class="p">)</span>
<span class="k">if</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">exists</span><span class="p">(</span><span class="n">test_path</span><span class="p">):</span>
<span class="c1"># Pretend to run the compose</span>
<span class="n">time</span><span class="o">.</span><span class="n">sleep</span><span class="p">(</span><span class="mi">10</span><span class="p">)</span>
<span class="k">try</span><span class="p">:</span>
<span class="n">test_mode</span> <span class="o">=</span> <span class="nb">int</span><span class="p">(</span><span class="nb">open</span><span class="p">(</span><span class="n">test_path</span><span class="p">,</span> <span class="s2">&quot;r&quot;</span><span class="p">)</span><span class="o">.</span><span class="n">read</span><span class="p">())</span>
<span class="k">except</span> <span class="ne">Exception</span><span class="p">:</span>
<span class="n">test_mode</span> <span class="o">=</span> <span class="mi">1</span>
<span class="k">if</span> <span class="n">test_mode</span> <span class="o">==</span> <span class="mi">1</span><span class="p">:</span>
<span class="k">raise</span> <span class="ne">RuntimeError</span><span class="p">(</span><span class="s2">&quot;TESTING FAILED compose&quot;</span><span class="p">)</span>
<span class="k">else</span><span class="p">:</span>
<span class="nb">open</span><span class="p">(</span><span class="n">joinpaths</span><span class="p">(</span><span class="n">results_dir</span><span class="p">,</span> <span class="n">install_cfg</span><span class="o">.</span><span class="n">image_name</span><span class="p">),</span> <span class="s2">&quot;w&quot;</span><span class="p">)</span><span class="o">.</span><span class="n">write</span><span class="p">(</span><span class="s2">&quot;TEST IMAGE&quot;</span><span class="p">)</span>
<span class="k">else</span><span class="p">:</span>
<span class="n">run_creator</span><span class="p">(</span><span class="n">install_cfg</span><span class="p">,</span> <span class="n">callback_func</span><span class="o">=</span><span class="n">cancel_build</span><span class="p">)</span>
<span class="c1"># Extract the results of the compose into results_dir and cleanup the compose directory</span>
<span class="n">move_compose_results</span><span class="p">(</span><span class="n">install_cfg</span><span class="p">,</span> <span class="n">results_dir</span><span class="p">)</span>
<span class="k">finally</span><span class="p">:</span>
<span class="c1"># Make sure any remaining temporary directories are removed (eg. if there was an exception)</span>
<span class="k">for</span> <span class="n">d</span> <span class="ow">in</span> <span class="n">glob</span><span class="p">(</span><span class="n">joinpaths</span><span class="p">(</span><span class="n">cfg</span><span class="o">.</span><span class="n">tmp</span><span class="p">,</span> <span class="s2">&quot;lmc-*&quot;</span><span class="p">)):</span>
<span class="k">if</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">isdir</span><span class="p">(</span><span class="n">d</span><span class="p">):</span>
<span class="n">shutil</span><span class="o">.</span><span class="n">rmtree</span><span class="p">(</span><span class="n">d</span><span class="p">)</span>
<span class="k">elif</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">isfile</span><span class="p">(</span><span class="n">d</span><span class="p">):</span>
<span class="n">os</span><span class="o">.</span><span class="n">unlink</span><span class="p">(</span><span class="n">d</span><span class="p">)</span>
<span class="c1"># Make sure that everything under the results directory is owned by the user</span>
<span class="n">user</span> <span class="o">=</span> <span class="n">pwd</span><span class="o">.</span><span class="n">getpwuid</span><span class="p">(</span><span class="n">cfg</span><span class="o">.</span><span class="n">uid</span><span class="p">)</span><span class="o">.</span><span class="n">pw_name</span>
<span class="n">group</span> <span class="o">=</span> <span class="n">grp</span><span class="o">.</span><span class="n">getgrgid</span><span class="p">(</span><span class="n">cfg</span><span class="o">.</span><span class="n">gid</span><span class="p">)</span><span class="o">.</span><span class="n">gr_name</span>
<span class="n">log</span><span class="o">.</span><span class="n">debug</span><span class="p">(</span><span class="s2">&quot;Install finished, chowning results to </span><span class="si">%s</span><span class="s2">:</span><span class="si">%s</span><span class="s2">&quot;</span><span class="p">,</span> <span class="n">user</span><span class="p">,</span> <span class="n">group</span><span class="p">)</span>
<span class="n">subprocess</span><span class="o">.</span><span class="n">call</span><span class="p">([</span><span class="s2">&quot;chown&quot;</span><span class="p">,</span> <span class="s2">&quot;-R&quot;</span><span class="p">,</span> <span class="s2">&quot;</span><span class="si">%s</span><span class="s2">:</span><span class="si">%s</span><span class="s2">&quot;</span> <span class="o">%</span> <span class="p">(</span><span class="n">user</span><span class="p">,</span> <span class="n">group</span><span class="p">),</span> <span class="n">results_dir</span><span class="p">])</span></div>
<div class="viewcode-block" id="get_compose_type"><a class="viewcode-back" href="../../../pylorax.api.html#pylorax.api.queue.get_compose_type">[docs]</a><span class="k">def</span> <span class="nf">get_compose_type</span><span class="p">(</span><span class="n">results_dir</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;Return the type of composition.</span>
<span class="sd"> :param results_dir: The directory containing the metadata and results for the build</span>
<span class="sd"> :type results_dir: str</span>
<span class="sd"> :returns: The type of compose (eg. &#39;tar&#39;)</span>
<span class="sd"> :rtype: str</span>
<span class="sd"> :raises: RuntimeError if no kickstart template can be found.</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="c1"># Should only be 2 kickstarts, the final-kickstart.ks and the template</span>
<span class="n">t</span> <span class="o">=</span> <span class="p">[</span><span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">basename</span><span class="p">(</span><span class="n">ks</span><span class="p">)[:</span><span class="o">-</span><span class="mi">3</span><span class="p">]</span> <span class="k">for</span> <span class="n">ks</span> <span class="ow">in</span> <span class="n">glob</span><span class="p">(</span><span class="n">joinpaths</span><span class="p">(</span><span class="n">results_dir</span><span class="p">,</span> <span class="s2">&quot;*.ks&quot;</span><span class="p">))</span>
<span class="k">if</span> <span class="s2">&quot;final-kickstart&quot;</span> <span class="ow">not</span> <span class="ow">in</span> <span class="n">ks</span><span class="p">]</span>
<span class="k">if</span> <span class="nb">len</span><span class="p">(</span><span class="n">t</span><span class="p">)</span> <span class="o">!=</span> <span class="mi">1</span><span class="p">:</span>
<span class="k">raise</span> <span class="ne">RuntimeError</span><span class="p">(</span><span class="s2">&quot;Cannot find ks template for build </span><span class="si">%s</span><span class="s2">&quot;</span> <span class="o">%</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">basename</span><span class="p">(</span><span class="n">results_dir</span><span class="p">))</span>
<span class="k">return</span> <span class="n">t</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span></div>
<div class="viewcode-block" id="compose_detail"><a class="viewcode-back" href="../../../pylorax.api.html#pylorax.api.queue.compose_detail">[docs]</a><span class="k">def</span> <span class="nf">compose_detail</span><span class="p">(</span><span class="n">results_dir</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;Return details about the build.</span>
<span class="sd"> :param results_dir: The directory containing the metadata and results for the build</span>
<span class="sd"> :type results_dir: str</span>
<span class="sd"> :returns: A dictionary with details about the compose</span>
<span class="sd"> :rtype: dict</span>
<span class="sd"> :raises: IOError if it cannot read the directory, STATUS, or blueprint file.</span>
<span class="sd"> The following details are included in the dict:</span>
<span class="sd"> * id - The uuid of the comoposition</span>
<span class="sd"> * queue_status - The final status of the composition (FINISHED or FAILED)</span>
<span class="sd"> * timestamp - The time of the last status change</span>
<span class="sd"> * compose_type - The type of output generated (tar, iso, etc.)</span>
<span class="sd"> * blueprint - Blueprint name</span>
<span class="sd"> * version - Blueprint version</span>
<span class="sd"> * image_size - Size of the image, if finished. 0 otherwise.</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="n">build_id</span> <span class="o">=</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">basename</span><span class="p">(</span><span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">abspath</span><span class="p">(</span><span class="n">results_dir</span><span class="p">))</span>
<span class="n">status</span> <span class="o">=</span> <span class="nb">open</span><span class="p">(</span><span class="n">joinpaths</span><span class="p">(</span><span class="n">results_dir</span><span class="p">,</span> <span class="s2">&quot;STATUS&quot;</span><span class="p">))</span><span class="o">.</span><span class="n">read</span><span class="p">()</span><span class="o">.</span><span class="n">strip</span><span class="p">()</span>
<span class="n">mtime</span> <span class="o">=</span> <span class="n">os</span><span class="o">.</span><span class="n">stat</span><span class="p">(</span><span class="n">joinpaths</span><span class="p">(</span><span class="n">results_dir</span><span class="p">,</span> <span class="s2">&quot;STATUS&quot;</span><span class="p">))</span><span class="o">.</span><span class="n">st_mtime</span>
<span class="n">blueprint</span> <span class="o">=</span> <span class="n">recipe_from_file</span><span class="p">(</span><span class="n">joinpaths</span><span class="p">(</span><span class="n">results_dir</span><span class="p">,</span> <span class="s2">&quot;blueprint.toml&quot;</span><span class="p">))</span>
<span class="n">compose_type</span> <span class="o">=</span> <span class="n">get_compose_type</span><span class="p">(</span><span class="n">results_dir</span><span class="p">)</span>
<span class="n">image_path</span> <span class="o">=</span> <span class="n">get_image_name</span><span class="p">(</span><span class="n">results_dir</span><span class="p">)[</span><span class="mi">1</span><span class="p">]</span>
<span class="k">if</span> <span class="n">status</span> <span class="o">==</span> <span class="s2">&quot;FINISHED&quot;</span> <span class="ow">and</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">exists</span><span class="p">(</span><span class="n">image_path</span><span class="p">):</span>
<span class="n">image_size</span> <span class="o">=</span> <span class="n">os</span><span class="o">.</span><span class="n">stat</span><span class="p">(</span><span class="n">image_path</span><span class="p">)</span><span class="o">.</span><span class="n">st_size</span>
<span class="k">else</span><span class="p">:</span>
<span class="n">image_size</span> <span class="o">=</span> <span class="mi">0</span>
<span class="k">return</span> <span class="p">{</span><span class="s2">&quot;id&quot;</span><span class="p">:</span> <span class="n">build_id</span><span class="p">,</span>
<span class="s2">&quot;queue_status&quot;</span><span class="p">:</span> <span class="n">status</span><span class="p">,</span>
<span class="s2">&quot;timestamp&quot;</span><span class="p">:</span> <span class="n">mtime</span><span class="p">,</span>
<span class="s2">&quot;compose_type&quot;</span><span class="p">:</span> <span class="n">compose_type</span><span class="p">,</span>
<span class="s2">&quot;blueprint&quot;</span><span class="p">:</span> <span class="n">blueprint</span><span class="p">[</span><span class="s2">&quot;name&quot;</span><span class="p">],</span>
<span class="s2">&quot;version&quot;</span><span class="p">:</span> <span class="n">blueprint</span><span class="p">[</span><span class="s2">&quot;version&quot;</span><span class="p">],</span>
<span class="s2">&quot;image_size&quot;</span><span class="p">:</span> <span class="n">image_size</span>
<span class="p">}</span></div>
<div class="viewcode-block" id="queue_status"><a class="viewcode-back" href="../../../pylorax.api.html#pylorax.api.queue.queue_status">[docs]</a><span class="k">def</span> <span class="nf">queue_status</span><span class="p">(</span><span class="n">cfg</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;Return details about what is in the queue.</span>
<span class="sd"> :param cfg: Configuration settings</span>
<span class="sd"> :type cfg: ComposerConfig</span>
<span class="sd"> :returns: A list of the new composes, and a list of the running composes</span>
<span class="sd"> :rtype: dict</span>
<span class="sd"> This returns a dict with 2 lists. &quot;new&quot; is the list of uuids that are waiting to be built,</span>
<span class="sd"> and &quot;run&quot; has the uuids that are being built (currently limited to 1 at a time).</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="n">queue_dir</span> <span class="o">=</span> <span class="n">joinpaths</span><span class="p">(</span><span class="n">cfg</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">&quot;composer&quot;</span><span class="p">,</span> <span class="s2">&quot;lib_dir&quot;</span><span class="p">),</span> <span class="s2">&quot;queue&quot;</span><span class="p">)</span>
<span class="n">new_queue</span> <span class="o">=</span> <span class="p">[</span><span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">realpath</span><span class="p">(</span><span class="n">p</span><span class="p">)</span> <span class="k">for</span> <span class="n">p</span> <span class="ow">in</span> <span class="n">glob</span><span class="p">(</span><span class="n">joinpaths</span><span class="p">(</span><span class="n">queue_dir</span><span class="p">,</span> <span class="s2">&quot;new/*&quot;</span><span class="p">))]</span>
<span class="n">run_queue</span> <span class="o">=</span> <span class="p">[</span><span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">realpath</span><span class="p">(</span><span class="n">p</span><span class="p">)</span> <span class="k">for</span> <span class="n">p</span> <span class="ow">in</span> <span class="n">glob</span><span class="p">(</span><span class="n">joinpaths</span><span class="p">(</span><span class="n">queue_dir</span><span class="p">,</span> <span class="s2">&quot;run/*&quot;</span><span class="p">))]</span>
<span class="n">new_details</span> <span class="o">=</span> <span class="p">[]</span>
<span class="k">for</span> <span class="n">n</span> <span class="ow">in</span> <span class="n">new_queue</span><span class="p">:</span>
<span class="k">try</span><span class="p">:</span>
<span class="n">d</span> <span class="o">=</span> <span class="n">compose_detail</span><span class="p">(</span><span class="n">n</span><span class="p">)</span>
<span class="k">except</span> <span class="ne">IOError</span><span class="p">:</span>
<span class="k">continue</span>
<span class="n">new_details</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">d</span><span class="p">)</span>
<span class="n">run_details</span> <span class="o">=</span> <span class="p">[]</span>
<span class="k">for</span> <span class="n">r</span> <span class="ow">in</span> <span class="n">run_queue</span><span class="p">:</span>
<span class="k">try</span><span class="p">:</span>
<span class="n">d</span> <span class="o">=</span> <span class="n">compose_detail</span><span class="p">(</span><span class="n">r</span><span class="p">)</span>
<span class="k">except</span> <span class="ne">IOError</span><span class="p">:</span>
<span class="k">continue</span>
<span class="n">run_details</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">d</span><span class="p">)</span>
<span class="k">return</span> <span class="p">{</span>
<span class="s2">&quot;new&quot;</span><span class="p">:</span> <span class="n">new_details</span><span class="p">,</span>
<span class="s2">&quot;run&quot;</span><span class="p">:</span> <span class="n">run_details</span>
<span class="p">}</span></div>
<div class="viewcode-block" id="uuid_status"><a class="viewcode-back" href="../../../pylorax.api.html#pylorax.api.queue.uuid_status">[docs]</a><span class="k">def</span> <span class="nf">uuid_status</span><span class="p">(</span><span class="n">cfg</span><span class="p">,</span> <span class="n">uuid</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;Return the details of a specific UUID compose</span>
<span class="sd"> :param cfg: Configuration settings</span>
<span class="sd"> :type cfg: ComposerConfig</span>
<span class="sd"> :param uuid: The UUID of the build</span>
<span class="sd"> :type uuid: str</span>
<span class="sd"> :returns: Details about the build</span>
<span class="sd"> :rtype: dict or None</span>
<span class="sd"> Returns the same dict as `compose_details()`</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="n">uuid_dir</span> <span class="o">=</span> <span class="n">joinpaths</span><span class="p">(</span><span class="n">cfg</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">&quot;composer&quot;</span><span class="p">,</span> <span class="s2">&quot;lib_dir&quot;</span><span class="p">),</span> <span class="s2">&quot;results&quot;</span><span class="p">,</span> <span class="n">uuid</span><span class="p">)</span>
<span class="k">try</span><span class="p">:</span>
<span class="k">return</span> <span class="n">compose_detail</span><span class="p">(</span><span class="n">uuid_dir</span><span class="p">)</span>
<span class="k">except</span> <span class="ne">IOError</span><span class="p">:</span>
<span class="k">return</span> <span class="kc">None</span></div>
<div class="viewcode-block" id="build_status"><a class="viewcode-back" href="../../../pylorax.api.html#pylorax.api.queue.build_status">[docs]</a><span class="k">def</span> <span class="nf">build_status</span><span class="p">(</span><span class="n">cfg</span><span class="p">,</span> <span class="n">status_filter</span><span class="o">=</span><span class="kc">None</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;Return the details of finished or failed builds</span>
<span class="sd"> :param cfg: Configuration settings</span>
<span class="sd"> :type cfg: ComposerConfig</span>
<span class="sd"> :param status_filter: What builds to return. None == all, &quot;FINISHED&quot;, or &quot;FAILED&quot;</span>
<span class="sd"> :type status_filter: str</span>
<span class="sd"> :returns: A list of the build details (from compose_details)</span>
<span class="sd"> :rtype: list of dicts</span>
<span class="sd"> This returns a list of build details for each of the matching builds on the</span>
<span class="sd"> system. It does not return the status of builds that have not been finished.</span>
<span class="sd"> Use queue_status() for those.</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="k">if</span> <span class="n">status_filter</span><span class="p">:</span>
<span class="n">status_filter</span> <span class="o">=</span> <span class="p">[</span><span class="n">status_filter</span><span class="p">]</span>
<span class="k">else</span><span class="p">:</span>
<span class="n">status_filter</span> <span class="o">=</span> <span class="p">[</span><span class="s2">&quot;FINISHED&quot;</span><span class="p">,</span> <span class="s2">&quot;FAILED&quot;</span><span class="p">]</span>
<span class="n">results</span> <span class="o">=</span> <span class="p">[]</span>
<span class="n">result_dir</span> <span class="o">=</span> <span class="n">joinpaths</span><span class="p">(</span><span class="n">cfg</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">&quot;composer&quot;</span><span class="p">,</span> <span class="s2">&quot;lib_dir&quot;</span><span class="p">),</span> <span class="s2">&quot;results&quot;</span><span class="p">)</span>
<span class="k">for</span> <span class="n">build</span> <span class="ow">in</span> <span class="n">glob</span><span class="p">(</span><span class="n">result_dir</span> <span class="o">+</span> <span class="s2">&quot;/*&quot;</span><span class="p">):</span>
<span class="n">log</span><span class="o">.</span><span class="n">debug</span><span class="p">(</span><span class="s2">&quot;Checking status of build </span><span class="si">%s</span><span class="s2">&quot;</span><span class="p">,</span> <span class="n">build</span><span class="p">)</span>
<span class="k">try</span><span class="p">:</span>
<span class="n">status</span> <span class="o">=</span> <span class="nb">open</span><span class="p">(</span><span class="n">joinpaths</span><span class="p">(</span><span class="n">build</span><span class="p">,</span> <span class="s2">&quot;STATUS&quot;</span><span class="p">),</span> <span class="s2">&quot;r&quot;</span><span class="p">)</span><span class="o">.</span><span class="n">read</span><span class="p">()</span><span class="o">.</span><span class="n">strip</span><span class="p">()</span>
<span class="k">if</span> <span class="n">status</span> <span class="ow">in</span> <span class="n">status_filter</span><span class="p">:</span>
<span class="n">results</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">compose_detail</span><span class="p">(</span><span class="n">build</span><span class="p">))</span>
<span class="k">except</span> <span class="ne">IOError</span><span class="p">:</span>
<span class="k">pass</span>
<span class="k">return</span> <span class="n">results</span></div>
<div class="viewcode-block" id="uuid_cancel"><a class="viewcode-back" href="../../../pylorax.api.html#pylorax.api.queue.uuid_cancel">[docs]</a><span class="k">def</span> <span class="nf">uuid_cancel</span><span class="p">(</span><span class="n">cfg</span><span class="p">,</span> <span class="n">uuid</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;Cancel a build and delete its results</span>
<span class="sd"> :param cfg: Configuration settings</span>
<span class="sd"> :type cfg: ComposerConfig</span>
<span class="sd"> :param uuid: The UUID of the build</span>
<span class="sd"> :type uuid: str</span>
<span class="sd"> :returns: True if it was canceled and deleted</span>
<span class="sd"> :rtype: bool</span>
<span class="sd"> Only call this if the build status is WAITING or RUNNING</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="c1"># This status can change (and probably will) while it is in the middle of doing this:</span>
<span class="c1"># It can move from WAITING -&gt; RUNNING or it can move from RUNNING -&gt; FINISHED|FAILED</span>
<span class="c1"># If it is in WAITING remove the symlink and then check to make sure it didn&#39;t show up</span>
<span class="c1"># in RUNNING</span>
<span class="n">queue_dir</span> <span class="o">=</span> <span class="n">joinpaths</span><span class="p">(</span><span class="n">cfg</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">&quot;composer&quot;</span><span class="p">,</span> <span class="s2">&quot;lib_dir&quot;</span><span class="p">),</span> <span class="s2">&quot;queue&quot;</span><span class="p">)</span>
<span class="n">uuid_new</span> <span class="o">=</span> <span class="n">joinpaths</span><span class="p">(</span><span class="n">queue_dir</span><span class="p">,</span> <span class="s2">&quot;new&quot;</span><span class="p">,</span> <span class="n">uuid</span><span class="p">)</span>
<span class="k">if</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">exists</span><span class="p">(</span><span class="n">uuid_new</span><span class="p">):</span>
<span class="k">try</span><span class="p">:</span>
<span class="n">os</span><span class="o">.</span><span class="n">unlink</span><span class="p">(</span><span class="n">uuid_new</span><span class="p">)</span>
<span class="k">except</span> <span class="ne">OSError</span><span class="p">:</span>
<span class="c1"># The symlink may vanish if the queue monitor started the build</span>
<span class="k">pass</span>
<span class="n">uuid_run</span> <span class="o">=</span> <span class="n">joinpaths</span><span class="p">(</span><span class="n">queue_dir</span><span class="p">,</span> <span class="s2">&quot;run&quot;</span><span class="p">,</span> <span class="n">uuid</span><span class="p">)</span>
<span class="k">if</span> <span class="ow">not</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">exists</span><span class="p">(</span><span class="n">uuid_run</span><span class="p">):</span>
<span class="c1"># Successfully removed it before the build started</span>
<span class="k">return</span> <span class="n">uuid_delete</span><span class="p">(</span><span class="n">cfg</span><span class="p">,</span> <span class="n">uuid</span><span class="p">)</span>
<span class="c1"># Tell the build to stop running</span>
<span class="n">cancel_path</span> <span class="o">=</span> <span class="n">joinpaths</span><span class="p">(</span><span class="n">cfg</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">&quot;composer&quot;</span><span class="p">,</span> <span class="s2">&quot;lib_dir&quot;</span><span class="p">),</span> <span class="s2">&quot;results&quot;</span><span class="p">,</span> <span class="n">uuid</span><span class="p">,</span> <span class="s2">&quot;CANCEL&quot;</span><span class="p">)</span>
<span class="nb">open</span><span class="p">(</span><span class="n">cancel_path</span><span class="p">,</span> <span class="s2">&quot;w&quot;</span><span class="p">)</span><span class="o">.</span><span class="n">write</span><span class="p">(</span><span class="s2">&quot;</span><span class="se">\n</span><span class="s2">&quot;</span><span class="p">)</span>
<span class="c1"># Wait for status to move to FAILED</span>
<span class="n">started</span> <span class="o">=</span> <span class="n">time</span><span class="o">.</span><span class="n">time</span><span class="p">()</span>
<span class="k">while</span> <span class="kc">True</span><span class="p">:</span>
<span class="n">status</span> <span class="o">=</span> <span class="n">uuid_status</span><span class="p">(</span><span class="n">cfg</span><span class="p">,</span> <span class="n">uuid</span><span class="p">)</span>
<span class="k">if</span> <span class="n">status</span> <span class="ow">is</span> <span class="kc">None</span> <span class="ow">or</span> <span class="n">status</span><span class="p">[</span><span class="s2">&quot;queue_status&quot;</span><span class="p">]</span> <span class="o">==</span> <span class="s2">&quot;FAILED&quot;</span><span class="p">:</span>
<span class="k">break</span>
<span class="c1"># Is this taking too long? Exit anyway and try to cleanup.</span>
<span class="k">if</span> <span class="n">time</span><span class="o">.</span><span class="n">time</span><span class="p">()</span> <span class="o">&gt;</span> <span class="n">started</span> <span class="o">+</span> <span class="p">(</span><span class="mi">10</span> <span class="o">*</span> <span class="mi">60</span><span class="p">):</span>
<span class="n">log</span><span class="o">.</span><span class="n">error</span><span class="p">(</span><span class="s2">&quot;Failed to cancel the build of </span><span class="si">%s</span><span class="s2">&quot;</span><span class="p">,</span> <span class="n">uuid</span><span class="p">)</span>
<span class="k">break</span>
<span class="n">time</span><span class="o">.</span><span class="n">sleep</span><span class="p">(</span><span class="mi">5</span><span class="p">)</span>
<span class="c1"># Remove the partial results</span>
<span class="n">uuid_delete</span><span class="p">(</span><span class="n">cfg</span><span class="p">,</span> <span class="n">uuid</span><span class="p">)</span></div>
<div class="viewcode-block" id="uuid_delete"><a class="viewcode-back" href="../../../pylorax.api.html#pylorax.api.queue.uuid_delete">[docs]</a><span class="k">def</span> <span class="nf">uuid_delete</span><span class="p">(</span><span class="n">cfg</span><span class="p">,</span> <span class="n">uuid</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;Delete all of the results from a compose</span>
<span class="sd"> :param cfg: Configuration settings</span>
<span class="sd"> :type cfg: ComposerConfig</span>
<span class="sd"> :param uuid: The UUID of the build</span>
<span class="sd"> :type uuid: str</span>
<span class="sd"> :returns: True if it was deleted</span>
<span class="sd"> :rtype: bool</span>
<span class="sd"> :raises: This will raise an error if the delete failed</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="n">uuid_dir</span> <span class="o">=</span> <span class="n">joinpaths</span><span class="p">(</span><span class="n">cfg</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">&quot;composer&quot;</span><span class="p">,</span> <span class="s2">&quot;lib_dir&quot;</span><span class="p">),</span> <span class="s2">&quot;results&quot;</span><span class="p">,</span> <span class="n">uuid</span><span class="p">)</span>
<span class="k">if</span> <span class="ow">not</span> <span class="n">uuid_dir</span> <span class="ow">or</span> <span class="nb">len</span><span class="p">(</span><span class="n">uuid_dir</span><span class="p">)</span> <span class="o">&lt;</span> <span class="mi">10</span><span class="p">:</span>
<span class="k">raise</span> <span class="ne">RuntimeError</span><span class="p">(</span><span class="s2">&quot;Directory length is too short: </span><span class="si">%s</span><span class="s2">&quot;</span> <span class="o">%</span> <span class="n">uuid_dir</span><span class="p">)</span>
<span class="n">shutil</span><span class="o">.</span><span class="n">rmtree</span><span class="p">(</span><span class="n">uuid_dir</span><span class="p">)</span>
<span class="k">return</span> <span class="kc">True</span></div>
<div class="viewcode-block" id="uuid_info"><a class="viewcode-back" href="../../../pylorax.api.html#pylorax.api.queue.uuid_info">[docs]</a><span class="k">def</span> <span class="nf">uuid_info</span><span class="p">(</span><span class="n">cfg</span><span class="p">,</span> <span class="n">uuid</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;Return information about the composition</span>
<span class="sd"> :param cfg: Configuration settings</span>
<span class="sd"> :type cfg: ComposerConfig</span>
<span class="sd"> :param uuid: The UUID of the build</span>
<span class="sd"> :type uuid: str</span>
<span class="sd"> :returns: dictionary of information about the composition</span>
<span class="sd"> :rtype: dict</span>
<span class="sd"> :raises: RuntimeError if there was a problem</span>
<span class="sd"> This will return a dict with the following fields populated:</span>
<span class="sd"> * id - The uuid of the comoposition</span>
<span class="sd"> * config - containing the configuration settings used to run Anaconda</span>
<span class="sd"> * blueprint - The depsolved blueprint used to generate the kickstart</span>
<span class="sd"> * commit - The (local) git commit hash for the blueprint used</span>
<span class="sd"> * deps - The NEVRA of all of the dependencies used in the composition</span>
<span class="sd"> * compose_type - The type of output generated (tar, iso, etc.)</span>
<span class="sd"> * queue_status - The final status of the composition (FINISHED or FAILED)</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="n">uuid_dir</span> <span class="o">=</span> <span class="n">joinpaths</span><span class="p">(</span><span class="n">cfg</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">&quot;composer&quot;</span><span class="p">,</span> <span class="s2">&quot;lib_dir&quot;</span><span class="p">),</span> <span class="s2">&quot;results&quot;</span><span class="p">,</span> <span class="n">uuid</span><span class="p">)</span>
<span class="k">if</span> <span class="ow">not</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">exists</span><span class="p">(</span><span class="n">uuid_dir</span><span class="p">):</span>
<span class="k">raise</span> <span class="ne">RuntimeError</span><span class="p">(</span><span class="s2">&quot;</span><span class="si">%s</span><span class="s2"> is not a valid build_id&quot;</span> <span class="o">%</span> <span class="n">uuid</span><span class="p">)</span>
<span class="c1"># Load the compose configuration</span>
<span class="n">cfg_path</span> <span class="o">=</span> <span class="n">joinpaths</span><span class="p">(</span><span class="n">uuid_dir</span><span class="p">,</span> <span class="s2">&quot;config.toml&quot;</span><span class="p">)</span>
<span class="k">if</span> <span class="ow">not</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">exists</span><span class="p">(</span><span class="n">cfg_path</span><span class="p">):</span>
<span class="k">raise</span> <span class="ne">RuntimeError</span><span class="p">(</span><span class="s2">&quot;Missing config.toml for </span><span class="si">%s</span><span class="s2">&quot;</span> <span class="o">%</span> <span class="n">uuid</span><span class="p">)</span>
<span class="n">cfg_dict</span> <span class="o">=</span> <span class="n">toml</span><span class="o">.</span><span class="n">loads</span><span class="p">(</span><span class="nb">open</span><span class="p">(</span><span class="n">cfg_path</span><span class="p">,</span> <span class="s2">&quot;r&quot;</span><span class="p">)</span><span class="o">.</span><span class="n">read</span><span class="p">())</span>
<span class="n">frozen_path</span> <span class="o">=</span> <span class="n">joinpaths</span><span class="p">(</span><span class="n">uuid_dir</span><span class="p">,</span> <span class="s2">&quot;frozen.toml&quot;</span><span class="p">)</span>
<span class="k">if</span> <span class="ow">not</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">exists</span><span class="p">(</span><span class="n">frozen_path</span><span class="p">):</span>
<span class="k">raise</span> <span class="ne">RuntimeError</span><span class="p">(</span><span class="s2">&quot;Missing frozen.toml for </span><span class="si">%s</span><span class="s2">&quot;</span> <span class="o">%</span> <span class="n">uuid</span><span class="p">)</span>
<span class="n">frozen_dict</span> <span class="o">=</span> <span class="n">toml</span><span class="o">.</span><span class="n">loads</span><span class="p">(</span><span class="nb">open</span><span class="p">(</span><span class="n">frozen_path</span><span class="p">,</span> <span class="s2">&quot;r&quot;</span><span class="p">)</span><span class="o">.</span><span class="n">read</span><span class="p">())</span>
<span class="n">deps_path</span> <span class="o">=</span> <span class="n">joinpaths</span><span class="p">(</span><span class="n">uuid_dir</span><span class="p">,</span> <span class="s2">&quot;deps.toml&quot;</span><span class="p">)</span>
<span class="k">if</span> <span class="ow">not</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">exists</span><span class="p">(</span><span class="n">deps_path</span><span class="p">):</span>
<span class="k">raise</span> <span class="ne">RuntimeError</span><span class="p">(</span><span class="s2">&quot;Missing deps.toml for </span><span class="si">%s</span><span class="s2">&quot;</span> <span class="o">%</span> <span class="n">uuid</span><span class="p">)</span>
<span class="n">deps_dict</span> <span class="o">=</span> <span class="n">toml</span><span class="o">.</span><span class="n">loads</span><span class="p">(</span><span class="nb">open</span><span class="p">(</span><span class="n">deps_path</span><span class="p">,</span> <span class="s2">&quot;r&quot;</span><span class="p">)</span><span class="o">.</span><span class="n">read</span><span class="p">())</span>
<span class="n">details</span> <span class="o">=</span> <span class="n">compose_detail</span><span class="p">(</span><span class="n">uuid_dir</span><span class="p">)</span>
<span class="n">commit_path</span> <span class="o">=</span> <span class="n">joinpaths</span><span class="p">(</span><span class="n">uuid_dir</span><span class="p">,</span> <span class="s2">&quot;COMMIT&quot;</span><span class="p">)</span>
<span class="k">if</span> <span class="ow">not</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">exists</span><span class="p">(</span><span class="n">commit_path</span><span class="p">):</span>
<span class="k">raise</span> <span class="ne">RuntimeError</span><span class="p">(</span><span class="s2">&quot;Missing commit hash for </span><span class="si">%s</span><span class="s2">&quot;</span> <span class="o">%</span> <span class="n">uuid</span><span class="p">)</span>
<span class="n">commit_id</span> <span class="o">=</span> <span class="nb">open</span><span class="p">(</span><span class="n">commit_path</span><span class="p">,</span> <span class="s2">&quot;r&quot;</span><span class="p">)</span><span class="o">.</span><span class="n">read</span><span class="p">()</span><span class="o">.</span><span class="n">strip</span><span class="p">()</span>
<span class="k">return</span> <span class="p">{</span><span class="s2">&quot;id&quot;</span><span class="p">:</span> <span class="n">uuid</span><span class="p">,</span>
<span class="s2">&quot;config&quot;</span><span class="p">:</span> <span class="n">cfg_dict</span><span class="p">,</span>
<span class="s2">&quot;blueprint&quot;</span><span class="p">:</span> <span class="n">frozen_dict</span><span class="p">,</span>
<span class="s2">&quot;commit&quot;</span><span class="p">:</span> <span class="n">commit_id</span><span class="p">,</span>
<span class="s2">&quot;deps&quot;</span><span class="p">:</span> <span class="n">deps_dict</span><span class="p">,</span>
<span class="s2">&quot;compose_type&quot;</span><span class="p">:</span> <span class="n">details</span><span class="p">[</span><span class="s2">&quot;compose_type&quot;</span><span class="p">],</span>
<span class="s2">&quot;queue_status&quot;</span><span class="p">:</span> <span class="n">details</span><span class="p">[</span><span class="s2">&quot;queue_status&quot;</span><span class="p">],</span>
<span class="s2">&quot;image_size&quot;</span><span class="p">:</span> <span class="n">details</span><span class="p">[</span><span class="s2">&quot;image_size&quot;</span><span class="p">]</span>
<span class="p">}</span></div>
<div class="viewcode-block" id="uuid_tar"><a class="viewcode-back" href="../../../pylorax.api.html#pylorax.api.queue.uuid_tar">[docs]</a><span class="k">def</span> <span class="nf">uuid_tar</span><span class="p">(</span><span class="n">cfg</span><span class="p">,</span> <span class="n">uuid</span><span class="p">,</span> <span class="n">metadata</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="n">image</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="n">logs</span><span class="o">=</span><span class="kc">False</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;Return a tar of the build data</span>
<span class="sd"> :param cfg: Configuration settings</span>
<span class="sd"> :type cfg: ComposerConfig</span>
<span class="sd"> :param uuid: The UUID of the build</span>
<span class="sd"> :type uuid: str</span>
<span class="sd"> :param metadata: Set to true to include all the metadata needed to reproduce the build</span>
<span class="sd"> :type metadata: bool</span>
<span class="sd"> :param image: Set to true to include the output image</span>
<span class="sd"> :type image: bool</span>
<span class="sd"> :param logs: Set to true to include the logs from the build</span>
<span class="sd"> :type logs: bool</span>
<span class="sd"> :returns: A stream of bytes from tar</span>
<span class="sd"> :rtype: A generator</span>
<span class="sd"> :raises: RuntimeError if there was a problem (eg. missing config file)</span>
<span class="sd"> This yields an uncompressed tar&#39;s data to the caller. It includes</span>
<span class="sd"> the selected data to the caller by returning the Popen stdout from the tar process.</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="n">uuid_dir</span> <span class="o">=</span> <span class="n">joinpaths</span><span class="p">(</span><span class="n">cfg</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">&quot;composer&quot;</span><span class="p">,</span> <span class="s2">&quot;lib_dir&quot;</span><span class="p">),</span> <span class="s2">&quot;results&quot;</span><span class="p">,</span> <span class="n">uuid</span><span class="p">)</span>
<span class="k">if</span> <span class="ow">not</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">exists</span><span class="p">(</span><span class="n">uuid_dir</span><span class="p">):</span>
<span class="k">raise</span> <span class="ne">RuntimeError</span><span class="p">(</span><span class="s2">&quot;</span><span class="si">%s</span><span class="s2"> is not a valid build_id&quot;</span> <span class="o">%</span> <span class="n">uuid</span><span class="p">)</span>
<span class="c1"># Load the compose configuration</span>
<span class="n">cfg_path</span> <span class="o">=</span> <span class="n">joinpaths</span><span class="p">(</span><span class="n">uuid_dir</span><span class="p">,</span> <span class="s2">&quot;config.toml&quot;</span><span class="p">)</span>
<span class="k">if</span> <span class="ow">not</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">exists</span><span class="p">(</span><span class="n">cfg_path</span><span class="p">):</span>
<span class="k">raise</span> <span class="ne">RuntimeError</span><span class="p">(</span><span class="s2">&quot;Missing config.toml for </span><span class="si">%s</span><span class="s2">&quot;</span> <span class="o">%</span> <span class="n">uuid</span><span class="p">)</span>
<span class="n">cfg_dict</span> <span class="o">=</span> <span class="n">toml</span><span class="o">.</span><span class="n">loads</span><span class="p">(</span><span class="nb">open</span><span class="p">(</span><span class="n">cfg_path</span><span class="p">,</span> <span class="s2">&quot;r&quot;</span><span class="p">)</span><span class="o">.</span><span class="n">read</span><span class="p">())</span>
<span class="n">image_name</span> <span class="o">=</span> <span class="n">cfg_dict</span><span class="p">[</span><span class="s2">&quot;image_name&quot;</span><span class="p">]</span>
<span class="k">def</span> <span class="nf">include_file</span><span class="p">(</span><span class="n">f</span><span class="p">):</span>
<span class="k">if</span> <span class="n">f</span><span class="o">.</span><span class="n">endswith</span><span class="p">(</span><span class="s2">&quot;/logs&quot;</span><span class="p">):</span>
<span class="k">return</span> <span class="n">logs</span>
<span class="k">if</span> <span class="n">f</span><span class="o">.</span><span class="n">endswith</span><span class="p">(</span><span class="n">image_name</span><span class="p">):</span>
<span class="k">return</span> <span class="n">image</span>
<span class="k">return</span> <span class="n">metadata</span>
<span class="n">filenames</span> <span class="o">=</span> <span class="p">[</span><span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">basename</span><span class="p">(</span><span class="n">f</span><span class="p">)</span> <span class="k">for</span> <span class="n">f</span> <span class="ow">in</span> <span class="n">glob</span><span class="p">(</span><span class="n">joinpaths</span><span class="p">(</span><span class="n">uuid_dir</span><span class="p">,</span> <span class="s2">&quot;*&quot;</span><span class="p">))</span> <span class="k">if</span> <span class="n">include_file</span><span class="p">(</span><span class="n">f</span><span class="p">)]</span>
<span class="n">tar</span> <span class="o">=</span> <span class="n">Popen</span><span class="p">([</span><span class="s2">&quot;tar&quot;</span><span class="p">,</span> <span class="s2">&quot;-C&quot;</span><span class="p">,</span> <span class="n">uuid_dir</span><span class="p">,</span> <span class="s2">&quot;-cf-&quot;</span><span class="p">]</span> <span class="o">+</span> <span class="n">filenames</span><span class="p">,</span> <span class="n">stdout</span><span class="o">=</span><span class="n">PIPE</span><span class="p">)</span>
<span class="k">return</span> <span class="n">tar</span><span class="o">.</span><span class="n">stdout</span></div>
<div class="viewcode-block" id="uuid_image"><a class="viewcode-back" href="../../../pylorax.api.html#pylorax.api.queue.uuid_image">[docs]</a><span class="k">def</span> <span class="nf">uuid_image</span><span class="p">(</span><span class="n">cfg</span><span class="p">,</span> <span class="n">uuid</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;Return the filename and full path of the build&#39;s image file</span>
<span class="sd"> :param cfg: Configuration settings</span>
<span class="sd"> :type cfg: ComposerConfig</span>
<span class="sd"> :param uuid: The UUID of the build</span>
<span class="sd"> :type uuid: str</span>
<span class="sd"> :returns: The image filename and full path</span>
<span class="sd"> :rtype: tuple of strings</span>
<span class="sd"> :raises: RuntimeError if there was a problem (eg. invalid uuid, missing config file)</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="n">uuid_dir</span> <span class="o">=</span> <span class="n">joinpaths</span><span class="p">(</span><span class="n">cfg</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">&quot;composer&quot;</span><span class="p">,</span> <span class="s2">&quot;lib_dir&quot;</span><span class="p">),</span> <span class="s2">&quot;results&quot;</span><span class="p">,</span> <span class="n">uuid</span><span class="p">)</span>
<span class="k">return</span> <span class="n">get_image_name</span><span class="p">(</span><span class="n">uuid_dir</span><span class="p">)</span></div>
<div class="viewcode-block" id="get_image_name"><a class="viewcode-back" href="../../../pylorax.api.html#pylorax.api.queue.get_image_name">[docs]</a><span class="k">def</span> <span class="nf">get_image_name</span><span class="p">(</span><span class="n">uuid_dir</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;Return the filename and full path of the build&#39;s image file</span>
<span class="sd"> :param uuid: The UUID of the build</span>
<span class="sd"> :type uuid: str</span>
<span class="sd"> :returns: The image filename and full path</span>
<span class="sd"> :rtype: tuple of strings</span>
<span class="sd"> :raises: RuntimeError if there was a problem (eg. invalid uuid, missing config file)</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="n">uuid</span> <span class="o">=</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">basename</span><span class="p">(</span><span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">abspath</span><span class="p">(</span><span class="n">uuid_dir</span><span class="p">))</span>
<span class="k">if</span> <span class="ow">not</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">exists</span><span class="p">(</span><span class="n">uuid_dir</span><span class="p">):</span>
<span class="k">raise</span> <span class="ne">RuntimeError</span><span class="p">(</span><span class="s2">&quot;</span><span class="si">%s</span><span class="s2"> is not a valid build_id&quot;</span> <span class="o">%</span> <span class="n">uuid</span><span class="p">)</span>
<span class="c1"># Load the compose configuration</span>
<span class="n">cfg_path</span> <span class="o">=</span> <span class="n">joinpaths</span><span class="p">(</span><span class="n">uuid_dir</span><span class="p">,</span> <span class="s2">&quot;config.toml&quot;</span><span class="p">)</span>
<span class="k">if</span> <span class="ow">not</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">exists</span><span class="p">(</span><span class="n">cfg_path</span><span class="p">):</span>
<span class="k">raise</span> <span class="ne">RuntimeError</span><span class="p">(</span><span class="s2">&quot;Missing config.toml for </span><span class="si">%s</span><span class="s2">&quot;</span> <span class="o">%</span> <span class="n">uuid</span><span class="p">)</span>
<span class="n">cfg_dict</span> <span class="o">=</span> <span class="n">toml</span><span class="o">.</span><span class="n">loads</span><span class="p">(</span><span class="nb">open</span><span class="p">(</span><span class="n">cfg_path</span><span class="p">,</span> <span class="s2">&quot;r&quot;</span><span class="p">)</span><span class="o">.</span><span class="n">read</span><span class="p">())</span>
<span class="n">image_name</span> <span class="o">=</span> <span class="n">cfg_dict</span><span class="p">[</span><span class="s2">&quot;image_name&quot;</span><span class="p">]</span>
<span class="k">return</span> <span class="p">(</span><span class="n">image_name</span><span class="p">,</span> <span class="n">joinpaths</span><span class="p">(</span><span class="n">uuid_dir</span><span class="p">,</span> <span class="n">image_name</span><span class="p">))</span></div>
<div class="viewcode-block" id="uuid_log"><a class="viewcode-back" href="../../../pylorax.api.html#pylorax.api.queue.uuid_log">[docs]</a><span class="k">def</span> <span class="nf">uuid_log</span><span class="p">(</span><span class="n">cfg</span><span class="p">,</span> <span class="n">uuid</span><span class="p">,</span> <span class="n">size</span><span class="o">=</span><span class="mi">1024</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;Return `size` kbytes from the end of the anaconda.log</span>
<span class="sd"> :param cfg: Configuration settings</span>
<span class="sd"> :type cfg: ComposerConfig</span>
<span class="sd"> :param uuid: The UUID of the build</span>
<span class="sd"> :type uuid: str</span>
<span class="sd"> :param size: Number of kbytes to read. Default is 1024</span>
<span class="sd"> :type size: int</span>
<span class="sd"> :returns: Up to `size` kbytes from the end of the log</span>
<span class="sd"> :rtype: str</span>
<span class="sd"> :raises: RuntimeError if there was a problem (eg. no log file available)</span>
<span class="sd"> This function tries to return lines from the end of the log, it will</span>
<span class="sd"> attempt to start on a line boundry, and may return less than `size` kbytes.</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="n">uuid_dir</span> <span class="o">=</span> <span class="n">joinpaths</span><span class="p">(</span><span class="n">cfg</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">&quot;composer&quot;</span><span class="p">,</span> <span class="s2">&quot;lib_dir&quot;</span><span class="p">),</span> <span class="s2">&quot;results&quot;</span><span class="p">,</span> <span class="n">uuid</span><span class="p">)</span>
<span class="k">if</span> <span class="ow">not</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">exists</span><span class="p">(</span><span class="n">uuid_dir</span><span class="p">):</span>
<span class="k">raise</span> <span class="ne">RuntimeError</span><span class="p">(</span><span class="s2">&quot;</span><span class="si">%s</span><span class="s2"> is not a valid build_id&quot;</span> <span class="o">%</span> <span class="n">uuid</span><span class="p">)</span>
<span class="c1"># While a build is running the logs will be in /tmp/anaconda.log and when it</span>
<span class="c1"># has finished they will be in the results directory</span>
<span class="n">status</span> <span class="o">=</span> <span class="n">uuid_status</span><span class="p">(</span><span class="n">cfg</span><span class="p">,</span> <span class="n">uuid</span><span class="p">)</span>
<span class="k">if</span> <span class="n">status</span> <span class="ow">is</span> <span class="kc">None</span><span class="p">:</span>
<span class="k">raise</span> <span class="ne">RuntimeError</span><span class="p">(</span><span class="s2">&quot;Status is missing for </span><span class="si">%s</span><span class="s2">&quot;</span> <span class="o">%</span> <span class="n">uuid</span><span class="p">)</span>
<span class="k">if</span> <span class="n">status</span><span class="p">[</span><span class="s2">&quot;queue_status&quot;</span><span class="p">]</span> <span class="o">==</span> <span class="s2">&quot;RUNNING&quot;</span><span class="p">:</span>
<span class="n">log_path</span> <span class="o">=</span> <span class="s2">&quot;/tmp/anaconda.log&quot;</span>
<span class="k">else</span><span class="p">:</span>
<span class="n">log_path</span> <span class="o">=</span> <span class="n">joinpaths</span><span class="p">(</span><span class="n">uuid_dir</span><span class="p">,</span> <span class="s2">&quot;logs&quot;</span><span class="p">,</span> <span class="s2">&quot;anaconda&quot;</span><span class="p">,</span> <span class="s2">&quot;anaconda.log&quot;</span><span class="p">)</span>
<span class="k">if</span> <span class="ow">not</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">exists</span><span class="p">(</span><span class="n">log_path</span><span class="p">):</span>
<span class="k">raise</span> <span class="ne">RuntimeError</span><span class="p">(</span><span class="s2">&quot;No anaconda.log available.&quot;</span><span class="p">)</span>
<span class="k">with</span> <span class="nb">open</span><span class="p">(</span><span class="n">log_path</span><span class="p">,</span> <span class="s2">&quot;r&quot;</span><span class="p">)</span> <span class="k">as</span> <span class="n">f</span><span class="p">:</span>
<span class="n">f</span><span class="o">.</span><span class="n">seek</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="mi">2</span><span class="p">)</span>
<span class="n">end</span> <span class="o">=</span> <span class="n">f</span><span class="o">.</span><span class="n">tell</span><span class="p">()</span>
<span class="k">if</span> <span class="n">end</span> <span class="o">&lt;</span> <span class="mi">1024</span> <span class="o">*</span> <span class="n">size</span><span class="p">:</span>
<span class="n">f</span><span class="o">.</span><span class="n">seek</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="mi">0</span><span class="p">)</span>
<span class="k">else</span><span class="p">:</span>
<span class="n">f</span><span class="o">.</span><span class="n">seek</span><span class="p">(</span><span class="n">end</span> <span class="o">-</span> <span class="p">(</span><span class="mi">1024</span> <span class="o">*</span> <span class="n">size</span><span class="p">))</span>
<span class="c1"># Find the start of the next line and return the rest</span>
<span class="n">f</span><span class="o">.</span><span class="n">readline</span><span class="p">()</span>
<span class="k">return</span> <span class="n">f</span><span class="o">.</span><span class="n">read</span><span class="p">()</span></div>
</pre></div>
</div>
</div>
<footer>
<hr/>
<div role="contentinfo">
<p>
&copy; Copyright 2018, Red Hat, Inc..
</p>
</div>
Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/rtfd/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>.
</footer>
</div>
</div>
</section>
</div>
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT:'../../../',
VERSION:'28.10',
LANGUAGE:'None',
COLLAPSE_INDEX:false,
FILE_SUFFIX:'.html',
HAS_SOURCE: true,
SOURCELINK_SUFFIX: '.txt'
};
</script>
<script type="text/javascript" src="../../../_static/jquery.js"></script>
<script type="text/javascript" src="../../../_static/underscore.js"></script>
<script type="text/javascript" src="../../../_static/doctools.js"></script>
<script type="text/javascript" src="../../../_static/js/theme.js"></script>
<script type="text/javascript">
jQuery(function () {
SphinxRtdTheme.Navigation.enableSticky();
});
</script>
</body>
</html>

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,297 @@
<!DOCTYPE html>
<!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]-->
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>pylorax.api.server &mdash; Lorax 28.10 documentation</title>
<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" />
<script src="../../../_static/js/modernizr.min.js"></script>
</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">
28.10
</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>
<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"><a class="reference internal" href="../../../modules.html">pylorax</a></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="../../index.html">Module code</a> &raquo;</li>
<li><a href="../../pylorax.html">pylorax</a> &raquo;</li>
<li>pylorax.api.server</li>
<li class="wy-breadcrumbs-aside">
</li>
</ul>
<hr/>
</div>
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
<div itemprop="articleBody">
<h1>Source code for pylorax.api.server</h1><div class="highlight"><pre>
<span></span><span class="c1">#</span>
<span class="c1"># Copyright (C) 2017 Red Hat, Inc.</span>
<span class="c1">#</span>
<span class="c1"># This program is free software; you can redistribute it and/or modify</span>
<span class="c1"># it under the terms of the GNU General Public License as published by</span>
<span class="c1"># the Free Software Foundation; either version 2 of the License, or</span>
<span class="c1"># (at your option) any later version.</span>
<span class="c1">#</span>
<span class="c1"># This program is distributed in the hope that it will be useful,</span>
<span class="c1"># but WITHOUT ANY WARRANTY; without even the implied warranty of</span>
<span class="c1"># MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the</span>
<span class="c1"># GNU General Public License for more details.</span>
<span class="c1">#</span>
<span class="c1"># You should have received a copy of the GNU General Public License</span>
<span class="c1"># along with this program. If not, see &lt;http://www.gnu.org/licenses/&gt;.</span>
<span class="c1">#</span>
<span class="kn">import</span> <span class="nn">logging</span>
<span class="n">log</span> <span class="o">=</span> <span class="n">logging</span><span class="o">.</span><span class="n">getLogger</span><span class="p">(</span><span class="s2">&quot;lorax-composer&quot;</span><span class="p">)</span>
<span class="kn">from</span> <span class="nn">collections</span> <span class="k">import</span> <span class="n">namedtuple</span>
<span class="kn">from</span> <span class="nn">flask</span> <span class="k">import</span> <span class="n">Flask</span><span class="p">,</span> <span class="n">jsonify</span><span class="p">,</span> <span class="n">redirect</span><span class="p">,</span> <span class="n">send_from_directory</span>
<span class="kn">from</span> <span class="nn">glob</span> <span class="k">import</span> <span class="n">glob</span>
<span class="kn">import</span> <span class="nn">os</span>
<span class="kn">from</span> <span class="nn">pylorax</span> <span class="k">import</span> <span class="n">vernum</span>
<span class="kn">from</span> <span class="nn">pylorax.api.crossdomain</span> <span class="k">import</span> <span class="n">crossdomain</span>
<span class="kn">from</span> <span class="nn">pylorax.api.v0</span> <span class="k">import</span> <span class="n">v0_api</span>
<span class="kn">from</span> <span class="nn">pylorax.sysutils</span> <span class="k">import</span> <span class="n">joinpaths</span>
<span class="n">GitLock</span> <span class="o">=</span> <span class="n">namedtuple</span><span class="p">(</span><span class="s2">&quot;GitLock&quot;</span><span class="p">,</span> <span class="p">[</span><span class="s2">&quot;repo&quot;</span><span class="p">,</span> <span class="s2">&quot;lock&quot;</span><span class="p">,</span> <span class="s2">&quot;dir&quot;</span><span class="p">])</span>
<span class="n">DNFLock</span> <span class="o">=</span> <span class="n">namedtuple</span><span class="p">(</span><span class="s2">&quot;DNFLock&quot;</span><span class="p">,</span> <span class="p">[</span><span class="s2">&quot;dbo&quot;</span><span class="p">,</span> <span class="s2">&quot;lock&quot;</span><span class="p">])</span>
<span class="n">server</span> <span class="o">=</span> <span class="n">Flask</span><span class="p">(</span><span class="vm">__name__</span><span class="p">)</span>
<span class="n">__all__</span> <span class="o">=</span> <span class="p">[</span><span class="s2">&quot;server&quot;</span><span class="p">,</span> <span class="s2">&quot;GitLock&quot;</span><span class="p">]</span>
<span class="nd">@server</span><span class="o">.</span><span class="n">route</span><span class="p">(</span><span class="s1">&#39;/&#39;</span><span class="p">)</span>
<span class="k">def</span> <span class="nf">server_root</span><span class="p">():</span>
<span class="n">redirect</span><span class="p">(</span><span class="s2">&quot;/api/docs/&quot;</span><span class="p">)</span>
<span class="nd">@server</span><span class="o">.</span><span class="n">route</span><span class="p">(</span><span class="s2">&quot;/api/docs/&quot;</span><span class="p">)</span>
<span class="nd">@server</span><span class="o">.</span><span class="n">route</span><span class="p">(</span><span class="s2">&quot;/api/docs/&lt;path:path&gt;&quot;</span><span class="p">)</span>
<span class="k">def</span> <span class="nf">api_docs</span><span class="p">(</span><span class="n">path</span><span class="o">=</span><span class="kc">None</span><span class="p">):</span>
<span class="c1"># Find the html docs</span>
<span class="k">try</span><span class="p">:</span>
<span class="c1"># This assumes it is running from the source tree</span>
<span class="n">docs_path</span> <span class="o">=</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">abspath</span><span class="p">(</span><span class="n">joinpaths</span><span class="p">(</span><span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">dirname</span><span class="p">(</span><span class="vm">__file__</span><span class="p">),</span> <span class="s2">&quot;../../../docs/html&quot;</span><span class="p">))</span>
<span class="k">except</span> <span class="ne">IndexError</span><span class="p">:</span>
<span class="n">docs_path</span> <span class="o">=</span> <span class="n">glob</span><span class="p">(</span><span class="s2">&quot;/usr/share/doc/lorax-*/html/&quot;</span><span class="p">)[</span><span class="mi">0</span><span class="p">]</span>
<span class="k">if</span> <span class="ow">not</span> <span class="n">path</span><span class="p">:</span>
<span class="n">path</span><span class="o">=</span><span class="s2">&quot;index.html&quot;</span>
<span class="k">return</span> <span class="n">send_from_directory</span><span class="p">(</span><span class="n">docs_path</span><span class="p">,</span> <span class="n">path</span><span class="p">)</span>
<span class="nd">@server</span><span class="o">.</span><span class="n">route</span><span class="p">(</span><span class="s2">&quot;/api/status&quot;</span><span class="p">)</span>
<span class="nd">@crossdomain</span><span class="p">(</span><span class="n">origin</span><span class="o">=</span><span class="s2">&quot;*&quot;</span><span class="p">)</span>
<span class="k">def</span> <span class="nf">v0_status</span><span class="p">():</span>
<span class="sd">&quot;&quot;&quot;</span>
<span class="sd"> `/api/v0/status`</span>
<span class="sd"> ^^^^^^^^^^^^^^^^</span>
<span class="sd"> Return the status of the API Server::</span>
<span class="sd"> { &quot;api&quot;: &quot;0&quot;,</span>
<span class="sd"> &quot;build&quot;: &quot;devel&quot;,</span>
<span class="sd"> &quot;db_supported&quot;: true,</span>
<span class="sd"> &quot;db_version&quot;: &quot;0&quot;,</span>
<span class="sd"> &quot;schema_version&quot;: &quot;0&quot;,</span>
<span class="sd"> &quot;backend&quot;: &quot;lorax-composer&quot;}</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="k">return</span> <span class="n">jsonify</span><span class="p">(</span><span class="n">backend</span><span class="o">=</span><span class="s2">&quot;lorax-composer&quot;</span><span class="p">,</span>
<span class="n">build</span><span class="o">=</span><span class="n">vernum</span><span class="p">,</span>
<span class="n">api</span><span class="o">=</span><span class="s2">&quot;0&quot;</span><span class="p">,</span>
<span class="n">db_version</span><span class="o">=</span><span class="s2">&quot;0&quot;</span><span class="p">,</span>
<span class="n">schema_version</span><span class="o">=</span><span class="s2">&quot;0&quot;</span><span class="p">,</span>
<span class="n">db_supported</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span>
<span class="n">v0_api</span><span class="p">(</span><span class="n">server</span><span class="p">)</span>
</pre></div>
</div>
</div>
<footer>
<hr/>
<div role="contentinfo">
<p>
&copy; Copyright 2018, Red Hat, Inc..
</p>
</div>
Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/rtfd/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>.
</footer>
</div>
</div>
</section>
</div>
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT:'../../../',
VERSION:'28.10',
LANGUAGE:'None',
COLLAPSE_INDEX:false,
FILE_SUFFIX:'.html',
HAS_SOURCE: true,
SOURCELINK_SUFFIX: '.txt'
};
</script>
<script type="text/javascript" src="../../../_static/jquery.js"></script>
<script type="text/javascript" src="../../../_static/underscore.js"></script>
<script type="text/javascript" src="../../../_static/doctools.js"></script>
<script type="text/javascript" src="../../../_static/js/theme.js"></script>
<script type="text/javascript">
jQuery(function () {
SphinxRtdTheme.Navigation.enableSticky();
});
</script>
</body>
</html>

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,319 @@
<!DOCTYPE html>
<!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]-->
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>pylorax.api.workspace &mdash; Lorax 28.10 documentation</title>
<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" />
<script src="../../../_static/js/modernizr.min.js"></script>
</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">
28.10
</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>
<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"><a class="reference internal" href="../../../modules.html">pylorax</a></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="../../index.html">Module code</a> &raquo;</li>
<li><a href="../../pylorax.html">pylorax</a> &raquo;</li>
<li>pylorax.api.workspace</li>
<li class="wy-breadcrumbs-aside">
</li>
</ul>
<hr/>
</div>
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
<div itemprop="articleBody">
<h1>Source code for pylorax.api.workspace</h1><div class="highlight"><pre>
<span></span><span class="c1">#</span>
<span class="c1"># Copyright (C) 2017 Red Hat, Inc.</span>
<span class="c1">#</span>
<span class="c1"># This program is free software; you can redistribute it and/or modify</span>
<span class="c1"># it under the terms of the GNU General Public License as published by</span>
<span class="c1"># the Free Software Foundation; either version 2 of the License, or</span>
<span class="c1"># (at your option) any later version.</span>
<span class="c1">#</span>
<span class="c1"># This program is distributed in the hope that it will be useful,</span>
<span class="c1"># but WITHOUT ANY WARRANTY; without even the implied warranty of</span>
<span class="c1"># MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the</span>
<span class="c1"># GNU General Public License for more details.</span>
<span class="c1">#</span>
<span class="c1"># You should have received a copy of the GNU General Public License</span>
<span class="c1"># along with this program. If not, see &lt;http://www.gnu.org/licenses/&gt;.</span>
<span class="c1">#</span>
<span class="kn">import</span> <span class="nn">os</span>
<span class="kn">from</span> <span class="nn">pylorax.api.recipes</span> <span class="k">import</span> <span class="n">recipe_filename</span><span class="p">,</span> <span class="n">recipe_from_toml</span><span class="p">,</span> <span class="n">RecipeFileError</span>
<span class="kn">from</span> <span class="nn">pylorax.sysutils</span> <span class="k">import</span> <span class="n">joinpaths</span>
<div class="viewcode-block" id="workspace_dir"><a class="viewcode-back" href="../../../pylorax.api.html#pylorax.api.workspace.workspace_dir">[docs]</a><span class="k">def</span> <span class="nf">workspace_dir</span><span class="p">(</span><span class="n">repo</span><span class="p">,</span> <span class="n">branch</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;Create the workspace&#39;s path from a Repository and branch</span>
<span class="sd"> :param repo: Open repository</span>
<span class="sd"> :type repo: Git.Repository</span>
<span class="sd"> :param branch: Branch name</span>
<span class="sd"> :type branch: str</span>
<span class="sd"> :returns: The path to the branch&#39;s workspace directory</span>
<span class="sd"> :rtype: str</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="n">repo_path</span> <span class="o">=</span> <span class="n">repo</span><span class="o">.</span><span class="n">get_location</span><span class="p">()</span><span class="o">.</span><span class="n">get_path</span><span class="p">()</span>
<span class="k">return</span> <span class="n">joinpaths</span><span class="p">(</span><span class="n">repo_path</span><span class="p">,</span> <span class="s2">&quot;workspace&quot;</span><span class="p">,</span> <span class="n">branch</span><span class="p">)</span></div>
<div class="viewcode-block" id="workspace_read"><a class="viewcode-back" href="../../../pylorax.api.html#pylorax.api.workspace.workspace_read">[docs]</a><span class="k">def</span> <span class="nf">workspace_read</span><span class="p">(</span><span class="n">repo</span><span class="p">,</span> <span class="n">branch</span><span class="p">,</span> <span class="n">recipe_name</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;Read a Recipe from the branch&#39;s workspace</span>
<span class="sd"> :param repo: Open repository</span>
<span class="sd"> :type repo: Git.Repository</span>
<span class="sd"> :param branch: Branch name</span>
<span class="sd"> :type branch: str</span>
<span class="sd"> :param recipe_name: The name of the recipe</span>
<span class="sd"> :type recipe_name: str</span>
<span class="sd"> :returns: The workspace copy of the recipe, or None if it doesn&#39;t exist</span>
<span class="sd"> :rtype: Recipe or None</span>
<span class="sd"> :raises: RecipeFileError</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="n">ws_dir</span> <span class="o">=</span> <span class="n">workspace_dir</span><span class="p">(</span><span class="n">repo</span><span class="p">,</span> <span class="n">branch</span><span class="p">)</span>
<span class="k">if</span> <span class="ow">not</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">isdir</span><span class="p">(</span><span class="n">ws_dir</span><span class="p">):</span>
<span class="n">os</span><span class="o">.</span><span class="n">makedirs</span><span class="p">(</span><span class="n">ws_dir</span><span class="p">)</span>
<span class="n">filename</span> <span class="o">=</span> <span class="n">joinpaths</span><span class="p">(</span><span class="n">ws_dir</span><span class="p">,</span> <span class="n">recipe_filename</span><span class="p">(</span><span class="n">recipe_name</span><span class="p">))</span>
<span class="k">if</span> <span class="ow">not</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">exists</span><span class="p">(</span><span class="n">filename</span><span class="p">):</span>
<span class="k">return</span> <span class="kc">None</span>
<span class="k">try</span><span class="p">:</span>
<span class="n">f</span> <span class="o">=</span> <span class="nb">open</span><span class="p">(</span><span class="n">filename</span><span class="p">,</span> <span class="s1">&#39;rb&#39;</span><span class="p">)</span>
<span class="n">recipe</span> <span class="o">=</span> <span class="n">recipe_from_toml</span><span class="p">(</span><span class="n">f</span><span class="o">.</span><span class="n">read</span><span class="p">()</span><span class="o">.</span><span class="n">decode</span><span class="p">(</span><span class="s2">&quot;UTF-8&quot;</span><span class="p">))</span>
<span class="k">except</span> <span class="ne">IOError</span><span class="p">:</span>
<span class="k">raise</span> <span class="n">RecipeFileError</span>
<span class="k">return</span> <span class="n">recipe</span></div>
<div class="viewcode-block" id="workspace_write"><a class="viewcode-back" href="../../../pylorax.api.html#pylorax.api.workspace.workspace_write">[docs]</a><span class="k">def</span> <span class="nf">workspace_write</span><span class="p">(</span><span class="n">repo</span><span class="p">,</span> <span class="n">branch</span><span class="p">,</span> <span class="n">recipe</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;Write a recipe to the workspace</span>
<span class="sd"> :param repo: Open repository</span>
<span class="sd"> :type repo: Git.Repository</span>
<span class="sd"> :param branch: Branch name</span>
<span class="sd"> :type branch: str</span>
<span class="sd"> :param recipe: The recipe to write to the workspace</span>
<span class="sd"> :type recipe: Recipe</span>
<span class="sd"> :returns: None</span>
<span class="sd"> :raises: IO related errors</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="n">ws_dir</span> <span class="o">=</span> <span class="n">workspace_dir</span><span class="p">(</span><span class="n">repo</span><span class="p">,</span> <span class="n">branch</span><span class="p">)</span>
<span class="k">if</span> <span class="ow">not</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">isdir</span><span class="p">(</span><span class="n">ws_dir</span><span class="p">):</span>
<span class="n">os</span><span class="o">.</span><span class="n">makedirs</span><span class="p">(</span><span class="n">ws_dir</span><span class="p">)</span>
<span class="n">filename</span> <span class="o">=</span> <span class="n">joinpaths</span><span class="p">(</span><span class="n">ws_dir</span><span class="p">,</span> <span class="n">recipe</span><span class="o">.</span><span class="n">filename</span><span class="p">)</span>
<span class="nb">open</span><span class="p">(</span><span class="n">filename</span><span class="p">,</span> <span class="s1">&#39;wb&#39;</span><span class="p">)</span><span class="o">.</span><span class="n">write</span><span class="p">(</span><span class="n">recipe</span><span class="o">.</span><span class="n">toml</span><span class="p">()</span><span class="o">.</span><span class="n">encode</span><span class="p">(</span><span class="s2">&quot;UTF-8&quot;</span><span class="p">))</span></div>
<div class="viewcode-block" id="workspace_delete"><a class="viewcode-back" href="../../../pylorax.api.html#pylorax.api.workspace.workspace_delete">[docs]</a><span class="k">def</span> <span class="nf">workspace_delete</span><span class="p">(</span><span class="n">repo</span><span class="p">,</span> <span class="n">branch</span><span class="p">,</span> <span class="n">recipe_name</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;Delete the recipe from the workspace</span>
<span class="sd"> :param repo: Open repository</span>
<span class="sd"> :type repo: Git.Repository</span>
<span class="sd"> :param branch: Branch name</span>
<span class="sd"> :type branch: str</span>
<span class="sd"> :param recipe_name: The name of the recipe</span>
<span class="sd"> :type recipe_name: str</span>
<span class="sd"> :returns: None</span>
<span class="sd"> :raises: IO related errors</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="n">ws_dir</span> <span class="o">=</span> <span class="n">workspace_dir</span><span class="p">(</span><span class="n">repo</span><span class="p">,</span> <span class="n">branch</span><span class="p">)</span>
<span class="n">filename</span> <span class="o">=</span> <span class="n">joinpaths</span><span class="p">(</span><span class="n">ws_dir</span><span class="p">,</span> <span class="n">recipe_filename</span><span class="p">(</span><span class="n">recipe_name</span><span class="p">))</span>
<span class="k">if</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">exists</span><span class="p">(</span><span class="n">filename</span><span class="p">):</span>
<span class="n">os</span><span class="o">.</span><span class="n">unlink</span><span class="p">(</span><span class="n">filename</span><span class="p">)</span></div>
</pre></div>
</div>
</div>
<footer>
<hr/>
<div role="contentinfo">
<p>
&copy; Copyright 2018, Red Hat, Inc..
</p>
</div>
Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/rtfd/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>.
</footer>
</div>
</div>
</section>
</div>
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT:'../../../',
VERSION:'28.10',
LANGUAGE:'None',
COLLAPSE_INDEX:false,
FILE_SUFFIX:'.html',
HAS_SOURCE: true,
SOURCELINK_SUFFIX: '.txt'
};
</script>
<script type="text/javascript" src="../../../_static/jquery.js"></script>
<script type="text/javascript" src="../../../_static/underscore.js"></script>
<script type="text/javascript" src="../../../_static/doctools.js"></script>
<script type="text/javascript" src="../../../_static/js/theme.js"></script>
<script type="text/javascript">
jQuery(function () {
SphinxRtdTheme.Navigation.enableSticky();
});
</script>
</body>
</html>

View File

@ -8,8 +8,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>pylorax.base &mdash; Lorax 28.9 documentation</title> <title>pylorax.base &mdash; Lorax 28.10 documentation</title>
@ -27,23 +26,16 @@
<link rel="stylesheet" href="../../_static/css/theme.css" type="text/css" /> <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="index" title="Index"
href="../../genindex.html"/>
<link rel="search" title="Search" href="../../search.html" /> <link rel="search" title="Search" href="../../search.html" />
<link rel="top" title="Lorax 28.9 documentation" href="../../index.html"/>
<link rel="up" title="pylorax" href="../pylorax.html"/>
<script src="../../_static/js/modernizr.min.js"></script> <script src="../../_static/js/modernizr.min.js"></script>
</head> </head>
<body class="wy-body-for-nav" role="document"> <body class="wy-body-for-nav">
<div class="wy-grid-for-nav"> <div class="wy-grid-for-nav">
@ -65,7 +57,7 @@
<div class="version"> <div class="version">
28.9 28.10
</div> </div>
@ -94,6 +86,8 @@
<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="../../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="../../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="../../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"><a class="reference internal" href="../../product-images.html">Product and Updates Images</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../modules.html">pylorax</a></li> <li class="toctree-l1"><a class="reference internal" href="../../modules.html">pylorax</a></li>
</ul> </ul>
@ -107,7 +101,7 @@
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"> <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
<nav class="wy-nav-top" role="navigation" aria-label="top navigation"> <nav class="wy-nav-top" aria-label="top navigation">
<i data-toggle="wy-nav-top" class="fa fa-bars"></i> <i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="../../index.html">Lorax</a> <a href="../../index.html">Lorax</a>
@ -115,8 +109,8 @@
</nav> </nav>
<div class="wy-nav-content"> <div class="wy-nav-content">
<div class="rst-content"> <div class="rst-content">
@ -134,6 +128,7 @@
<div role="navigation" aria-label="breadcrumbs navigation"> <div role="navigation" aria-label="breadcrumbs navigation">
<ul class="wy-breadcrumbs"> <ul class="wy-breadcrumbs">
@ -149,8 +144,6 @@
<li class="wy-breadcrumbs-aside"> <li class="wy-breadcrumbs-aside">
</li> </li>
</ul> </ul>
@ -232,10 +225,8 @@
</pre></div> </pre></div>
</div> </div>
<div class="articleComments">
</div> </div>
</div>
<footer> <footer>
@ -247,7 +238,7 @@
</p> </p>
</div> </div>
Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/snide/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>. 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> </footer>
@ -265,7 +256,8 @@
<script type="text/javascript"> <script type="text/javascript">
var DOCUMENTATION_OPTIONS = { var DOCUMENTATION_OPTIONS = {
URL_ROOT:'../../', URL_ROOT:'../../',
VERSION:'28.9', VERSION:'28.10',
LANGUAGE:'None',
COLLAPSE_INDEX:false, COLLAPSE_INDEX:false,
FILE_SUFFIX:'.html', FILE_SUFFIX:'.html',
HAS_SOURCE: true, HAS_SOURCE: true,
@ -283,14 +275,13 @@
<script type="text/javascript" src="../../_static/js/theme.js"></script> <script type="text/javascript" src="../../_static/js/theme.js"></script>
<script type="text/javascript"> <script type="text/javascript">
jQuery(function () { jQuery(function () {
SphinxRtdTheme.StickyNav.enable();
SphinxRtdTheme.Navigation.enableSticky();
}); });
</script> </script>
</body> </body>
</html> </html>

View File

@ -8,8 +8,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>pylorax.buildstamp &mdash; Lorax 28.9 documentation</title> <title>pylorax.buildstamp &mdash; Lorax 28.10 documentation</title>
@ -27,23 +26,16 @@
<link rel="stylesheet" href="../../_static/css/theme.css" type="text/css" /> <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="index" title="Index"
href="../../genindex.html"/>
<link rel="search" title="Search" href="../../search.html" /> <link rel="search" title="Search" href="../../search.html" />
<link rel="top" title="Lorax 28.9 documentation" href="../../index.html"/>
<link rel="up" title="pylorax" href="../pylorax.html"/>
<script src="../../_static/js/modernizr.min.js"></script> <script src="../../_static/js/modernizr.min.js"></script>
</head> </head>
<body class="wy-body-for-nav" role="document"> <body class="wy-body-for-nav">
<div class="wy-grid-for-nav"> <div class="wy-grid-for-nav">
@ -65,7 +57,7 @@
<div class="version"> <div class="version">
28.9 28.10
</div> </div>
@ -94,6 +86,8 @@
<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="../../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="../../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="../../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"><a class="reference internal" href="../../product-images.html">Product and Updates Images</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../modules.html">pylorax</a></li> <li class="toctree-l1"><a class="reference internal" href="../../modules.html">pylorax</a></li>
</ul> </ul>
@ -107,7 +101,7 @@
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"> <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
<nav class="wy-nav-top" role="navigation" aria-label="top navigation"> <nav class="wy-nav-top" aria-label="top navigation">
<i data-toggle="wy-nav-top" class="fa fa-bars"></i> <i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="../../index.html">Lorax</a> <a href="../../index.html">Lorax</a>
@ -115,8 +109,8 @@
</nav> </nav>
<div class="wy-nav-content"> <div class="wy-nav-content">
<div class="rst-content"> <div class="rst-content">
@ -134,6 +128,7 @@
<div role="navigation" aria-label="breadcrumbs navigation"> <div role="navigation" aria-label="breadcrumbs navigation">
<ul class="wy-breadcrumbs"> <ul class="wy-breadcrumbs">
@ -149,8 +144,6 @@
<li class="wy-breadcrumbs-aside"> <li class="wy-breadcrumbs-aside">
</li> </li>
</ul> </ul>
@ -226,10 +219,8 @@
</pre></div> </pre></div>
</div> </div>
<div class="articleComments">
</div> </div>
</div>
<footer> <footer>
@ -241,7 +232,7 @@
</p> </p>
</div> </div>
Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/snide/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>. 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> </footer>
@ -259,7 +250,8 @@
<script type="text/javascript"> <script type="text/javascript">
var DOCUMENTATION_OPTIONS = { var DOCUMENTATION_OPTIONS = {
URL_ROOT:'../../', URL_ROOT:'../../',
VERSION:'28.9', VERSION:'28.10',
LANGUAGE:'None',
COLLAPSE_INDEX:false, COLLAPSE_INDEX:false,
FILE_SUFFIX:'.html', FILE_SUFFIX:'.html',
HAS_SOURCE: true, HAS_SOURCE: true,
@ -277,14 +269,13 @@
<script type="text/javascript" src="../../_static/js/theme.js"></script> <script type="text/javascript" src="../../_static/js/theme.js"></script>
<script type="text/javascript"> <script type="text/javascript">
jQuery(function () { jQuery(function () {
SphinxRtdTheme.StickyNav.enable();
SphinxRtdTheme.Navigation.enableSticky();
}); });
</script> </script>
</body> </body>
</html> </html>

View File

@ -8,8 +8,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>pylorax.cmdline &mdash; Lorax 28.9 documentation</title> <title>pylorax.cmdline &mdash; Lorax 28.10 documentation</title>
@ -27,23 +26,16 @@
<link rel="stylesheet" href="../../_static/css/theme.css" type="text/css" /> <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="index" title="Index"
href="../../genindex.html"/>
<link rel="search" title="Search" href="../../search.html" /> <link rel="search" title="Search" href="../../search.html" />
<link rel="top" title="Lorax 28.9 documentation" href="../../index.html"/>
<link rel="up" title="pylorax" href="../pylorax.html"/>
<script src="../../_static/js/modernizr.min.js"></script> <script src="../../_static/js/modernizr.min.js"></script>
</head> </head>
<body class="wy-body-for-nav" role="document"> <body class="wy-body-for-nav">
<div class="wy-grid-for-nav"> <div class="wy-grid-for-nav">
@ -65,7 +57,7 @@
<div class="version"> <div class="version">
28.9 28.10
</div> </div>
@ -94,6 +86,8 @@
<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="../../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="../../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="../../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"><a class="reference internal" href="../../product-images.html">Product and Updates Images</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../modules.html">pylorax</a></li> <li class="toctree-l1"><a class="reference internal" href="../../modules.html">pylorax</a></li>
</ul> </ul>
@ -107,7 +101,7 @@
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"> <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
<nav class="wy-nav-top" role="navigation" aria-label="top navigation"> <nav class="wy-nav-top" aria-label="top navigation">
<i data-toggle="wy-nav-top" class="fa fa-bars"></i> <i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="../../index.html">Lorax</a> <a href="../../index.html">Lorax</a>
@ -115,8 +109,8 @@
</nav> </nav>
<div class="wy-nav-content"> <div class="wy-nav-content">
<div class="rst-content"> <div class="rst-content">
@ -134,6 +128,7 @@
<div role="navigation" aria-label="breadcrumbs navigation"> <div role="navigation" aria-label="breadcrumbs navigation">
<ul class="wy-breadcrumbs"> <ul class="wy-breadcrumbs">
@ -149,8 +144,6 @@
<li class="wy-breadcrumbs-aside"> <li class="wy-breadcrumbs-aside">
</li> </li>
</ul> </ul>
@ -459,10 +452,8 @@
</pre></div> </pre></div>
</div> </div>
<div class="articleComments">
</div> </div>
</div>
<footer> <footer>
@ -474,7 +465,7 @@
</p> </p>
</div> </div>
Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/snide/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>. 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> </footer>
@ -492,7 +483,8 @@
<script type="text/javascript"> <script type="text/javascript">
var DOCUMENTATION_OPTIONS = { var DOCUMENTATION_OPTIONS = {
URL_ROOT:'../../', URL_ROOT:'../../',
VERSION:'28.9', VERSION:'28.10',
LANGUAGE:'None',
COLLAPSE_INDEX:false, COLLAPSE_INDEX:false,
FILE_SUFFIX:'.html', FILE_SUFFIX:'.html',
HAS_SOURCE: true, HAS_SOURCE: true,
@ -510,14 +502,13 @@
<script type="text/javascript" src="../../_static/js/theme.js"></script> <script type="text/javascript" src="../../_static/js/theme.js"></script>
<script type="text/javascript"> <script type="text/javascript">
jQuery(function () { jQuery(function () {
SphinxRtdTheme.StickyNav.enable();
SphinxRtdTheme.Navigation.enableSticky();
}); });
</script> </script>
</body> </body>
</html> </html>

View File

@ -0,0 +1,934 @@
<!DOCTYPE html>
<!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]-->
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>pylorax.creator &mdash; Lorax 28.10 documentation</title>
<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" />
<script src="../../_static/js/modernizr.min.js"></script>
</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">
28.10
</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>
<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"><a class="reference internal" href="../../modules.html">pylorax</a></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="../index.html">Module code</a> &raquo;</li>
<li><a href="../pylorax.html">pylorax</a> &raquo;</li>
<li>pylorax.creator</li>
<li class="wy-breadcrumbs-aside">
</li>
</ul>
<hr/>
</div>
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
<div itemprop="articleBody">
<h1>Source code for pylorax.creator</h1><div class="highlight"><pre>
<span></span><span class="c1">#</span>
<span class="c1"># Copyright (C) 2011-2018 Red Hat, Inc.</span>
<span class="c1">#</span>
<span class="c1"># This program is free software; you can redistribute it and/or modify</span>
<span class="c1"># it under the terms of the GNU General Public License as published by</span>
<span class="c1"># the Free Software Foundation; either version 2 of the License, or</span>
<span class="c1"># (at your option) any later version.</span>
<span class="c1">#</span>
<span class="c1"># This program is distributed in the hope that it will be useful,</span>
<span class="c1"># but WITHOUT ANY WARRANTY; without even the implied warranty of</span>
<span class="c1"># MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the</span>
<span class="c1"># GNU General Public License for more details.</span>
<span class="c1">#</span>
<span class="c1"># You should have received a copy of the GNU General Public License</span>
<span class="c1"># along with this program. If not, see &lt;http://www.gnu.org/licenses/&gt;.</span>
<span class="c1">#</span>
<span class="kn">import</span> <span class="nn">logging</span>
<span class="n">log</span> <span class="o">=</span> <span class="n">logging</span><span class="o">.</span><span class="n">getLogger</span><span class="p">(</span><span class="s2">&quot;pylorax&quot;</span><span class="p">)</span>
<span class="kn">import</span> <span class="nn">os</span>
<span class="kn">import</span> <span class="nn">tempfile</span>
<span class="kn">import</span> <span class="nn">subprocess</span>
<span class="kn">import</span> <span class="nn">shutil</span>
<span class="kn">import</span> <span class="nn">hashlib</span>
<span class="kn">import</span> <span class="nn">glob</span>
<span class="c1"># Use Mako templates for appliance builder descriptions</span>
<span class="kn">from</span> <span class="nn">mako.template</span> <span class="k">import</span> <span class="n">Template</span>
<span class="kn">from</span> <span class="nn">mako.exceptions</span> <span class="k">import</span> <span class="n">text_error_template</span>
<span class="c1"># Use pykickstart to calculate disk image size</span>
<span class="kn">from</span> <span class="nn">pykickstart.parser</span> <span class="k">import</span> <span class="n">KickstartParser</span>
<span class="kn">from</span> <span class="nn">pykickstart.constants</span> <span class="k">import</span> <span class="n">KS_SHUTDOWN</span>
<span class="kn">from</span> <span class="nn">pykickstart.version</span> <span class="k">import</span> <span class="n">makeVersion</span>
<span class="c1"># Use the Lorax treebuilder branch for iso creation</span>
<span class="kn">from</span> <span class="nn">pylorax</span> <span class="k">import</span> <span class="n">ArchData</span>
<span class="kn">from</span> <span class="nn">pylorax.base</span> <span class="k">import</span> <span class="n">DataHolder</span>
<span class="kn">from</span> <span class="nn">pylorax.executils</span> <span class="k">import</span> <span class="n">execWithRedirect</span><span class="p">,</span> <span class="n">runcmd</span>
<span class="kn">from</span> <span class="nn">pylorax.imgutils</span> <span class="k">import</span> <span class="n">PartitionMount</span>
<span class="kn">from</span> <span class="nn">pylorax.imgutils</span> <span class="k">import</span> <span class="n">mount</span><span class="p">,</span> <span class="n">umount</span><span class="p">,</span> <span class="n">Mount</span>
<span class="kn">from</span> <span class="nn">pylorax.imgutils</span> <span class="k">import</span> <span class="n">mksquashfs</span><span class="p">,</span> <span class="n">mkrootfsimg</span>
<span class="kn">from</span> <span class="nn">pylorax.imgutils</span> <span class="k">import</span> <span class="n">copytree</span>
<span class="kn">from</span> <span class="nn">pylorax.installer</span> <span class="k">import</span> <span class="n">novirt_install</span><span class="p">,</span> <span class="n">virt_install</span><span class="p">,</span> <span class="n">InstallError</span>
<span class="kn">from</span> <span class="nn">pylorax.treebuilder</span> <span class="k">import</span> <span class="n">TreeBuilder</span><span class="p">,</span> <span class="n">RuntimeBuilder</span>
<span class="kn">from</span> <span class="nn">pylorax.treebuilder</span> <span class="k">import</span> <span class="n">findkernels</span>
<span class="kn">from</span> <span class="nn">pylorax.sysutils</span> <span class="k">import</span> <span class="n">joinpaths</span><span class="p">,</span> <span class="n">remove</span>
<span class="c1"># Default parameters for rebuilding initramfs, override with --dracut-args</span>
<span class="n">DRACUT_DEFAULT</span> <span class="o">=</span> <span class="p">[</span><span class="s2">&quot;--xz&quot;</span><span class="p">,</span> <span class="s2">&quot;--add&quot;</span><span class="p">,</span> <span class="s2">&quot;livenet dmsquash-live convertfs pollcdrom qemu qemu-net&quot;</span><span class="p">,</span>
<span class="s2">&quot;--omit&quot;</span><span class="p">,</span> <span class="s2">&quot;plymouth&quot;</span><span class="p">,</span> <span class="s2">&quot;--no-hostonly&quot;</span><span class="p">,</span> <span class="s2">&quot;--debug&quot;</span><span class="p">,</span> <span class="s2">&quot;--no-early-microcode&quot;</span><span class="p">]</span>
<span class="n">RUNTIME</span> <span class="o">=</span> <span class="s2">&quot;images/install.img&quot;</span>
<div class="viewcode-block" id="FakeDNF"><a class="viewcode-back" href="../../pylorax.html#pylorax.creator.FakeDNF">[docs]</a><span class="k">class</span> <span class="nc">FakeDNF</span><span class="p">(</span><span class="nb">object</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;</span>
<span class="sd"> A minimal DNF object suitable for passing to RuntimeBuilder</span>
<span class="sd"> lmc uses RuntimeBuilder to run the arch specific iso creation</span>
<span class="sd"> templates, so the the installroot config value is the important part of</span>
<span class="sd"> this. Everything else should be a nop.</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="k">def</span> <span class="nf">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">conf</span><span class="p">):</span>
<span class="bp">self</span><span class="o">.</span><span class="n">conf</span> <span class="o">=</span> <span class="n">conf</span>
<div class="viewcode-block" id="FakeDNF.reset"><a class="viewcode-back" href="../../pylorax.html#pylorax.creator.FakeDNF.reset">[docs]</a> <span class="k">def</span> <span class="nf">reset</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
<span class="k">pass</span></div></div>
<div class="viewcode-block" id="is_image_mounted"><a class="viewcode-back" href="../../pylorax.html#pylorax.creator.is_image_mounted">[docs]</a><span class="k">def</span> <span class="nf">is_image_mounted</span><span class="p">(</span><span class="n">disk_img</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;</span>
<span class="sd"> Check to see if the disk_img is mounted</span>
<span class="sd"> :returns: True if disk_img is in /proc/mounts</span>
<span class="sd"> :rtype: bool</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="k">with</span> <span class="nb">open</span><span class="p">(</span><span class="s2">&quot;/proc/mounts&quot;</span><span class="p">)</span> <span class="k">as</span> <span class="n">mounts</span><span class="p">:</span>
<span class="k">for</span> <span class="n">mnt</span> <span class="ow">in</span> <span class="n">mounts</span><span class="p">:</span>
<span class="n">fields</span> <span class="o">=</span> <span class="n">mnt</span><span class="o">.</span><span class="n">split</span><span class="p">()</span>
<span class="k">if</span> <span class="nb">len</span><span class="p">(</span><span class="n">fields</span><span class="p">)</span> <span class="o">&gt;</span> <span class="mi">2</span> <span class="ow">and</span> <span class="n">fields</span><span class="p">[</span><span class="mi">1</span><span class="p">]</span> <span class="o">==</span> <span class="n">disk_img</span><span class="p">:</span>
<span class="k">return</span> <span class="kc">True</span>
<span class="k">return</span> <span class="kc">False</span></div>
<div class="viewcode-block" id="find_ostree_root"><a class="viewcode-back" href="../../pylorax.html#pylorax.creator.find_ostree_root">[docs]</a><span class="k">def</span> <span class="nf">find_ostree_root</span><span class="p">(</span><span class="n">phys_root</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;</span>
<span class="sd"> Find root of ostree deployment</span>
<span class="sd"> :param str phys_root: Path to physical root</span>
<span class="sd"> :returns: Relative path of ostree deployment root</span>
<span class="sd"> :rtype: str</span>
<span class="sd"> :raise Exception: More than one deployment roots were found</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="n">ostree_root</span> <span class="o">=</span> <span class="s2">&quot;&quot;</span>
<span class="n">ostree_sysroots</span> <span class="o">=</span> <span class="n">glob</span><span class="o">.</span><span class="n">glob</span><span class="p">(</span><span class="n">joinpaths</span><span class="p">(</span><span class="n">phys_root</span><span class="p">,</span> <span class="s2">&quot;ostree/boot.?/*/*/0&quot;</span><span class="p">))</span>
<span class="n">log</span><span class="o">.</span><span class="n">debug</span><span class="p">(</span><span class="s2">&quot;ostree_sysroots = </span><span class="si">%s</span><span class="s2">&quot;</span><span class="p">,</span> <span class="n">ostree_sysroots</span><span class="p">)</span>
<span class="k">if</span> <span class="n">ostree_sysroots</span><span class="p">:</span>
<span class="k">if</span> <span class="nb">len</span><span class="p">(</span><span class="n">ostree_sysroots</span><span class="p">)</span> <span class="o">&gt;</span> <span class="mi">1</span><span class="p">:</span>
<span class="k">raise</span> <span class="ne">Exception</span><span class="p">(</span><span class="s2">&quot;Too many deployment roots found: </span><span class="si">%s</span><span class="s2">&quot;</span> <span class="o">%</span> <span class="n">ostree_sysroots</span><span class="p">)</span>
<span class="n">ostree_root</span> <span class="o">=</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">relpath</span><span class="p">(</span><span class="n">ostree_sysroots</span><span class="p">[</span><span class="mi">0</span><span class="p">],</span> <span class="n">phys_root</span><span class="p">)</span>
<span class="k">return</span> <span class="n">ostree_root</span></div>
<div class="viewcode-block" id="get_arch"><a class="viewcode-back" href="../../pylorax.html#pylorax.creator.get_arch">[docs]</a><span class="k">def</span> <span class="nf">get_arch</span><span class="p">(</span><span class="n">mount_dir</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;</span>
<span class="sd"> Get the kernel arch</span>
<span class="sd"> :returns: Arch of first kernel found at mount_dir/boot/ or i386</span>
<span class="sd"> :rtype: str</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="n">kernels</span> <span class="o">=</span> <span class="n">findkernels</span><span class="p">(</span><span class="n">mount_dir</span><span class="p">)</span>
<span class="k">if</span> <span class="ow">not</span> <span class="n">kernels</span><span class="p">:</span>
<span class="k">return</span> <span class="s2">&quot;i386&quot;</span>
<span class="k">return</span> <span class="n">kernels</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span><span class="o">.</span><span class="n">arch</span></div>
<div class="viewcode-block" id="squashfs_args"><a class="viewcode-back" href="../../pylorax.html#pylorax.creator.squashfs_args">[docs]</a><span class="k">def</span> <span class="nf">squashfs_args</span><span class="p">(</span><span class="n">opts</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot; Returns the compression type and args to use when making squashfs</span>
<span class="sd"> :param opts: ArgumentParser object with compression and compressopts</span>
<span class="sd"> :returns: tuple of compression type and args</span>
<span class="sd"> :rtype: tuple</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="n">compression</span> <span class="o">=</span> <span class="n">opts</span><span class="o">.</span><span class="n">compression</span> <span class="ow">or</span> <span class="s2">&quot;xz&quot;</span>
<span class="n">arch</span> <span class="o">=</span> <span class="n">ArchData</span><span class="p">(</span><span class="n">opts</span><span class="o">.</span><span class="n">arch</span> <span class="ow">or</span> <span class="n">os</span><span class="o">.</span><span class="n">uname</span><span class="p">()</span><span class="o">.</span><span class="n">machine</span><span class="p">)</span>
<span class="k">if</span> <span class="n">compression</span> <span class="o">==</span> <span class="s2">&quot;xz&quot;</span> <span class="ow">and</span> <span class="n">arch</span><span class="o">.</span><span class="n">bcj</span><span class="p">:</span>
<span class="n">compressargs</span> <span class="o">=</span> <span class="p">[</span><span class="s2">&quot;-Xbcj&quot;</span><span class="p">,</span> <span class="n">arch</span><span class="o">.</span><span class="n">bcj</span><span class="p">]</span>
<span class="k">else</span><span class="p">:</span>
<span class="n">compressargs</span> <span class="o">=</span> <span class="p">[]</span>
<span class="k">return</span> <span class="p">(</span><span class="n">compression</span><span class="p">,</span> <span class="n">compressargs</span><span class="p">)</span></div>
<div class="viewcode-block" id="make_appliance"><a class="viewcode-back" href="../../pylorax.html#pylorax.creator.make_appliance">[docs]</a><span class="k">def</span> <span class="nf">make_appliance</span><span class="p">(</span><span class="n">disk_img</span><span class="p">,</span> <span class="n">name</span><span class="p">,</span> <span class="n">template</span><span class="p">,</span> <span class="n">outfile</span><span class="p">,</span> <span class="n">networks</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">ram</span><span class="o">=</span><span class="mi">1024</span><span class="p">,</span>
<span class="n">vcpus</span><span class="o">=</span><span class="mi">1</span><span class="p">,</span> <span class="n">arch</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">title</span><span class="o">=</span><span class="s2">&quot;Linux&quot;</span><span class="p">,</span> <span class="n">project</span><span class="o">=</span><span class="s2">&quot;Linux&quot;</span><span class="p">,</span>
<span class="n">releasever</span><span class="o">=</span><span class="s2">&quot;29&quot;</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;</span>
<span class="sd"> Generate an appliance description file</span>
<span class="sd"> :param str disk_img: Full path of the disk image</span>
<span class="sd"> :param str name: Name of the appliance, passed to the template</span>
<span class="sd"> :param str template: Full path of Mako template</span>
<span class="sd"> :param str outfile: Full path of file to write, using template</span>
<span class="sd"> :param list networks: List of networks(str) from the kickstart</span>
<span class="sd"> :param int ram: Ram, in MiB, passed to template. Default is 1024</span>
<span class="sd"> :param int vcpus: CPUs, passed to template. Default is 1</span>
<span class="sd"> :param str arch: CPU architecture. Default is &#39;x86_64&#39;</span>
<span class="sd"> :param str title: Title, passed to template. Default is &#39;Linux&#39;</span>
<span class="sd"> :param str project: Project, passed to template. Default is &#39;Linux&#39;</span>
<span class="sd"> :param str releasever: Release version, passed to template. Default is 29</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="k">if</span> <span class="ow">not</span> <span class="p">(</span><span class="n">disk_img</span> <span class="ow">and</span> <span class="n">template</span> <span class="ow">and</span> <span class="n">outfile</span><span class="p">):</span>
<span class="k">return</span> <span class="kc">None</span>
<span class="n">log</span><span class="o">.</span><span class="n">info</span><span class="p">(</span><span class="s2">&quot;Creating appliance definition using </span><span class="si">%s</span><span class="s2">&quot;</span><span class="p">,</span> <span class="n">template</span><span class="p">)</span>
<span class="k">if</span> <span class="ow">not</span> <span class="n">arch</span><span class="p">:</span>
<span class="n">arch</span> <span class="o">=</span> <span class="s2">&quot;x86_64&quot;</span>
<span class="n">log</span><span class="o">.</span><span class="n">info</span><span class="p">(</span><span class="s2">&quot;Calculating SHA256 checksum of </span><span class="si">%s</span><span class="s2">&quot;</span><span class="p">,</span> <span class="n">disk_img</span><span class="p">)</span>
<span class="n">sha256</span> <span class="o">=</span> <span class="n">hashlib</span><span class="o">.</span><span class="n">sha256</span><span class="p">()</span>
<span class="k">with</span> <span class="nb">open</span><span class="p">(</span><span class="n">disk_img</span><span class="p">)</span> <span class="k">as</span> <span class="n">f</span><span class="p">:</span>
<span class="k">while</span> <span class="kc">True</span><span class="p">:</span>
<span class="n">data</span> <span class="o">=</span> <span class="n">f</span><span class="o">.</span><span class="n">read</span><span class="p">(</span><span class="mi">1024</span><span class="o">**</span><span class="mi">2</span><span class="p">)</span>
<span class="k">if</span> <span class="ow">not</span> <span class="n">data</span><span class="p">:</span>
<span class="k">break</span>
<span class="n">sha256</span><span class="o">.</span><span class="n">update</span><span class="p">(</span><span class="n">data</span><span class="p">)</span>
<span class="n">log</span><span class="o">.</span><span class="n">info</span><span class="p">(</span><span class="s2">&quot;SHA256 of </span><span class="si">%s</span><span class="s2"> is </span><span class="si">%s</span><span class="s2">&quot;</span><span class="p">,</span> <span class="n">disk_img</span><span class="p">,</span> <span class="n">sha256</span><span class="o">.</span><span class="n">hexdigest</span><span class="p">())</span>
<span class="n">disk_info</span> <span class="o">=</span> <span class="n">DataHolder</span><span class="p">(</span><span class="n">name</span><span class="o">=</span><span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">basename</span><span class="p">(</span><span class="n">disk_img</span><span class="p">),</span> <span class="nb">format</span><span class="o">=</span><span class="s2">&quot;raw&quot;</span><span class="p">,</span>
<span class="n">checksum_type</span><span class="o">=</span><span class="s2">&quot;sha256&quot;</span><span class="p">,</span> <span class="n">checksum</span><span class="o">=</span><span class="n">sha256</span><span class="o">.</span><span class="n">hexdigest</span><span class="p">())</span>
<span class="k">try</span><span class="p">:</span>
<span class="n">result</span> <span class="o">=</span> <span class="n">Template</span><span class="p">(</span><span class="n">filename</span><span class="o">=</span><span class="n">template</span><span class="p">)</span><span class="o">.</span><span class="n">render</span><span class="p">(</span><span class="n">disks</span><span class="o">=</span><span class="p">[</span><span class="n">disk_info</span><span class="p">],</span> <span class="n">name</span><span class="o">=</span><span class="n">name</span><span class="p">,</span>
<span class="n">arch</span><span class="o">=</span><span class="n">arch</span><span class="p">,</span> <span class="n">memory</span><span class="o">=</span><span class="n">ram</span><span class="p">,</span> <span class="n">vcpus</span><span class="o">=</span><span class="n">vcpus</span><span class="p">,</span> <span class="n">networks</span><span class="o">=</span><span class="n">networks</span><span class="p">,</span>
<span class="n">title</span><span class="o">=</span><span class="n">title</span><span class="p">,</span> <span class="n">project</span><span class="o">=</span><span class="n">project</span><span class="p">,</span> <span class="n">releasever</span><span class="o">=</span><span class="n">releasever</span><span class="p">)</span>
<span class="k">except</span> <span class="ne">Exception</span><span class="p">:</span>
<span class="n">log</span><span class="o">.</span><span class="n">error</span><span class="p">(</span><span class="n">text_error_template</span><span class="p">()</span><span class="o">.</span><span class="n">render</span><span class="p">())</span>
<span class="k">raise</span>
<span class="k">with</span> <span class="nb">open</span><span class="p">(</span><span class="n">outfile</span><span class="p">,</span> <span class="s2">&quot;w&quot;</span><span class="p">)</span> <span class="k">as</span> <span class="n">f</span><span class="p">:</span>
<span class="n">f</span><span class="o">.</span><span class="n">write</span><span class="p">(</span><span class="n">result</span><span class="p">)</span></div>
<div class="viewcode-block" id="make_runtime"><a class="viewcode-back" href="../../pylorax.html#pylorax.creator.make_runtime">[docs]</a><span class="k">def</span> <span class="nf">make_runtime</span><span class="p">(</span><span class="n">opts</span><span class="p">,</span> <span class="n">mount_dir</span><span class="p">,</span> <span class="n">work_dir</span><span class="p">,</span> <span class="n">size</span><span class="o">=</span><span class="kc">None</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;</span>
<span class="sd"> Make the squashfs image from a directory</span>
<span class="sd"> :param opts: options passed to livemedia-creator</span>
<span class="sd"> :type opts: argparse options</span>
<span class="sd"> :param str mount_dir: Directory tree to compress</span>
<span class="sd"> :param str work_dir: Output compressed image to work_dir+images/install.img</span>
<span class="sd"> :param int size: Size of disk image, in GiB</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="n">kernel_arch</span> <span class="o">=</span> <span class="n">get_arch</span><span class="p">(</span><span class="n">mount_dir</span><span class="p">)</span>
<span class="c1"># Fake dnf object</span>
<span class="n">fake_dbo</span> <span class="o">=</span> <span class="n">FakeDNF</span><span class="p">(</span><span class="n">conf</span><span class="o">=</span><span class="n">DataHolder</span><span class="p">(</span><span class="n">installroot</span><span class="o">=</span><span class="n">mount_dir</span><span class="p">))</span>
<span class="c1"># Fake arch with only basearch set</span>
<span class="n">arch</span> <span class="o">=</span> <span class="n">ArchData</span><span class="p">(</span><span class="n">kernel_arch</span><span class="p">)</span>
<span class="c1"># TODO: Need to get release info from someplace...</span>
<span class="n">product</span> <span class="o">=</span> <span class="n">DataHolder</span><span class="p">(</span><span class="n">name</span><span class="o">=</span><span class="n">opts</span><span class="o">.</span><span class="n">project</span><span class="p">,</span> <span class="n">version</span><span class="o">=</span><span class="n">opts</span><span class="o">.</span><span class="n">releasever</span><span class="p">,</span> <span class="n">release</span><span class="o">=</span><span class="s2">&quot;&quot;</span><span class="p">,</span>
<span class="n">variant</span><span class="o">=</span><span class="s2">&quot;&quot;</span><span class="p">,</span> <span class="n">bugurl</span><span class="o">=</span><span class="s2">&quot;&quot;</span><span class="p">,</span> <span class="n">isfinal</span><span class="o">=</span><span class="kc">False</span><span class="p">)</span>
<span class="c1"># This is a mounted image partition, cannot hardlink to it, so just use it</span>
<span class="c1"># symlink mount_dir/images to work_dir/images so we don&#39;t run out of space</span>
<span class="n">os</span><span class="o">.</span><span class="n">makedirs</span><span class="p">(</span><span class="n">joinpaths</span><span class="p">(</span><span class="n">work_dir</span><span class="p">,</span> <span class="s2">&quot;images&quot;</span><span class="p">))</span>
<span class="n">rb</span> <span class="o">=</span> <span class="n">RuntimeBuilder</span><span class="p">(</span><span class="n">product</span><span class="p">,</span> <span class="n">arch</span><span class="p">,</span> <span class="n">fake_dbo</span><span class="p">)</span>
<span class="n">compression</span><span class="p">,</span> <span class="n">compressargs</span> <span class="o">=</span> <span class="n">squashfs_args</span><span class="p">(</span><span class="n">opts</span><span class="p">)</span>
<span class="n">log</span><span class="o">.</span><span class="n">info</span><span class="p">(</span><span class="s2">&quot;Creating runtime&quot;</span><span class="p">)</span>
<span class="n">rb</span><span class="o">.</span><span class="n">create_runtime</span><span class="p">(</span><span class="n">joinpaths</span><span class="p">(</span><span class="n">work_dir</span><span class="p">,</span> <span class="n">RUNTIME</span><span class="p">),</span> <span class="n">size</span><span class="o">=</span><span class="n">size</span><span class="p">,</span>
<span class="n">compression</span><span class="o">=</span><span class="n">compression</span><span class="p">,</span> <span class="n">compressargs</span><span class="o">=</span><span class="n">compressargs</span><span class="p">)</span></div>
<div class="viewcode-block" id="rebuild_initrds_for_live"><a class="viewcode-back" href="../../pylorax.html#pylorax.creator.rebuild_initrds_for_live">[docs]</a><span class="k">def</span> <span class="nf">rebuild_initrds_for_live</span><span class="p">(</span><span class="n">opts</span><span class="p">,</span> <span class="n">sys_root_dir</span><span class="p">,</span> <span class="n">results_dir</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;</span>
<span class="sd"> Rebuild intrds for pxe live image (root=live:http://)</span>
<span class="sd"> :param opts: options passed to livemedia-creator</span>
<span class="sd"> :type opts: argparse options</span>
<span class="sd"> :param str sys_root_dir: Path to root of the system</span>
<span class="sd"> :param str results_dir: Path of directory for storing results</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="k">if</span> <span class="ow">not</span> <span class="n">opts</span><span class="o">.</span><span class="n">dracut_args</span><span class="p">:</span>
<span class="n">dracut_args</span> <span class="o">=</span> <span class="n">DRACUT_DEFAULT</span>
<span class="k">else</span><span class="p">:</span>
<span class="n">dracut_args</span> <span class="o">=</span> <span class="p">[]</span>
<span class="k">for</span> <span class="n">arg</span> <span class="ow">in</span> <span class="n">opts</span><span class="o">.</span><span class="n">dracut_args</span><span class="p">:</span>
<span class="n">dracut_args</span> <span class="o">+=</span> <span class="n">arg</span><span class="o">.</span><span class="n">split</span><span class="p">(</span><span class="s2">&quot; &quot;</span><span class="p">,</span> <span class="mi">1</span><span class="p">)</span>
<span class="n">log</span><span class="o">.</span><span class="n">info</span><span class="p">(</span><span class="s2">&quot;dracut args = </span><span class="si">%s</span><span class="s2">&quot;</span><span class="p">,</span> <span class="n">dracut_args</span><span class="p">)</span>
<span class="n">dracut</span> <span class="o">=</span> <span class="p">[</span><span class="s2">&quot;dracut&quot;</span><span class="p">,</span> <span class="s2">&quot;--nomdadmconf&quot;</span><span class="p">,</span> <span class="s2">&quot;--nolvmconf&quot;</span><span class="p">]</span> <span class="o">+</span> <span class="n">dracut_args</span>
<span class="n">kdir</span> <span class="o">=</span> <span class="s2">&quot;boot&quot;</span>
<span class="k">if</span> <span class="n">opts</span><span class="o">.</span><span class="n">ostree</span><span class="p">:</span>
<span class="n">kernels_dir</span> <span class="o">=</span> <span class="n">glob</span><span class="o">.</span><span class="n">glob</span><span class="p">(</span><span class="n">joinpaths</span><span class="p">(</span><span class="n">sys_root_dir</span><span class="p">,</span> <span class="s2">&quot;boot/ostree/*&quot;</span><span class="p">))</span>
<span class="k">if</span> <span class="n">kernels_dir</span><span class="p">:</span>
<span class="n">kdir</span> <span class="o">=</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">relpath</span><span class="p">(</span><span class="n">kernels_dir</span><span class="p">[</span><span class="mi">0</span><span class="p">],</span> <span class="n">sys_root_dir</span><span class="p">)</span>
<span class="n">kernels</span> <span class="o">=</span> <span class="p">[</span><span class="n">kernel</span> <span class="k">for</span> <span class="n">kernel</span> <span class="ow">in</span> <span class="n">findkernels</span><span class="p">(</span><span class="n">sys_root_dir</span><span class="p">,</span> <span class="n">kdir</span><span class="p">)]</span>
<span class="k">if</span> <span class="ow">not</span> <span class="n">kernels</span><span class="p">:</span>
<span class="k">raise</span> <span class="ne">Exception</span><span class="p">(</span><span class="s2">&quot;No initrds found, cannot rebuild_initrds&quot;</span><span class="p">)</span>
<span class="c1"># Hush some dracut warnings. TODO: bind-mount proc in place?</span>
<span class="nb">open</span><span class="p">(</span><span class="n">joinpaths</span><span class="p">(</span><span class="n">sys_root_dir</span><span class="p">,</span><span class="s2">&quot;/proc/modules&quot;</span><span class="p">),</span><span class="s2">&quot;w&quot;</span><span class="p">)</span>
<span class="k">if</span> <span class="n">opts</span><span class="o">.</span><span class="n">ostree</span><span class="p">:</span>
<span class="c1"># Dracut assumes to have some dirs in disk image</span>
<span class="c1"># /var/tmp for temp files</span>
<span class="n">vartmp_dir</span> <span class="o">=</span> <span class="n">joinpaths</span><span class="p">(</span><span class="n">sys_root_dir</span><span class="p">,</span> <span class="s2">&quot;var/tmp&quot;</span><span class="p">)</span>
<span class="k">if</span> <span class="ow">not</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">isdir</span><span class="p">(</span><span class="n">vartmp_dir</span><span class="p">):</span>
<span class="n">os</span><span class="o">.</span><span class="n">mkdir</span><span class="p">(</span><span class="n">vartmp_dir</span><span class="p">)</span>
<span class="c1"># /root (maybe not fatal)</span>
<span class="n">root_dir</span> <span class="o">=</span> <span class="n">joinpaths</span><span class="p">(</span><span class="n">sys_root_dir</span><span class="p">,</span> <span class="s2">&quot;var/roothome&quot;</span><span class="p">)</span>
<span class="k">if</span> <span class="ow">not</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">isdir</span><span class="p">(</span><span class="n">root_dir</span><span class="p">):</span>
<span class="n">os</span><span class="o">.</span><span class="n">mkdir</span><span class="p">(</span><span class="n">root_dir</span><span class="p">)</span>
<span class="c1"># /tmp (maybe not fatal)</span>
<span class="n">tmp_dir</span> <span class="o">=</span> <span class="n">joinpaths</span><span class="p">(</span><span class="n">sys_root_dir</span><span class="p">,</span> <span class="s2">&quot;sysroot/tmp&quot;</span><span class="p">)</span>
<span class="k">if</span> <span class="ow">not</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">isdir</span><span class="p">(</span><span class="n">tmp_dir</span><span class="p">):</span>
<span class="n">os</span><span class="o">.</span><span class="n">mkdir</span><span class="p">(</span><span class="n">tmp_dir</span><span class="p">)</span>
<span class="c1"># Write the new initramfs directly to the results directory</span>
<span class="n">os</span><span class="o">.</span><span class="n">mkdir</span><span class="p">(</span><span class="n">joinpaths</span><span class="p">(</span><span class="n">sys_root_dir</span><span class="p">,</span> <span class="s2">&quot;results&quot;</span><span class="p">))</span>
<span class="n">mount</span><span class="p">(</span><span class="n">results_dir</span><span class="p">,</span> <span class="n">opts</span><span class="o">=</span><span class="s2">&quot;bind&quot;</span><span class="p">,</span> <span class="n">mnt</span><span class="o">=</span><span class="n">joinpaths</span><span class="p">(</span><span class="n">sys_root_dir</span><span class="p">,</span> <span class="s2">&quot;results&quot;</span><span class="p">))</span>
<span class="c1"># Dracut runs out of space inside the minimal rootfs image</span>
<span class="n">mount</span><span class="p">(</span><span class="s2">&quot;/var/tmp&quot;</span><span class="p">,</span> <span class="n">opts</span><span class="o">=</span><span class="s2">&quot;bind&quot;</span><span class="p">,</span> <span class="n">mnt</span><span class="o">=</span><span class="n">joinpaths</span><span class="p">(</span><span class="n">sys_root_dir</span><span class="p">,</span> <span class="s2">&quot;var/tmp&quot;</span><span class="p">))</span>
<span class="k">for</span> <span class="n">kernel</span> <span class="ow">in</span> <span class="n">kernels</span><span class="p">:</span>
<span class="k">if</span> <span class="nb">hasattr</span><span class="p">(</span><span class="n">kernel</span><span class="p">,</span> <span class="s2">&quot;initrd&quot;</span><span class="p">):</span>
<span class="n">outfile</span> <span class="o">=</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">basename</span><span class="p">(</span><span class="n">kernel</span><span class="o">.</span><span class="n">initrd</span><span class="o">.</span><span class="n">path</span><span class="p">)</span>
<span class="k">else</span><span class="p">:</span>
<span class="c1"># Construct an initrd from the kernel name</span>
<span class="n">outfile</span> <span class="o">=</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">basename</span><span class="p">(</span><span class="n">kernel</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">replace</span><span class="p">(</span><span class="s2">&quot;vmlinuz-&quot;</span><span class="p">,</span> <span class="s2">&quot;initrd-&quot;</span><span class="p">)</span> <span class="o">+</span> <span class="s2">&quot;.img&quot;</span><span class="p">)</span>
<span class="n">log</span><span class="o">.</span><span class="n">info</span><span class="p">(</span><span class="s2">&quot;rebuilding </span><span class="si">%s</span><span class="s2">&quot;</span><span class="p">,</span> <span class="n">outfile</span><span class="p">)</span>
<span class="n">kver</span> <span class="o">=</span> <span class="n">kernel</span><span class="o">.</span><span class="n">version</span>
<span class="n">cmd</span> <span class="o">=</span> <span class="n">dracut</span> <span class="o">+</span> <span class="p">[</span><span class="s2">&quot;/results/&quot;</span><span class="o">+</span><span class="n">outfile</span><span class="p">,</span> <span class="n">kver</span><span class="p">]</span>
<span class="n">runcmd</span><span class="p">(</span><span class="n">cmd</span><span class="p">,</span> <span class="n">root</span><span class="o">=</span><span class="n">sys_root_dir</span><span class="p">)</span>
<span class="n">shutil</span><span class="o">.</span><span class="n">copy2</span><span class="p">(</span><span class="n">joinpaths</span><span class="p">(</span><span class="n">sys_root_dir</span><span class="p">,</span> <span class="n">kernel</span><span class="o">.</span><span class="n">path</span><span class="p">),</span> <span class="n">results_dir</span><span class="p">)</span>
<span class="n">umount</span><span class="p">(</span><span class="n">joinpaths</span><span class="p">(</span><span class="n">sys_root_dir</span><span class="p">,</span> <span class="s2">&quot;var/tmp&quot;</span><span class="p">),</span> <span class="n">delete</span><span class="o">=</span><span class="kc">False</span><span class="p">)</span>
<span class="n">umount</span><span class="p">(</span><span class="n">joinpaths</span><span class="p">(</span><span class="n">sys_root_dir</span><span class="p">,</span> <span class="s2">&quot;results&quot;</span><span class="p">),</span> <span class="n">delete</span><span class="o">=</span><span class="kc">False</span><span class="p">)</span>
<span class="n">os</span><span class="o">.</span><span class="n">unlink</span><span class="p">(</span><span class="n">joinpaths</span><span class="p">(</span><span class="n">sys_root_dir</span><span class="p">,</span><span class="s2">&quot;/proc/modules&quot;</span><span class="p">))</span></div>
<div class="viewcode-block" id="create_pxe_config"><a class="viewcode-back" href="../../pylorax.html#pylorax.creator.create_pxe_config">[docs]</a><span class="k">def</span> <span class="nf">create_pxe_config</span><span class="p">(</span><span class="n">template</span><span class="p">,</span> <span class="n">images_dir</span><span class="p">,</span> <span class="n">live_image_name</span><span class="p">,</span> <span class="n">add_args</span> <span class="o">=</span> <span class="kc">None</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;</span>
<span class="sd"> Create template for pxe to live configuration</span>
<span class="sd"> :param str images_dir: Path of directory with images to be used</span>
<span class="sd"> :param str live_image_name: Name of live rootfs image file</span>
<span class="sd"> :param list add_args: Arguments to be added to initrd= pxe config</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="n">add_args</span> <span class="o">=</span> <span class="n">add_args</span> <span class="ow">or</span> <span class="p">[]</span>
<span class="n">kernels</span> <span class="o">=</span> <span class="p">[</span><span class="n">kernel</span> <span class="k">for</span> <span class="n">kernel</span> <span class="ow">in</span> <span class="n">findkernels</span><span class="p">(</span><span class="n">images_dir</span><span class="p">,</span> <span class="n">kdir</span><span class="o">=</span><span class="s2">&quot;&quot;</span><span class="p">)</span>
<span class="k">if</span> <span class="nb">hasattr</span><span class="p">(</span><span class="n">kernel</span><span class="p">,</span> <span class="s2">&quot;initrd&quot;</span><span class="p">)]</span>
<span class="k">if</span> <span class="ow">not</span> <span class="n">kernels</span><span class="p">:</span>
<span class="k">return</span>
<span class="n">kernel</span> <span class="o">=</span> <span class="n">kernels</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span>
<span class="n">add_args_str</span> <span class="o">=</span> <span class="s2">&quot; &quot;</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="n">add_args</span><span class="p">)</span>
<span class="k">try</span><span class="p">:</span>
<span class="n">result</span> <span class="o">=</span> <span class="n">Template</span><span class="p">(</span><span class="n">filename</span><span class="o">=</span><span class="n">template</span><span class="p">)</span><span class="o">.</span><span class="n">render</span><span class="p">(</span><span class="n">kernel</span><span class="o">=</span><span class="n">kernel</span><span class="o">.</span><span class="n">path</span><span class="p">,</span>
<span class="n">initrd</span><span class="o">=</span><span class="n">kernel</span><span class="o">.</span><span class="n">initrd</span><span class="o">.</span><span class="n">path</span><span class="p">,</span> <span class="n">liveimg</span><span class="o">=</span><span class="n">live_image_name</span><span class="p">,</span>
<span class="n">addargs</span><span class="o">=</span><span class="n">add_args_str</span><span class="p">)</span>
<span class="k">except</span> <span class="ne">Exception</span><span class="p">:</span>
<span class="n">log</span><span class="o">.</span><span class="n">error</span><span class="p">(</span><span class="n">text_error_template</span><span class="p">()</span><span class="o">.</span><span class="n">render</span><span class="p">())</span>
<span class="k">raise</span>
<span class="k">with</span> <span class="nb">open</span> <span class="p">(</span><span class="n">joinpaths</span><span class="p">(</span><span class="n">images_dir</span><span class="p">,</span> <span class="s2">&quot;PXE_CONFIG&quot;</span><span class="p">),</span> <span class="s2">&quot;w&quot;</span><span class="p">)</span> <span class="k">as</span> <span class="n">f</span><span class="p">:</span>
<span class="n">f</span><span class="o">.</span><span class="n">write</span><span class="p">(</span><span class="n">result</span><span class="p">)</span></div>
<div class="viewcode-block" id="make_livecd"><a class="viewcode-back" href="../../pylorax.html#pylorax.creator.make_livecd">[docs]</a><span class="k">def</span> <span class="nf">make_livecd</span><span class="p">(</span><span class="n">opts</span><span class="p">,</span> <span class="n">mount_dir</span><span class="p">,</span> <span class="n">work_dir</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;</span>
<span class="sd"> Take the content from the disk image and make a livecd out of it</span>
<span class="sd"> :param opts: options passed to livemedia-creator</span>
<span class="sd"> :type opts: argparse options</span>
<span class="sd"> :param str mount_dir: Directory tree to compress</span>
<span class="sd"> :param str work_dir: Output compressed image to work_dir+images/install.img</span>
<span class="sd"> This uses wwood&#39;s squashfs live initramfs method:</span>
<span class="sd"> * put the real / into LiveOS/rootfs.img</span>
<span class="sd"> * make a squashfs of the LiveOS/rootfs.img tree</span>
<span class="sd"> * This is loaded by dracut when the cmdline is passed to the kernel:</span>
<span class="sd"> root=live:CDLABEL=&lt;volid&gt; rd.live.image</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="n">kernel_arch</span> <span class="o">=</span> <span class="n">get_arch</span><span class="p">(</span><span class="n">mount_dir</span><span class="p">)</span>
<span class="n">arch</span> <span class="o">=</span> <span class="n">ArchData</span><span class="p">(</span><span class="n">kernel_arch</span><span class="p">)</span>
<span class="c1"># TODO: Need to get release info from someplace...</span>
<span class="n">product</span> <span class="o">=</span> <span class="n">DataHolder</span><span class="p">(</span><span class="n">name</span><span class="o">=</span><span class="n">opts</span><span class="o">.</span><span class="n">project</span><span class="p">,</span> <span class="n">version</span><span class="o">=</span><span class="n">opts</span><span class="o">.</span><span class="n">releasever</span><span class="p">,</span> <span class="n">release</span><span class="o">=</span><span class="s2">&quot;&quot;</span><span class="p">,</span>
<span class="n">variant</span><span class="o">=</span><span class="s2">&quot;&quot;</span><span class="p">,</span> <span class="n">bugurl</span><span class="o">=</span><span class="s2">&quot;&quot;</span><span class="p">,</span> <span class="n">isfinal</span><span class="o">=</span><span class="kc">False</span><span class="p">)</span>
<span class="c1"># Link /images to work_dir/images to make the templates happy</span>
<span class="k">if</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">islink</span><span class="p">(</span><span class="n">joinpaths</span><span class="p">(</span><span class="n">mount_dir</span><span class="p">,</span> <span class="s2">&quot;images&quot;</span><span class="p">)):</span>
<span class="n">os</span><span class="o">.</span><span class="n">unlink</span><span class="p">(</span><span class="n">joinpaths</span><span class="p">(</span><span class="n">mount_dir</span><span class="p">,</span> <span class="s2">&quot;images&quot;</span><span class="p">))</span>
<span class="n">execWithRedirect</span><span class="p">(</span><span class="s2">&quot;/bin/ln&quot;</span><span class="p">,</span> <span class="p">[</span><span class="s2">&quot;-s&quot;</span><span class="p">,</span> <span class="n">joinpaths</span><span class="p">(</span><span class="n">work_dir</span><span class="p">,</span> <span class="s2">&quot;images&quot;</span><span class="p">),</span>
<span class="n">joinpaths</span><span class="p">(</span><span class="n">mount_dir</span><span class="p">,</span> <span class="s2">&quot;images&quot;</span><span class="p">)])</span>
<span class="c1"># The templates expect the config files to be in /tmp/config_files</span>
<span class="c1"># I think these should be release specific, not from lorax, but for now</span>
<span class="n">configdir</span> <span class="o">=</span> <span class="n">joinpaths</span><span class="p">(</span><span class="n">opts</span><span class="o">.</span><span class="n">lorax_templates</span><span class="p">,</span><span class="s2">&quot;live/config_files/&quot;</span><span class="p">)</span>
<span class="n">configdir_path</span> <span class="o">=</span> <span class="s2">&quot;tmp/config_files&quot;</span>
<span class="n">fullpath</span> <span class="o">=</span> <span class="n">joinpaths</span><span class="p">(</span><span class="n">mount_dir</span><span class="p">,</span> <span class="n">configdir_path</span><span class="p">)</span>
<span class="k">if</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">exists</span><span class="p">(</span><span class="n">fullpath</span><span class="p">):</span>
<span class="n">remove</span><span class="p">(</span><span class="n">fullpath</span><span class="p">)</span>
<span class="n">copytree</span><span class="p">(</span><span class="n">configdir</span><span class="p">,</span> <span class="n">fullpath</span><span class="p">)</span>
<span class="n">isolabel</span> <span class="o">=</span> <span class="n">opts</span><span class="o">.</span><span class="n">volid</span> <span class="ow">or</span> <span class="s2">&quot;</span><span class="si">{0.name}</span><span class="s2">-</span><span class="si">{0.version}</span><span class="s2">-</span><span class="si">{1.basearch}</span><span class="s2">&quot;</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="n">product</span><span class="p">,</span> <span class="n">arch</span><span class="p">)</span>
<span class="k">if</span> <span class="nb">len</span><span class="p">(</span><span class="n">isolabel</span><span class="p">)</span> <span class="o">&gt;</span> <span class="mi">32</span><span class="p">:</span>
<span class="n">isolabel</span> <span class="o">=</span> <span class="n">isolabel</span><span class="p">[:</span><span class="mi">32</span><span class="p">]</span>
<span class="n">log</span><span class="o">.</span><span class="n">warning</span><span class="p">(</span><span class="s2">&quot;Truncating isolabel to 32 chars: </span><span class="si">%s</span><span class="s2">&quot;</span><span class="p">,</span> <span class="n">isolabel</span><span class="p">)</span>
<span class="n">tb</span> <span class="o">=</span> <span class="n">TreeBuilder</span><span class="p">(</span><span class="n">product</span><span class="o">=</span><span class="n">product</span><span class="p">,</span> <span class="n">arch</span><span class="o">=</span><span class="n">arch</span><span class="p">,</span> <span class="n">domacboot</span><span class="o">=</span><span class="n">opts</span><span class="o">.</span><span class="n">domacboot</span><span class="p">,</span>
<span class="n">inroot</span><span class="o">=</span><span class="n">mount_dir</span><span class="p">,</span> <span class="n">outroot</span><span class="o">=</span><span class="n">work_dir</span><span class="p">,</span>
<span class="n">runtime</span><span class="o">=</span><span class="n">RUNTIME</span><span class="p">,</span> <span class="n">isolabel</span><span class="o">=</span><span class="n">isolabel</span><span class="p">,</span>
<span class="n">templatedir</span><span class="o">=</span><span class="n">joinpaths</span><span class="p">(</span><span class="n">opts</span><span class="o">.</span><span class="n">lorax_templates</span><span class="p">,</span><span class="s2">&quot;live/&quot;</span><span class="p">))</span>
<span class="n">log</span><span class="o">.</span><span class="n">info</span><span class="p">(</span><span class="s2">&quot;Rebuilding initrds&quot;</span><span class="p">)</span>
<span class="k">if</span> <span class="ow">not</span> <span class="n">opts</span><span class="o">.</span><span class="n">dracut_args</span><span class="p">:</span>
<span class="n">dracut_args</span> <span class="o">=</span> <span class="n">DRACUT_DEFAULT</span>
<span class="k">else</span><span class="p">:</span>
<span class="n">dracut_args</span> <span class="o">=</span> <span class="p">[]</span>
<span class="k">for</span> <span class="n">arg</span> <span class="ow">in</span> <span class="n">opts</span><span class="o">.</span><span class="n">dracut_args</span><span class="p">:</span>
<span class="n">dracut_args</span> <span class="o">+=</span> <span class="n">arg</span><span class="o">.</span><span class="n">split</span><span class="p">(</span><span class="s2">&quot; &quot;</span><span class="p">,</span> <span class="mi">1</span><span class="p">)</span>
<span class="n">log</span><span class="o">.</span><span class="n">info</span><span class="p">(</span><span class="s2">&quot;dracut args = </span><span class="si">%s</span><span class="s2">&quot;</span><span class="p">,</span> <span class="n">dracut_args</span><span class="p">)</span>
<span class="n">tb</span><span class="o">.</span><span class="n">rebuild_initrds</span><span class="p">(</span><span class="n">add_args</span><span class="o">=</span><span class="n">dracut_args</span><span class="p">)</span>
<span class="n">log</span><span class="o">.</span><span class="n">info</span><span class="p">(</span><span class="s2">&quot;Building boot.iso&quot;</span><span class="p">)</span>
<span class="n">tb</span><span class="o">.</span><span class="n">build</span><span class="p">()</span>
<span class="k">return</span> <span class="n">work_dir</span></div>
<div class="viewcode-block" id="mount_boot_part_over_root"><a class="viewcode-back" href="../../pylorax.html#pylorax.creator.mount_boot_part_over_root">[docs]</a><span class="k">def</span> <span class="nf">mount_boot_part_over_root</span><span class="p">(</span><span class="n">img_mount</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;</span>
<span class="sd"> Mount boot partition to /boot of root fs mounted in img_mount</span>
<span class="sd"> Used for OSTree so it finds deployment configurations on live rootfs</span>
<span class="sd"> param img_mount: object with mounted disk image root partition</span>
<span class="sd"> type img_mount: imgutils.PartitionMount</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="n">root_dir</span> <span class="o">=</span> <span class="n">img_mount</span><span class="o">.</span><span class="n">mount_dir</span>
<span class="n">is_boot_part</span> <span class="o">=</span> <span class="k">lambda</span> <span class="nb">dir</span><span class="p">:</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">exists</span><span class="p">(</span><span class="nb">dir</span><span class="o">+</span><span class="s2">&quot;/loader.0&quot;</span><span class="p">)</span>
<span class="n">tmp_mount_dir</span> <span class="o">=</span> <span class="n">tempfile</span><span class="o">.</span><span class="n">mkdtemp</span><span class="p">(</span><span class="n">prefix</span><span class="o">=</span><span class="s2">&quot;lmc-tmpdir-&quot;</span><span class="p">)</span>
<span class="n">sysroot_boot_dir</span> <span class="o">=</span> <span class="kc">None</span>
<span class="k">for</span> <span class="n">dev</span><span class="p">,</span> <span class="n">_size</span> <span class="ow">in</span> <span class="n">img_mount</span><span class="o">.</span><span class="n">loop_devices</span><span class="p">:</span>
<span class="k">if</span> <span class="n">dev</span> <span class="ow">is</span> <span class="n">img_mount</span><span class="o">.</span><span class="n">mount_dev</span><span class="p">:</span>
<span class="k">continue</span>
<span class="k">try</span><span class="p">:</span>
<span class="n">mount</span><span class="p">(</span><span class="s2">&quot;/dev/mapper/&quot;</span><span class="o">+</span><span class="n">dev</span><span class="p">,</span> <span class="n">mnt</span><span class="o">=</span><span class="n">tmp_mount_dir</span><span class="p">)</span>
<span class="k">if</span> <span class="n">is_boot_part</span><span class="p">(</span><span class="n">tmp_mount_dir</span><span class="p">):</span>
<span class="n">umount</span><span class="p">(</span><span class="n">tmp_mount_dir</span><span class="p">)</span>
<span class="n">sysroot_boot_dir</span> <span class="o">=</span> <span class="n">joinpaths</span><span class="p">(</span><span class="n">root_dir</span><span class="p">,</span> <span class="s2">&quot;boot&quot;</span><span class="p">)</span>
<span class="n">mount</span><span class="p">(</span><span class="s2">&quot;/dev/mapper/&quot;</span><span class="o">+</span><span class="n">dev</span><span class="p">,</span> <span class="n">mnt</span><span class="o">=</span><span class="n">sysroot_boot_dir</span><span class="p">)</span>
<span class="k">break</span>
<span class="k">else</span><span class="p">:</span>
<span class="n">umount</span><span class="p">(</span><span class="n">tmp_mount_dir</span><span class="p">)</span>
<span class="k">except</span> <span class="n">subprocess</span><span class="o">.</span><span class="n">CalledProcessError</span> <span class="k">as</span> <span class="n">e</span><span class="p">:</span>
<span class="n">log</span><span class="o">.</span><span class="n">debug</span><span class="p">(</span><span class="s2">&quot;Looking for boot partition error: </span><span class="si">%s</span><span class="s2">&quot;</span><span class="p">,</span> <span class="n">e</span><span class="p">)</span>
<span class="n">remove</span><span class="p">(</span><span class="n">tmp_mount_dir</span><span class="p">)</span>
<span class="k">return</span> <span class="n">sysroot_boot_dir</span></div>
<div class="viewcode-block" id="make_squashfs"><a class="viewcode-back" href="../../pylorax.html#pylorax.creator.make_squashfs">[docs]</a><span class="k">def</span> <span class="nf">make_squashfs</span><span class="p">(</span><span class="n">opts</span><span class="p">,</span> <span class="n">disk_img</span><span class="p">,</span> <span class="n">work_dir</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;</span>
<span class="sd"> Create a squashfs image of an unpartitioned filesystem disk image</span>
<span class="sd"> :param str disk_img: Path to the unpartitioned filesystem disk image</span>
<span class="sd"> :param str work_dir: Output compressed image to work_dir+images/install.img</span>
<span class="sd"> :param str compression: Compression type to use</span>
<span class="sd"> :returns: True if squashfs creation was successful. False if there was an error.</span>
<span class="sd"> :rtype: bool</span>
<span class="sd"> Take disk_img and put it into LiveOS/rootfs.img and squashfs this</span>
<span class="sd"> tree into work_dir+images/install.img</span>
<span class="sd"> fsck.ext4 is run on the disk image to make sure there are no errors and to zero</span>
<span class="sd"> out any deleted blocks to make it compress better. If this fails for any reason</span>
<span class="sd"> it will return False and log the error.</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="c1"># Make sure free blocks are actually zeroed so it will compress</span>
<span class="n">rc</span> <span class="o">=</span> <span class="n">execWithRedirect</span><span class="p">(</span><span class="s2">&quot;/usr/sbin/fsck.ext4&quot;</span><span class="p">,</span> <span class="p">[</span><span class="s2">&quot;-y&quot;</span><span class="p">,</span> <span class="s2">&quot;-f&quot;</span><span class="p">,</span> <span class="s2">&quot;-E&quot;</span><span class="p">,</span> <span class="s2">&quot;discard&quot;</span><span class="p">,</span> <span class="n">disk_img</span><span class="p">])</span>
<span class="k">if</span> <span class="n">rc</span> <span class="o">!=</span> <span class="mi">0</span><span class="p">:</span>
<span class="n">log</span><span class="o">.</span><span class="n">error</span><span class="p">(</span><span class="s2">&quot;Problem zeroing free blocks of </span><span class="si">%s</span><span class="s2">&quot;</span><span class="p">,</span> <span class="n">disk_img</span><span class="p">)</span>
<span class="k">return</span> <span class="kc">False</span>
<span class="n">liveos_dir</span> <span class="o">=</span> <span class="n">joinpaths</span><span class="p">(</span><span class="n">work_dir</span><span class="p">,</span> <span class="s2">&quot;runtime/LiveOS&quot;</span><span class="p">)</span>
<span class="n">os</span><span class="o">.</span><span class="n">makedirs</span><span class="p">(</span><span class="n">liveos_dir</span><span class="p">)</span>
<span class="n">os</span><span class="o">.</span><span class="n">makedirs</span><span class="p">(</span><span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">dirname</span><span class="p">(</span><span class="n">joinpaths</span><span class="p">(</span><span class="n">work_dir</span><span class="p">,</span> <span class="n">RUNTIME</span><span class="p">)))</span>
<span class="n">rc</span> <span class="o">=</span> <span class="n">execWithRedirect</span><span class="p">(</span><span class="s2">&quot;/bin/ln&quot;</span><span class="p">,</span> <span class="p">[</span><span class="n">disk_img</span><span class="p">,</span> <span class="n">joinpaths</span><span class="p">(</span><span class="n">liveos_dir</span><span class="p">,</span> <span class="s2">&quot;rootfs.img&quot;</span><span class="p">)])</span>
<span class="k">if</span> <span class="n">rc</span> <span class="o">!=</span> <span class="mi">0</span><span class="p">:</span>
<span class="n">shutil</span><span class="o">.</span><span class="n">copy2</span><span class="p">(</span><span class="n">disk_img</span><span class="p">,</span> <span class="n">joinpaths</span><span class="p">(</span><span class="n">liveos_dir</span><span class="p">,</span> <span class="s2">&quot;rootfs.img&quot;</span><span class="p">))</span>
<span class="n">compression</span><span class="p">,</span> <span class="n">compressargs</span> <span class="o">=</span> <span class="n">squashfs_args</span><span class="p">(</span><span class="n">opts</span><span class="p">)</span>
<span class="n">mksquashfs</span><span class="p">(</span><span class="n">joinpaths</span><span class="p">(</span><span class="n">work_dir</span><span class="p">,</span> <span class="s2">&quot;runtime&quot;</span><span class="p">),</span>
<span class="n">joinpaths</span><span class="p">(</span><span class="n">work_dir</span><span class="p">,</span> <span class="n">RUNTIME</span><span class="p">),</span> <span class="n">compression</span><span class="p">,</span> <span class="n">compressargs</span><span class="p">)</span>
<span class="n">remove</span><span class="p">(</span><span class="n">joinpaths</span><span class="p">(</span><span class="n">work_dir</span><span class="p">,</span> <span class="s2">&quot;runtime&quot;</span><span class="p">))</span>
<span class="k">return</span> <span class="kc">True</span></div>
<div class="viewcode-block" id="calculate_disk_size"><a class="viewcode-back" href="../../pylorax.html#pylorax.creator.calculate_disk_size">[docs]</a><span class="k">def</span> <span class="nf">calculate_disk_size</span><span class="p">(</span><span class="n">opts</span><span class="p">,</span> <span class="n">ks</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot; Calculate the disk size from the kickstart</span>
<span class="sd"> :param opts: options passed to livemedia-creator</span>
<span class="sd"> :type opts: argparse options</span>
<span class="sd"> :param str ks: Path to the kickstart to use for the installation</span>
<span class="sd"> :returns: Disk size in MiB</span>
<span class="sd"> :rtype: int</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="c1"># Disk size for a filesystem image should only be the size of /</span>
<span class="c1"># to prevent surprises when using the same kickstart for different installations.</span>
<span class="n">unique_partitions</span> <span class="o">=</span> <span class="nb">dict</span><span class="p">((</span><span class="n">p</span><span class="o">.</span><span class="n">mountpoint</span><span class="p">,</span> <span class="n">p</span><span class="p">)</span> <span class="k">for</span> <span class="n">p</span> <span class="ow">in</span> <span class="n">ks</span><span class="o">.</span><span class="n">handler</span><span class="o">.</span><span class="n">partition</span><span class="o">.</span><span class="n">partitions</span><span class="p">)</span>
<span class="k">if</span> <span class="n">opts</span><span class="o">.</span><span class="n">no_virt</span> <span class="ow">and</span> <span class="p">(</span><span class="n">opts</span><span class="o">.</span><span class="n">make_iso</span> <span class="ow">or</span> <span class="n">opts</span><span class="o">.</span><span class="n">make_fsimage</span><span class="p">):</span>
<span class="n">disk_size</span> <span class="o">=</span> <span class="mi">2</span> <span class="o">+</span> <span class="nb">sum</span><span class="p">(</span><span class="n">p</span><span class="o">.</span><span class="n">size</span> <span class="k">for</span> <span class="n">p</span> <span class="ow">in</span> <span class="n">unique_partitions</span><span class="o">.</span><span class="n">values</span><span class="p">()</span> <span class="k">if</span> <span class="n">p</span><span class="o">.</span><span class="n">mountpoint</span> <span class="o">==</span> <span class="s2">&quot;/&quot;</span><span class="p">)</span>
<span class="k">else</span><span class="p">:</span>
<span class="n">disk_size</span> <span class="o">=</span> <span class="mi">2</span> <span class="o">+</span> <span class="nb">sum</span><span class="p">(</span><span class="n">p</span><span class="o">.</span><span class="n">size</span> <span class="k">for</span> <span class="n">p</span> <span class="ow">in</span> <span class="n">unique_partitions</span><span class="o">.</span><span class="n">values</span><span class="p">())</span>
<span class="n">log</span><span class="o">.</span><span class="n">info</span><span class="p">(</span><span class="s2">&quot;Using disk size of </span><span class="si">%s</span><span class="s2">MiB&quot;</span><span class="p">,</span> <span class="n">disk_size</span><span class="p">)</span>
<span class="k">return</span> <span class="n">disk_size</span></div>
<div class="viewcode-block" id="make_image"><a class="viewcode-back" href="../../pylorax.html#pylorax.creator.make_image">[docs]</a><span class="k">def</span> <span class="nf">make_image</span><span class="p">(</span><span class="n">opts</span><span class="p">,</span> <span class="n">ks</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;</span>
<span class="sd"> Install to a disk image</span>
<span class="sd"> :param opts: options passed to livemedia-creator</span>
<span class="sd"> :type opts: argparse options</span>
<span class="sd"> :param str ks: Path to the kickstart to use for the installation</span>
<span class="sd"> :returns: Path of the image created</span>
<span class="sd"> :rtype: str</span>
<span class="sd"> Use qemu+boot.iso or anaconda to install to a disk image.</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="k">if</span> <span class="n">opts</span><span class="o">.</span><span class="n">image_name</span><span class="p">:</span>
<span class="n">disk_img</span> <span class="o">=</span> <span class="n">joinpaths</span><span class="p">(</span><span class="n">opts</span><span class="o">.</span><span class="n">result_dir</span><span class="p">,</span> <span class="n">opts</span><span class="o">.</span><span class="n">image_name</span><span class="p">)</span>
<span class="k">else</span><span class="p">:</span>
<span class="n">disk_img</span> <span class="o">=</span> <span class="n">tempfile</span><span class="o">.</span><span class="n">mktemp</span><span class="p">(</span><span class="n">prefix</span><span class="o">=</span><span class="s2">&quot;lmc-disk-&quot;</span><span class="p">,</span> <span class="n">suffix</span><span class="o">=</span><span class="s2">&quot;.img&quot;</span><span class="p">,</span> <span class="nb">dir</span><span class="o">=</span><span class="n">opts</span><span class="o">.</span><span class="n">result_dir</span><span class="p">)</span>
<span class="n">log</span><span class="o">.</span><span class="n">info</span><span class="p">(</span><span class="s2">&quot;disk_img = </span><span class="si">%s</span><span class="s2">&quot;</span><span class="p">,</span> <span class="n">disk_img</span><span class="p">)</span>
<span class="n">disk_size</span> <span class="o">=</span> <span class="n">calculate_disk_size</span><span class="p">(</span><span class="n">opts</span><span class="p">,</span> <span class="n">ks</span><span class="p">)</span>
<span class="k">try</span><span class="p">:</span>
<span class="k">if</span> <span class="n">opts</span><span class="o">.</span><span class="n">no_virt</span><span class="p">:</span>
<span class="n">novirt_install</span><span class="p">(</span><span class="n">opts</span><span class="p">,</span> <span class="n">disk_img</span><span class="p">,</span> <span class="n">disk_size</span><span class="p">)</span>
<span class="k">else</span><span class="p">:</span>
<span class="n">install_log</span> <span class="o">=</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">abspath</span><span class="p">(</span><span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">dirname</span><span class="p">(</span><span class="n">opts</span><span class="o">.</span><span class="n">logfile</span><span class="p">))</span><span class="o">+</span><span class="s2">&quot;/virt-install.log&quot;</span>
<span class="n">log</span><span class="o">.</span><span class="n">info</span><span class="p">(</span><span class="s2">&quot;install_log = </span><span class="si">%s</span><span class="s2">&quot;</span><span class="p">,</span> <span class="n">install_log</span><span class="p">)</span>
<span class="n">virt_install</span><span class="p">(</span><span class="n">opts</span><span class="p">,</span> <span class="n">install_log</span><span class="p">,</span> <span class="n">disk_img</span><span class="p">,</span> <span class="n">disk_size</span><span class="p">)</span>
<span class="k">except</span> <span class="n">InstallError</span> <span class="k">as</span> <span class="n">e</span><span class="p">:</span>
<span class="n">log</span><span class="o">.</span><span class="n">error</span><span class="p">(</span><span class="s2">&quot;Install failed: </span><span class="si">%s</span><span class="s2">&quot;</span><span class="p">,</span> <span class="n">e</span><span class="p">)</span>
<span class="k">if</span> <span class="ow">not</span> <span class="n">opts</span><span class="o">.</span><span class="n">keep_image</span> <span class="ow">and</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">exists</span><span class="p">(</span><span class="n">disk_img</span><span class="p">):</span>
<span class="n">log</span><span class="o">.</span><span class="n">info</span><span class="p">(</span><span class="s2">&quot;Removing bad disk image&quot;</span><span class="p">)</span>
<span class="n">os</span><span class="o">.</span><span class="n">unlink</span><span class="p">(</span><span class="n">disk_img</span><span class="p">)</span>
<span class="k">raise</span>
<span class="n">log</span><span class="o">.</span><span class="n">info</span><span class="p">(</span><span class="s2">&quot;Disk Image install successful&quot;</span><span class="p">)</span>
<span class="k">return</span> <span class="n">disk_img</span></div>
<div class="viewcode-block" id="make_live_images"><a class="viewcode-back" href="../../pylorax.html#pylorax.creator.make_live_images">[docs]</a><span class="k">def</span> <span class="nf">make_live_images</span><span class="p">(</span><span class="n">opts</span><span class="p">,</span> <span class="n">work_dir</span><span class="p">,</span> <span class="n">disk_img</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;</span>
<span class="sd"> Create live images from direcory or rootfs image</span>
<span class="sd"> :param opts: options passed to livemedia-creator</span>
<span class="sd"> :type opts: argparse options</span>
<span class="sd"> :param str work_dir: Directory for storing results</span>
<span class="sd"> :param str disk_img: Path to disk image (fsimage or partitioned)</span>
<span class="sd"> :returns: Path of directory with created images or None</span>
<span class="sd"> :rtype: str</span>
<span class="sd"> fsck.ext4 is run on the rootfs_image to make sure there are no errors and to zero</span>
<span class="sd"> out any deleted blocks to make it compress better. If this fails for any reason</span>
<span class="sd"> it will return None and log the error.</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="n">sys_root</span> <span class="o">=</span> <span class="s2">&quot;&quot;</span>
<span class="n">squashfs_root_dir</span> <span class="o">=</span> <span class="n">joinpaths</span><span class="p">(</span><span class="n">work_dir</span><span class="p">,</span> <span class="s2">&quot;squashfs_root&quot;</span><span class="p">)</span>
<span class="n">liveos_dir</span> <span class="o">=</span> <span class="n">joinpaths</span><span class="p">(</span><span class="n">squashfs_root_dir</span><span class="p">,</span> <span class="s2">&quot;LiveOS&quot;</span><span class="p">)</span>
<span class="n">os</span><span class="o">.</span><span class="n">makedirs</span><span class="p">(</span><span class="n">liveos_dir</span><span class="p">)</span>
<span class="n">rootfs_img</span> <span class="o">=</span> <span class="n">joinpaths</span><span class="p">(</span><span class="n">liveos_dir</span><span class="p">,</span> <span class="s2">&quot;rootfs.img&quot;</span><span class="p">)</span>
<span class="k">if</span> <span class="n">opts</span><span class="o">.</span><span class="n">fs_image</span> <span class="ow">or</span> <span class="n">opts</span><span class="o">.</span><span class="n">no_virt</span><span class="p">:</span>
<span class="c1"># Find the ostree root in the fsimage</span>
<span class="k">if</span> <span class="n">opts</span><span class="o">.</span><span class="n">ostree</span><span class="p">:</span>
<span class="k">with</span> <span class="n">Mount</span><span class="p">(</span><span class="n">disk_img</span><span class="p">,</span> <span class="n">opts</span><span class="o">=</span><span class="s2">&quot;loop&quot;</span><span class="p">)</span> <span class="k">as</span> <span class="n">mnt_dir</span><span class="p">:</span>
<span class="n">sys_root</span> <span class="o">=</span> <span class="n">find_ostree_root</span><span class="p">(</span><span class="n">mnt_dir</span><span class="p">)</span>
<span class="c1"># Try to hardlink the image, if that fails, copy it</span>
<span class="n">rc</span> <span class="o">=</span> <span class="n">execWithRedirect</span><span class="p">(</span><span class="s2">&quot;/bin/ln&quot;</span><span class="p">,</span> <span class="p">[</span><span class="n">disk_img</span><span class="p">,</span> <span class="n">rootfs_img</span><span class="p">])</span>
<span class="k">if</span> <span class="n">rc</span> <span class="o">!=</span> <span class="mi">0</span><span class="p">:</span>
<span class="n">shutil</span><span class="o">.</span><span class="n">copy2</span><span class="p">(</span><span class="n">disk_img</span><span class="p">,</span> <span class="n">rootfs_img</span><span class="p">)</span>
<span class="k">else</span><span class="p">:</span>
<span class="n">is_root_part</span> <span class="o">=</span> <span class="kc">None</span>
<span class="k">if</span> <span class="n">opts</span><span class="o">.</span><span class="n">ostree</span><span class="p">:</span>
<span class="n">is_root_part</span> <span class="o">=</span> <span class="k">lambda</span> <span class="nb">dir</span><span class="p">:</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">exists</span><span class="p">(</span><span class="nb">dir</span><span class="o">+</span><span class="s2">&quot;/ostree/deploy&quot;</span><span class="p">)</span>
<span class="k">with</span> <span class="n">PartitionMount</span><span class="p">(</span><span class="n">disk_img</span><span class="p">,</span> <span class="n">mount_ok</span><span class="o">=</span><span class="n">is_root_part</span><span class="p">)</span> <span class="k">as</span> <span class="n">img_mount</span><span class="p">:</span>
<span class="k">if</span> <span class="n">img_mount</span> <span class="ow">and</span> <span class="n">img_mount</span><span class="o">.</span><span class="n">mount_dir</span><span class="p">:</span>
<span class="k">try</span><span class="p">:</span>
<span class="n">mounted_sysroot_boot_dir</span> <span class="o">=</span> <span class="kc">None</span>
<span class="k">if</span> <span class="n">opts</span><span class="o">.</span><span class="n">ostree</span><span class="p">:</span>
<span class="n">sys_root</span> <span class="o">=</span> <span class="n">find_ostree_root</span><span class="p">(</span><span class="n">img_mount</span><span class="o">.</span><span class="n">mount_dir</span><span class="p">)</span>
<span class="n">mounted_sysroot_boot_dir</span> <span class="o">=</span> <span class="n">mount_boot_part_over_root</span><span class="p">(</span><span class="n">img_mount</span><span class="p">)</span>
<span class="k">if</span> <span class="n">opts</span><span class="o">.</span><span class="n">live_rootfs_keep_size</span><span class="p">:</span>
<span class="n">size</span> <span class="o">=</span> <span class="n">img_mount</span><span class="o">.</span><span class="n">mount_size</span> <span class="o">/</span> <span class="mi">1024</span><span class="o">**</span><span class="mi">3</span>
<span class="k">else</span><span class="p">:</span>
<span class="n">size</span> <span class="o">=</span> <span class="n">opts</span><span class="o">.</span><span class="n">live_rootfs_size</span> <span class="ow">or</span> <span class="kc">None</span>
<span class="n">log</span><span class="o">.</span><span class="n">info</span><span class="p">(</span><span class="s2">&quot;Creating live rootfs image&quot;</span><span class="p">)</span>
<span class="n">mkrootfsimg</span><span class="p">(</span><span class="n">img_mount</span><span class="o">.</span><span class="n">mount_dir</span><span class="p">,</span> <span class="n">rootfs_img</span><span class="p">,</span> <span class="s2">&quot;LiveOS&quot;</span><span class="p">,</span> <span class="n">size</span><span class="o">=</span><span class="n">size</span><span class="p">,</span> <span class="n">sysroot</span><span class="o">=</span><span class="n">sys_root</span><span class="p">)</span>
<span class="k">finally</span><span class="p">:</span>
<span class="k">if</span> <span class="n">mounted_sysroot_boot_dir</span><span class="p">:</span>
<span class="n">umount</span><span class="p">(</span><span class="n">mounted_sysroot_boot_dir</span><span class="p">)</span>
<span class="n">log</span><span class="o">.</span><span class="n">debug</span><span class="p">(</span><span class="s2">&quot;sys_root = </span><span class="si">%s</span><span class="s2">&quot;</span><span class="p">,</span> <span class="n">sys_root</span><span class="p">)</span>
<span class="c1"># Make sure free blocks are actually zeroed so it will compress</span>
<span class="n">rc</span> <span class="o">=</span> <span class="n">execWithRedirect</span><span class="p">(</span><span class="s2">&quot;/usr/sbin/fsck.ext4&quot;</span><span class="p">,</span> <span class="p">[</span><span class="s2">&quot;-y&quot;</span><span class="p">,</span> <span class="s2">&quot;-f&quot;</span><span class="p">,</span> <span class="s2">&quot;-E&quot;</span><span class="p">,</span> <span class="s2">&quot;discard&quot;</span><span class="p">,</span> <span class="n">rootfs_img</span><span class="p">])</span>
<span class="k">if</span> <span class="n">rc</span> <span class="o">!=</span> <span class="mi">0</span><span class="p">:</span>
<span class="n">log</span><span class="o">.</span><span class="n">error</span><span class="p">(</span><span class="s2">&quot;Problem zeroing free blocks of </span><span class="si">%s</span><span class="s2">&quot;</span><span class="p">,</span> <span class="n">disk_img</span><span class="p">)</span>
<span class="k">return</span> <span class="kc">None</span>
<span class="n">log</span><span class="o">.</span><span class="n">info</span><span class="p">(</span><span class="s2">&quot;Packing live rootfs image&quot;</span><span class="p">)</span>
<span class="n">add_pxe_args</span> <span class="o">=</span> <span class="p">[]</span>
<span class="n">live_image_name</span> <span class="o">=</span> <span class="s2">&quot;live-rootfs.squashfs.img&quot;</span>
<span class="n">compression</span><span class="p">,</span> <span class="n">compressargs</span> <span class="o">=</span> <span class="n">squashfs_args</span><span class="p">(</span><span class="n">opts</span><span class="p">)</span>
<span class="n">mksquashfs</span><span class="p">(</span><span class="n">squashfs_root_dir</span><span class="p">,</span> <span class="n">joinpaths</span><span class="p">(</span><span class="n">work_dir</span><span class="p">,</span> <span class="n">live_image_name</span><span class="p">),</span> <span class="n">compression</span><span class="p">,</span> <span class="n">compressargs</span><span class="p">)</span>
<span class="n">log</span><span class="o">.</span><span class="n">info</span><span class="p">(</span><span class="s2">&quot;Rebuilding initramfs for live&quot;</span><span class="p">)</span>
<span class="k">with</span> <span class="n">Mount</span><span class="p">(</span><span class="n">rootfs_img</span><span class="p">,</span> <span class="n">opts</span><span class="o">=</span><span class="s2">&quot;loop&quot;</span><span class="p">)</span> <span class="k">as</span> <span class="n">mnt_dir</span><span class="p">:</span>
<span class="k">try</span><span class="p">:</span>
<span class="n">mount</span><span class="p">(</span><span class="n">joinpaths</span><span class="p">(</span><span class="n">mnt_dir</span><span class="p">,</span> <span class="s2">&quot;boot&quot;</span><span class="p">),</span> <span class="n">opts</span><span class="o">=</span><span class="s2">&quot;bind&quot;</span><span class="p">,</span> <span class="n">mnt</span><span class="o">=</span><span class="n">joinpaths</span><span class="p">(</span><span class="n">mnt_dir</span><span class="p">,</span> <span class="n">sys_root</span><span class="p">,</span> <span class="s2">&quot;boot&quot;</span><span class="p">))</span>
<span class="n">rebuild_initrds_for_live</span><span class="p">(</span><span class="n">opts</span><span class="p">,</span> <span class="n">joinpaths</span><span class="p">(</span><span class="n">mnt_dir</span><span class="p">,</span> <span class="n">sys_root</span><span class="p">),</span> <span class="n">work_dir</span><span class="p">)</span>
<span class="k">finally</span><span class="p">:</span>
<span class="n">umount</span><span class="p">(</span><span class="n">joinpaths</span><span class="p">(</span><span class="n">mnt_dir</span><span class="p">,</span> <span class="n">sys_root</span><span class="p">,</span> <span class="s2">&quot;boot&quot;</span><span class="p">),</span> <span class="n">delete</span><span class="o">=</span><span class="kc">False</span><span class="p">)</span>
<span class="n">remove</span><span class="p">(</span><span class="n">squashfs_root_dir</span><span class="p">)</span>
<span class="k">if</span> <span class="n">opts</span><span class="o">.</span><span class="n">ostree</span><span class="p">:</span>
<span class="n">add_pxe_args</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="s2">&quot;ostree=/</span><span class="si">%s</span><span class="s2">&quot;</span> <span class="o">%</span> <span class="n">sys_root</span><span class="p">)</span>
<span class="n">template</span> <span class="o">=</span> <span class="n">joinpaths</span><span class="p">(</span><span class="n">opts</span><span class="o">.</span><span class="n">lorax_templates</span><span class="p">,</span> <span class="s2">&quot;pxe-live/pxe-config.tmpl&quot;</span><span class="p">)</span>
<span class="n">create_pxe_config</span><span class="p">(</span><span class="n">template</span><span class="p">,</span> <span class="n">work_dir</span><span class="p">,</span> <span class="n">live_image_name</span><span class="p">,</span> <span class="n">add_pxe_args</span><span class="p">)</span>
<span class="k">return</span> <span class="n">work_dir</span></div>
<div class="viewcode-block" id="run_creator"><a class="viewcode-back" href="../../pylorax.html#pylorax.creator.run_creator">[docs]</a><span class="k">def</span> <span class="nf">run_creator</span><span class="p">(</span><span class="n">opts</span><span class="p">,</span> <span class="n">callback_func</span><span class="o">=</span><span class="kc">None</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;Run the image creator process</span>
<span class="sd"> :param opts: Commandline options to control the process</span>
<span class="sd"> :type opts: Either a DataHolder or ArgumentParser</span>
<span class="sd"> :returns: The result directory and the disk image path.</span>
<span class="sd"> :rtype: Tuple of str</span>
<span class="sd"> This function takes the opts arguments and creates the selected output image.</span>
<span class="sd"> See the cmdline --help for livemedia-creator for the possible options</span>
<span class="sd"> (Yes, this is not ideal, but we can fix that later)</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="n">result_dir</span> <span class="o">=</span> <span class="kc">None</span>
<span class="c1"># Parse the kickstart</span>
<span class="k">if</span> <span class="n">opts</span><span class="o">.</span><span class="n">ks</span><span class="p">:</span>
<span class="n">ks_version</span> <span class="o">=</span> <span class="n">makeVersion</span><span class="p">()</span>
<span class="n">ks</span> <span class="o">=</span> <span class="n">KickstartParser</span><span class="p">(</span><span class="n">ks_version</span><span class="p">,</span> <span class="n">errorsAreFatal</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="n">missingIncludeIsFatal</span><span class="o">=</span><span class="kc">False</span><span class="p">)</span>
<span class="n">ks</span><span class="o">.</span><span class="n">readKickstart</span><span class="p">(</span><span class="n">opts</span><span class="o">.</span><span class="n">ks</span><span class="p">[</span><span class="mi">0</span><span class="p">])</span>
<span class="c1"># live iso usually needs dracut-live so warn the user if it is missing</span>
<span class="k">if</span> <span class="n">opts</span><span class="o">.</span><span class="n">ks</span> <span class="ow">and</span> <span class="n">opts</span><span class="o">.</span><span class="n">make_iso</span><span class="p">:</span>
<span class="k">if</span> <span class="s2">&quot;dracut-live&quot;</span> <span class="ow">not</span> <span class="ow">in</span> <span class="n">ks</span><span class="o">.</span><span class="n">handler</span><span class="o">.</span><span class="n">packages</span><span class="o">.</span><span class="n">packageList</span><span class="p">:</span>
<span class="n">log</span><span class="o">.</span><span class="n">error</span><span class="p">(</span><span class="s2">&quot;dracut-live package is missing from the kickstart.&quot;</span><span class="p">)</span>
<span class="k">raise</span> <span class="ne">RuntimeError</span><span class="p">(</span><span class="s2">&quot;dracut-live package is missing from the kickstart.&quot;</span><span class="p">)</span>
<span class="c1"># Make the disk or filesystem image</span>
<span class="k">if</span> <span class="ow">not</span> <span class="n">opts</span><span class="o">.</span><span class="n">disk_image</span> <span class="ow">and</span> <span class="ow">not</span> <span class="n">opts</span><span class="o">.</span><span class="n">fs_image</span><span class="p">:</span>
<span class="k">if</span> <span class="ow">not</span> <span class="n">opts</span><span class="o">.</span><span class="n">ks</span><span class="p">:</span>
<span class="k">raise</span> <span class="ne">RuntimeError</span><span class="p">(</span><span class="s2">&quot;Image creation requires a kickstart file&quot;</span><span class="p">)</span>
<span class="n">errors</span> <span class="o">=</span> <span class="p">[]</span>
<span class="k">if</span> <span class="n">opts</span><span class="o">.</span><span class="n">no_virt</span> <span class="ow">and</span> <span class="n">ks</span><span class="o">.</span><span class="n">handler</span><span class="o">.</span><span class="n">method</span><span class="o">.</span><span class="n">method</span> <span class="ow">not</span> <span class="ow">in</span> <span class="p">(</span><span class="s2">&quot;url&quot;</span><span class="p">,</span> <span class="s2">&quot;nfs&quot;</span><span class="p">)</span> \
<span class="ow">and</span> <span class="ow">not</span> <span class="n">ks</span><span class="o">.</span><span class="n">handler</span><span class="o">.</span><span class="n">ostreesetup</span><span class="o">.</span><span class="n">seen</span><span class="p">:</span>
<span class="n">errors</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="s2">&quot;Only url, nfs and ostreesetup install methods are currently supported.&quot;</span>
<span class="s2">&quot;Please fix your kickstart file.&quot;</span> <span class="p">)</span>
<span class="k">if</span> <span class="n">ks</span><span class="o">.</span><span class="n">handler</span><span class="o">.</span><span class="n">method</span><span class="o">.</span><span class="n">method</span> <span class="ow">in</span> <span class="p">(</span><span class="s2">&quot;url&quot;</span><span class="p">,</span> <span class="s2">&quot;nfs&quot;</span><span class="p">)</span> <span class="ow">and</span> <span class="ow">not</span> <span class="n">ks</span><span class="o">.</span><span class="n">handler</span><span class="o">.</span><span class="n">network</span><span class="o">.</span><span class="n">seen</span><span class="p">:</span>
<span class="n">errors</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="s2">&quot;The kickstart must activate networking if &quot;</span>
<span class="s2">&quot;the url or nfs install method is used.&quot;</span><span class="p">)</span>
<span class="k">if</span> <span class="n">ks</span><span class="o">.</span><span class="n">handler</span><span class="o">.</span><span class="n">displaymode</span><span class="o">.</span><span class="n">displayMode</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span><span class="p">:</span>
<span class="n">errors</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="s2">&quot;The kickstart must not set a display mode (text, cmdline, &quot;</span>
<span class="s2">&quot;graphical), this will interfere with livemedia-creator.&quot;</span><span class="p">)</span>
<span class="k">if</span> <span class="n">opts</span><span class="o">.</span><span class="n">make_fsimage</span> <span class="ow">or</span> <span class="p">(</span><span class="n">opts</span><span class="o">.</span><span class="n">make_pxe_live</span> <span class="ow">and</span> <span class="n">opts</span><span class="o">.</span><span class="n">no_virt</span><span class="p">):</span>
<span class="c1"># Make sure the kickstart isn&#39;t using autopart and only has a / mountpoint</span>
<span class="n">part_ok</span> <span class="o">=</span> <span class="ow">not</span> <span class="nb">any</span><span class="p">(</span><span class="n">p</span> <span class="k">for</span> <span class="n">p</span> <span class="ow">in</span> <span class="n">ks</span><span class="o">.</span><span class="n">handler</span><span class="o">.</span><span class="n">partition</span><span class="o">.</span><span class="n">partitions</span>
<span class="k">if</span> <span class="n">p</span><span class="o">.</span><span class="n">mountpoint</span> <span class="ow">not</span> <span class="ow">in</span> <span class="p">[</span><span class="s2">&quot;/&quot;</span><span class="p">,</span> <span class="s2">&quot;swap&quot;</span><span class="p">])</span>
<span class="k">if</span> <span class="ow">not</span> <span class="n">part_ok</span> <span class="ow">or</span> <span class="n">ks</span><span class="o">.</span><span class="n">handler</span><span class="o">.</span><span class="n">autopart</span><span class="o">.</span><span class="n">seen</span><span class="p">:</span>
<span class="n">errors</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="s2">&quot;Filesystem images must use a single / part, not autopart or &quot;</span>
<span class="s2">&quot;multiple partitions. swap is allowed but not used.&quot;</span><span class="p">)</span>
<span class="k">if</span> <span class="ow">not</span> <span class="n">opts</span><span class="o">.</span><span class="n">no_virt</span> <span class="ow">and</span> <span class="n">ks</span><span class="o">.</span><span class="n">handler</span><span class="o">.</span><span class="n">reboot</span><span class="o">.</span><span class="n">action</span> <span class="o">!=</span> <span class="n">KS_SHUTDOWN</span><span class="p">:</span>
<span class="n">errors</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="s2">&quot;The kickstart must include shutdown when using virt installation.&quot;</span><span class="p">)</span>
<span class="k">if</span> <span class="n">errors</span><span class="p">:</span>
<span class="nb">list</span><span class="p">(</span><span class="n">log</span><span class="o">.</span><span class="n">error</span><span class="p">(</span><span class="n">e</span><span class="p">)</span> <span class="k">for</span> <span class="n">e</span> <span class="ow">in</span> <span class="n">errors</span><span class="p">)</span>
<span class="k">raise</span> <span class="ne">RuntimeError</span><span class="p">(</span><span class="s2">&quot;</span><span class="se">\n</span><span class="s2">&quot;</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="n">errors</span><span class="p">))</span>
<span class="c1"># Make the image. Output of this is either a partitioned disk image or a fsimage</span>
<span class="k">try</span><span class="p">:</span>
<span class="n">disk_img</span> <span class="o">=</span> <span class="n">make_image</span><span class="p">(</span><span class="n">opts</span><span class="p">,</span> <span class="n">ks</span><span class="p">)</span>
<span class="k">except</span> <span class="n">InstallError</span> <span class="k">as</span> <span class="n">e</span><span class="p">:</span>
<span class="n">log</span><span class="o">.</span><span class="n">error</span><span class="p">(</span><span class="s2">&quot;ERROR: Image creation failed: </span><span class="si">%s</span><span class="s2">&quot;</span><span class="p">,</span> <span class="n">e</span><span class="p">)</span>
<span class="k">raise</span> <span class="ne">RuntimeError</span><span class="p">(</span><span class="s2">&quot;Image creation failed: </span><span class="si">%s</span><span class="s2">&quot;</span> <span class="o">%</span> <span class="n">e</span><span class="p">)</span>
<span class="k">if</span> <span class="n">opts</span><span class="o">.</span><span class="n">image_only</span><span class="p">:</span>
<span class="k">return</span> <span class="p">(</span><span class="n">result_dir</span><span class="p">,</span> <span class="n">disk_img</span><span class="p">)</span>
<span class="k">if</span> <span class="n">opts</span><span class="o">.</span><span class="n">make_iso</span><span class="p">:</span>
<span class="n">work_dir</span> <span class="o">=</span> <span class="n">tempfile</span><span class="o">.</span><span class="n">mkdtemp</span><span class="p">(</span><span class="n">prefix</span><span class="o">=</span><span class="s2">&quot;lmc-work-&quot;</span><span class="p">)</span>
<span class="n">log</span><span class="o">.</span><span class="n">info</span><span class="p">(</span><span class="s2">&quot;working dir is </span><span class="si">%s</span><span class="s2">&quot;</span><span class="p">,</span> <span class="n">work_dir</span><span class="p">)</span>
<span class="k">if</span> <span class="p">(</span><span class="n">opts</span><span class="o">.</span><span class="n">fs_image</span> <span class="ow">or</span> <span class="n">opts</span><span class="o">.</span><span class="n">no_virt</span><span class="p">)</span> <span class="ow">and</span> <span class="ow">not</span> <span class="n">opts</span><span class="o">.</span><span class="n">disk_image</span><span class="p">:</span>
<span class="c1"># Create iso from a filesystem image</span>
<span class="n">disk_img</span> <span class="o">=</span> <span class="n">opts</span><span class="o">.</span><span class="n">fs_image</span> <span class="ow">or</span> <span class="n">disk_img</span>
<span class="k">if</span> <span class="ow">not</span> <span class="n">make_squashfs</span><span class="p">(</span><span class="n">opts</span><span class="p">,</span> <span class="n">disk_img</span><span class="p">,</span> <span class="n">work_dir</span><span class="p">):</span>
<span class="n">log</span><span class="o">.</span><span class="n">error</span><span class="p">(</span><span class="s2">&quot;squashfs.img creation failed&quot;</span><span class="p">)</span>
<span class="k">raise</span> <span class="ne">RuntimeError</span><span class="p">(</span><span class="s2">&quot;squashfs.img creation failed&quot;</span><span class="p">)</span>
<span class="k">with</span> <span class="n">Mount</span><span class="p">(</span><span class="n">disk_img</span><span class="p">,</span> <span class="n">opts</span><span class="o">=</span><span class="s2">&quot;loop&quot;</span><span class="p">)</span> <span class="k">as</span> <span class="n">mount_dir</span><span class="p">:</span>
<span class="n">result_dir</span> <span class="o">=</span> <span class="n">make_livecd</span><span class="p">(</span><span class="n">opts</span><span class="p">,</span> <span class="n">mount_dir</span><span class="p">,</span> <span class="n">work_dir</span><span class="p">)</span>
<span class="k">else</span><span class="p">:</span>
<span class="c1"># Create iso from a partitioned disk image</span>
<span class="n">disk_img</span> <span class="o">=</span> <span class="n">opts</span><span class="o">.</span><span class="n">disk_image</span> <span class="ow">or</span> <span class="n">disk_img</span>
<span class="k">with</span> <span class="n">PartitionMount</span><span class="p">(</span><span class="n">disk_img</span><span class="p">)</span> <span class="k">as</span> <span class="n">img_mount</span><span class="p">:</span>
<span class="k">if</span> <span class="n">img_mount</span> <span class="ow">and</span> <span class="n">img_mount</span><span class="o">.</span><span class="n">mount_dir</span><span class="p">:</span>
<span class="n">make_runtime</span><span class="p">(</span><span class="n">opts</span><span class="p">,</span> <span class="n">img_mount</span><span class="o">.</span><span class="n">mount_dir</span><span class="p">,</span> <span class="n">work_dir</span><span class="p">,</span> <span class="n">calculate_disk_size</span><span class="p">(</span><span class="n">opts</span><span class="p">,</span> <span class="n">ks</span><span class="p">)</span><span class="o">/</span><span class="mf">1024.0</span><span class="p">)</span>
<span class="n">result_dir</span> <span class="o">=</span> <span class="n">make_livecd</span><span class="p">(</span><span class="n">opts</span><span class="p">,</span> <span class="n">img_mount</span><span class="o">.</span><span class="n">mount_dir</span><span class="p">,</span> <span class="n">work_dir</span><span class="p">)</span>
<span class="c1"># --iso-only removes the extra build artifacts, keeping only the boot.iso</span>
<span class="k">if</span> <span class="n">opts</span><span class="o">.</span><span class="n">iso_only</span> <span class="ow">and</span> <span class="n">result_dir</span><span class="p">:</span>
<span class="n">boot_iso</span> <span class="o">=</span> <span class="n">joinpaths</span><span class="p">(</span><span class="n">result_dir</span><span class="p">,</span> <span class="s2">&quot;images/boot.iso&quot;</span><span class="p">)</span>
<span class="k">if</span> <span class="ow">not</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">exists</span><span class="p">(</span><span class="n">boot_iso</span><span class="p">):</span>
<span class="n">log</span><span class="o">.</span><span class="n">error</span><span class="p">(</span><span class="s2">&quot;</span><span class="si">%s</span><span class="s2"> is missing, skipping --iso-only.&quot;</span><span class="p">,</span> <span class="n">boot_iso</span><span class="p">)</span>
<span class="k">else</span><span class="p">:</span>
<span class="n">iso_dir</span> <span class="o">=</span> <span class="n">tempfile</span><span class="o">.</span><span class="n">mkdtemp</span><span class="p">(</span><span class="n">prefix</span><span class="o">=</span><span class="s2">&quot;lmc-result-&quot;</span><span class="p">)</span>
<span class="n">dest_file</span> <span class="o">=</span> <span class="n">joinpaths</span><span class="p">(</span><span class="n">iso_dir</span><span class="p">,</span> <span class="n">opts</span><span class="o">.</span><span class="n">iso_name</span> <span class="ow">or</span> <span class="s2">&quot;boot.iso&quot;</span><span class="p">)</span>
<span class="n">shutil</span><span class="o">.</span><span class="n">move</span><span class="p">(</span><span class="n">boot_iso</span><span class="p">,</span> <span class="n">dest_file</span><span class="p">)</span>
<span class="n">shutil</span><span class="o">.</span><span class="n">rmtree</span><span class="p">(</span><span class="n">result_dir</span><span class="p">)</span>
<span class="n">result_dir</span> <span class="o">=</span> <span class="n">iso_dir</span>
<span class="c1"># cleanup the mess</span>
<span class="c1"># cleanup work_dir?</span>
<span class="k">if</span> <span class="n">disk_img</span> <span class="ow">and</span> <span class="ow">not</span> <span class="p">(</span><span class="n">opts</span><span class="o">.</span><span class="n">keep_image</span> <span class="ow">or</span> <span class="n">opts</span><span class="o">.</span><span class="n">disk_image</span> <span class="ow">or</span> <span class="n">opts</span><span class="o">.</span><span class="n">fs_image</span><span class="p">):</span>
<span class="n">os</span><span class="o">.</span><span class="n">unlink</span><span class="p">(</span><span class="n">disk_img</span><span class="p">)</span>
<span class="n">log</span><span class="o">.</span><span class="n">info</span><span class="p">(</span><span class="s2">&quot;Disk image erased&quot;</span><span class="p">)</span>
<span class="n">disk_img</span> <span class="o">=</span> <span class="kc">None</span>
<span class="k">elif</span> <span class="n">opts</span><span class="o">.</span><span class="n">make_appliance</span><span class="p">:</span>
<span class="k">if</span> <span class="ow">not</span> <span class="n">opts</span><span class="o">.</span><span class="n">ks</span><span class="p">:</span>
<span class="n">networks</span> <span class="o">=</span> <span class="p">[]</span>
<span class="k">else</span><span class="p">:</span>
<span class="n">networks</span> <span class="o">=</span> <span class="n">ks</span><span class="o">.</span><span class="n">handler</span><span class="o">.</span><span class="n">network</span><span class="o">.</span><span class="n">network</span>
<span class="n">make_appliance</span><span class="p">(</span><span class="n">opts</span><span class="o">.</span><span class="n">disk_image</span> <span class="ow">or</span> <span class="n">disk_img</span><span class="p">,</span> <span class="n">opts</span><span class="o">.</span><span class="n">app_name</span><span class="p">,</span>
<span class="n">opts</span><span class="o">.</span><span class="n">app_template</span><span class="p">,</span> <span class="n">opts</span><span class="o">.</span><span class="n">app_file</span><span class="p">,</span> <span class="n">networks</span><span class="p">,</span> <span class="n">opts</span><span class="o">.</span><span class="n">ram</span><span class="p">,</span>
<span class="n">opts</span><span class="o">.</span><span class="n">vcpus</span> <span class="ow">or</span> <span class="mi">1</span><span class="p">,</span> <span class="n">opts</span><span class="o">.</span><span class="n">arch</span><span class="p">,</span> <span class="n">opts</span><span class="o">.</span><span class="n">title</span><span class="p">,</span> <span class="n">opts</span><span class="o">.</span><span class="n">project</span><span class="p">,</span> <span class="n">opts</span><span class="o">.</span><span class="n">releasever</span><span class="p">)</span>
<span class="k">elif</span> <span class="n">opts</span><span class="o">.</span><span class="n">make_pxe_live</span><span class="p">:</span>
<span class="n">work_dir</span> <span class="o">=</span> <span class="n">tempfile</span><span class="o">.</span><span class="n">mkdtemp</span><span class="p">(</span><span class="n">prefix</span><span class="o">=</span><span class="s2">&quot;lmc-work-&quot;</span><span class="p">)</span>
<span class="n">log</span><span class="o">.</span><span class="n">info</span><span class="p">(</span><span class="s2">&quot;working dir is </span><span class="si">%s</span><span class="s2">&quot;</span><span class="p">,</span> <span class="n">work_dir</span><span class="p">)</span>
<span class="n">disk_img</span> <span class="o">=</span> <span class="n">opts</span><span class="o">.</span><span class="n">fs_image</span> <span class="ow">or</span> <span class="n">opts</span><span class="o">.</span><span class="n">disk_image</span> <span class="ow">or</span> <span class="n">disk_img</span>
<span class="n">log</span><span class="o">.</span><span class="n">debug</span><span class="p">(</span><span class="s2">&quot;disk image is </span><span class="si">%s</span><span class="s2">&quot;</span><span class="p">,</span> <span class="n">disk_img</span><span class="p">)</span>
<span class="n">result_dir</span> <span class="o">=</span> <span class="n">make_live_images</span><span class="p">(</span><span class="n">opts</span><span class="p">,</span> <span class="n">work_dir</span><span class="p">,</span> <span class="n">disk_img</span><span class="p">)</span>
<span class="k">if</span> <span class="n">result_dir</span> <span class="ow">is</span> <span class="kc">None</span><span class="p">:</span>
<span class="n">log</span><span class="o">.</span><span class="n">error</span><span class="p">(</span><span class="s2">&quot;Creating PXE live image failed.&quot;</span><span class="p">)</span>
<span class="k">raise</span> <span class="ne">RuntimeError</span><span class="p">(</span><span class="s2">&quot;Creating PXE live image failed.&quot;</span><span class="p">)</span>
<span class="k">if</span> <span class="n">opts</span><span class="o">.</span><span class="n">result_dir</span> <span class="o">!=</span> <span class="n">opts</span><span class="o">.</span><span class="n">tmp</span> <span class="ow">and</span> <span class="n">result_dir</span><span class="p">:</span>
<span class="n">copytree</span><span class="p">(</span><span class="n">result_dir</span><span class="p">,</span> <span class="n">opts</span><span class="o">.</span><span class="n">result_dir</span><span class="p">,</span> <span class="n">preserve</span><span class="o">=</span><span class="kc">False</span><span class="p">)</span>
<span class="n">shutil</span><span class="o">.</span><span class="n">rmtree</span><span class="p">(</span><span class="n">result_dir</span><span class="p">)</span>
<span class="n">result_dir</span> <span class="o">=</span> <span class="kc">None</span>
<span class="k">return</span> <span class="p">(</span><span class="n">result_dir</span><span class="p">,</span> <span class="n">disk_img</span><span class="p">)</span></div>
</pre></div>
</div>
</div>
<footer>
<hr/>
<div role="contentinfo">
<p>
&copy; Copyright 2018, Red Hat, Inc..
</p>
</div>
Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/rtfd/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>.
</footer>
</div>
</div>
</section>
</div>
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT:'../../',
VERSION:'28.10',
LANGUAGE:'None',
COLLAPSE_INDEX:false,
FILE_SUFFIX:'.html',
HAS_SOURCE: true,
SOURCELINK_SUFFIX: '.txt'
};
</script>
<script type="text/javascript" src="../../_static/jquery.js"></script>
<script type="text/javascript" src="../../_static/underscore.js"></script>
<script type="text/javascript" src="../../_static/doctools.js"></script>
<script type="text/javascript" src="../../_static/js/theme.js"></script>
<script type="text/javascript">
jQuery(function () {
SphinxRtdTheme.Navigation.enableSticky();
});
</script>
</body>
</html>

View File

@ -8,8 +8,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>pylorax.decorators &mdash; Lorax 28.9 documentation</title> <title>pylorax.decorators &mdash; Lorax 28.10 documentation</title>
@ -27,23 +26,16 @@
<link rel="stylesheet" href="../../_static/css/theme.css" type="text/css" /> <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="index" title="Index"
href="../../genindex.html"/>
<link rel="search" title="Search" href="../../search.html" /> <link rel="search" title="Search" href="../../search.html" />
<link rel="top" title="Lorax 28.9 documentation" href="../../index.html"/>
<link rel="up" title="pylorax" href="../pylorax.html"/>
<script src="../../_static/js/modernizr.min.js"></script> <script src="../../_static/js/modernizr.min.js"></script>
</head> </head>
<body class="wy-body-for-nav" role="document"> <body class="wy-body-for-nav">
<div class="wy-grid-for-nav"> <div class="wy-grid-for-nav">
@ -65,7 +57,7 @@
<div class="version"> <div class="version">
28.9 28.10
</div> </div>
@ -94,6 +86,8 @@
<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="../../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="../../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="../../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"><a class="reference internal" href="../../product-images.html">Product and Updates Images</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../modules.html">pylorax</a></li> <li class="toctree-l1"><a class="reference internal" href="../../modules.html">pylorax</a></li>
</ul> </ul>
@ -107,7 +101,7 @@
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"> <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
<nav class="wy-nav-top" role="navigation" aria-label="top navigation"> <nav class="wy-nav-top" aria-label="top navigation">
<i data-toggle="wy-nav-top" class="fa fa-bars"></i> <i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="../../index.html">Lorax</a> <a href="../../index.html">Lorax</a>
@ -115,8 +109,8 @@
</nav> </nav>
<div class="wy-nav-content"> <div class="wy-nav-content">
<div class="rst-content"> <div class="rst-content">
@ -134,6 +128,7 @@
<div role="navigation" aria-label="breadcrumbs navigation"> <div role="navigation" aria-label="breadcrumbs navigation">
<ul class="wy-breadcrumbs"> <ul class="wy-breadcrumbs">
@ -149,8 +144,6 @@
<li class="wy-breadcrumbs-aside"> <li class="wy-breadcrumbs-aside">
</li> </li>
</ul> </ul>
@ -195,10 +188,8 @@
</pre></div> </pre></div>
</div> </div>
<div class="articleComments">
</div> </div>
</div>
<footer> <footer>
@ -210,7 +201,7 @@
</p> </p>
</div> </div>
Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/snide/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>. 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> </footer>
@ -228,7 +219,8 @@
<script type="text/javascript"> <script type="text/javascript">
var DOCUMENTATION_OPTIONS = { var DOCUMENTATION_OPTIONS = {
URL_ROOT:'../../', URL_ROOT:'../../',
VERSION:'28.9', VERSION:'28.10',
LANGUAGE:'None',
COLLAPSE_INDEX:false, COLLAPSE_INDEX:false,
FILE_SUFFIX:'.html', FILE_SUFFIX:'.html',
HAS_SOURCE: true, HAS_SOURCE: true,
@ -246,14 +238,13 @@
<script type="text/javascript" src="../../_static/js/theme.js"></script> <script type="text/javascript" src="../../_static/js/theme.js"></script>
<script type="text/javascript"> <script type="text/javascript">
jQuery(function () { jQuery(function () {
SphinxRtdTheme.StickyNav.enable();
SphinxRtdTheme.Navigation.enableSticky();
}); });
</script> </script>
</body> </body>
</html> </html>

View File

@ -8,8 +8,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>pylorax.discinfo &mdash; Lorax 28.9 documentation</title> <title>pylorax.discinfo &mdash; Lorax 28.10 documentation</title>
@ -27,23 +26,16 @@
<link rel="stylesheet" href="../../_static/css/theme.css" type="text/css" /> <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="index" title="Index"
href="../../genindex.html"/>
<link rel="search" title="Search" href="../../search.html" /> <link rel="search" title="Search" href="../../search.html" />
<link rel="top" title="Lorax 28.9 documentation" href="../../index.html"/>
<link rel="up" title="pylorax" href="../pylorax.html"/>
<script src="../../_static/js/modernizr.min.js"></script> <script src="../../_static/js/modernizr.min.js"></script>
</head> </head>
<body class="wy-body-for-nav" role="document"> <body class="wy-body-for-nav">
<div class="wy-grid-for-nav"> <div class="wy-grid-for-nav">
@ -65,7 +57,7 @@
<div class="version"> <div class="version">
28.9 28.10
</div> </div>
@ -94,6 +86,8 @@
<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="../../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="../../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="../../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"><a class="reference internal" href="../../product-images.html">Product and Updates Images</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../modules.html">pylorax</a></li> <li class="toctree-l1"><a class="reference internal" href="../../modules.html">pylorax</a></li>
</ul> </ul>
@ -107,7 +101,7 @@
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"> <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
<nav class="wy-nav-top" role="navigation" aria-label="top navigation"> <nav class="wy-nav-top" aria-label="top navigation">
<i data-toggle="wy-nav-top" class="fa fa-bars"></i> <i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="../../index.html">Lorax</a> <a href="../../index.html">Lorax</a>
@ -115,8 +109,8 @@
</nav> </nav>
<div class="wy-nav-content"> <div class="wy-nav-content">
<div class="rst-content"> <div class="rst-content">
@ -134,6 +128,7 @@
<div role="navigation" aria-label="breadcrumbs navigation"> <div role="navigation" aria-label="breadcrumbs navigation">
<ul class="wy-breadcrumbs"> <ul class="wy-breadcrumbs">
@ -149,8 +144,6 @@
<li class="wy-breadcrumbs-aside"> <li class="wy-breadcrumbs-aside">
</li> </li>
</ul> </ul>
@ -204,10 +197,8 @@
</pre></div> </pre></div>
</div> </div>
<div class="articleComments">
</div> </div>
</div>
<footer> <footer>
@ -219,7 +210,7 @@
</p> </p>
</div> </div>
Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/snide/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>. 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> </footer>
@ -237,7 +228,8 @@
<script type="text/javascript"> <script type="text/javascript">
var DOCUMENTATION_OPTIONS = { var DOCUMENTATION_OPTIONS = {
URL_ROOT:'../../', URL_ROOT:'../../',
VERSION:'28.9', VERSION:'28.10',
LANGUAGE:'None',
COLLAPSE_INDEX:false, COLLAPSE_INDEX:false,
FILE_SUFFIX:'.html', FILE_SUFFIX:'.html',
HAS_SOURCE: true, HAS_SOURCE: true,
@ -255,14 +247,13 @@
<script type="text/javascript" src="../../_static/js/theme.js"></script> <script type="text/javascript" src="../../_static/js/theme.js"></script>
<script type="text/javascript"> <script type="text/javascript">
jQuery(function () { jQuery(function () {
SphinxRtdTheme.StickyNav.enable();
SphinxRtdTheme.Navigation.enableSticky();
}); });
</script> </script>
</body> </body>
</html> </html>

View File

@ -8,8 +8,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>pylorax.dnfhelper &mdash; Lorax 28.9 documentation</title> <title>pylorax.dnfhelper &mdash; Lorax 28.10 documentation</title>
@ -27,23 +26,16 @@
<link rel="stylesheet" href="../../_static/css/theme.css" type="text/css" /> <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="index" title="Index"
href="../../genindex.html"/>
<link rel="search" title="Search" href="../../search.html" /> <link rel="search" title="Search" href="../../search.html" />
<link rel="top" title="Lorax 28.9 documentation" href="../../index.html"/>
<link rel="up" title="pylorax" href="../pylorax.html"/>
<script src="../../_static/js/modernizr.min.js"></script> <script src="../../_static/js/modernizr.min.js"></script>
</head> </head>
<body class="wy-body-for-nav" role="document"> <body class="wy-body-for-nav">
<div class="wy-grid-for-nav"> <div class="wy-grid-for-nav">
@ -65,7 +57,7 @@
<div class="version"> <div class="version">
28.9 28.10
</div> </div>
@ -94,6 +86,8 @@
<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="../../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="../../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="../../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"><a class="reference internal" href="../../product-images.html">Product and Updates Images</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../modules.html">pylorax</a></li> <li class="toctree-l1"><a class="reference internal" href="../../modules.html">pylorax</a></li>
</ul> </ul>
@ -107,7 +101,7 @@
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"> <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
<nav class="wy-nav-top" role="navigation" aria-label="top navigation"> <nav class="wy-nav-top" aria-label="top navigation">
<i data-toggle="wy-nav-top" class="fa fa-bars"></i> <i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="../../index.html">Lorax</a> <a href="../../index.html">Lorax</a>
@ -115,8 +109,8 @@
</nav> </nav>
<div class="wy-nav-content"> <div class="wy-nav-content">
<div class="rst-content"> <div class="rst-content">
@ -134,6 +128,7 @@
<div role="navigation" aria-label="breadcrumbs navigation"> <div role="navigation" aria-label="breadcrumbs navigation">
<ul class="wy-breadcrumbs"> <ul class="wy-breadcrumbs">
@ -149,8 +144,6 @@
<li class="wy-breadcrumbs-aside"> <li class="wy-breadcrumbs-aside">
</li> </li>
</ul> </ul>
@ -274,10 +267,8 @@
</pre></div> </pre></div>
</div> </div>
<div class="articleComments">
</div> </div>
</div>
<footer> <footer>
@ -289,7 +280,7 @@
</p> </p>
</div> </div>
Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/snide/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>. 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> </footer>
@ -307,7 +298,8 @@
<script type="text/javascript"> <script type="text/javascript">
var DOCUMENTATION_OPTIONS = { var DOCUMENTATION_OPTIONS = {
URL_ROOT:'../../', URL_ROOT:'../../',
VERSION:'28.9', VERSION:'28.10',
LANGUAGE:'None',
COLLAPSE_INDEX:false, COLLAPSE_INDEX:false,
FILE_SUFFIX:'.html', FILE_SUFFIX:'.html',
HAS_SOURCE: true, HAS_SOURCE: true,
@ -325,14 +317,13 @@
<script type="text/javascript" src="../../_static/js/theme.js"></script> <script type="text/javascript" src="../../_static/js/theme.js"></script>
<script type="text/javascript"> <script type="text/javascript">
jQuery(function () { jQuery(function () {
SphinxRtdTheme.StickyNav.enable();
SphinxRtdTheme.Navigation.enableSticky();
}); });
</script> </script>
</body> </body>
</html> </html>

View File

@ -8,8 +8,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>pylorax.executils &mdash; Lorax 28.9 documentation</title> <title>pylorax.executils &mdash; Lorax 28.10 documentation</title>
@ -27,23 +26,16 @@
<link rel="stylesheet" href="../../_static/css/theme.css" type="text/css" /> <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="index" title="Index"
href="../../genindex.html"/>
<link rel="search" title="Search" href="../../search.html" /> <link rel="search" title="Search" href="../../search.html" />
<link rel="top" title="Lorax 28.9 documentation" href="../../index.html"/>
<link rel="up" title="pylorax" href="../pylorax.html"/>
<script src="../../_static/js/modernizr.min.js"></script> <script src="../../_static/js/modernizr.min.js"></script>
</head> </head>
<body class="wy-body-for-nav" role="document"> <body class="wy-body-for-nav">
<div class="wy-grid-for-nav"> <div class="wy-grid-for-nav">
@ -65,7 +57,7 @@
<div class="version"> <div class="version">
28.9 28.10
</div> </div>
@ -94,6 +86,8 @@
<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="../../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="../../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="../../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"><a class="reference internal" href="../../product-images.html">Product and Updates Images</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../modules.html">pylorax</a></li> <li class="toctree-l1"><a class="reference internal" href="../../modules.html">pylorax</a></li>
</ul> </ul>
@ -107,7 +101,7 @@
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"> <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
<nav class="wy-nav-top" role="navigation" aria-label="top navigation"> <nav class="wy-nav-top" aria-label="top navigation">
<i data-toggle="wy-nav-top" class="fa fa-bars"></i> <i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="../../index.html">Lorax</a> <a href="../../index.html">Lorax</a>
@ -115,8 +109,8 @@
</nav> </nav>
<div class="wy-nav-content"> <div class="wy-nav-content">
<div class="rst-content"> <div class="rst-content">
@ -134,6 +128,7 @@
<div role="navigation" aria-label="breadcrumbs navigation"> <div role="navigation" aria-label="breadcrumbs navigation">
<ul class="wy-breadcrumbs"> <ul class="wy-breadcrumbs">
@ -149,8 +144,6 @@
<li class="wy-breadcrumbs-aside"> <li class="wy-breadcrumbs-aside">
</li> </li>
</ul> </ul>
@ -512,10 +505,8 @@
</pre></div> </pre></div>
</div> </div>
<div class="articleComments">
</div> </div>
</div>
<footer> <footer>
@ -527,7 +518,7 @@
</p> </p>
</div> </div>
Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/snide/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>. 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> </footer>
@ -545,7 +536,8 @@
<script type="text/javascript"> <script type="text/javascript">
var DOCUMENTATION_OPTIONS = { var DOCUMENTATION_OPTIONS = {
URL_ROOT:'../../', URL_ROOT:'../../',
VERSION:'28.9', VERSION:'28.10',
LANGUAGE:'None',
COLLAPSE_INDEX:false, COLLAPSE_INDEX:false,
FILE_SUFFIX:'.html', FILE_SUFFIX:'.html',
HAS_SOURCE: true, HAS_SOURCE: true,
@ -563,14 +555,13 @@
<script type="text/javascript" src="../../_static/js/theme.js"></script> <script type="text/javascript" src="../../_static/js/theme.js"></script>
<script type="text/javascript"> <script type="text/javascript">
jQuery(function () { jQuery(function () {
SphinxRtdTheme.StickyNav.enable();
SphinxRtdTheme.Navigation.enableSticky();
}); });
</script> </script>
</body> </body>
</html> </html>

View File

@ -8,8 +8,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>pylorax.imgutils &mdash; Lorax 28.9 documentation</title> <title>pylorax.imgutils &mdash; Lorax 28.10 documentation</title>
@ -27,23 +26,16 @@
<link rel="stylesheet" href="../../_static/css/theme.css" type="text/css" /> <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="index" title="Index"
href="../../genindex.html"/>
<link rel="search" title="Search" href="../../search.html" /> <link rel="search" title="Search" href="../../search.html" />
<link rel="top" title="Lorax 28.9 documentation" href="../../index.html"/>
<link rel="up" title="pylorax" href="../pylorax.html"/>
<script src="../../_static/js/modernizr.min.js"></script> <script src="../../_static/js/modernizr.min.js"></script>
</head> </head>
<body class="wy-body-for-nav" role="document"> <body class="wy-body-for-nav">
<div class="wy-grid-for-nav"> <div class="wy-grid-for-nav">
@ -65,7 +57,7 @@
<div class="version"> <div class="version">
28.9 28.10
</div> </div>
@ -94,6 +86,8 @@
<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="../../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="../../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="../../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"><a class="reference internal" href="../../product-images.html">Product and Updates Images</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../modules.html">pylorax</a></li> <li class="toctree-l1"><a class="reference internal" href="../../modules.html">pylorax</a></li>
</ul> </ul>
@ -107,7 +101,7 @@
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"> <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
<nav class="wy-nav-top" role="navigation" aria-label="top navigation"> <nav class="wy-nav-top" aria-label="top navigation">
<i data-toggle="wy-nav-top" class="fa fa-bars"></i> <i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="../../index.html">Lorax</a> <a href="../../index.html">Lorax</a>
@ -115,8 +109,8 @@
</nav> </nav>
<div class="wy-nav-content"> <div class="wy-nav-content">
<div class="rst-content"> <div class="rst-content">
@ -134,6 +128,7 @@
<div role="navigation" aria-label="breadcrumbs navigation"> <div role="navigation" aria-label="breadcrumbs navigation">
<ul class="wy-breadcrumbs"> <ul class="wy-breadcrumbs">
@ -149,8 +144,6 @@
<li class="wy-breadcrumbs-aside"> <li class="wy-breadcrumbs-aside">
</li> </li>
</ul> </ul>
@ -647,13 +640,45 @@
<span class="n">graft</span> <span class="o">=</span> <span class="n">graft</span> <span class="ow">or</span> <span class="p">{}</span> <span class="n">graft</span> <span class="o">=</span> <span class="n">graft</span> <span class="ow">or</span> <span class="p">{}</span>
<span class="n">mkfsimage</span><span class="p">(</span><span class="s2">&quot;hfsplus&quot;</span><span class="p">,</span> <span class="n">rootdir</span><span class="p">,</span> <span class="n">outfile</span><span class="p">,</span> <span class="n">size</span><span class="p">,</span> <span class="n">mountargs</span><span class="o">=</span><span class="n">mountargs</span><span class="p">,</span> <span class="n">mkfsimage</span><span class="p">(</span><span class="s2">&quot;hfsplus&quot;</span><span class="p">,</span> <span class="n">rootdir</span><span class="p">,</span> <span class="n">outfile</span><span class="p">,</span> <span class="n">size</span><span class="p">,</span> <span class="n">mountargs</span><span class="o">=</span><span class="n">mountargs</span><span class="p">,</span>
<span class="n">mkfsargs</span><span class="o">=</span><span class="p">[</span><span class="s2">&quot;-v&quot;</span><span class="p">,</span> <span class="n">label</span><span class="p">],</span> <span class="n">graft</span><span class="o">=</span><span class="n">graft</span><span class="p">)</span></div> <span class="n">mkfsargs</span><span class="o">=</span><span class="p">[</span><span class="s2">&quot;-v&quot;</span><span class="p">,</span> <span class="n">label</span><span class="p">],</span> <span class="n">graft</span><span class="o">=</span><span class="n">graft</span><span class="p">)</span></div>
<div class="viewcode-block" id="mkfsimage_from_disk"><a class="viewcode-back" href="../../pylorax.html#pylorax.imgutils.mkfsimage_from_disk">[docs]</a><span class="k">def</span> <span class="nf">mkfsimage_from_disk</span><span class="p">(</span><span class="n">diskimage</span><span class="p">,</span> <span class="n">fsimage</span><span class="p">,</span> <span class="n">img_size</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">label</span><span class="o">=</span><span class="s2">&quot;Anaconda&quot;</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;</span>
<span class="sd"> Copy the / partition of a partitioned disk image to an un-partitioned</span>
<span class="sd"> disk image.</span>
<span class="sd"> :param str diskimage: The full path to partitioned disk image with a /</span>
<span class="sd"> :param str fsimage: The full path of the output fs image file</span>
<span class="sd"> :param int img_size: Optional size of the fsimage in MiB or None to make</span>
<span class="sd"> it as small as possible</span>
<span class="sd"> :param str label: The label to apply to the image. Defaults to &quot;Anaconda&quot;</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="k">with</span> <span class="n">PartitionMount</span><span class="p">(</span><span class="n">diskimage</span><span class="p">)</span> <span class="k">as</span> <span class="n">img_mount</span><span class="p">:</span>
<span class="k">if</span> <span class="ow">not</span> <span class="n">img_mount</span> <span class="ow">or</span> <span class="ow">not</span> <span class="n">img_mount</span><span class="o">.</span><span class="n">mount_dir</span><span class="p">:</span>
<span class="k">return</span> <span class="kc">None</span>
<span class="n">logger</span><span class="o">.</span><span class="n">info</span><span class="p">(</span><span class="s2">&quot;Creating fsimage </span><span class="si">%s</span><span class="s2"> (</span><span class="si">%s</span><span class="s2">)&quot;</span><span class="p">,</span> <span class="n">fsimage</span><span class="p">,</span> <span class="n">img_size</span> <span class="ow">or</span> <span class="s2">&quot;minimized&quot;</span><span class="p">)</span>
<span class="k">if</span> <span class="n">img_size</span><span class="p">:</span>
<span class="c1"># convert to Bytes</span>
<span class="n">img_size</span> <span class="o">*=</span> <span class="mi">1024</span><span class="o">**</span><span class="mi">2</span>
<span class="n">mkext4img</span><span class="p">(</span><span class="n">img_mount</span><span class="o">.</span><span class="n">mount_dir</span><span class="p">,</span> <span class="n">fsimage</span><span class="p">,</span> <span class="n">size</span><span class="o">=</span><span class="n">img_size</span><span class="p">,</span> <span class="n">label</span><span class="o">=</span><span class="n">label</span><span class="p">)</span></div>
<div class="viewcode-block" id="default_image_name"><a class="viewcode-back" href="../../pylorax.html#pylorax.imgutils.default_image_name">[docs]</a><span class="k">def</span> <span class="nf">default_image_name</span><span class="p">(</span><span class="n">compression</span><span class="p">,</span> <span class="n">basename</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot; Return a default image name with the correct suffix for the compression type.</span>
<span class="sd"> :param str compression: Compression type</span>
<span class="sd"> :param str basename: Base filename</span>
<span class="sd"> :returns: basename with compression suffix</span>
<span class="sd"> If the compression is unknown it defaults to xz</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="n">SUFFIXES</span> <span class="o">=</span> <span class="p">{</span><span class="s2">&quot;xz&quot;</span><span class="p">:</span> <span class="s2">&quot;.xz&quot;</span><span class="p">,</span> <span class="s2">&quot;gzip&quot;</span><span class="p">:</span> <span class="s2">&quot;.gz&quot;</span><span class="p">,</span> <span class="s2">&quot;bzip2&quot;</span><span class="p">:</span> <span class="s2">&quot;.bz2&quot;</span><span class="p">,</span> <span class="s2">&quot;lzma&quot;</span><span class="p">:</span> <span class="s2">&quot;.lzma&quot;</span><span class="p">}</span>
<span class="k">return</span> <span class="n">basename</span> <span class="o">+</span> <span class="n">SUFFIXES</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="n">compression</span><span class="p">,</span> <span class="s2">&quot;.xz&quot;</span><span class="p">)</span></div>
</pre></div> </pre></div>
</div> </div>
<div class="articleComments">
</div> </div>
</div>
<footer> <footer>
@ -665,7 +690,7 @@
</p> </p>
</div> </div>
Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/snide/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>. 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> </footer>
@ -683,7 +708,8 @@
<script type="text/javascript"> <script type="text/javascript">
var DOCUMENTATION_OPTIONS = { var DOCUMENTATION_OPTIONS = {
URL_ROOT:'../../', URL_ROOT:'../../',
VERSION:'28.9', VERSION:'28.10',
LANGUAGE:'None',
COLLAPSE_INDEX:false, COLLAPSE_INDEX:false,
FILE_SUFFIX:'.html', FILE_SUFFIX:'.html',
HAS_SOURCE: true, HAS_SOURCE: true,
@ -701,14 +727,13 @@
<script type="text/javascript" src="../../_static/js/theme.js"></script> <script type="text/javascript" src="../../_static/js/theme.js"></script>
<script type="text/javascript"> <script type="text/javascript">
jQuery(function () { jQuery(function () {
SphinxRtdTheme.StickyNav.enable();
SphinxRtdTheme.Navigation.enableSticky();
}); });
</script> </script>
</body> </body>
</html> </html>

View File

@ -0,0 +1,823 @@
<!DOCTYPE html>
<!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]-->
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>pylorax.installer &mdash; Lorax 28.10 documentation</title>
<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" />
<script src="../../_static/js/modernizr.min.js"></script>
</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">
28.10
</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>
<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"><a class="reference internal" href="../../modules.html">pylorax</a></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="../index.html">Module code</a> &raquo;</li>
<li><a href="../pylorax.html">pylorax</a> &raquo;</li>
<li>pylorax.installer</li>
<li class="wy-breadcrumbs-aside">
</li>
</ul>
<hr/>
</div>
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
<div itemprop="articleBody">
<h1>Source code for pylorax.installer</h1><div class="highlight"><pre>
<span></span><span class="c1">#</span>
<span class="c1"># Copyright (C) 2011-2018 Red Hat, Inc.</span>
<span class="c1">#</span>
<span class="c1"># This program is free software; you can redistribute it and/or modify</span>
<span class="c1"># it under the terms of the GNU General Public License as published by</span>
<span class="c1"># the Free Software Foundation; either version 2 of the License, or</span>
<span class="c1"># (at your option) any later version.</span>
<span class="c1">#</span>
<span class="c1"># This program is distributed in the hope that it will be useful,</span>
<span class="c1"># but WITHOUT ANY WARRANTY; without even the implied warranty of</span>
<span class="c1"># MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the</span>
<span class="c1"># GNU General Public License for more details.</span>
<span class="c1">#</span>
<span class="c1"># You should have received a copy of the GNU General Public License</span>
<span class="c1"># along with this program. If not, see &lt;http://www.gnu.org/licenses/&gt;.</span>
<span class="c1">#</span>
<span class="kn">import</span> <span class="nn">logging</span>
<span class="n">log</span> <span class="o">=</span> <span class="n">logging</span><span class="o">.</span><span class="n">getLogger</span><span class="p">(</span><span class="s2">&quot;pylorax&quot;</span><span class="p">)</span>
<span class="kn">import</span> <span class="nn">glob</span>
<span class="kn">import</span> <span class="nn">json</span>
<span class="kn">from</span> <span class="nn">math</span> <span class="k">import</span> <span class="n">ceil</span>
<span class="kn">import</span> <span class="nn">os</span>
<span class="kn">import</span> <span class="nn">subprocess</span>
<span class="kn">import</span> <span class="nn">shutil</span>
<span class="kn">import</span> <span class="nn">socket</span>
<span class="kn">import</span> <span class="nn">tempfile</span>
<span class="c1"># Use the Lorax treebuilder branch for iso creation</span>
<span class="kn">from</span> <span class="nn">pylorax.executils</span> <span class="k">import</span> <span class="n">execWithRedirect</span><span class="p">,</span> <span class="n">execReadlines</span>
<span class="kn">from</span> <span class="nn">pylorax.imgutils</span> <span class="k">import</span> <span class="n">PartitionMount</span><span class="p">,</span> <span class="n">mksparse</span><span class="p">,</span> <span class="n">mkext4img</span><span class="p">,</span> <span class="n">loop_detach</span>
<span class="kn">from</span> <span class="nn">pylorax.imgutils</span> <span class="k">import</span> <span class="n">get_loop_name</span><span class="p">,</span> <span class="n">dm_detach</span><span class="p">,</span> <span class="n">mount</span><span class="p">,</span> <span class="n">umount</span>
<span class="kn">from</span> <span class="nn">pylorax.imgutils</span> <span class="k">import</span> <span class="n">mkqemu_img</span><span class="p">,</span> <span class="n">mktar</span><span class="p">,</span> <span class="n">mkcpio</span><span class="p">,</span> <span class="n">mkfsimage_from_disk</span>
<span class="kn">from</span> <span class="nn">pylorax.monitor</span> <span class="k">import</span> <span class="n">LogMonitor</span>
<span class="kn">from</span> <span class="nn">pylorax.mount</span> <span class="k">import</span> <span class="n">IsoMountpoint</span>
<span class="kn">from</span> <span class="nn">pylorax.sysutils</span> <span class="k">import</span> <span class="n">joinpaths</span>
<span class="kn">from</span> <span class="nn">pylorax.treebuilder</span> <span class="k">import</span> <span class="n">udev_escape</span>
<span class="n">ROOT_PATH</span> <span class="o">=</span> <span class="s2">&quot;/mnt/sysimage/&quot;</span>
<div class="viewcode-block" id="InstallError"><a class="viewcode-back" href="../../pylorax.html#pylorax.installer.InstallError">[docs]</a><span class="k">class</span> <span class="nc">InstallError</span><span class="p">(</span><span class="ne">Exception</span><span class="p">):</span>
<span class="k">pass</span></div>
<div class="viewcode-block" id="create_vagrant_metadata"><a class="viewcode-back" href="../../pylorax.html#pylorax.installer.create_vagrant_metadata">[docs]</a><span class="k">def</span> <span class="nf">create_vagrant_metadata</span><span class="p">(</span><span class="n">path</span><span class="p">,</span> <span class="n">size</span><span class="o">=</span><span class="mi">0</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot; Create a default Vagrant metadata.json file</span>
<span class="sd"> :param str path: Path to metadata.json file</span>
<span class="sd"> :param int size: Disk size in MiB</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="n">metadata</span> <span class="o">=</span> <span class="p">{</span> <span class="s2">&quot;provider&quot;</span><span class="p">:</span><span class="s2">&quot;libvirt&quot;</span><span class="p">,</span> <span class="s2">&quot;format&quot;</span><span class="p">:</span><span class="s2">&quot;qcow2&quot;</span><span class="p">,</span> <span class="s2">&quot;virtual_size&quot;</span><span class="p">:</span> <span class="n">ceil</span><span class="p">(</span><span class="n">size</span> <span class="o">/</span> <span class="mi">1024</span><span class="p">)</span> <span class="p">}</span>
<span class="k">with</span> <span class="nb">open</span><span class="p">(</span><span class="n">path</span><span class="p">,</span> <span class="s2">&quot;wt&quot;</span><span class="p">)</span> <span class="k">as</span> <span class="n">f</span><span class="p">:</span>
<span class="n">json</span><span class="o">.</span><span class="n">dump</span><span class="p">(</span><span class="n">metadata</span><span class="p">,</span> <span class="n">f</span><span class="p">,</span> <span class="n">indent</span><span class="o">=</span><span class="mi">4</span><span class="p">)</span></div>
<div class="viewcode-block" id="update_vagrant_metadata"><a class="viewcode-back" href="../../pylorax.html#pylorax.installer.update_vagrant_metadata">[docs]</a><span class="k">def</span> <span class="nf">update_vagrant_metadata</span><span class="p">(</span><span class="n">path</span><span class="p">,</span> <span class="n">size</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot; Update the Vagrant metadata.json file</span>
<span class="sd"> :param str path: Path to metadata.json file</span>
<span class="sd"> :param int size: Disk size in MiB</span>
<span class="sd"> This function makes sure that the provider, format and virtual size of the</span>
<span class="sd"> metadata file are set correctly. All other values are left untouched.</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="k">with</span> <span class="nb">open</span><span class="p">(</span><span class="n">path</span><span class="p">,</span> <span class="s2">&quot;rt&quot;</span><span class="p">)</span> <span class="k">as</span> <span class="n">f</span><span class="p">:</span>
<span class="k">try</span><span class="p">:</span>
<span class="n">metadata</span> <span class="o">=</span> <span class="n">json</span><span class="o">.</span><span class="n">load</span><span class="p">(</span><span class="n">f</span><span class="p">)</span>
<span class="k">except</span> <span class="ne">ValueError</span> <span class="k">as</span> <span class="n">e</span><span class="p">:</span>
<span class="n">log</span><span class="o">.</span><span class="n">error</span><span class="p">(</span><span class="s2">&quot;Problem reading metadata file </span><span class="si">%s</span><span class="s2">: </span><span class="si">%s</span><span class="s2">&quot;</span><span class="p">,</span> <span class="n">path</span><span class="p">,</span> <span class="n">e</span><span class="p">)</span>
<span class="k">return</span>
<span class="n">metadata</span><span class="p">[</span><span class="s2">&quot;provider&quot;</span><span class="p">]</span> <span class="o">=</span> <span class="s2">&quot;libvirt&quot;</span>
<span class="n">metadata</span><span class="p">[</span><span class="s2">&quot;format&quot;</span><span class="p">]</span> <span class="o">=</span> <span class="s2">&quot;qcow2&quot;</span>
<span class="n">metadata</span><span class="p">[</span><span class="s2">&quot;virtual_size&quot;</span><span class="p">]</span> <span class="o">=</span> <span class="n">ceil</span><span class="p">(</span><span class="n">size</span> <span class="o">/</span> <span class="mi">1024</span><span class="p">)</span>
<span class="k">with</span> <span class="nb">open</span><span class="p">(</span><span class="n">path</span><span class="p">,</span> <span class="s2">&quot;wt&quot;</span><span class="p">)</span> <span class="k">as</span> <span class="n">f</span><span class="p">:</span>
<span class="n">json</span><span class="o">.</span><span class="n">dump</span><span class="p">(</span><span class="n">metadata</span><span class="p">,</span> <span class="n">f</span><span class="p">,</span> <span class="n">indent</span><span class="o">=</span><span class="mi">4</span><span class="p">)</span></div>
<div class="viewcode-block" id="find_free_port"><a class="viewcode-back" href="../../pylorax.html#pylorax.installer.find_free_port">[docs]</a><span class="k">def</span> <span class="nf">find_free_port</span><span class="p">(</span><span class="n">start</span><span class="o">=</span><span class="mi">5900</span><span class="p">,</span> <span class="n">end</span><span class="o">=</span><span class="mi">5999</span><span class="p">,</span> <span class="n">host</span><span class="o">=</span><span class="s2">&quot;127.0.0.1&quot;</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot; Return first free port in range.</span>
<span class="sd"> :param int start: Starting port number</span>
<span class="sd"> :param int end: Ending port number</span>
<span class="sd"> :param str host: Host IP to search</span>
<span class="sd"> :returns: First free port or -1 if none found</span>
<span class="sd"> :rtype: int</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="n">s</span> <span class="o">=</span> <span class="n">socket</span><span class="o">.</span><span class="n">socket</span><span class="p">(</span><span class="n">socket</span><span class="o">.</span><span class="n">AF_INET</span><span class="p">,</span> <span class="n">socket</span><span class="o">.</span><span class="n">SOCK_STREAM</span><span class="p">)</span>
<span class="k">for</span> <span class="n">port</span> <span class="ow">in</span> <span class="nb">range</span><span class="p">(</span><span class="n">start</span><span class="p">,</span> <span class="n">end</span><span class="o">+</span><span class="mi">1</span><span class="p">):</span>
<span class="k">try</span><span class="p">:</span>
<span class="n">s</span><span class="o">.</span><span class="n">bind</span><span class="p">((</span><span class="n">host</span><span class="p">,</span> <span class="n">port</span><span class="p">))</span>
<span class="n">s</span><span class="o">.</span><span class="n">close</span><span class="p">()</span>
<span class="k">return</span> <span class="n">port</span>
<span class="k">except</span> <span class="ne">OSError</span><span class="p">:</span>
<span class="k">pass</span>
<span class="k">return</span> <span class="o">-</span><span class="mi">1</span></div>
<div class="viewcode-block" id="append_initrd"><a class="viewcode-back" href="../../pylorax.html#pylorax.installer.append_initrd">[docs]</a><span class="k">def</span> <span class="nf">append_initrd</span><span class="p">(</span><span class="n">initrd</span><span class="p">,</span> <span class="n">files</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot; Append files to an initrd.</span>
<span class="sd"> :param str initrd: Path to initrd</span>
<span class="sd"> :param list files: list of file paths to add</span>
<span class="sd"> :returns: Path to a new initrd</span>
<span class="sd"> :rtype: str</span>
<span class="sd"> The files are added to the initrd by creating a cpio image</span>
<span class="sd"> of the files (stored at /) and writing the cpio to the end of a</span>
<span class="sd"> copy of the initrd.</span>
<span class="sd"> The initrd is not changed, a copy is made before appending the</span>
<span class="sd"> cpio archive.</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="n">qemu_initrd</span> <span class="o">=</span> <span class="n">tempfile</span><span class="o">.</span><span class="n">mktemp</span><span class="p">(</span><span class="n">prefix</span><span class="o">=</span><span class="s2">&quot;lmc-initrd-&quot;</span><span class="p">,</span> <span class="n">suffix</span><span class="o">=</span><span class="s2">&quot;.img&quot;</span><span class="p">)</span>
<span class="n">shutil</span><span class="o">.</span><span class="n">copy2</span><span class="p">(</span><span class="n">initrd</span><span class="p">,</span> <span class="n">qemu_initrd</span><span class="p">)</span>
<span class="n">ks_dir</span> <span class="o">=</span> <span class="n">tempfile</span><span class="o">.</span><span class="n">mkdtemp</span><span class="p">(</span><span class="n">prefix</span><span class="o">=</span><span class="s2">&quot;lmc-ksdir-&quot;</span><span class="p">)</span>
<span class="k">for</span> <span class="n">ks</span> <span class="ow">in</span> <span class="n">files</span><span class="p">:</span>
<span class="n">shutil</span><span class="o">.</span><span class="n">copy2</span><span class="p">(</span><span class="n">ks</span><span class="p">,</span> <span class="n">ks_dir</span><span class="p">)</span>
<span class="n">ks_initrd</span> <span class="o">=</span> <span class="n">tempfile</span><span class="o">.</span><span class="n">mktemp</span><span class="p">(</span><span class="n">prefix</span><span class="o">=</span><span class="s2">&quot;lmc-ks-&quot;</span><span class="p">,</span> <span class="n">suffix</span><span class="o">=</span><span class="s2">&quot;.img&quot;</span><span class="p">)</span>
<span class="n">mkcpio</span><span class="p">(</span><span class="n">ks_dir</span><span class="p">,</span> <span class="n">ks_initrd</span><span class="p">)</span>
<span class="n">shutil</span><span class="o">.</span><span class="n">rmtree</span><span class="p">(</span><span class="n">ks_dir</span><span class="p">)</span>
<span class="k">with</span> <span class="nb">open</span><span class="p">(</span><span class="n">qemu_initrd</span><span class="p">,</span> <span class="s2">&quot;ab&quot;</span><span class="p">)</span> <span class="k">as</span> <span class="n">initrd_fp</span><span class="p">:</span>
<span class="k">with</span> <span class="nb">open</span><span class="p">(</span><span class="n">ks_initrd</span><span class="p">,</span> <span class="s2">&quot;rb&quot;</span><span class="p">)</span> <span class="k">as</span> <span class="n">ks_fp</span><span class="p">:</span>
<span class="k">while</span> <span class="kc">True</span><span class="p">:</span>
<span class="n">data</span> <span class="o">=</span> <span class="n">ks_fp</span><span class="o">.</span><span class="n">read</span><span class="p">(</span><span class="mi">1024</span><span class="o">**</span><span class="mi">2</span><span class="p">)</span>
<span class="k">if</span> <span class="ow">not</span> <span class="n">data</span><span class="p">:</span>
<span class="k">break</span>
<span class="n">initrd_fp</span><span class="o">.</span><span class="n">write</span><span class="p">(</span><span class="n">data</span><span class="p">)</span>
<span class="n">os</span><span class="o">.</span><span class="n">unlink</span><span class="p">(</span><span class="n">ks_initrd</span><span class="p">)</span>
<span class="k">return</span> <span class="n">qemu_initrd</span></div>
<div class="viewcode-block" id="QEMUInstall"><a class="viewcode-back" href="../../pylorax.html#pylorax.installer.QEMUInstall">[docs]</a><span class="k">class</span> <span class="nc">QEMUInstall</span><span class="p">(</span><span class="nb">object</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;</span>
<span class="sd"> Run qemu using an iso and a kickstart</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="c1"># Mapping of arch to qemu command</span>
<span class="n">QEMU_CMDS</span> <span class="o">=</span> <span class="p">{</span><span class="s2">&quot;x86_64&quot;</span><span class="p">:</span> <span class="s2">&quot;qemu-system-x86_64&quot;</span><span class="p">,</span>
<span class="s2">&quot;i386&quot;</span><span class="p">:</span> <span class="s2">&quot;qemu-system-i386&quot;</span><span class="p">,</span>
<span class="s2">&quot;arm&quot;</span><span class="p">:</span> <span class="s2">&quot;qemu-system-arm&quot;</span><span class="p">,</span>
<span class="s2">&quot;aarch64&quot;</span><span class="p">:</span> <span class="s2">&quot;qemu-system-aarch64&quot;</span><span class="p">,</span>
<span class="s2">&quot;ppc&quot;</span><span class="p">:</span> <span class="s2">&quot;qemu-system-ppc&quot;</span><span class="p">,</span>
<span class="s2">&quot;ppc64&quot;</span><span class="p">:</span> <span class="s2">&quot;qemu-system-ppc64&quot;</span>
<span class="p">}</span>
<span class="k">def</span> <span class="nf">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">opts</span><span class="p">,</span> <span class="n">iso</span><span class="p">,</span> <span class="n">ks_paths</span><span class="p">,</span> <span class="n">disk_img</span><span class="p">,</span> <span class="n">img_size</span><span class="o">=</span><span class="mi">2048</span><span class="p">,</span>
<span class="n">kernel_args</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">memory</span><span class="o">=</span><span class="mi">1024</span><span class="p">,</span> <span class="n">vcpus</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">vnc</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">arch</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span>
<span class="n">log_check</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">virtio_host</span><span class="o">=</span><span class="s2">&quot;127.0.0.1&quot;</span><span class="p">,</span> <span class="n">virtio_port</span><span class="o">=</span><span class="mi">6080</span><span class="p">,</span>
<span class="n">image_type</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">boot_uefi</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="n">ovmf_path</span><span class="o">=</span><span class="kc">None</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;</span>
<span class="sd"> Start the installation</span>
<span class="sd"> :param iso: Information about the iso to use for the installation</span>
<span class="sd"> :type iso: IsoMountpoint</span>
<span class="sd"> :param list ks_paths: Paths to kickstart files. All are injected, the</span>
<span class="sd"> first one is the one executed.</span>
<span class="sd"> :param str disk_img: Path to a disk image, created it it doesn&#39;t exist</span>
<span class="sd"> :param int img_size: The image size, in MiB, to create if it doesn&#39;t exist</span>
<span class="sd"> :param str kernel_args: Extra kernel arguments to pass on the kernel cmdline</span>
<span class="sd"> :param int memory: Amount of RAM to assign to the virt, in MiB</span>
<span class="sd"> :param int vcpus: Number of virtual cpus</span>
<span class="sd"> :param str vnc: Arguments to pass to qemu -display</span>
<span class="sd"> :param str arch: Optional architecture to use in the virt</span>
<span class="sd"> :param log_check: Method that returns True if the installation fails</span>
<span class="sd"> :type log_check: method</span>
<span class="sd"> :param str virtio_host: Hostname to connect virtio log to</span>
<span class="sd"> :param int virtio_port: Port to connect virtio log to</span>
<span class="sd"> :param str image_type: Type of qemu-img disk to create, or None.</span>
<span class="sd"> :param bool boot_uefi: Use OVMF to boot the VM in UEFI mode</span>
<span class="sd"> :param str ovmf_path: Path to the OVMF firmware</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="c1"># Lookup qemu-system- for arch if passed, or try to guess using host arch</span>
<span class="n">qemu_cmd</span> <span class="o">=</span> <span class="p">[</span><span class="bp">self</span><span class="o">.</span><span class="n">QEMU_CMDS</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="n">arch</span> <span class="ow">or</span> <span class="n">os</span><span class="o">.</span><span class="n">uname</span><span class="p">()</span><span class="o">.</span><span class="n">machine</span><span class="p">,</span> <span class="s2">&quot;qemu-system-&quot;</span><span class="o">+</span><span class="n">os</span><span class="o">.</span><span class="n">uname</span><span class="p">()</span><span class="o">.</span><span class="n">machine</span><span class="p">)]</span>
<span class="k">if</span> <span class="ow">not</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">exists</span><span class="p">(</span><span class="s2">&quot;/usr/bin/&quot;</span><span class="o">+</span><span class="n">qemu_cmd</span><span class="p">[</span><span class="mi">0</span><span class="p">]):</span>
<span class="k">raise</span> <span class="n">InstallError</span><span class="p">(</span><span class="s2">&quot;</span><span class="si">%s</span><span class="s2"> does not exist, cannot run qemu&quot;</span> <span class="o">%</span> <span class="n">qemu_cmd</span><span class="p">[</span><span class="mi">0</span><span class="p">])</span>
<span class="n">qemu_cmd</span> <span class="o">+=</span> <span class="p">[</span><span class="s2">&quot;-nodefconfig&quot;</span><span class="p">]</span>
<span class="n">qemu_cmd</span> <span class="o">+=</span> <span class="p">[</span><span class="s2">&quot;-m&quot;</span><span class="p">,</span> <span class="nb">str</span><span class="p">(</span><span class="n">memory</span><span class="p">)]</span>
<span class="k">if</span> <span class="n">vcpus</span><span class="p">:</span>
<span class="n">qemu_cmd</span> <span class="o">+=</span> <span class="p">[</span><span class="s2">&quot;-smp&quot;</span><span class="p">,</span> <span class="nb">str</span><span class="p">(</span><span class="n">vcpus</span><span class="p">)]</span>
<span class="k">if</span> <span class="ow">not</span> <span class="n">opts</span><span class="o">.</span><span class="n">no_kvm</span> <span class="ow">and</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">exists</span><span class="p">(</span><span class="s2">&quot;/dev/kvm&quot;</span><span class="p">):</span>
<span class="n">qemu_cmd</span> <span class="o">+=</span> <span class="p">[</span><span class="s2">&quot;--machine&quot;</span><span class="p">,</span> <span class="s2">&quot;accel=kvm&quot;</span><span class="p">]</span>
<span class="c1"># Copy the initrd from the iso, create a cpio archive of the kickstart files</span>
<span class="c1"># and append it to the temporary initrd.</span>
<span class="n">qemu_initrd</span> <span class="o">=</span> <span class="n">append_initrd</span><span class="p">(</span><span class="n">iso</span><span class="o">.</span><span class="n">initrd</span><span class="p">,</span> <span class="n">ks_paths</span><span class="p">)</span>
<span class="n">qemu_cmd</span> <span class="o">+=</span> <span class="p">[</span><span class="s2">&quot;-kernel&quot;</span><span class="p">,</span> <span class="n">iso</span><span class="o">.</span><span class="n">kernel</span><span class="p">]</span>
<span class="n">qemu_cmd</span> <span class="o">+=</span> <span class="p">[</span><span class="s2">&quot;-initrd&quot;</span><span class="p">,</span> <span class="n">qemu_initrd</span><span class="p">]</span>
<span class="c1"># Add the disk and cdrom</span>
<span class="k">if</span> <span class="ow">not</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">isfile</span><span class="p">(</span><span class="n">disk_img</span><span class="p">):</span>
<span class="n">mksparse</span><span class="p">(</span><span class="n">disk_img</span><span class="p">,</span> <span class="n">img_size</span> <span class="o">*</span> <span class="mi">1024</span><span class="o">**</span><span class="mi">2</span><span class="p">)</span>
<span class="n">drive_args</span> <span class="o">=</span> <span class="s2">&quot;file=</span><span class="si">%s</span><span class="s2">&quot;</span> <span class="o">%</span> <span class="n">disk_img</span>
<span class="n">drive_args</span> <span class="o">+=</span> <span class="s2">&quot;,cache=unsafe,discard=unmap&quot;</span>
<span class="k">if</span> <span class="n">image_type</span><span class="p">:</span>
<span class="n">drive_args</span> <span class="o">+=</span> <span class="s2">&quot;,format=</span><span class="si">%s</span><span class="s2">&quot;</span> <span class="o">%</span> <span class="n">image_type</span>
<span class="k">else</span><span class="p">:</span>
<span class="n">drive_args</span> <span class="o">+=</span> <span class="s2">&quot;,format=raw&quot;</span>
<span class="n">qemu_cmd</span> <span class="o">+=</span> <span class="p">[</span><span class="s2">&quot;-drive&quot;</span><span class="p">,</span> <span class="n">drive_args</span><span class="p">]</span>
<span class="n">drive_args</span> <span class="o">=</span> <span class="s2">&quot;file=</span><span class="si">%s</span><span class="s2">,media=cdrom,readonly=on&quot;</span> <span class="o">%</span> <span class="n">iso</span><span class="o">.</span><span class="n">iso_path</span>
<span class="n">qemu_cmd</span> <span class="o">+=</span> <span class="p">[</span><span class="s2">&quot;-drive&quot;</span><span class="p">,</span> <span class="n">drive_args</span><span class="p">]</span>
<span class="c1"># Setup the cmdline args</span>
<span class="c1"># ======================</span>
<span class="n">cmdline_args</span> <span class="o">=</span> <span class="s2">&quot;ks=file:/</span><span class="si">%s</span><span class="s2">&quot;</span> <span class="o">%</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">basename</span><span class="p">(</span><span class="n">ks_paths</span><span class="p">[</span><span class="mi">0</span><span class="p">])</span>
<span class="n">cmdline_args</span> <span class="o">+=</span> <span class="s2">&quot; inst.stage2=hd:LABEL=</span><span class="si">%s</span><span class="s2">&quot;</span> <span class="o">%</span> <span class="n">udev_escape</span><span class="p">(</span><span class="n">iso</span><span class="o">.</span><span class="n">label</span><span class="p">)</span>
<span class="k">if</span> <span class="n">opts</span><span class="o">.</span><span class="n">proxy</span><span class="p">:</span>
<span class="n">cmdline_args</span> <span class="o">+=</span> <span class="s2">&quot; inst.proxy=</span><span class="si">%s</span><span class="s2">&quot;</span> <span class="o">%</span> <span class="n">opts</span><span class="o">.</span><span class="n">proxy</span>
<span class="k">if</span> <span class="n">kernel_args</span><span class="p">:</span>
<span class="n">cmdline_args</span> <span class="o">+=</span> <span class="s2">&quot; &quot;</span><span class="o">+</span><span class="n">kernel_args</span>
<span class="n">cmdline_args</span> <span class="o">+=</span> <span class="s2">&quot; inst.text inst.cmdline&quot;</span>
<span class="n">qemu_cmd</span> <span class="o">+=</span> <span class="p">[</span><span class="s2">&quot;-append&quot;</span><span class="p">,</span> <span class="n">cmdline_args</span><span class="p">]</span>
<span class="k">if</span> <span class="ow">not</span> <span class="n">opts</span><span class="o">.</span><span class="n">vnc</span><span class="p">:</span>
<span class="n">vnc_port</span> <span class="o">=</span> <span class="n">find_free_port</span><span class="p">()</span>
<span class="k">if</span> <span class="n">vnc_port</span> <span class="o">==</span> <span class="o">-</span><span class="mi">1</span><span class="p">:</span>
<span class="k">raise</span> <span class="n">InstallError</span><span class="p">(</span><span class="s2">&quot;No free VNC ports&quot;</span><span class="p">)</span>
<span class="n">display_args</span> <span class="o">=</span> <span class="s2">&quot;vnc=127.0.0.1:</span><span class="si">%d</span><span class="s2">&quot;</span> <span class="o">%</span> <span class="p">(</span><span class="n">vnc_port</span> <span class="o">-</span> <span class="mi">5900</span><span class="p">)</span>
<span class="k">else</span><span class="p">:</span>
<span class="n">display_args</span> <span class="o">=</span> <span class="n">opts</span><span class="o">.</span><span class="n">vnc</span>
<span class="n">log</span><span class="o">.</span><span class="n">info</span><span class="p">(</span><span class="s2">&quot;qemu </span><span class="si">%s</span><span class="s2">&quot;</span><span class="p">,</span> <span class="n">display_args</span><span class="p">)</span>
<span class="n">qemu_cmd</span> <span class="o">+=</span> <span class="p">[</span><span class="s2">&quot;-nographic&quot;</span><span class="p">,</span> <span class="s2">&quot;-display&quot;</span><span class="p">,</span> <span class="n">display_args</span> <span class="p">]</span>
<span class="c1"># Setup the virtio log port</span>
<span class="n">qemu_cmd</span> <span class="o">+=</span> <span class="p">[</span><span class="s2">&quot;-device&quot;</span><span class="p">,</span> <span class="s2">&quot;virtio-serial-pci,id=virtio-serial0&quot;</span><span class="p">]</span>
<span class="n">qemu_cmd</span> <span class="o">+=</span> <span class="p">[</span><span class="s2">&quot;-device&quot;</span><span class="p">,</span> <span class="s2">&quot;virtserialport,bus=virtio-serial0.0,nr=1,chardev=charchannel0&quot;</span>
<span class="s2">&quot;,id=channel0,name=org.fedoraproject.anaconda.log.0&quot;</span><span class="p">]</span>
<span class="n">qemu_cmd</span> <span class="o">+=</span> <span class="p">[</span><span class="s2">&quot;-chardev&quot;</span><span class="p">,</span> <span class="s2">&quot;socket,id=charchannel0,host=</span><span class="si">%s</span><span class="s2">,port=</span><span class="si">%s</span><span class="s2">&quot;</span> <span class="o">%</span> <span class="p">(</span><span class="n">virtio_host</span><span class="p">,</span> <span class="n">virtio_port</span><span class="p">)]</span>
<span class="c1"># PAss through rng from host</span>
<span class="k">if</span> <span class="n">opts</span><span class="o">.</span><span class="n">with_rng</span> <span class="o">!=</span> <span class="s2">&quot;none&quot;</span><span class="p">:</span>
<span class="n">qemu_cmd</span> <span class="o">+=</span> <span class="p">[</span><span class="s2">&quot;-object&quot;</span><span class="p">,</span> <span class="s2">&quot;rng-random,id=virtio-rng0,filename=</span><span class="si">%s</span><span class="s2">&quot;</span> <span class="o">%</span> <span class="n">opts</span><span class="o">.</span><span class="n">with_rng</span><span class="p">]</span>
<span class="n">qemu_cmd</span> <span class="o">+=</span> <span class="p">[</span><span class="s2">&quot;-device&quot;</span><span class="p">,</span> <span class="s2">&quot;virtio-rng-pci,rng=virtio-rng0,id=rng0,bus=pci.0,addr=0x9&quot;</span><span class="p">]</span>
<span class="k">if</span> <span class="n">boot_uefi</span> <span class="ow">and</span> <span class="n">ovmf_path</span><span class="p">:</span>
<span class="n">qemu_cmd</span> <span class="o">+=</span> <span class="p">[</span><span class="s2">&quot;-drive&quot;</span><span class="p">,</span> <span class="s2">&quot;file=</span><span class="si">%s</span><span class="s2">/OVMF_CODE.fd,if=pflash,format=raw,unit=0,readonly=on&quot;</span> <span class="o">%</span> <span class="n">ovmf_path</span><span class="p">]</span>
<span class="c1"># Make a copy of the OVMF_VARS.fd for this run</span>
<span class="n">ovmf_vars</span> <span class="o">=</span> <span class="n">tempfile</span><span class="o">.</span><span class="n">mktemp</span><span class="p">(</span><span class="n">prefix</span><span class="o">=</span><span class="s2">&quot;lmc-OVMF_VARS-&quot;</span><span class="p">,</span> <span class="n">suffix</span><span class="o">=</span><span class="s2">&quot;.fd&quot;</span><span class="p">)</span>
<span class="n">shutil</span><span class="o">.</span><span class="n">copy2</span><span class="p">(</span><span class="n">joinpaths</span><span class="p">(</span><span class="n">ovmf_path</span><span class="p">,</span> <span class="s2">&quot;/OVMF_VARS.fd&quot;</span><span class="p">),</span> <span class="n">ovmf_vars</span><span class="p">)</span>
<span class="n">qemu_cmd</span> <span class="o">+=</span> <span class="p">[</span><span class="s2">&quot;-drive&quot;</span><span class="p">,</span> <span class="s2">&quot;file=</span><span class="si">%s</span><span class="s2">,if=pflash,format=raw,unit=1&quot;</span> <span class="o">%</span> <span class="n">ovmf_vars</span><span class="p">]</span>
<span class="n">log</span><span class="o">.</span><span class="n">info</span><span class="p">(</span><span class="s2">&quot;Running qemu&quot;</span><span class="p">)</span>
<span class="n">log</span><span class="o">.</span><span class="n">debug</span><span class="p">(</span><span class="n">qemu_cmd</span><span class="p">)</span>
<span class="k">try</span><span class="p">:</span>
<span class="n">execWithRedirect</span><span class="p">(</span><span class="n">qemu_cmd</span><span class="p">[</span><span class="mi">0</span><span class="p">],</span> <span class="n">qemu_cmd</span><span class="p">[</span><span class="mi">1</span><span class="p">:],</span> <span class="n">reset_lang</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="n">raise_err</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span>
<span class="n">callback</span><span class="o">=</span><span class="k">lambda</span> <span class="n">p</span><span class="p">:</span> <span class="ow">not</span> <span class="n">log_check</span><span class="p">())</span>
<span class="k">except</span> <span class="n">subprocess</span><span class="o">.</span><span class="n">CalledProcessError</span> <span class="k">as</span> <span class="n">e</span><span class="p">:</span>
<span class="n">log</span><span class="o">.</span><span class="n">error</span><span class="p">(</span><span class="s2">&quot;Running qemu failed:&quot;</span><span class="p">)</span>
<span class="n">log</span><span class="o">.</span><span class="n">error</span><span class="p">(</span><span class="s2">&quot;cmd: </span><span class="si">%s</span><span class="s2">&quot;</span><span class="p">,</span> <span class="s2">&quot; &quot;</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="n">e</span><span class="o">.</span><span class="n">cmd</span><span class="p">))</span>
<span class="n">log</span><span class="o">.</span><span class="n">error</span><span class="p">(</span><span class="s2">&quot;output: </span><span class="si">%s</span><span class="s2">&quot;</span><span class="p">,</span> <span class="n">e</span><span class="o">.</span><span class="n">output</span> <span class="ow">or</span> <span class="s2">&quot;&quot;</span><span class="p">)</span>
<span class="k">raise</span> <span class="n">InstallError</span><span class="p">(</span><span class="s2">&quot;QEMUInstall failed&quot;</span><span class="p">)</span>
<span class="k">except</span> <span class="p">(</span><span class="ne">OSError</span><span class="p">,</span> <span class="ne">KeyboardInterrupt</span><span class="p">)</span> <span class="k">as</span> <span class="n">e</span><span class="p">:</span>
<span class="n">log</span><span class="o">.</span><span class="n">error</span><span class="p">(</span><span class="s2">&quot;Running qemu failed: </span><span class="si">%s</span><span class="s2">&quot;</span><span class="p">,</span> <span class="nb">str</span><span class="p">(</span><span class="n">e</span><span class="p">))</span>
<span class="k">raise</span> <span class="n">InstallError</span><span class="p">(</span><span class="s2">&quot;QEMUInstall failed&quot;</span><span class="p">)</span>
<span class="k">finally</span><span class="p">:</span>
<span class="n">os</span><span class="o">.</span><span class="n">unlink</span><span class="p">(</span><span class="n">qemu_initrd</span><span class="p">)</span>
<span class="k">if</span> <span class="n">boot_uefi</span> <span class="ow">and</span> <span class="n">ovmf_path</span><span class="p">:</span>
<span class="n">os</span><span class="o">.</span><span class="n">unlink</span><span class="p">(</span><span class="n">ovmf_vars</span><span class="p">)</span>
<span class="k">if</span> <span class="n">log_check</span><span class="p">():</span>
<span class="n">log</span><span class="o">.</span><span class="n">error</span><span class="p">(</span><span class="s2">&quot;Installation error detected. See logfile for details.&quot;</span><span class="p">)</span>
<span class="k">raise</span> <span class="n">InstallError</span><span class="p">(</span><span class="s2">&quot;QEMUInstall failed&quot;</span><span class="p">)</span>
<span class="k">else</span><span class="p">:</span>
<span class="n">log</span><span class="o">.</span><span class="n">info</span><span class="p">(</span><span class="s2">&quot;Installation finished without errors.&quot;</span><span class="p">)</span></div>
<div class="viewcode-block" id="novirt_log_check"><a class="viewcode-back" href="../../pylorax.html#pylorax.installer.novirt_log_check">[docs]</a><span class="k">def</span> <span class="nf">novirt_log_check</span><span class="p">(</span><span class="n">log_check</span><span class="p">,</span> <span class="n">proc</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;</span>
<span class="sd"> Check to see if there has been an error in the logs</span>
<span class="sd"> :param log_check: method to call to check for an error in the logs</span>
<span class="sd"> :param proc: Popen object for the anaconda process</span>
<span class="sd"> :returns: True if the process has been terminated</span>
<span class="sd"> The log_check method should return a True if an error has been detected.</span>
<span class="sd"> When an error is detected the process is terminated and this returns True</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="k">if</span> <span class="n">log_check</span><span class="p">():</span>
<span class="n">proc</span><span class="o">.</span><span class="n">terminate</span><span class="p">()</span>
<span class="k">return</span> <span class="kc">True</span>
<span class="k">return</span> <span class="kc">False</span></div>
<div class="viewcode-block" id="anaconda_cleanup"><a class="viewcode-back" href="../../pylorax.html#pylorax.installer.anaconda_cleanup">[docs]</a><span class="k">def</span> <span class="nf">anaconda_cleanup</span><span class="p">(</span><span class="n">dirinstall_path</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;</span>
<span class="sd"> Cleanup any leftover mounts from anaconda</span>
<span class="sd"> :param str dirinstall_path: Path where anaconda mounts things</span>
<span class="sd"> :returns: True if cleanups were successful. False if any of them failed.</span>
<span class="sd"> If anaconda crashes it may leave things mounted under this path. It will</span>
<span class="sd"> typically be set to /mnt/sysimage/</span>
<span class="sd"> Attempts to cleanup may also fail. Catch these and continue trying the</span>
<span class="sd"> other mountpoints.</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="n">rc</span> <span class="o">=</span> <span class="kc">True</span>
<span class="n">dirinstall_path</span> <span class="o">=</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">abspath</span><span class="p">(</span><span class="n">dirinstall_path</span><span class="p">)</span>
<span class="c1"># unmount filesystems</span>
<span class="k">for</span> <span class="n">mounted</span> <span class="ow">in</span> <span class="nb">reversed</span><span class="p">(</span><span class="nb">open</span><span class="p">(</span><span class="s2">&quot;/proc/mounts&quot;</span><span class="p">)</span><span class="o">.</span><span class="n">readlines</span><span class="p">()):</span>
<span class="p">(</span><span class="n">_device</span><span class="p">,</span> <span class="n">mountpoint</span><span class="p">,</span> <span class="n">_rest</span><span class="p">)</span> <span class="o">=</span> <span class="n">mounted</span><span class="o">.</span><span class="n">split</span><span class="p">(</span><span class="s2">&quot; &quot;</span><span class="p">,</span> <span class="mi">2</span><span class="p">)</span>
<span class="k">if</span> <span class="n">mountpoint</span><span class="o">.</span><span class="n">startswith</span><span class="p">(</span><span class="n">dirinstall_path</span><span class="p">)</span> <span class="ow">and</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">ismount</span><span class="p">(</span><span class="n">mountpoint</span><span class="p">):</span>
<span class="k">try</span><span class="p">:</span>
<span class="n">umount</span><span class="p">(</span><span class="n">mountpoint</span><span class="p">)</span>
<span class="k">except</span> <span class="n">subprocess</span><span class="o">.</span><span class="n">CalledProcessError</span><span class="p">:</span>
<span class="n">log</span><span class="o">.</span><span class="n">error</span><span class="p">(</span><span class="s2">&quot;Cleanup of </span><span class="si">%s</span><span class="s2"> failed. See program.log for details&quot;</span><span class="p">,</span> <span class="n">mountpoint</span><span class="p">)</span>
<span class="n">rc</span> <span class="o">=</span> <span class="kc">False</span>
<span class="k">return</span> <span class="n">rc</span></div>
<div class="viewcode-block" id="novirt_install"><a class="viewcode-back" href="../../pylorax.html#pylorax.installer.novirt_install">[docs]</a><span class="k">def</span> <span class="nf">novirt_install</span><span class="p">(</span><span class="n">opts</span><span class="p">,</span> <span class="n">disk_img</span><span class="p">,</span> <span class="n">disk_size</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;</span>
<span class="sd"> Use Anaconda to install to a disk image</span>
<span class="sd"> :param opts: options passed to livemedia-creator</span>
<span class="sd"> :type opts: argparse options</span>
<span class="sd"> :param str disk_img: The full path to the disk image to be created</span>
<span class="sd"> :param int disk_size: The size of the disk_img in MiB</span>
<span class="sd"> This method runs anaconda to create the image and then based on the opts</span>
<span class="sd"> passed creates a qemu disk image or tarfile.</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="n">dirinstall_path</span> <span class="o">=</span> <span class="n">ROOT_PATH</span>
<span class="c1"># Clean up /tmp/ from previous runs to prevent stale info from being used</span>
<span class="k">for</span> <span class="n">path</span> <span class="ow">in</span> <span class="p">[</span><span class="s2">&quot;/tmp/yum.repos.d/&quot;</span><span class="p">,</span> <span class="s2">&quot;/tmp/yum.cache/&quot;</span><span class="p">]:</span>
<span class="k">if</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">isdir</span><span class="p">(</span><span class="n">path</span><span class="p">):</span>
<span class="n">shutil</span><span class="o">.</span><span class="n">rmtree</span><span class="p">(</span><span class="n">path</span><span class="p">)</span>
<span class="n">args</span> <span class="o">=</span> <span class="p">[</span><span class="s2">&quot;--kickstart&quot;</span><span class="p">,</span> <span class="n">opts</span><span class="o">.</span><span class="n">ks</span><span class="p">[</span><span class="mi">0</span><span class="p">],</span> <span class="s2">&quot;--cmdline&quot;</span><span class="p">,</span> <span class="s2">&quot;--loglevel&quot;</span><span class="p">,</span> <span class="s2">&quot;debug&quot;</span><span class="p">]</span>
<span class="k">if</span> <span class="n">opts</span><span class="o">.</span><span class="n">anaconda_args</span><span class="p">:</span>
<span class="k">for</span> <span class="n">arg</span> <span class="ow">in</span> <span class="n">opts</span><span class="o">.</span><span class="n">anaconda_args</span><span class="p">:</span>
<span class="n">args</span> <span class="o">+=</span> <span class="n">arg</span><span class="o">.</span><span class="n">split</span><span class="p">(</span><span class="s2">&quot; &quot;</span><span class="p">,</span> <span class="mi">1</span><span class="p">)</span>
<span class="k">if</span> <span class="n">opts</span><span class="o">.</span><span class="n">proxy</span><span class="p">:</span>
<span class="n">args</span> <span class="o">+=</span> <span class="p">[</span><span class="s2">&quot;--proxy&quot;</span><span class="p">,</span> <span class="n">opts</span><span class="o">.</span><span class="n">proxy</span><span class="p">]</span>
<span class="k">if</span> <span class="n">opts</span><span class="o">.</span><span class="n">armplatform</span><span class="p">:</span>
<span class="n">args</span> <span class="o">+=</span> <span class="p">[</span><span class="s2">&quot;--armplatform&quot;</span><span class="p">,</span> <span class="n">opts</span><span class="o">.</span><span class="n">armplatform</span><span class="p">]</span>
<span class="k">if</span> <span class="n">opts</span><span class="o">.</span><span class="n">make_iso</span> <span class="ow">or</span> <span class="n">opts</span><span class="o">.</span><span class="n">make_fsimage</span> <span class="ow">or</span> <span class="n">opts</span><span class="o">.</span><span class="n">make_pxe_live</span><span class="p">:</span>
<span class="c1"># Make a blank fs image</span>
<span class="n">args</span> <span class="o">+=</span> <span class="p">[</span><span class="s2">&quot;--dirinstall&quot;</span><span class="p">]</span>
<span class="n">mkext4img</span><span class="p">(</span><span class="kc">None</span><span class="p">,</span> <span class="n">disk_img</span><span class="p">,</span> <span class="n">label</span><span class="o">=</span><span class="n">opts</span><span class="o">.</span><span class="n">fs_label</span><span class="p">,</span> <span class="n">size</span><span class="o">=</span><span class="n">disk_size</span> <span class="o">*</span> <span class="mi">1024</span><span class="o">**</span><span class="mi">2</span><span class="p">)</span>
<span class="k">if</span> <span class="ow">not</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">isdir</span><span class="p">(</span><span class="n">dirinstall_path</span><span class="p">):</span>
<span class="n">os</span><span class="o">.</span><span class="n">mkdir</span><span class="p">(</span><span class="n">dirinstall_path</span><span class="p">)</span>
<span class="n">mount</span><span class="p">(</span><span class="n">disk_img</span><span class="p">,</span> <span class="n">opts</span><span class="o">=</span><span class="s2">&quot;loop&quot;</span><span class="p">,</span> <span class="n">mnt</span><span class="o">=</span><span class="n">dirinstall_path</span><span class="p">)</span>
<span class="k">elif</span> <span class="n">opts</span><span class="o">.</span><span class="n">make_tar</span> <span class="ow">or</span> <span class="n">opts</span><span class="o">.</span><span class="n">make_oci</span><span class="p">:</span>
<span class="c1"># Install under dirinstall_path, make sure it starts clean</span>
<span class="k">if</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">exists</span><span class="p">(</span><span class="n">dirinstall_path</span><span class="p">):</span>
<span class="n">shutil</span><span class="o">.</span><span class="n">rmtree</span><span class="p">(</span><span class="n">dirinstall_path</span><span class="p">)</span>
<span class="k">if</span> <span class="n">opts</span><span class="o">.</span><span class="n">make_oci</span><span class="p">:</span>
<span class="c1"># OCI installs under /rootfs/</span>
<span class="n">dirinstall_path</span> <span class="o">=</span> <span class="n">joinpaths</span><span class="p">(</span><span class="n">dirinstall_path</span><span class="p">,</span> <span class="s2">&quot;rootfs&quot;</span><span class="p">)</span>
<span class="n">args</span> <span class="o">+=</span> <span class="p">[</span><span class="s2">&quot;--dirinstall&quot;</span><span class="p">,</span> <span class="n">dirinstall_path</span><span class="p">]</span>
<span class="k">else</span><span class="p">:</span>
<span class="n">args</span> <span class="o">+=</span> <span class="p">[</span><span class="s2">&quot;--dirinstall&quot;</span><span class="p">]</span>
<span class="n">os</span><span class="o">.</span><span class="n">makedirs</span><span class="p">(</span><span class="n">dirinstall_path</span><span class="p">)</span>
<span class="k">else</span><span class="p">:</span>
<span class="n">args</span> <span class="o">+=</span> <span class="p">[</span><span class="s2">&quot;--image&quot;</span><span class="p">,</span> <span class="n">disk_img</span><span class="p">]</span>
<span class="c1"># Create the sparse image</span>
<span class="n">mksparse</span><span class="p">(</span><span class="n">disk_img</span><span class="p">,</span> <span class="n">disk_size</span> <span class="o">*</span> <span class="mi">1024</span><span class="o">**</span><span class="mi">2</span><span class="p">)</span>
<span class="n">log_monitor</span> <span class="o">=</span> <span class="n">LogMonitor</span><span class="p">(</span><span class="n">timeout</span><span class="o">=</span><span class="n">opts</span><span class="o">.</span><span class="n">timeout</span><span class="p">)</span>
<span class="n">args</span> <span class="o">+=</span> <span class="p">[</span><span class="s2">&quot;--remotelog&quot;</span><span class="p">,</span> <span class="s2">&quot;</span><span class="si">%s</span><span class="s2">:</span><span class="si">%s</span><span class="s2">&quot;</span> <span class="o">%</span> <span class="p">(</span><span class="n">log_monitor</span><span class="o">.</span><span class="n">host</span><span class="p">,</span> <span class="n">log_monitor</span><span class="o">.</span><span class="n">port</span><span class="p">)]</span>
<span class="c1"># Make sure anaconda has the right product and release</span>
<span class="n">log</span><span class="o">.</span><span class="n">info</span><span class="p">(</span><span class="s2">&quot;Running anaconda.&quot;</span><span class="p">)</span>
<span class="k">try</span><span class="p">:</span>
<span class="k">for</span> <span class="n">line</span> <span class="ow">in</span> <span class="n">execReadlines</span><span class="p">(</span><span class="s2">&quot;anaconda&quot;</span><span class="p">,</span> <span class="n">args</span><span class="p">,</span> <span class="n">reset_lang</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span>
<span class="n">env_add</span><span class="o">=</span><span class="p">{</span><span class="s2">&quot;ANACONDA_PRODUCTNAME&quot;</span><span class="p">:</span> <span class="n">opts</span><span class="o">.</span><span class="n">project</span><span class="p">,</span>
<span class="s2">&quot;ANACONDA_PRODUCTVERSION&quot;</span><span class="p">:</span> <span class="n">opts</span><span class="o">.</span><span class="n">releasever</span><span class="p">},</span>
<span class="n">callback</span><span class="o">=</span><span class="k">lambda</span> <span class="n">p</span><span class="p">:</span> <span class="ow">not</span> <span class="n">novirt_log_check</span><span class="p">(</span><span class="n">log_monitor</span><span class="o">.</span><span class="n">server</span><span class="o">.</span><span class="n">log_check</span><span class="p">,</span> <span class="n">p</span><span class="p">)):</span>
<span class="n">log</span><span class="o">.</span><span class="n">info</span><span class="p">(</span><span class="n">line</span><span class="p">)</span>
<span class="c1"># Make sure the new filesystem is correctly labeled</span>
<span class="n">setfiles_args</span> <span class="o">=</span> <span class="p">[</span><span class="s2">&quot;-e&quot;</span><span class="p">,</span> <span class="s2">&quot;/proc&quot;</span><span class="p">,</span> <span class="s2">&quot;-e&quot;</span><span class="p">,</span> <span class="s2">&quot;/sys&quot;</span><span class="p">,</span> <span class="s2">&quot;-e&quot;</span><span class="p">,</span> <span class="s2">&quot;/dev&quot;</span><span class="p">,</span>
<span class="s2">&quot;/etc/selinux/targeted/contexts/files/file_contexts&quot;</span><span class="p">,</span> <span class="s2">&quot;/&quot;</span><span class="p">]</span>
<span class="c1"># setfiles may not be available, warn instead of fail</span>
<span class="k">try</span><span class="p">:</span>
<span class="k">if</span> <span class="s2">&quot;--dirinstall&quot;</span> <span class="ow">in</span> <span class="n">args</span><span class="p">:</span>
<span class="n">execWithRedirect</span><span class="p">(</span><span class="s2">&quot;setfiles&quot;</span><span class="p">,</span> <span class="n">setfiles_args</span><span class="p">,</span> <span class="n">root</span><span class="o">=</span><span class="n">dirinstall_path</span><span class="p">)</span>
<span class="k">else</span><span class="p">:</span>
<span class="k">with</span> <span class="n">PartitionMount</span><span class="p">(</span><span class="n">disk_img</span><span class="p">)</span> <span class="k">as</span> <span class="n">img_mount</span><span class="p">:</span>
<span class="k">if</span> <span class="n">img_mount</span> <span class="ow">and</span> <span class="n">img_mount</span><span class="o">.</span><span class="n">mount_dir</span><span class="p">:</span>
<span class="n">execWithRedirect</span><span class="p">(</span><span class="s2">&quot;setfiles&quot;</span><span class="p">,</span> <span class="n">setfiles_args</span><span class="p">,</span> <span class="n">root</span><span class="o">=</span><span class="n">img_mount</span><span class="o">.</span><span class="n">mount_dir</span><span class="p">)</span>
<span class="k">except</span> <span class="p">(</span><span class="n">subprocess</span><span class="o">.</span><span class="n">CalledProcessError</span><span class="p">,</span> <span class="ne">OSError</span><span class="p">)</span> <span class="k">as</span> <span class="n">e</span><span class="p">:</span>
<span class="n">log</span><span class="o">.</span><span class="n">warning</span><span class="p">(</span><span class="s2">&quot;Running setfiles on install tree failed: </span><span class="si">%s</span><span class="s2">&quot;</span><span class="p">,</span> <span class="nb">str</span><span class="p">(</span><span class="n">e</span><span class="p">))</span>
<span class="k">except</span> <span class="p">(</span><span class="n">subprocess</span><span class="o">.</span><span class="n">CalledProcessError</span><span class="p">,</span> <span class="ne">OSError</span><span class="p">)</span> <span class="k">as</span> <span class="n">e</span><span class="p">:</span>
<span class="n">log</span><span class="o">.</span><span class="n">error</span><span class="p">(</span><span class="s2">&quot;Running anaconda failed: </span><span class="si">%s</span><span class="s2">&quot;</span><span class="p">,</span> <span class="n">e</span><span class="p">)</span>
<span class="k">raise</span> <span class="n">InstallError</span><span class="p">(</span><span class="s2">&quot;novirt_install failed&quot;</span><span class="p">)</span>
<span class="k">finally</span><span class="p">:</span>
<span class="n">log_monitor</span><span class="o">.</span><span class="n">shutdown</span><span class="p">()</span>
<span class="c1"># Move the anaconda logs over to a log directory</span>
<span class="n">log_dir</span> <span class="o">=</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">abspath</span><span class="p">(</span><span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">dirname</span><span class="p">(</span><span class="n">opts</span><span class="o">.</span><span class="n">logfile</span><span class="p">))</span>
<span class="n">log_anaconda</span> <span class="o">=</span> <span class="n">joinpaths</span><span class="p">(</span><span class="n">log_dir</span><span class="p">,</span> <span class="s2">&quot;anaconda&quot;</span><span class="p">)</span>
<span class="k">if</span> <span class="ow">not</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">isdir</span><span class="p">(</span><span class="n">log_anaconda</span><span class="p">):</span>
<span class="n">os</span><span class="o">.</span><span class="n">mkdir</span><span class="p">(</span><span class="n">log_anaconda</span><span class="p">)</span>
<span class="k">for</span> <span class="n">l</span> <span class="ow">in</span> <span class="n">glob</span><span class="o">.</span><span class="n">glob</span><span class="p">(</span><span class="s2">&quot;/tmp/*log&quot;</span><span class="p">)</span><span class="o">+</span><span class="n">glob</span><span class="o">.</span><span class="n">glob</span><span class="p">(</span><span class="s2">&quot;/tmp/anaconda-tb-*&quot;</span><span class="p">):</span>
<span class="n">shutil</span><span class="o">.</span><span class="n">copy2</span><span class="p">(</span><span class="n">l</span><span class="p">,</span> <span class="n">log_anaconda</span><span class="p">)</span>
<span class="n">os</span><span class="o">.</span><span class="n">unlink</span><span class="p">(</span><span class="n">l</span><span class="p">)</span>
<span class="c1"># Make sure any leftover anaconda mounts have been cleaned up</span>
<span class="k">if</span> <span class="ow">not</span> <span class="n">anaconda_cleanup</span><span class="p">(</span><span class="n">dirinstall_path</span><span class="p">):</span>
<span class="k">raise</span> <span class="n">InstallError</span><span class="p">(</span><span class="s2">&quot;novirt_install cleanup of anaconda mounts failed.&quot;</span><span class="p">)</span>
<span class="k">if</span> <span class="ow">not</span> <span class="n">opts</span><span class="o">.</span><span class="n">make_iso</span> <span class="ow">and</span> <span class="ow">not</span> <span class="n">opts</span><span class="o">.</span><span class="n">make_fsimage</span> <span class="ow">and</span> <span class="ow">not</span> <span class="n">opts</span><span class="o">.</span><span class="n">make_pxe_live</span><span class="p">:</span>
<span class="n">dm_name</span> <span class="o">=</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">splitext</span><span class="p">(</span><span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">basename</span><span class="p">(</span><span class="n">disk_img</span><span class="p">))[</span><span class="mi">0</span><span class="p">]</span>
<span class="n">dm_path</span> <span class="o">=</span> <span class="s2">&quot;/dev/mapper/&quot;</span><span class="o">+</span><span class="n">dm_name</span>
<span class="k">if</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">exists</span><span class="p">(</span><span class="n">dm_path</span><span class="p">):</span>
<span class="n">dm_detach</span><span class="p">(</span><span class="n">dm_path</span><span class="p">)</span>
<span class="n">loop_detach</span><span class="p">(</span><span class="n">get_loop_name</span><span class="p">(</span><span class="n">disk_img</span><span class="p">))</span>
<span class="c1"># qemu disk image is used by bare qcow2 images and by Vagrant</span>
<span class="k">if</span> <span class="n">opts</span><span class="o">.</span><span class="n">image_type</span><span class="p">:</span>
<span class="n">log</span><span class="o">.</span><span class="n">info</span><span class="p">(</span><span class="s2">&quot;Converting </span><span class="si">%s</span><span class="s2"> to </span><span class="si">%s</span><span class="s2">&quot;</span><span class="p">,</span> <span class="n">disk_img</span><span class="p">,</span> <span class="n">opts</span><span class="o">.</span><span class="n">image_type</span><span class="p">)</span>
<span class="n">qemu_args</span> <span class="o">=</span> <span class="p">[]</span>
<span class="k">for</span> <span class="n">arg</span> <span class="ow">in</span> <span class="n">opts</span><span class="o">.</span><span class="n">qemu_args</span><span class="p">:</span>
<span class="n">qemu_args</span> <span class="o">+=</span> <span class="n">arg</span><span class="o">.</span><span class="n">split</span><span class="p">(</span><span class="s2">&quot; &quot;</span><span class="p">,</span> <span class="mi">1</span><span class="p">)</span>
<span class="c1"># convert the image to the selected format</span>
<span class="k">if</span> <span class="s2">&quot;-O&quot;</span> <span class="ow">not</span> <span class="ow">in</span> <span class="n">qemu_args</span><span class="p">:</span>
<span class="n">qemu_args</span><span class="o">.</span><span class="n">extend</span><span class="p">([</span><span class="s2">&quot;-O&quot;</span><span class="p">,</span> <span class="n">opts</span><span class="o">.</span><span class="n">image_type</span><span class="p">])</span>
<span class="n">qemu_img</span> <span class="o">=</span> <span class="n">tempfile</span><span class="o">.</span><span class="n">mktemp</span><span class="p">(</span><span class="n">prefix</span><span class="o">=</span><span class="s2">&quot;lmc-disk-&quot;</span><span class="p">,</span> <span class="n">suffix</span><span class="o">=</span><span class="s2">&quot;.img&quot;</span><span class="p">)</span>
<span class="n">execWithRedirect</span><span class="p">(</span><span class="s2">&quot;qemu-img&quot;</span><span class="p">,</span> <span class="p">[</span><span class="s2">&quot;convert&quot;</span><span class="p">]</span> <span class="o">+</span> <span class="n">qemu_args</span> <span class="o">+</span> <span class="p">[</span><span class="n">disk_img</span><span class="p">,</span> <span class="n">qemu_img</span><span class="p">],</span> <span class="n">raise_err</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span>
<span class="k">if</span> <span class="ow">not</span> <span class="n">opts</span><span class="o">.</span><span class="n">make_vagrant</span><span class="p">:</span>
<span class="n">execWithRedirect</span><span class="p">(</span><span class="s2">&quot;mv&quot;</span><span class="p">,</span> <span class="p">[</span><span class="s2">&quot;-f&quot;</span><span class="p">,</span> <span class="n">qemu_img</span><span class="p">,</span> <span class="n">disk_img</span><span class="p">],</span> <span class="n">raise_err</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span>
<span class="k">else</span><span class="p">:</span>
<span class="c1"># Take the new qcow2 image and package it up for Vagrant</span>
<span class="n">compress_args</span> <span class="o">=</span> <span class="p">[]</span>
<span class="k">for</span> <span class="n">arg</span> <span class="ow">in</span> <span class="n">opts</span><span class="o">.</span><span class="n">compress_args</span><span class="p">:</span>
<span class="n">compress_args</span> <span class="o">+=</span> <span class="n">arg</span><span class="o">.</span><span class="n">split</span><span class="p">(</span><span class="s2">&quot; &quot;</span><span class="p">,</span> <span class="mi">1</span><span class="p">)</span>
<span class="n">vagrant_dir</span> <span class="o">=</span> <span class="n">tempfile</span><span class="o">.</span><span class="n">mkdtemp</span><span class="p">(</span><span class="n">prefix</span><span class="o">=</span><span class="s2">&quot;lmc-tmpdir-&quot;</span><span class="p">)</span>
<span class="n">metadata_path</span> <span class="o">=</span> <span class="n">joinpaths</span><span class="p">(</span><span class="n">vagrant_dir</span><span class="p">,</span> <span class="s2">&quot;metadata.json&quot;</span><span class="p">)</span>
<span class="n">execWithRedirect</span><span class="p">(</span><span class="s2">&quot;mv&quot;</span><span class="p">,</span> <span class="p">[</span><span class="s2">&quot;-f&quot;</span><span class="p">,</span> <span class="n">qemu_img</span><span class="p">,</span> <span class="n">joinpaths</span><span class="p">(</span><span class="n">vagrant_dir</span><span class="p">,</span> <span class="s2">&quot;box.img&quot;</span><span class="p">)],</span> <span class="n">raise_err</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span>
<span class="k">if</span> <span class="n">opts</span><span class="o">.</span><span class="n">vagrant_metadata</span><span class="p">:</span>
<span class="n">shutil</span><span class="o">.</span><span class="n">copy2</span><span class="p">(</span><span class="n">opts</span><span class="o">.</span><span class="n">vagrant_metadata</span><span class="p">,</span> <span class="n">metadata_path</span><span class="p">)</span>
<span class="k">else</span><span class="p">:</span>
<span class="n">create_vagrant_metadata</span><span class="p">(</span><span class="n">metadata_path</span><span class="p">)</span>
<span class="n">update_vagrant_metadata</span><span class="p">(</span><span class="n">metadata_path</span><span class="p">,</span> <span class="n">disk_size</span><span class="p">)</span>
<span class="k">if</span> <span class="n">opts</span><span class="o">.</span><span class="n">vagrantfile</span><span class="p">:</span>
<span class="n">shutil</span><span class="o">.</span><span class="n">copy2</span><span class="p">(</span><span class="n">opts</span><span class="o">.</span><span class="n">vagrantfile</span><span class="p">,</span> <span class="n">joinpaths</span><span class="p">(</span><span class="n">vagrant_dir</span><span class="p">,</span> <span class="s2">&quot;vagrantfile&quot;</span><span class="p">))</span>
<span class="n">log</span><span class="o">.</span><span class="n">info</span><span class="p">(</span><span class="s2">&quot;Creating Vagrant image&quot;</span><span class="p">)</span>
<span class="n">rc</span> <span class="o">=</span> <span class="n">mktar</span><span class="p">(</span><span class="n">vagrant_dir</span><span class="p">,</span> <span class="n">disk_img</span><span class="p">,</span> <span class="n">opts</span><span class="o">.</span><span class="n">compression</span><span class="p">,</span> <span class="n">compress_args</span><span class="p">,</span> <span class="n">selinux</span><span class="o">=</span><span class="kc">False</span><span class="p">)</span>
<span class="k">if</span> <span class="n">rc</span><span class="p">:</span>
<span class="k">raise</span> <span class="n">InstallError</span><span class="p">(</span><span class="s2">&quot;novirt_install mktar failed: rc=</span><span class="si">%s</span><span class="s2">&quot;</span> <span class="o">%</span> <span class="n">rc</span><span class="p">)</span>
<span class="n">shutil</span><span class="o">.</span><span class="n">rmtree</span><span class="p">(</span><span class="n">vagrant_dir</span><span class="p">)</span>
<span class="k">elif</span> <span class="n">opts</span><span class="o">.</span><span class="n">make_tar</span><span class="p">:</span>
<span class="n">compress_args</span> <span class="o">=</span> <span class="p">[]</span>
<span class="k">for</span> <span class="n">arg</span> <span class="ow">in</span> <span class="n">opts</span><span class="o">.</span><span class="n">compress_args</span><span class="p">:</span>
<span class="n">compress_args</span> <span class="o">+=</span> <span class="n">arg</span><span class="o">.</span><span class="n">split</span><span class="p">(</span><span class="s2">&quot; &quot;</span><span class="p">,</span> <span class="mi">1</span><span class="p">)</span>
<span class="n">rc</span> <span class="o">=</span> <span class="n">mktar</span><span class="p">(</span><span class="n">dirinstall_path</span><span class="p">,</span> <span class="n">disk_img</span><span class="p">,</span> <span class="n">opts</span><span class="o">.</span><span class="n">compression</span><span class="p">,</span> <span class="n">compress_args</span><span class="p">)</span>
<span class="n">shutil</span><span class="o">.</span><span class="n">rmtree</span><span class="p">(</span><span class="n">dirinstall_path</span><span class="p">)</span>
<span class="k">if</span> <span class="n">rc</span><span class="p">:</span>
<span class="k">raise</span> <span class="n">InstallError</span><span class="p">(</span><span class="s2">&quot;novirt_install mktar failed: rc=</span><span class="si">%s</span><span class="s2">&quot;</span> <span class="o">%</span> <span class="n">rc</span><span class="p">)</span>
<span class="k">elif</span> <span class="n">opts</span><span class="o">.</span><span class="n">make_oci</span><span class="p">:</span>
<span class="c1"># An OCI image places the filesystem under /rootfs/ and adds the json files at the top</span>
<span class="c1"># And then creates a tar of the whole thing.</span>
<span class="n">compress_args</span> <span class="o">=</span> <span class="p">[]</span>
<span class="k">for</span> <span class="n">arg</span> <span class="ow">in</span> <span class="n">opts</span><span class="o">.</span><span class="n">compress_args</span><span class="p">:</span>
<span class="n">compress_args</span> <span class="o">+=</span> <span class="n">arg</span><span class="o">.</span><span class="n">split</span><span class="p">(</span><span class="s2">&quot; &quot;</span><span class="p">,</span> <span class="mi">1</span><span class="p">)</span>
<span class="n">shutil</span><span class="o">.</span><span class="n">copy2</span><span class="p">(</span><span class="n">opts</span><span class="o">.</span><span class="n">oci_config</span><span class="p">,</span> <span class="n">ROOT_PATH</span><span class="p">)</span>
<span class="n">shutil</span><span class="o">.</span><span class="n">copy2</span><span class="p">(</span><span class="n">opts</span><span class="o">.</span><span class="n">oci_runtime</span><span class="p">,</span> <span class="n">ROOT_PATH</span><span class="p">)</span>
<span class="n">rc</span> <span class="o">=</span> <span class="n">mktar</span><span class="p">(</span><span class="n">ROOT_PATH</span><span class="p">,</span> <span class="n">disk_img</span><span class="p">,</span> <span class="n">opts</span><span class="o">.</span><span class="n">compression</span><span class="p">,</span> <span class="n">compress_args</span><span class="p">)</span>
<span class="k">if</span> <span class="n">rc</span><span class="p">:</span>
<span class="k">raise</span> <span class="n">InstallError</span><span class="p">(</span><span class="s2">&quot;novirt_install mktar failed: rc=</span><span class="si">%s</span><span class="s2">&quot;</span> <span class="o">%</span> <span class="n">rc</span><span class="p">)</span></div>
<div class="viewcode-block" id="virt_install"><a class="viewcode-back" href="../../pylorax.html#pylorax.installer.virt_install">[docs]</a><span class="k">def</span> <span class="nf">virt_install</span><span class="p">(</span><span class="n">opts</span><span class="p">,</span> <span class="n">install_log</span><span class="p">,</span> <span class="n">disk_img</span><span class="p">,</span> <span class="n">disk_size</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;</span>
<span class="sd"> Use qemu to install to a disk image</span>
<span class="sd"> :param opts: options passed to livemedia-creator</span>
<span class="sd"> :type opts: argparse options</span>
<span class="sd"> :param str install_log: The path to write the log from qemu</span>
<span class="sd"> :param str disk_img: The full path to the disk image to be created</span>
<span class="sd"> :param int disk_size: The size of the disk_img in MiB</span>
<span class="sd"> This uses qemu with a boot.iso and a kickstart to create a disk</span>
<span class="sd"> image and then optionally, based on the opts passed, creates tarfile.</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="n">iso_mount</span> <span class="o">=</span> <span class="n">IsoMountpoint</span><span class="p">(</span><span class="n">opts</span><span class="o">.</span><span class="n">iso</span><span class="p">,</span> <span class="n">opts</span><span class="o">.</span><span class="n">location</span><span class="p">)</span>
<span class="k">if</span> <span class="ow">not</span> <span class="n">iso_mount</span><span class="o">.</span><span class="n">stage2</span><span class="p">:</span>
<span class="n">iso_mount</span><span class="o">.</span><span class="n">umount</span><span class="p">()</span>
<span class="k">raise</span> <span class="n">InstallError</span><span class="p">(</span><span class="s2">&quot;ISO is missing stage2, cannot continue&quot;</span><span class="p">)</span>
<span class="n">log_monitor</span> <span class="o">=</span> <span class="n">LogMonitor</span><span class="p">(</span><span class="n">install_log</span><span class="p">,</span> <span class="n">timeout</span><span class="o">=</span><span class="n">opts</span><span class="o">.</span><span class="n">timeout</span><span class="p">)</span>
<span class="n">kernel_args</span> <span class="o">=</span> <span class="s2">&quot;&quot;</span>
<span class="k">if</span> <span class="n">opts</span><span class="o">.</span><span class="n">kernel_args</span><span class="p">:</span>
<span class="n">kernel_args</span> <span class="o">+=</span> <span class="n">opts</span><span class="o">.</span><span class="n">kernel_args</span>
<span class="k">if</span> <span class="n">opts</span><span class="o">.</span><span class="n">proxy</span><span class="p">:</span>
<span class="n">kernel_args</span> <span class="o">+=</span> <span class="s2">&quot; proxy=&quot;</span><span class="o">+</span><span class="n">opts</span><span class="o">.</span><span class="n">proxy</span>
<span class="k">if</span> <span class="n">opts</span><span class="o">.</span><span class="n">image_type</span> <span class="ow">and</span> <span class="ow">not</span> <span class="n">opts</span><span class="o">.</span><span class="n">make_fsimage</span><span class="p">:</span>
<span class="n">qemu_args</span> <span class="o">=</span> <span class="p">[]</span>
<span class="k">for</span> <span class="n">arg</span> <span class="ow">in</span> <span class="n">opts</span><span class="o">.</span><span class="n">qemu_args</span><span class="p">:</span>
<span class="n">qemu_args</span> <span class="o">+=</span> <span class="n">arg</span><span class="o">.</span><span class="n">split</span><span class="p">(</span><span class="s2">&quot; &quot;</span><span class="p">,</span> <span class="mi">1</span><span class="p">)</span>
<span class="k">if</span> <span class="s2">&quot;-f&quot;</span> <span class="ow">not</span> <span class="ow">in</span> <span class="n">qemu_args</span><span class="p">:</span>
<span class="n">qemu_args</span> <span class="o">+=</span> <span class="p">[</span><span class="s2">&quot;-f&quot;</span><span class="p">,</span> <span class="n">opts</span><span class="o">.</span><span class="n">image_type</span><span class="p">]</span>
<span class="n">mkqemu_img</span><span class="p">(</span><span class="n">disk_img</span><span class="p">,</span> <span class="n">disk_size</span><span class="o">*</span><span class="mi">1024</span><span class="o">**</span><span class="mi">2</span><span class="p">,</span> <span class="n">qemu_args</span><span class="p">)</span>
<span class="k">if</span> <span class="n">opts</span><span class="o">.</span><span class="n">make_fsimage</span> <span class="ow">or</span> <span class="n">opts</span><span class="o">.</span><span class="n">make_tar</span> <span class="ow">or</span> <span class="n">opts</span><span class="o">.</span><span class="n">make_oci</span><span class="p">:</span>
<span class="n">diskimg_path</span> <span class="o">=</span> <span class="n">tempfile</span><span class="o">.</span><span class="n">mktemp</span><span class="p">(</span><span class="n">prefix</span><span class="o">=</span><span class="s2">&quot;lmc-disk-&quot;</span><span class="p">,</span> <span class="n">suffix</span><span class="o">=</span><span class="s2">&quot;.img&quot;</span><span class="p">)</span>
<span class="k">else</span><span class="p">:</span>
<span class="n">diskimg_path</span> <span class="o">=</span> <span class="n">disk_img</span>
<span class="k">try</span><span class="p">:</span>
<span class="n">QEMUInstall</span><span class="p">(</span><span class="n">opts</span><span class="p">,</span> <span class="n">iso_mount</span><span class="p">,</span> <span class="n">opts</span><span class="o">.</span><span class="n">ks</span><span class="p">,</span> <span class="n">diskimg_path</span><span class="p">,</span> <span class="n">disk_size</span><span class="p">,</span>
<span class="n">kernel_args</span><span class="p">,</span> <span class="n">opts</span><span class="o">.</span><span class="n">ram</span><span class="p">,</span> <span class="n">opts</span><span class="o">.</span><span class="n">vcpus</span><span class="p">,</span> <span class="n">opts</span><span class="o">.</span><span class="n">vnc</span><span class="p">,</span> <span class="n">opts</span><span class="o">.</span><span class="n">arch</span><span class="p">,</span>
<span class="n">log_check</span> <span class="o">=</span> <span class="n">log_monitor</span><span class="o">.</span><span class="n">server</span><span class="o">.</span><span class="n">log_check</span><span class="p">,</span>
<span class="n">virtio_host</span> <span class="o">=</span> <span class="n">log_monitor</span><span class="o">.</span><span class="n">host</span><span class="p">,</span>
<span class="n">virtio_port</span> <span class="o">=</span> <span class="n">log_monitor</span><span class="o">.</span><span class="n">port</span><span class="p">,</span>
<span class="n">image_type</span><span class="o">=</span><span class="n">opts</span><span class="o">.</span><span class="n">image_type</span><span class="p">,</span> <span class="n">boot_uefi</span><span class="o">=</span><span class="n">opts</span><span class="o">.</span><span class="n">virt_uefi</span><span class="p">,</span>
<span class="n">ovmf_path</span><span class="o">=</span><span class="n">opts</span><span class="o">.</span><span class="n">ovmf_path</span><span class="p">)</span>
<span class="n">log_monitor</span><span class="o">.</span><span class="n">shutdown</span><span class="p">()</span>
<span class="k">except</span> <span class="n">InstallError</span> <span class="k">as</span> <span class="n">e</span><span class="p">:</span>
<span class="n">log</span><span class="o">.</span><span class="n">error</span><span class="p">(</span><span class="s2">&quot;VirtualInstall failed: </span><span class="si">%s</span><span class="s2">&quot;</span><span class="p">,</span> <span class="n">e</span><span class="p">)</span>
<span class="k">raise</span>
<span class="k">finally</span><span class="p">:</span>
<span class="n">log</span><span class="o">.</span><span class="n">info</span><span class="p">(</span><span class="s2">&quot;unmounting the iso&quot;</span><span class="p">)</span>
<span class="n">iso_mount</span><span class="o">.</span><span class="n">umount</span><span class="p">()</span>
<span class="k">if</span> <span class="n">log_monitor</span><span class="o">.</span><span class="n">server</span><span class="o">.</span><span class="n">log_check</span><span class="p">():</span>
<span class="k">if</span> <span class="ow">not</span> <span class="n">log_monitor</span><span class="o">.</span><span class="n">server</span><span class="o">.</span><span class="n">error_line</span> <span class="ow">and</span> <span class="n">opts</span><span class="o">.</span><span class="n">timeout</span><span class="p">:</span>
<span class="n">msg</span> <span class="o">=</span> <span class="s2">&quot;virt_install failed due to timeout&quot;</span>
<span class="k">else</span><span class="p">:</span>
<span class="n">msg</span> <span class="o">=</span> <span class="s2">&quot;virt_install failed on line: </span><span class="si">%s</span><span class="s2">&quot;</span> <span class="o">%</span> <span class="n">log_monitor</span><span class="o">.</span><span class="n">server</span><span class="o">.</span><span class="n">error_line</span>
<span class="k">raise</span> <span class="n">InstallError</span><span class="p">(</span><span class="n">msg</span><span class="p">)</span>
<span class="k">if</span> <span class="n">opts</span><span class="o">.</span><span class="n">make_fsimage</span><span class="p">:</span>
<span class="n">mkfsimage_from_disk</span><span class="p">(</span><span class="n">diskimg_path</span><span class="p">,</span> <span class="n">disk_img</span><span class="p">,</span> <span class="n">disk_size</span><span class="p">,</span> <span class="n">label</span><span class="o">=</span><span class="n">opts</span><span class="o">.</span><span class="n">fs_label</span><span class="p">)</span>
<span class="n">os</span><span class="o">.</span><span class="n">unlink</span><span class="p">(</span><span class="n">diskimg_path</span><span class="p">)</span>
<span class="k">elif</span> <span class="n">opts</span><span class="o">.</span><span class="n">make_tar</span><span class="p">:</span>
<span class="n">compress_args</span> <span class="o">=</span> <span class="p">[]</span>
<span class="k">for</span> <span class="n">arg</span> <span class="ow">in</span> <span class="n">opts</span><span class="o">.</span><span class="n">compress_args</span><span class="p">:</span>
<span class="n">compress_args</span> <span class="o">+=</span> <span class="n">arg</span><span class="o">.</span><span class="n">split</span><span class="p">(</span><span class="s2">&quot; &quot;</span><span class="p">,</span> <span class="mi">1</span><span class="p">)</span>
<span class="k">with</span> <span class="n">PartitionMount</span><span class="p">(</span><span class="n">diskimg_path</span><span class="p">)</span> <span class="k">as</span> <span class="n">img_mount</span><span class="p">:</span>
<span class="k">if</span> <span class="n">img_mount</span> <span class="ow">and</span> <span class="n">img_mount</span><span class="o">.</span><span class="n">mount_dir</span><span class="p">:</span>
<span class="n">rc</span> <span class="o">=</span> <span class="n">mktar</span><span class="p">(</span><span class="n">img_mount</span><span class="o">.</span><span class="n">mount_dir</span><span class="p">,</span> <span class="n">disk_img</span><span class="p">,</span> <span class="n">opts</span><span class="o">.</span><span class="n">compression</span><span class="p">,</span> <span class="n">compress_args</span><span class="p">)</span>
<span class="k">else</span><span class="p">:</span>
<span class="n">rc</span> <span class="o">=</span> <span class="mi">1</span>
<span class="n">os</span><span class="o">.</span><span class="n">unlink</span><span class="p">(</span><span class="n">diskimg_path</span><span class="p">)</span>
<span class="k">if</span> <span class="n">rc</span><span class="p">:</span>
<span class="k">raise</span> <span class="n">InstallError</span><span class="p">(</span><span class="s2">&quot;virt_install failed&quot;</span><span class="p">)</span>
<span class="k">elif</span> <span class="n">opts</span><span class="o">.</span><span class="n">make_oci</span><span class="p">:</span>
<span class="c1"># An OCI image places the filesystem under /rootfs/ and adds the json files at the top</span>
<span class="c1"># And then creates a tar of the whole thing.</span>
<span class="n">compress_args</span> <span class="o">=</span> <span class="p">[]</span>
<span class="k">for</span> <span class="n">arg</span> <span class="ow">in</span> <span class="n">opts</span><span class="o">.</span><span class="n">compress_args</span><span class="p">:</span>
<span class="n">compress_args</span> <span class="o">+=</span> <span class="n">arg</span><span class="o">.</span><span class="n">split</span><span class="p">(</span><span class="s2">&quot; &quot;</span><span class="p">,</span> <span class="mi">1</span><span class="p">)</span>
<span class="k">with</span> <span class="n">PartitionMount</span><span class="p">(</span><span class="n">diskimg_path</span><span class="p">,</span> <span class="n">submount</span><span class="o">=</span><span class="s2">&quot;rootfs&quot;</span><span class="p">)</span> <span class="k">as</span> <span class="n">img_mount</span><span class="p">:</span>
<span class="k">if</span> <span class="n">img_mount</span> <span class="ow">and</span> <span class="n">img_mount</span><span class="o">.</span><span class="n">temp_dir</span><span class="p">:</span>
<span class="n">shutil</span><span class="o">.</span><span class="n">copy2</span><span class="p">(</span><span class="n">opts</span><span class="o">.</span><span class="n">oci_config</span><span class="p">,</span> <span class="n">img_mount</span><span class="o">.</span><span class="n">temp_dir</span><span class="p">)</span>
<span class="n">shutil</span><span class="o">.</span><span class="n">copy2</span><span class="p">(</span><span class="n">opts</span><span class="o">.</span><span class="n">oci_runtime</span><span class="p">,</span> <span class="n">img_mount</span><span class="o">.</span><span class="n">temp_dir</span><span class="p">)</span>
<span class="n">rc</span> <span class="o">=</span> <span class="n">mktar</span><span class="p">(</span><span class="n">img_mount</span><span class="o">.</span><span class="n">temp_dir</span><span class="p">,</span> <span class="n">disk_img</span><span class="p">,</span> <span class="n">opts</span><span class="o">.</span><span class="n">compression</span><span class="p">,</span> <span class="n">compress_args</span><span class="p">)</span>
<span class="k">else</span><span class="p">:</span>
<span class="n">rc</span> <span class="o">=</span> <span class="mi">1</span>
<span class="n">os</span><span class="o">.</span><span class="n">unlink</span><span class="p">(</span><span class="n">diskimg_path</span><span class="p">)</span>
<span class="k">if</span> <span class="n">rc</span><span class="p">:</span>
<span class="k">raise</span> <span class="n">InstallError</span><span class="p">(</span><span class="s2">&quot;virt_install failed&quot;</span><span class="p">)</span>
<span class="k">elif</span> <span class="n">opts</span><span class="o">.</span><span class="n">make_vagrant</span><span class="p">:</span>
<span class="n">compress_args</span> <span class="o">=</span> <span class="p">[]</span>
<span class="k">for</span> <span class="n">arg</span> <span class="ow">in</span> <span class="n">opts</span><span class="o">.</span><span class="n">compress_args</span><span class="p">:</span>
<span class="n">compress_args</span> <span class="o">+=</span> <span class="n">arg</span><span class="o">.</span><span class="n">split</span><span class="p">(</span><span class="s2">&quot; &quot;</span><span class="p">,</span> <span class="mi">1</span><span class="p">)</span>
<span class="n">vagrant_dir</span> <span class="o">=</span> <span class="n">tempfile</span><span class="o">.</span><span class="n">mkdtemp</span><span class="p">(</span><span class="n">prefix</span><span class="o">=</span><span class="s2">&quot;lmc-tmpdir-&quot;</span><span class="p">)</span>
<span class="n">metadata_path</span> <span class="o">=</span> <span class="n">joinpaths</span><span class="p">(</span><span class="n">vagrant_dir</span><span class="p">,</span> <span class="s2">&quot;metadata.json&quot;</span><span class="p">)</span>
<span class="n">execWithRedirect</span><span class="p">(</span><span class="s2">&quot;mv&quot;</span><span class="p">,</span> <span class="p">[</span><span class="s2">&quot;-f&quot;</span><span class="p">,</span> <span class="n">disk_img</span><span class="p">,</span> <span class="n">joinpaths</span><span class="p">(</span><span class="n">vagrant_dir</span><span class="p">,</span> <span class="s2">&quot;box.img&quot;</span><span class="p">)],</span> <span class="n">raise_err</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span>
<span class="k">if</span> <span class="n">opts</span><span class="o">.</span><span class="n">vagrant_metadata</span><span class="p">:</span>
<span class="n">shutil</span><span class="o">.</span><span class="n">copy2</span><span class="p">(</span><span class="n">opts</span><span class="o">.</span><span class="n">vagrant_metadata</span><span class="p">,</span> <span class="n">metadata_path</span><span class="p">)</span>
<span class="k">else</span><span class="p">:</span>
<span class="n">create_vagrant_metadata</span><span class="p">(</span><span class="n">metadata_path</span><span class="p">)</span>
<span class="n">update_vagrant_metadata</span><span class="p">(</span><span class="n">metadata_path</span><span class="p">,</span> <span class="n">disk_size</span><span class="p">)</span>
<span class="k">if</span> <span class="n">opts</span><span class="o">.</span><span class="n">vagrantfile</span><span class="p">:</span>
<span class="n">shutil</span><span class="o">.</span><span class="n">copy2</span><span class="p">(</span><span class="n">opts</span><span class="o">.</span><span class="n">vagrantfile</span><span class="p">,</span> <span class="n">joinpaths</span><span class="p">(</span><span class="n">vagrant_dir</span><span class="p">,</span> <span class="s2">&quot;vagrantfile&quot;</span><span class="p">))</span>
<span class="n">rc</span> <span class="o">=</span> <span class="n">mktar</span><span class="p">(</span><span class="n">vagrant_dir</span><span class="p">,</span> <span class="n">disk_img</span><span class="p">,</span> <span class="n">opts</span><span class="o">.</span><span class="n">compression</span><span class="p">,</span> <span class="n">compress_args</span><span class="p">,</span> <span class="n">selinux</span><span class="o">=</span><span class="kc">False</span><span class="p">)</span>
<span class="k">if</span> <span class="n">rc</span><span class="p">:</span>
<span class="k">raise</span> <span class="n">InstallError</span><span class="p">(</span><span class="s2">&quot;virt_install failed&quot;</span><span class="p">)</span>
<span class="n">shutil</span><span class="o">.</span><span class="n">rmtree</span><span class="p">(</span><span class="n">vagrant_dir</span><span class="p">)</span></div>
</pre></div>
</div>
</div>
<footer>
<hr/>
<div role="contentinfo">
<p>
&copy; Copyright 2018, Red Hat, Inc..
</p>
</div>
Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/rtfd/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>.
</footer>
</div>
</div>
</section>
</div>
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT:'../../',
VERSION:'28.10',
LANGUAGE:'None',
COLLAPSE_INDEX:false,
FILE_SUFFIX:'.html',
HAS_SOURCE: true,
SOURCELINK_SUFFIX: '.txt'
};
</script>
<script type="text/javascript" src="../../_static/jquery.js"></script>
<script type="text/javascript" src="../../_static/underscore.js"></script>
<script type="text/javascript" src="../../_static/doctools.js"></script>
<script type="text/javascript" src="../../_static/js/theme.js"></script>
<script type="text/javascript">
jQuery(function () {
SphinxRtdTheme.Navigation.enableSticky();
});
</script>
</body>
</html>

View File

@ -8,8 +8,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>pylorax.ltmpl &mdash; Lorax 28.9 documentation</title> <title>pylorax.ltmpl &mdash; Lorax 28.10 documentation</title>
@ -27,23 +26,16 @@
<link rel="stylesheet" href="../../_static/css/theme.css" type="text/css" /> <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="index" title="Index"
href="../../genindex.html"/>
<link rel="search" title="Search" href="../../search.html" /> <link rel="search" title="Search" href="../../search.html" />
<link rel="top" title="Lorax 28.9 documentation" href="../../index.html"/>
<link rel="up" title="pylorax" href="../pylorax.html"/>
<script src="../../_static/js/modernizr.min.js"></script> <script src="../../_static/js/modernizr.min.js"></script>
</head> </head>
<body class="wy-body-for-nav" role="document"> <body class="wy-body-for-nav">
<div class="wy-grid-for-nav"> <div class="wy-grid-for-nav">
@ -65,7 +57,7 @@
<div class="version"> <div class="version">
28.9 28.10
</div> </div>
@ -94,6 +86,8 @@
<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="../../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="../../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="../../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"><a class="reference internal" href="../../product-images.html">Product and Updates Images</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../modules.html">pylorax</a></li> <li class="toctree-l1"><a class="reference internal" href="../../modules.html">pylorax</a></li>
</ul> </ul>
@ -107,7 +101,7 @@
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"> <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
<nav class="wy-nav-top" role="navigation" aria-label="top navigation"> <nav class="wy-nav-top" aria-label="top navigation">
<i data-toggle="wy-nav-top" class="fa fa-bars"></i> <i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="../../index.html">Lorax</a> <a href="../../index.html">Lorax</a>
@ -115,8 +109,8 @@
</nav> </nav>
<div class="wy-nav-content"> <div class="wy-nav-content">
<div class="rst-content"> <div class="rst-content">
@ -134,6 +128,7 @@
<div role="navigation" aria-label="breadcrumbs navigation"> <div role="navigation" aria-label="breadcrumbs navigation">
<ul class="wy-breadcrumbs"> <ul class="wy-breadcrumbs">
@ -149,8 +144,6 @@
<li class="wy-breadcrumbs-aside"> <li class="wy-breadcrumbs-aside">
</li> </li>
</ul> </ul>
@ -952,10 +945,8 @@
</pre></div> </pre></div>
</div> </div>
<div class="articleComments">
</div> </div>
</div>
<footer> <footer>
@ -967,7 +958,7 @@
</p> </p>
</div> </div>
Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/snide/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>. 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> </footer>
@ -985,7 +976,8 @@
<script type="text/javascript"> <script type="text/javascript">
var DOCUMENTATION_OPTIONS = { var DOCUMENTATION_OPTIONS = {
URL_ROOT:'../../', URL_ROOT:'../../',
VERSION:'28.9', VERSION:'28.10',
LANGUAGE:'None',
COLLAPSE_INDEX:false, COLLAPSE_INDEX:false,
FILE_SUFFIX:'.html', FILE_SUFFIX:'.html',
HAS_SOURCE: true, HAS_SOURCE: true,
@ -1003,14 +995,13 @@
<script type="text/javascript" src="../../_static/js/theme.js"></script> <script type="text/javascript" src="../../_static/js/theme.js"></script>
<script type="text/javascript"> <script type="text/javascript">
jQuery(function () { jQuery(function () {
SphinxRtdTheme.StickyNav.enable();
SphinxRtdTheme.Navigation.enableSticky();
}); });
</script> </script>
</body> </body>
</html> </html>

View File

@ -8,8 +8,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>pylorax.monitor &mdash; Lorax 28.9 documentation</title> <title>pylorax.monitor &mdash; Lorax 28.10 documentation</title>
@ -27,23 +26,16 @@
<link rel="stylesheet" href="../../_static/css/theme.css" type="text/css" /> <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="index" title="Index"
href="../../genindex.html"/>
<link rel="search" title="Search" href="../../search.html" /> <link rel="search" title="Search" href="../../search.html" />
<link rel="top" title="Lorax 28.9 documentation" href="../../index.html"/>
<link rel="up" title="pylorax" href="../pylorax.html"/>
<script src="../../_static/js/modernizr.min.js"></script> <script src="../../_static/js/modernizr.min.js"></script>
</head> </head>
<body class="wy-body-for-nav" role="document"> <body class="wy-body-for-nav">
<div class="wy-grid-for-nav"> <div class="wy-grid-for-nav">
@ -65,7 +57,7 @@
<div class="version"> <div class="version">
28.9 28.10
</div> </div>
@ -94,6 +86,8 @@
<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="../../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="../../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="../../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"><a class="reference internal" href="../../product-images.html">Product and Updates Images</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../modules.html">pylorax</a></li> <li class="toctree-l1"><a class="reference internal" href="../../modules.html">pylorax</a></li>
</ul> </ul>
@ -107,7 +101,7 @@
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"> <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
<nav class="wy-nav-top" role="navigation" aria-label="top navigation"> <nav class="wy-nav-top" aria-label="top navigation">
<i data-toggle="wy-nav-top" class="fa fa-bars"></i> <i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="../../index.html">Lorax</a> <a href="../../index.html">Lorax</a>
@ -115,8 +109,8 @@
</nav> </nav>
<div class="wy-nav-content"> <div class="wy-nav-content">
<div class="rst-content"> <div class="rst-content">
@ -134,6 +128,7 @@
<div role="navigation" aria-label="breadcrumbs navigation"> <div role="navigation" aria-label="breadcrumbs navigation">
<ul class="wy-breadcrumbs"> <ul class="wy-breadcrumbs">
@ -149,8 +144,6 @@
<li class="wy-breadcrumbs-aside"> <li class="wy-breadcrumbs-aside">
</li> </li>
</ul> </ul>
@ -360,10 +353,8 @@
</pre></div> </pre></div>
</div> </div>
<div class="articleComments">
</div> </div>
</div>
<footer> <footer>
@ -375,7 +366,7 @@
</p> </p>
</div> </div>
Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/snide/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>. 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> </footer>
@ -393,7 +384,8 @@
<script type="text/javascript"> <script type="text/javascript">
var DOCUMENTATION_OPTIONS = { var DOCUMENTATION_OPTIONS = {
URL_ROOT:'../../', URL_ROOT:'../../',
VERSION:'28.9', VERSION:'28.10',
LANGUAGE:'None',
COLLAPSE_INDEX:false, COLLAPSE_INDEX:false,
FILE_SUFFIX:'.html', FILE_SUFFIX:'.html',
HAS_SOURCE: true, HAS_SOURCE: true,
@ -411,14 +403,13 @@
<script type="text/javascript" src="../../_static/js/theme.js"></script> <script type="text/javascript" src="../../_static/js/theme.js"></script>
<script type="text/javascript"> <script type="text/javascript">
jQuery(function () { jQuery(function () {
SphinxRtdTheme.StickyNav.enable();
SphinxRtdTheme.Navigation.enableSticky();
}); });
</script> </script>
</body> </body>
</html> </html>

View File

@ -8,8 +8,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>pylorax.mount &mdash; Lorax 28.9 documentation</title> <title>pylorax.mount &mdash; Lorax 28.10 documentation</title>
@ -27,23 +26,16 @@
<link rel="stylesheet" href="../../_static/css/theme.css" type="text/css" /> <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="index" title="Index"
href="../../genindex.html"/>
<link rel="search" title="Search" href="../../search.html" /> <link rel="search" title="Search" href="../../search.html" />
<link rel="top" title="Lorax 28.9 documentation" href="../../index.html"/>
<link rel="up" title="pylorax" href="../pylorax.html"/>
<script src="../../_static/js/modernizr.min.js"></script> <script src="../../_static/js/modernizr.min.js"></script>
</head> </head>
<body class="wy-body-for-nav" role="document"> <body class="wy-body-for-nav">
<div class="wy-grid-for-nav"> <div class="wy-grid-for-nav">
@ -65,7 +57,7 @@
<div class="version"> <div class="version">
28.9 28.10
</div> </div>
@ -94,6 +86,8 @@
<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="../../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="../../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="../../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"><a class="reference internal" href="../../product-images.html">Product and Updates Images</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../modules.html">pylorax</a></li> <li class="toctree-l1"><a class="reference internal" href="../../modules.html">pylorax</a></li>
</ul> </ul>
@ -107,7 +101,7 @@
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"> <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
<nav class="wy-nav-top" role="navigation" aria-label="top navigation"> <nav class="wy-nav-top" aria-label="top navigation">
<i data-toggle="wy-nav-top" class="fa fa-bars"></i> <i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="../../index.html">Lorax</a> <a href="../../index.html">Lorax</a>
@ -115,8 +109,8 @@
</nav> </nav>
<div class="wy-nav-content"> <div class="wy-nav-content">
<div class="rst-content"> <div class="rst-content">
@ -134,6 +128,7 @@
<div role="navigation" aria-label="breadcrumbs navigation"> <div role="navigation" aria-label="breadcrumbs navigation">
<ul class="wy-breadcrumbs"> <ul class="wy-breadcrumbs">
@ -149,8 +144,6 @@
<li class="wy-breadcrumbs-aside"> <li class="wy-breadcrumbs-aside">
</li> </li>
</ul> </ul>
@ -267,10 +260,8 @@
</pre></div> </pre></div>
</div> </div>
<div class="articleComments">
</div> </div>
</div>
<footer> <footer>
@ -282,7 +273,7 @@
</p> </p>
</div> </div>
Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/snide/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>. 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> </footer>
@ -300,7 +291,8 @@
<script type="text/javascript"> <script type="text/javascript">
var DOCUMENTATION_OPTIONS = { var DOCUMENTATION_OPTIONS = {
URL_ROOT:'../../', URL_ROOT:'../../',
VERSION:'28.9', VERSION:'28.10',
LANGUAGE:'None',
COLLAPSE_INDEX:false, COLLAPSE_INDEX:false,
FILE_SUFFIX:'.html', FILE_SUFFIX:'.html',
HAS_SOURCE: true, HAS_SOURCE: true,
@ -318,14 +310,13 @@
<script type="text/javascript" src="../../_static/js/theme.js"></script> <script type="text/javascript" src="../../_static/js/theme.js"></script>
<script type="text/javascript"> <script type="text/javascript">
jQuery(function () { jQuery(function () {
SphinxRtdTheme.StickyNav.enable();
SphinxRtdTheme.Navigation.enableSticky();
}); });
</script> </script>
</body> </body>
</html> </html>

View File

@ -8,8 +8,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>pylorax.sysutils &mdash; Lorax 28.9 documentation</title> <title>pylorax.sysutils &mdash; Lorax 28.10 documentation</title>
@ -27,23 +26,16 @@
<link rel="stylesheet" href="../../_static/css/theme.css" type="text/css" /> <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="index" title="Index"
href="../../genindex.html"/>
<link rel="search" title="Search" href="../../search.html" /> <link rel="search" title="Search" href="../../search.html" />
<link rel="top" title="Lorax 28.9 documentation" href="../../index.html"/>
<link rel="up" title="pylorax" href="../pylorax.html"/>
<script src="../../_static/js/modernizr.min.js"></script> <script src="../../_static/js/modernizr.min.js"></script>
</head> </head>
<body class="wy-body-for-nav" role="document"> <body class="wy-body-for-nav">
<div class="wy-grid-for-nav"> <div class="wy-grid-for-nav">
@ -65,7 +57,7 @@
<div class="version"> <div class="version">
28.9 28.10
</div> </div>
@ -94,6 +86,8 @@
<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="../../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="../../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="../../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"><a class="reference internal" href="../../product-images.html">Product and Updates Images</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../modules.html">pylorax</a></li> <li class="toctree-l1"><a class="reference internal" href="../../modules.html">pylorax</a></li>
</ul> </ul>
@ -107,7 +101,7 @@
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"> <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
<nav class="wy-nav-top" role="navigation" aria-label="top navigation"> <nav class="wy-nav-top" aria-label="top navigation">
<i data-toggle="wy-nav-top" class="fa fa-bars"></i> <i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="../../index.html">Lorax</a> <a href="../../index.html">Lorax</a>
@ -115,8 +109,8 @@
</nav> </nav>
<div class="wy-nav-content"> <div class="wy-nav-content">
<div class="rst-content"> <div class="rst-content">
@ -134,6 +128,7 @@
<div role="navigation" aria-label="breadcrumbs navigation"> <div role="navigation" aria-label="breadcrumbs navigation">
<ul class="wy-breadcrumbs"> <ul class="wy-breadcrumbs">
@ -149,8 +144,6 @@
<li class="wy-breadcrumbs-aside"> <li class="wy-breadcrumbs-aside">
</li> </li>
</ul> </ul>
@ -273,10 +266,8 @@
</pre></div> </pre></div>
</div> </div>
<div class="articleComments">
</div> </div>
</div>
<footer> <footer>
@ -288,7 +279,7 @@
</p> </p>
</div> </div>
Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/snide/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>. 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> </footer>
@ -306,7 +297,8 @@
<script type="text/javascript"> <script type="text/javascript">
var DOCUMENTATION_OPTIONS = { var DOCUMENTATION_OPTIONS = {
URL_ROOT:'../../', URL_ROOT:'../../',
VERSION:'28.9', VERSION:'28.10',
LANGUAGE:'None',
COLLAPSE_INDEX:false, COLLAPSE_INDEX:false,
FILE_SUFFIX:'.html', FILE_SUFFIX:'.html',
HAS_SOURCE: true, HAS_SOURCE: true,
@ -324,14 +316,13 @@
<script type="text/javascript" src="../../_static/js/theme.js"></script> <script type="text/javascript" src="../../_static/js/theme.js"></script>
<script type="text/javascript"> <script type="text/javascript">
jQuery(function () { jQuery(function () {
SphinxRtdTheme.StickyNav.enable();
SphinxRtdTheme.Navigation.enableSticky();
}); });
</script> </script>
</body> </body>
</html> </html>

View File

@ -8,8 +8,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>pylorax.treebuilder &mdash; Lorax 28.9 documentation</title> <title>pylorax.treebuilder &mdash; Lorax 28.10 documentation</title>
@ -27,23 +26,16 @@
<link rel="stylesheet" href="../../_static/css/theme.css" type="text/css" /> <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="index" title="Index"
href="../../genindex.html"/>
<link rel="search" title="Search" href="../../search.html" /> <link rel="search" title="Search" href="../../search.html" />
<link rel="top" title="Lorax 28.9 documentation" href="../../index.html"/>
<link rel="up" title="pylorax" href="../pylorax.html"/>
<script src="../../_static/js/modernizr.min.js"></script> <script src="../../_static/js/modernizr.min.js"></script>
</head> </head>
<body class="wy-body-for-nav" role="document"> <body class="wy-body-for-nav">
<div class="wy-grid-for-nav"> <div class="wy-grid-for-nav">
@ -65,7 +57,7 @@
<div class="version"> <div class="version">
28.9 28.10
</div> </div>
@ -94,6 +86,8 @@
<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="../../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="../../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="../../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"><a class="reference internal" href="../../product-images.html">Product and Updates Images</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../modules.html">pylorax</a></li> <li class="toctree-l1"><a class="reference internal" href="../../modules.html">pylorax</a></li>
</ul> </ul>
@ -107,7 +101,7 @@
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"> <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
<nav class="wy-nav-top" role="navigation" aria-label="top navigation"> <nav class="wy-nav-top" aria-label="top navigation">
<i data-toggle="wy-nav-top" class="fa fa-bars"></i> <i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="../../index.html">Lorax</a> <a href="../../index.html">Lorax</a>
@ -115,8 +109,8 @@
</nav> </nav>
<div class="wy-nav-content"> <div class="wy-nav-content">
<div class="rst-content"> <div class="rst-content">
@ -134,6 +128,7 @@
<div role="navigation" aria-label="breadcrumbs navigation"> <div role="navigation" aria-label="breadcrumbs navigation">
<ul class="wy-breadcrumbs"> <ul class="wy-breadcrumbs">
@ -149,8 +144,6 @@
<li class="wy-breadcrumbs-aside"> <li class="wy-breadcrumbs-aside">
</li> </li>
</ul> </ul>
@ -565,10 +558,8 @@
</pre></div> </pre></div>
</div> </div>
<div class="articleComments">
</div> </div>
</div>
<footer> <footer>
@ -580,7 +571,7 @@
</p> </p>
</div> </div>
Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/snide/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>. 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> </footer>
@ -598,7 +589,8 @@
<script type="text/javascript"> <script type="text/javascript">
var DOCUMENTATION_OPTIONS = { var DOCUMENTATION_OPTIONS = {
URL_ROOT:'../../', URL_ROOT:'../../',
VERSION:'28.9', VERSION:'28.10',
LANGUAGE:'None',
COLLAPSE_INDEX:false, COLLAPSE_INDEX:false,
FILE_SUFFIX:'.html', FILE_SUFFIX:'.html',
HAS_SOURCE: true, HAS_SOURCE: true,
@ -616,14 +608,13 @@
<script type="text/javascript" src="../../_static/js/theme.js"></script> <script type="text/javascript" src="../../_static/js/theme.js"></script>
<script type="text/javascript"> <script type="text/javascript">
jQuery(function () { jQuery(function () {
SphinxRtdTheme.StickyNav.enable();
SphinxRtdTheme.Navigation.enableSticky();
}); });
</script> </script>
</body> </body>
</html> </html>

View File

@ -8,8 +8,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>pylorax.treeinfo &mdash; Lorax 28.9 documentation</title> <title>pylorax.treeinfo &mdash; Lorax 28.10 documentation</title>
@ -27,23 +26,16 @@
<link rel="stylesheet" href="../../_static/css/theme.css" type="text/css" /> <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="index" title="Index"
href="../../genindex.html"/>
<link rel="search" title="Search" href="../../search.html" /> <link rel="search" title="Search" href="../../search.html" />
<link rel="top" title="Lorax 28.9 documentation" href="../../index.html"/>
<link rel="up" title="pylorax" href="../pylorax.html"/>
<script src="../../_static/js/modernizr.min.js"></script> <script src="../../_static/js/modernizr.min.js"></script>
</head> </head>
<body class="wy-body-for-nav" role="document"> <body class="wy-body-for-nav">
<div class="wy-grid-for-nav"> <div class="wy-grid-for-nav">
@ -65,7 +57,7 @@
<div class="version"> <div class="version">
28.9 28.10
</div> </div>
@ -94,6 +86,8 @@
<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="../../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="../../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="../../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"><a class="reference internal" href="../../product-images.html">Product and Updates Images</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../modules.html">pylorax</a></li> <li class="toctree-l1"><a class="reference internal" href="../../modules.html">pylorax</a></li>
</ul> </ul>
@ -107,7 +101,7 @@
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"> <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
<nav class="wy-nav-top" role="navigation" aria-label="top navigation"> <nav class="wy-nav-top" aria-label="top navigation">
<i data-toggle="wy-nav-top" class="fa fa-bars"></i> <i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="../../index.html">Lorax</a> <a href="../../index.html">Lorax</a>
@ -115,8 +109,8 @@
</nav> </nav>
<div class="wy-nav-content"> <div class="wy-nav-content">
<div class="rst-content"> <div class="rst-content">
@ -134,6 +128,7 @@
<div role="navigation" aria-label="breadcrumbs navigation"> <div role="navigation" aria-label="breadcrumbs navigation">
<ul class="wy-breadcrumbs"> <ul class="wy-breadcrumbs">
@ -149,8 +144,6 @@
<li class="wy-breadcrumbs-aside"> <li class="wy-breadcrumbs-aside">
</li> </li>
</ul> </ul>
@ -222,10 +215,8 @@
</pre></div> </pre></div>
</div> </div>
<div class="articleComments">
</div> </div>
</div>
<footer> <footer>
@ -237,7 +228,7 @@
</p> </p>
</div> </div>
Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/snide/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>. 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> </footer>
@ -255,7 +246,8 @@
<script type="text/javascript"> <script type="text/javascript">
var DOCUMENTATION_OPTIONS = { var DOCUMENTATION_OPTIONS = {
URL_ROOT:'../../', URL_ROOT:'../../',
VERSION:'28.9', VERSION:'28.10',
LANGUAGE:'None',
COLLAPSE_INDEX:false, COLLAPSE_INDEX:false,
FILE_SUFFIX:'.html', FILE_SUFFIX:'.html',
HAS_SOURCE: true, HAS_SOURCE: true,
@ -273,14 +265,13 @@
<script type="text/javascript" src="../../_static/js/theme.js"></script> <script type="text/javascript" src="../../_static/js/theme.js"></script>
<script type="text/javascript"> <script type="text/javascript">
jQuery(function () { jQuery(function () {
SphinxRtdTheme.StickyNav.enable();
SphinxRtdTheme.Navigation.enableSticky();
}); });
</script> </script>
</body> </body>
</html> </html>

View File

@ -0,0 +1,62 @@
composer-cli
============
:Authors:
Brian C. Lane <bcl@redhat.com>
``composer-cli`` is used to interact with the ``lorax-composer`` API server, managing blueprints, exploring available packages, and building new images.
It requires `lorax-composer <lorax-composer.html>`_ to be installed on the
local system, and the user running it needs to be a member of the ``weldr``
group. They do not need to be root, but all of the `security precautions
<lorax-composer.html#security>`_ apply.
composer-cli cmdline arguments
------------------------------
.. argparse::
:ref: composer.cli.cmdline.composer_cli_parser
:prog: composer-cli
Edit a Blueprint
----------------
Start out by listing the available blueprints using ``composer-cli blueprints
list``, pick one and save it to the local directory by running ``composer-cli
blueprints save http-server``. If there are no blueprints available you can
copy one of the examples `from the test suite
<https://github.com/weldr/lorax/tree/master/tests/pylorax/blueprints/>`_.
Edit the file (it will be saved with a .toml extension) and chance the
description, add a package or module to it. Send it back to the server by
running ``composer-cli blueprints push http-server.toml``. You can verify that it was
saved by viewing the changelog - ``composer-cli blueprints changes http-server``.
Build an image
----------------
Build a ``qcow2`` disk image from this blueprint by running ``composer-cli
compose start http-server qcow2``. It will print a UUID that you can use to
keep track of the build. You can also cancel the build if needed.
The available types of images is displayed by ``composer-cli compose types``.
Currently this consists of: ext4-filesystem, live-iso, partitioned-disk, qcow2,
tar
Monitor the build status
------------------------
Monitor it using ``composer-cli compose status``, which will show the status of
all the builds on the system. You can view the end of the anaconda build logs
once it is in the ``RUNNING`` state using ``composer-cli compose log UUID``
where UUID is the UUID returned by the start command.
Once the build is in the ``FINISHED`` state you can download the image.
Download the image
------------------
Downloading the final image is done with ``composer-cli compose image UUID`` and it will
save the qcow2 image as ``UUID-disk.qcow2`` which you can then use to boot a VM like this::
qemu-kvm --name test-image -m 1024 -hda ./UUID-disk.qcow2

View File

@ -14,9 +14,16 @@ Contents:
intro intro
lorax lorax
livemedia-creator livemedia-creator
lorax-composer
composer-cli
product-images product-images
modules modules
Documentation for other Lorax Branches
======================================
* `Fedora 28 <f28-branch/>`_
* `RHEL7 lorax-composer <lorax-composer/>`_
Indices and tables Indices and tables
================== ==================

View File

@ -0,0 +1,237 @@
lorax-composer
==============
:Authors:
Brian C. Lane <bcl@redhat.com>
``lorax-composer`` is an API server that allows you to build disk images using
`Blueprints`_ to describe the package versions to be installed into the image.
It is compatible with the Weldr project's bdcs-api REST protocol. More
information on Weldr can be found `on the Weldr blog <http://www.weldr.io>`_.
Behind the scenes it uses `livemedia-creator <livemedia-creator.html>`_ and
`Anaconda <https://anaconda-installer.readthedocs.io/en/latest/>`_ to handle the
installation and configuration of the images.
Installation
------------
The best way to install ``lorax-composer`` is to use ``sudo dnf install
lorax-composer composer-cli``, this will setup the weldr user and install the
systemd socket activation service. You will then need to enable it with ``sudo
systemctl enable lorax-composer.socket && sudo systemctl start
lorax-composer.socket``. This will leave the server off until the first request
is made. Systemd will then launch the server and it will remain running until
the system is rebooted.
Quickstart
----------
1. Create a ``weldr`` user and group by running ``useradd weldr``
2. Remove any pre-existing socket directory with ``rm -rf /run/weldr/``
A new directory with correct permissions will be created the first time the server runs.
3. Enable the socket activation with ``systemctl enable lorax-composer.socket
&& sudo systemctl start lorax-composer.socket`` or run it directly with
``lorax-composer /path/to/blueprints/``
The ``/path/to/blueprints/`` directory is where the blueprints' git repo will
be created, and all the blueprints created with the ``/api/v0/blueprints/new``
route will be stored. If there are blueprint ``.toml`` files in the top level
of the directory they will be imported into the blueprint git storage when
``lorax-composer`` starts.
Logs
----
Logs are stored under ``/var/log/lorax-composer/`` and include all console
messages as well as extra debugging info and API requests.
Security
--------
Some security related issues that you should be aware of before running ``lorax-composer``:
* One of the API server threads needs to retain root privileges in order to run Anaconda.
* SELinux must be set to Permissive or disabled to allow ``livemedia-creator`` to run Anaconda.
* Only allow authorized users access to the ``weldr`` group and socket.
Since Anaconda kickstarts are used there is the possibility that a user could
inject commands into a blueprint that would result in the kickstart executing
arbitrary code on the host. Only authorized users should be allowed to build
images using ``lorax-composer``.
lorax-composer cmdline arguments
--------------------------------
.. argparse::
:ref: pylorax.api.cmdline.lorax_composer_parser
:prog: lorax-composer
How it Works
------------
The server runs as root, and as ``weldr``. Communication with it is via a unix
domain socket (``/run/weldr/api.socket`` by default). The directory and socket
are owned by ``root:weldr`` so that any user in the ``weldr`` group can use the API
to control ``lorax-composer``.
At startup the server will check for the correct permissions and
ownership of a pre-existing directory, or it will create a new one if it
doesn't exist. The socket path and group owner's name can be changed from the
cmdline by passing it the ``--socket`` and ``--group`` arguments.
It will then drop root privileges for the API thread and run as the ``weldr``
user. The queue and compose thread still runs as root because it needs to be
able to mount/umount files and run Anaconda.
Composing Images
----------------
The `welder-web <https://github.com/weldr/welder-web/>`_ GUI project can be used to construct
blueprints and create composes using a web browser.
Or use the command line with `composer-cli <composer-cli.html>`_.
Blueprints
----------
Blueprints are simple text files in `TOML <https://github.com/toml-lang/toml>`_ format that describe
which packages, and what versions, to install into the image. They can also define a limited set
of customizations to make to the final image.
Example blueprints can be found in the ``lorax-composer`` `test suite
<https://github.com/weldr/lorax/tree/master/tests/pylorax/blueprints/>`_, with a simple one
looking like this::
name = "base"
description = "A base system with bash"
version = "0.0.1"
[[packages]]
name = "bash"
version = "4.4.*"
The ``name`` field is the name of the blueprint. It can contain spaces, but they will be converted to ``-``
when it is written to disk. It should be short and descriptive.
``description`` can be a longer description of the blueprint, it is only used for display purposes.
``version`` is a `semver compatible <https://semver.org/>`_ version number. If
a new blueprint is uploaded with the same ``version`` the server will
automatically bump the PATCH level of the ``version``. If the ``version``
doesn't match it will be used as is. eg. Uploading a blueprint with ``version`` set to ``0.0.1`` when the existing blueprint ``version`` is ``0.0.1`` will result in the new blueprint being stored as ``version 0.0.1``.
[[packages]] and [[modules]]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
These entries describe the package names and matching version glob to be installed into the image.
The names must match the names exactly, and the versions can be an exact match
or a filesystem-like glob of the version using ``*`` wildcards and ``?``
character matching.
NOTE: As of lorax-composer-29.2-1 the versions are not used for depsolving,
that is planned for a future release. And currently there are no differences
between ``packages`` and ``modules`` in ``lorax-composer``.
Customizations
~~~~~~~~~~~~~~
The ``[[customizations]]`` section can be used to configure the hostname of the final image. eg.::
[[customizations]]
hostname = "baseimage"
[[customizations.sshkey]]
*************************
Set an existing user's ssh key in the final image::
[[customizations.sshkey]]
user = "root"
key = "PUBLIC SSH KEY"
The key will be added to the user's authorized_keys file.
[[customizations.user]]
***********************
Add a user to the image, and/or set their ssh key.
All fields for this section are optional except for the ``name``, here is a complete example::
[[customizations.user]]
name = "admin"
description = "Administrator account"
password = "$6$CHO2$3rN8eviE2t50lmVyBYihTgVRHcaecmeCk31L..."
key = "PUBLIC SSH KEY"
home = "/srv/widget/"
shell = "/usr/bin/bash"
groups = ["widget", "users", "wheel"]
uid = 1200
gid = 1200
If the password starts with ``$6$``, ``$5$``, or ``$2b$`` it will be stored as
an encrypted password. Otherwise it will be treated as a plain text password.
[[customizations.group]]
************************
Add a group to the image. ``name`` is required and ``gid`` is optional::
[[customizations.group]]
name = "widget"
gid = 1130
Adding Output Types
-------------------
``livemedia-creator`` supports a large number of output types, and only some of
these are currently available via ``lorax-composer``. To add a new output type to
lorax-composer a kickstart file needs to be added to ``./share/composer/``. The
name of the kickstart is what will be used by the ``/compose/types`` route, and the
``compose_type`` field of the POST to start a compose. It also needs to have
code added to the :py:func:`pylorax.api.compose.compose_args` function. The
``_MAP`` entry in this function defines what lorax-composer will pass to
:py:func:`pylorax.installer.novirt_install` when it runs the compose. When the
compose is finished the output files need to be copied out of the build
directory (``/var/lib/lorax/composer/results/<UUID>/compose/``),
:py:func:`pylorax.api.compose.move_compose_results` handles this for each type.
You should move them instead of copying to save space.
If the new output type does not have support in livemedia-creator it should be
added there first. This will make the output available to the widest number of
users.
Example: Add partitioned disk support
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Partitioned disk support is something that livemedia-creator already supports
via the ``--make-disk`` cmdline argument. To add this to lorax-composer it
needs 3 things:
* A ``partitioned-disk.ks`` file in ``./share/composer/``
* A new entry in the _MAP in :py:func:`pylorax.api.compose.compose_args`
* Add a bit of code to :py:func:`pylorax.api.compose.move_compose_results` to move the disk image from
the compose directory to the results directory.
The ``partitioned-disk.ks`` is pretty similar to the example minimal kickstart
in ``./docs/fedora-minimal.ks``. You should remove the ``url`` and ``repo``
commands, they will be added by the compose process. Make sure the bootloader
packages are included in the ``%packages`` section at the end of the kickstart,
and you will want to leave off the ``%end`` so that the compose can append the
list of packages from the blueprint.
The new ``_MAP`` entry should be a copy of one of the existing entries, but with ``make_disk`` set
to ``True``. Make sure that none of the other ``make_*`` options are ``True``. The ``image_name`` is
what the name of the final image will be.
``move_compose_results()`` can be as simple as moving the output file into
the results directory, or it could do some post-processing on it. The end of
the function should always clean up the ``./compose/`` directory, removing any
unneeded extra files. This is especially true for the ``live-iso`` since it produces
the contents of the iso as well as the boot.iso itself.

View File

@ -0,0 +1,102 @@
pylorax.api package
===================
Submodules
----------
pylorax.api.cmdline module
--------------------------
.. automodule:: pylorax.api.cmdline
:members:
:undoc-members:
:show-inheritance:
pylorax.api.compose module
--------------------------
.. automodule:: pylorax.api.compose
:members:
:undoc-members:
:show-inheritance:
pylorax.api.config module
-------------------------
.. automodule:: pylorax.api.config
:members:
:undoc-members:
:show-inheritance:
pylorax.api.crossdomain module
------------------------------
.. automodule:: pylorax.api.crossdomain
:members:
:undoc-members:
:show-inheritance:
pylorax.api.dnfbase module
--------------------------
.. automodule:: pylorax.api.dnfbase
:members:
:undoc-members:
:show-inheritance:
pylorax.api.projects module
---------------------------
.. automodule:: pylorax.api.projects
:members:
:undoc-members:
:show-inheritance:
pylorax.api.queue module
------------------------
.. automodule:: pylorax.api.queue
:members:
:undoc-members:
:show-inheritance:
pylorax.api.recipes module
--------------------------
.. automodule:: pylorax.api.recipes
:members:
:undoc-members:
:show-inheritance:
pylorax.api.server module
-------------------------
.. automodule:: pylorax.api.server
:members:
:undoc-members:
:show-inheritance:
pylorax.api.v0 module
---------------------
.. automodule:: pylorax.api.v0
:members:
:undoc-members:
:show-inheritance:
pylorax.api.workspace module
----------------------------
.. automodule:: pylorax.api.workspace
:members:
:undoc-members:
:show-inheritance:
Module contents
---------------
.. automodule:: pylorax.api
:members:
:undoc-members:
:show-inheritance:

View File

@ -1,123 +1,146 @@
pylorax package pylorax package
=============== ===============
Subpackages
-----------
.. toctree::
pylorax.api
Submodules Submodules
---------- ----------
pylorax\.base module pylorax.base module
-------------------- -------------------
.. automodule:: pylorax.base .. automodule:: pylorax.base
:members: :members:
:undoc-members: :undoc-members:
:show-inheritance: :show-inheritance:
pylorax\.buildstamp module pylorax.buildstamp module
-------------------------- -------------------------
.. automodule:: pylorax.buildstamp .. automodule:: pylorax.buildstamp
:members: :members:
:undoc-members: :undoc-members:
:show-inheritance: :show-inheritance:
pylorax\.cmdline module pylorax.cmdline module
----------------------- ----------------------
.. automodule:: pylorax.cmdline .. automodule:: pylorax.cmdline
:members: :members:
:undoc-members: :undoc-members:
:show-inheritance: :show-inheritance:
pylorax\.decorators module pylorax.creator module
-------------------------- ----------------------
.. automodule:: pylorax.creator
:members:
:undoc-members:
:show-inheritance:
pylorax.decorators module
-------------------------
.. automodule:: pylorax.decorators .. automodule:: pylorax.decorators
:members: :members:
:undoc-members: :undoc-members:
:show-inheritance: :show-inheritance:
pylorax\.discinfo module pylorax.discinfo module
------------------------ -----------------------
.. automodule:: pylorax.discinfo .. automodule:: pylorax.discinfo
:members: :members:
:undoc-members: :undoc-members:
:show-inheritance: :show-inheritance:
pylorax\.dnfhelper module pylorax.dnfhelper module
------------------------- ------------------------
.. automodule:: pylorax.dnfhelper .. automodule:: pylorax.dnfhelper
:members: :members:
:undoc-members: :undoc-members:
:show-inheritance: :show-inheritance:
pylorax\.executils module pylorax.executils module
------------------------- ------------------------
.. automodule:: pylorax.executils .. automodule:: pylorax.executils
:members: :members:
:undoc-members: :undoc-members:
:show-inheritance: :show-inheritance:
pylorax\.imgutils module pylorax.imgutils module
------------------------ -----------------------
.. automodule:: pylorax.imgutils .. automodule:: pylorax.imgutils
:members: :members:
:undoc-members: :undoc-members:
:show-inheritance: :show-inheritance:
pylorax\.ltmpl module pylorax.installer module
--------------------- ------------------------
.. automodule:: pylorax.installer
:members:
:undoc-members:
:show-inheritance:
pylorax.ltmpl module
--------------------
.. automodule:: pylorax.ltmpl .. automodule:: pylorax.ltmpl
:members: :members:
:undoc-members: :undoc-members:
:show-inheritance: :show-inheritance:
pylorax\.monitor module pylorax.monitor module
----------------------- ----------------------
.. automodule:: pylorax.monitor .. automodule:: pylorax.monitor
:members: :members:
:undoc-members: :undoc-members:
:show-inheritance: :show-inheritance:
pylorax\.mount module pylorax.mount module
--------------------- --------------------
.. automodule:: pylorax.mount .. automodule:: pylorax.mount
:members: :members:
:undoc-members: :undoc-members:
:show-inheritance: :show-inheritance:
pylorax\.output module pylorax.output module
---------------------- ---------------------
.. automodule:: pylorax.output .. automodule:: pylorax.output
:members: :members:
:undoc-members: :undoc-members:
:show-inheritance: :show-inheritance:
pylorax\.sysutils module pylorax.sysutils module
------------------------ -----------------------
.. automodule:: pylorax.sysutils .. automodule:: pylorax.sysutils
:members: :members:
:undoc-members: :undoc-members:
:show-inheritance: :show-inheritance:
pylorax\.treebuilder module pylorax.treebuilder module
--------------------------- --------------------------
.. automodule:: pylorax.treebuilder .. automodule:: pylorax.treebuilder
:members: :members:
:undoc-members: :undoc-members:
:show-inheritance: :show-inheritance:
pylorax\.treeinfo module pylorax.treeinfo module
------------------------ -----------------------
.. automodule:: pylorax.treeinfo .. automodule:: pylorax.treeinfo
:members: :members:

View File

@ -82,9 +82,21 @@ div.sphinxsidebar input {
} }
div.sphinxsidebar #searchbox input[type="text"] { div.sphinxsidebar #searchbox input[type="text"] {
width: 170px; float: left;
width: 80%;
padding: 0.25em;
box-sizing: border-box;
} }
div.sphinxsidebar #searchbox input[type="submit"] {
float: left;
width: 20%;
border-left: none;
padding: 0.25em;
box-sizing: border-box;
}
img { img {
border: 0; border: 0;
max-width: 100%; max-width: 100%;
@ -199,6 +211,11 @@ table.modindextable td {
/* -- general body styles --------------------------------------------------- */ /* -- general body styles --------------------------------------------------- */
div.body {
min-width: 450px;
max-width: 800px;
}
div.body p, div.body dd, div.body li, div.body blockquote { div.body p, div.body dd, div.body li, div.body blockquote {
-moz-hyphens: auto; -moz-hyphens: auto;
-ms-hyphens: auto; -ms-hyphens: auto;
@ -332,6 +349,11 @@ table.docutils {
border-collapse: collapse; border-collapse: collapse;
} }
table.align-center {
margin-left: auto;
margin-right: auto;
}
table caption span.caption-number { table caption span.caption-number {
font-style: italic; font-style: italic;
} }

View File

@ -1,2 +1 @@
.fa:before{-webkit-font-smoothing:antialiased}.clearfix{*zoom:1}.clearfix:before,.clearfix:after{display:table;content:""}.clearfix:after{clear:both}@font-face{font-family:FontAwesome;font-weight:normal;font-style:normal;src:url("../font/fontawesome_webfont.eot");src:url("../font/fontawesome_webfont.eot?#iefix") format("embedded-opentype"),url("../font/fontawesome_webfont.woff") format("woff"),url("../font/fontawesome_webfont.ttf") format("truetype"),url("../font/fontawesome_webfont.svg#FontAwesome") format("svg")}.fa:before{display:inline-block;font-family:FontAwesome;font-style:normal;font-weight:normal;line-height:1;text-decoration:inherit}a .fa{display:inline-block;text-decoration:inherit}li .fa{display:inline-block}li .fa-large:before,li .fa-large:before{width:1.875em}ul.fas{list-style-type:none;margin-left:2em;text-indent:-0.8em}ul.fas li .fa{width:0.8em}ul.fas li .fa-large:before,ul.fas li .fa-large:before{vertical-align:baseline}.fa-book:before{content:""}.icon-book:before{content:""}.fa-caret-down:before{content:""}.icon-caret-down:before{content:""}.fa-caret-up:before{content:""}.icon-caret-up:before{content:""}.fa-caret-left:before{content:""}.icon-caret-left:before{content:""}.fa-caret-right:before{content:""}.icon-caret-right:before{content:""}.rst-versions{position:fixed;bottom:0;left:0;width:300px;color:#fcfcfc;background:#1f1d1d;border-top:solid 10px #343131;font-family:"Lato","proxima-nova","Helvetica Neue",Arial,sans-serif;z-index:400}.rst-versions a{color:#2980B9;text-decoration:none}.rst-versions .rst-badge-small{display:none}.rst-versions .rst-current-version{padding:12px;background-color:#272525;display:block;text-align:right;font-size:90%;cursor:pointer;color:#27AE60;*zoom:1}.rst-versions .rst-current-version:before,.rst-versions .rst-current-version:after{display:table;content:""}.rst-versions .rst-current-version:after{clear:both}.rst-versions .rst-current-version .fa{color:#fcfcfc}.rst-versions .rst-current-version .fa-book{float:left}.rst-versions .rst-current-version .icon-book{float:left}.rst-versions .rst-current-version.rst-out-of-date{background-color:#E74C3C;color:#fff}.rst-versions .rst-current-version.rst-active-old-version{background-color:#F1C40F;color:#000}.rst-versions.shift-up .rst-other-versions{display:block}.rst-versions .rst-other-versions{font-size:90%;padding:12px;color:gray;display:none}.rst-versions .rst-other-versions hr{display:block;height:1px;border:0;margin:20px 0;padding:0;border-top:solid 1px #413d3d}.rst-versions .rst-other-versions dd{display:inline-block;margin:0}.rst-versions .rst-other-versions dd a{display:inline-block;padding:6px;color:#fcfcfc}.rst-versions.rst-badge{width:auto;bottom:20px;right:20px;left:auto;border:none;max-width:300px}.rst-versions.rst-badge .icon-book{float:none}.rst-versions.rst-badge .fa-book{float:none}.rst-versions.rst-badge.shift-up .rst-current-version{text-align:right}.rst-versions.rst-badge.shift-up .rst-current-version .fa-book{float:left}.rst-versions.rst-badge.shift-up .rst-current-version .icon-book{float:left}.rst-versions.rst-badge .rst-current-version{width:auto;height:30px;line-height:30px;padding:0 6px;display:block;text-align:center}@media screen and (max-width: 768px){.rst-versions{width:85%;display:none}.rst-versions.shift{display:block}} .fa:before{-webkit-font-smoothing:antialiased}.clearfix{*zoom:1}.clearfix:before,.clearfix:after{display:table;content:""}.clearfix:after{clear:both}@font-face{font-family:FontAwesome;font-weight:normal;font-style:normal;src:url("../fonts/fontawesome-webfont.eot");src:url("../fonts/fontawesome-webfont.eot?#iefix") format("embedded-opentype"),url("../fonts/fontawesome-webfont.woff") format("woff"),url("../fonts/fontawesome-webfont.ttf") format("truetype"),url("../fonts/fontawesome-webfont.svg#FontAwesome") format("svg")}.fa:before{display:inline-block;font-family:FontAwesome;font-style:normal;font-weight:normal;line-height:1;text-decoration:inherit}a .fa{display:inline-block;text-decoration:inherit}li .fa{display:inline-block}li .fa-large:before,li .fa-large:before{width:1.875em}ul.fas{list-style-type:none;margin-left:2em;text-indent:-0.8em}ul.fas li .fa{width:.8em}ul.fas li .fa-large:before,ul.fas li .fa-large:before{vertical-align:baseline}.fa-book:before{content:""}.icon-book:before{content:""}.fa-caret-down:before{content:""}.icon-caret-down:before{content:""}.fa-caret-up:before{content:""}.icon-caret-up:before{content:""}.fa-caret-left:before{content:""}.icon-caret-left:before{content:""}.fa-caret-right:before{content:""}.icon-caret-right:before{content:""}.rst-versions{position:fixed;bottom:0;left:0;overflow-y:scroll;width:300px;color:#fcfcfc;background:#1f1d1d;font-family:"Lato","proxima-nova","Helvetica Neue",Arial,sans-serif;z-index:400}.rst-versions a{color:#2980B9;text-decoration:none}.rst-versions .rst-badge-small{display:none}.rst-versions .rst-current-version{padding:12px;background-color:#272525;display:block;text-align:right;font-size:90%;cursor:pointer;color:#27AE60;*zoom:1}.rst-versions .rst-current-version:before,.rst-versions .rst-current-version:after{display:table;content:""}.rst-versions .rst-current-version:after{clear:both}.rst-versions .rst-current-version .fa{color:#fcfcfc}.rst-versions .rst-current-version .fa-book{float:left}.rst-versions .rst-current-version .icon-book{float:left}.rst-versions .rst-current-version.rst-out-of-date{background-color:#E74C3C;color:#fff}.rst-versions .rst-current-version.rst-active-old-version{background-color:#F1C40F;color:#000}.rst-versions.shift-up{max-height:100%}.rst-versions.shift-up .rst-other-versions{display:block}.rst-versions .rst-other-versions{font-size:90%;padding:12px;color:gray;display:none}.rst-versions .rst-other-versions hr{display:block;height:1px;border:0;margin:20px 0;padding:0;border-top:solid 1px #413d3d}.rst-versions .rst-other-versions dd{display:inline-block;margin:0}.rst-versions .rst-other-versions dd a{display:inline-block;padding:6px;color:#fcfcfc}.rst-versions.rst-badge{width:auto;bottom:20px;right:20px;left:auto;border:none;max-width:300px}.rst-versions.rst-badge .icon-book{float:none}.rst-versions.rst-badge .fa-book{float:none}.rst-versions.rst-badge.shift-up .rst-current-version{text-align:right}.rst-versions.rst-badge.shift-up .rst-current-version .fa-book{float:left}.rst-versions.rst-badge.shift-up .rst-current-version .icon-book{float:left}.rst-versions.rst-badge .rst-current-version{width:auto;height:30px;line-height:30px;padding:0 6px;display:block;text-align:center}@media screen and (max-width: 768px){.rst-versions{width:85%;display:none}.rst-versions.shift{display:block}}
/*# sourceMappingURL=badge_only.css.map */

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,9 @@
var DOCUMENTATION_OPTIONS = {
URL_ROOT: '',
VERSION: '28.10',
LANGUAGE: 'None',
COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html',
HAS_SOURCE: true,
SOURCELINK_SUFFIX: '.txt'
};

Binary file not shown.

Binary file not shown.

Binary file not shown.

10253
docs/html/_static/jquery-3.2.1.js vendored Normal file

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

View File

@ -1,169 +1 @@
require=(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({"sphinx-rtd-theme":[function(require,module,exports){ require=function r(s,a,l){function c(i,n){if(!a[i]){if(!s[i]){var e="function"==typeof require&&require;if(!n&&e)return e(i,!0);if(u)return u(i,!0);var t=new Error("Cannot find module '"+i+"'");throw t.code="MODULE_NOT_FOUND",t}var o=a[i]={exports:{}};s[i][0].call(o.exports,function(n){var e=s[i][1][n];return c(e||n)},o,o.exports,r,s,a,l)}return a[i].exports}for(var u="function"==typeof require&&require,n=0;n<l.length;n++)c(l[n]);return c}({"sphinx-rtd-theme":[function(n,e,i){var jQuery="undefined"!=typeof window?window.jQuery:n("jquery");e.exports.ThemeNav={navBar:null,win:null,winScroll:!1,winResize:!1,linkScroll:!1,winPosition:0,winHeight:null,docHeight:null,isRunning:!1,enable:function(e){var i=this;i.isRunning||(i.isRunning=!0,jQuery(function(n){i.init(n),i.reset(),i.win.on("hashchange",i.reset),e&&i.win.on("scroll",function(){i.linkScroll||i.winScroll||(i.winScroll=!0,requestAnimationFrame(function(){i.onScroll()}))}),i.win.on("resize",function(){i.winResize||(i.winResize=!0,requestAnimationFrame(function(){i.onResize()}))}),i.onResize()}))},enableSticky:function(){this.enable(!0)},init:function(i){i(document);var t=this;this.navBar=i("div.wy-side-scroll:first"),this.win=i(window),i(document).on("click","[data-toggle='wy-nav-top']",function(){i("[data-toggle='wy-nav-shift']").toggleClass("shift"),i("[data-toggle='rst-versions']").toggleClass("shift")}).on("click",".wy-menu-vertical .current ul li a",function(){var n=i(this);i("[data-toggle='wy-nav-shift']").removeClass("shift"),i("[data-toggle='rst-versions']").toggleClass("shift"),t.toggleCurrent(n),t.hashChange()}).on("click","[data-toggle='rst-current-version']",function(){i("[data-toggle='rst-versions']").toggleClass("shift-up")}),i("table.docutils:not(.field-list,.footnote,.citation)").wrap("<div class='wy-table-responsive'></div>"),i("table.docutils.footnote").wrap("<div class='wy-table-responsive footnote'></div>"),i("table.docutils.citation").wrap("<div class='wy-table-responsive citation'></div>"),i(".wy-menu-vertical ul").not(".simple").siblings("a").each(function(){var e=i(this);expand=i('<span class="toctree-expand"></span>'),expand.on("click",function(n){return t.toggleCurrent(e),n.stopPropagation(),!1}),e.prepend(expand)})},reset:function(){var n=encodeURI(window.location.hash)||"#";try{var e=$(".wy-menu-vertical"),i=e.find('[href="'+n+'"]');if(0===i.length){var t=$('.document [id="'+n.substring(1)+'"]').closest("div.section");0===(i=e.find('[href="#'+t.attr("id")+'"]')).length&&(i=e.find('[href="#"]'))}0<i.length&&($(".wy-menu-vertical .current").removeClass("current"),i.addClass("current"),i.closest("li.toctree-l1").addClass("current"),i.closest("li.toctree-l1").parent().addClass("current"),i.closest("li.toctree-l1").addClass("current"),i.closest("li.toctree-l2").addClass("current"),i.closest("li.toctree-l3").addClass("current"),i.closest("li.toctree-l4").addClass("current"))}catch(o){console.log("Error expanding nav for anchor",o)}},onScroll:function(){this.winScroll=!1;var n=this.win.scrollTop(),e=n+this.winHeight,i=this.navBar.scrollTop()+(n-this.winPosition);n<0||e>this.docHeight||(this.navBar.scrollTop(i),this.winPosition=n)},onResize:function(){this.winResize=!1,this.winHeight=this.win.height(),this.docHeight=$(document).height()},hashChange:function(){this.linkScroll=!0,this.win.one("hashchange",function(){this.linkScroll=!1})},toggleCurrent:function(n){var e=n.closest("li");e.siblings("li.current").removeClass("current"),e.siblings().find("li.current").removeClass("current"),e.find("> ul li.current").removeClass("current"),e.toggleClass("current")}},"undefined"!=typeof window&&(window.SphinxRtdTheme={Navigation:e.exports.ThemeNav}),function(){for(var r=0,n=["ms","moz","webkit","o"],e=0;e<n.length&&!window.requestAnimationFrame;++e)window.requestAnimationFrame=window[n[e]+"RequestAnimationFrame"],window.cancelAnimationFrame=window[n[e]+"CancelAnimationFrame"]||window[n[e]+"CancelRequestAnimationFrame"];window.requestAnimationFrame||(window.requestAnimationFrame=function(n,e){var i=(new Date).getTime(),t=Math.max(0,16-(i-r)),o=window.setTimeout(function(){n(i+t)},t);return r=i+t,o}),window.cancelAnimationFrame||(window.cancelAnimationFrame=function(n){clearTimeout(n)})}()},{jquery:"jquery"}]},{},["sphinx-rtd-theme"]);
var jQuery = (typeof(window) != 'undefined') ? window.jQuery : require('jquery');
// Sphinx theme nav state
function ThemeNav () {
var nav = {
navBar: null,
win: null,
winScroll: false,
winResize: false,
linkScroll: false,
winPosition: 0,
winHeight: null,
docHeight: null,
isRunning: false
};
nav.enable = function () {
var self = this;
if (!self.isRunning) {
self.isRunning = true;
jQuery(function ($) {
self.init($);
self.reset();
self.win.on('hashchange', self.reset);
// Set scroll monitor
self.win.on('scroll', function () {
if (!self.linkScroll) {
self.winScroll = true;
}
});
setInterval(function () { if (self.winScroll) self.onScroll(); }, 25);
// Set resize monitor
self.win.on('resize', function () {
self.winResize = true;
});
setInterval(function () { if (self.winResize) self.onResize(); }, 25);
self.onResize();
});
};
};
nav.init = function ($) {
var doc = $(document),
self = this;
this.navBar = $('div.wy-side-scroll:first');
this.win = $(window);
// Set up javascript UX bits
$(document)
// Shift nav in mobile when clicking the menu.
.on('click', "[data-toggle='wy-nav-top']", function() {
$("[data-toggle='wy-nav-shift']").toggleClass("shift");
$("[data-toggle='rst-versions']").toggleClass("shift");
})
// Nav menu link click operations
.on('click', ".wy-menu-vertical .current ul li a", function() {
var target = $(this);
// Close menu when you click a link.
$("[data-toggle='wy-nav-shift']").removeClass("shift");
$("[data-toggle='rst-versions']").toggleClass("shift");
// Handle dynamic display of l3 and l4 nav lists
self.toggleCurrent(target);
self.hashChange();
})
.on('click', "[data-toggle='rst-current-version']", function() {
$("[data-toggle='rst-versions']").toggleClass("shift-up");
})
// Make tables responsive
$("table.docutils:not(.field-list)")
.wrap("<div class='wy-table-responsive'></div>");
// Add expand links to all parents of nested ul
$('.wy-menu-vertical ul').not('.simple').siblings('a').each(function () {
var link = $(this);
expand = $('<span class="toctree-expand"></span>');
expand.on('click', function (ev) {
self.toggleCurrent(link);
ev.stopPropagation();
return false;
});
link.prepend(expand);
});
};
nav.reset = function () {
// Get anchor from URL and open up nested nav
var anchor = encodeURI(window.location.hash);
if (anchor) {
try {
var link = $('.wy-menu-vertical')
.find('[href="' + anchor + '"]');
// If we didn't find a link, it may be because we clicked on
// something that is not in the sidebar (eg: when using
// sphinxcontrib.httpdomain it generates headerlinks but those
// aren't picked up and placed in the toctree). So let's find
// the closest header in the document and try with that one.
if (link.length === 0) {
var doc_link = $('.document a[href="' + anchor + '"]');
var closest_section = doc_link.closest('div.section');
// Try again with the closest section entry.
link = $('.wy-menu-vertical')
.find('[href="#' + closest_section.attr("id") + '"]');
}
$('.wy-menu-vertical li.toctree-l1 li.current')
.removeClass('current');
link.closest('li.toctree-l2').addClass('current');
link.closest('li.toctree-l3').addClass('current');
link.closest('li.toctree-l4').addClass('current');
}
catch (err) {
console.log("Error expanding nav for anchor", err);
}
}
};
nav.onScroll = function () {
this.winScroll = false;
var newWinPosition = this.win.scrollTop(),
winBottom = newWinPosition + this.winHeight,
navPosition = this.navBar.scrollTop(),
newNavPosition = navPosition + (newWinPosition - this.winPosition);
if (newWinPosition < 0 || winBottom > this.docHeight) {
return;
}
this.navBar.scrollTop(newNavPosition);
this.winPosition = newWinPosition;
};
nav.onResize = function () {
this.winResize = false;
this.winHeight = this.win.height();
this.docHeight = $(document).height();
};
nav.hashChange = function () {
this.linkScroll = true;
this.win.one('hashchange', function () {
this.linkScroll = false;
});
};
nav.toggleCurrent = function (elem) {
var parent_li = elem.closest('li');
parent_li.siblings('li.current').removeClass('current');
parent_li.siblings().find('li.current').removeClass('current');
parent_li.find('> ul li.current').removeClass('current');
parent_li.toggleClass('current');
}
return nav;
};
module.exports.ThemeNav = ThemeNav();
if (typeof(window) != 'undefined') {
window.SphinxRtdTheme = { StickyNav: module.exports.ThemeNav };
}
},{"jquery":"jquery"}]},{},["sphinx-rtd-theme"]);

View File

@ -301,7 +301,7 @@
li.hide(); li.hide();
// Determine where in the parents children list to insert this comment. // Determine where in the parents children list to insert this comment.
for(i=0; i < siblings.length; i++) { for(var i=0; i < siblings.length; i++) {
if (comp(comment, siblings[i]) <= 0) { if (comp(comment, siblings[i]) <= 0) {
$('#cd' + siblings[i].id) $('#cd' + siblings[i].id)
.parent() .parent()

387
docs/html/composer-cli.html Normal file
View File

@ -0,0 +1,387 @@
<!DOCTYPE html>
<!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]-->
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>composer-cli &mdash; Lorax 28.10 documentation</title>
<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="Product and Updates Images" href="product-images.html" />
<link rel="prev" title="lorax-composer" href="lorax-composer.html" />
<script src="_static/js/modernizr.min.js"></script>
</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">
28.10
</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 current"><a class="current reference internal" href="#">composer-cli</a><ul>
<li class="toctree-l2"><a class="reference internal" href="#composer-cli-cmdline-arguments">composer-cli cmdline arguments</a><ul>
<li class="toctree-l3"><a class="reference internal" href="#Positional Arguments">Positional Arguments</a></li>
<li class="toctree-l3"><a class="reference internal" href="#Named Arguments">Named Arguments</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="#edit-a-blueprint">Edit a Blueprint</a></li>
<li class="toctree-l2"><a class="reference internal" href="#build-an-image">Build an image</a></li>
<li class="toctree-l2"><a class="reference internal" href="#monitor-the-build-status">Monitor the build status</a></li>
<li class="toctree-l2"><a class="reference internal" href="#download-the-image">Download the image</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="product-images.html">Product and Updates Images</a></li>
<li class="toctree-l1"><a class="reference internal" href="modules.html">pylorax</a></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>composer-cli</li>
<li class="wy-breadcrumbs-aside">
<a href="_sources/composer-cli.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="composer-cli">
<h1>composer-cli<a class="headerlink" href="#composer-cli" title="Permalink to this headline"></a></h1>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Authors:</th><td class="field-body">Brian C. Lane &lt;<a class="reference external" href="mailto:bcl&#37;&#52;&#48;redhat&#46;com">bcl<span>&#64;</span>redhat<span>&#46;</span>com</a>&gt;</td>
</tr>
</tbody>
</table>
<p><code class="docutils literal notranslate"><span class="pre">composer-cli</span></code> is used to interact with the <code class="docutils literal notranslate"><span class="pre">lorax-composer</span></code> API server, managing blueprints, exploring available packages, and building new images.</p>
<p>It requires <a class="reference external" href="lorax-composer.html">lorax-composer</a> to be installed on the
local system, and the user running it needs to be a member of the <code class="docutils literal notranslate"><span class="pre">weldr</span></code>
group. They do not need to be root, but all of the <a class="reference external" href="lorax-composer.html#security">security precautions</a> apply.</p>
<div class="section" id="composer-cli-cmdline-arguments">
<h2>composer-cli cmdline arguments<a class="headerlink" href="#composer-cli-cmdline-arguments" title="Permalink to this headline"></a></h2>
<p>Lorax Composer commandline tool</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">usage</span><span class="p">:</span> <span class="n">composer</span><span class="o">-</span><span class="n">cli</span> <span class="p">[</span><span class="o">-</span><span class="n">h</span><span class="p">]</span> <span class="p">[</span><span class="o">-</span><span class="n">j</span><span class="p">]</span> <span class="p">[</span><span class="o">-</span><span class="n">s</span> <span class="n">SOCKET</span><span class="p">]</span> <span class="p">[</span><span class="o">--</span><span class="n">log</span> <span class="n">LOG</span><span class="p">]</span> <span class="p">[</span><span class="o">-</span><span class="n">a</span> <span class="n">APIVER</span><span class="p">]</span>
<span class="p">[</span><span class="o">--</span><span class="n">test</span> <span class="n">TESTMODE</span><span class="p">]</span> <span class="p">[</span><span class="o">-</span><span class="n">V</span><span class="p">]</span>
<span class="o">...</span>
</pre></div>
</div>
<div class="section" id="Positional Arguments">
<h3>Positional Arguments<a class="headerlink" href="#Positional Arguments" title="Permalink to this headline"></a></h3>
<table class="docutils option-list" frame="void" rules="none">
<col class="option" />
<col class="description" />
<tbody valign="top">
<tr><td class="option-group">
<kbd>args</kbd></td>
<td></td></tr>
</tbody>
</table>
</div>
<div class="section" id="Named Arguments">
<h3>Named Arguments<a class="headerlink" href="#Named Arguments" title="Permalink to this headline"></a></h3>
<table class="docutils option-list" frame="void" rules="none">
<col class="option" />
<col class="description" />
<tbody valign="top">
<tr><td class="option-group">
<kbd>-j, --json</kbd></td>
<td><p class="first">Output the raw JSON response instead of the normal output.</p>
<p class="last">Default: False</p>
</td></tr>
<tr><td class="option-group">
<kbd>-s, --socket</kbd></td>
<td><p class="first">Path to the socket file to listen on</p>
<p class="last">Default: “/run/weldr/api.socket”</p>
</td></tr>
<tr><td class="option-group">
<kbd>--log</kbd></td>
<td><p class="first">Path to logfile (./composer-cli.log)</p>
<p class="last">Default: “./composer-cli.log”</p>
</td></tr>
<tr><td class="option-group">
<kbd>-a, --api</kbd></td>
<td><p class="first">API Version to use</p>
<p class="last">Default: “0”</p>
</td></tr>
<tr><td class="option-group">
<kbd>--test</kbd></td>
<td><p class="first">Pass test mode to compose. 1=Mock compose with fail. 2=Mock compose with finished.</p>
<p class="last">Default: 0</p>
</td></tr>
<tr><td class="option-group">
<kbd>-V</kbd></td>
<td><p class="first">show programs version number and exit</p>
<p class="last">Default: False</p>
</td></tr>
</tbody>
</table>
</div>
<p><dl class="docutils">
<dt>compose start &lt;blueprint&gt; &lt;type&gt; Start a compose using the selected blueprint and output type.</dt>
<dd>types List the supported output types.
status List the status of all running and finished composes.
log &lt;uuid&gt; [&lt;size&gt;kB] Show the last 1kB of the compose log.
cancel &lt;uuid&gt; Cancel a running compose and delete any intermediate results.
delete &lt;uuid,…&gt; Delete the listed compose results.
info &lt;uuid&gt; Show detailed information on the compose.
metadata &lt;uuid&gt; Download the metadata use to create the compose to &lt;uuid&gt;-metadata.tar
logs &lt;uuid&gt; Download the compose logs to &lt;uuid&gt;-logs.tar
results &lt;uuid&gt; Download all of the compose results; metadata, logs, and image to &lt;uuid&gt;.tar
image &lt;uuid&gt; Download the output image from the compose. Filename depends on the type.</dd>
<dt>blueprints list List the names of the available blueprints.</dt>
<dd><p class="first">show &lt;blueprint,…&gt; Display the blueprint in TOML format.
changes &lt;blueprint,…&gt; Display the changes for each blueprint.
diff &lt;blueprint-name&gt; Display the differences between 2 versions of a blueprint.</p>
<blockquote>
<div>&lt;from-commit&gt; Commit hash or NEWEST
&lt;to-commit&gt; Commit hash, NEWEST, or WORKSPACE</div></blockquote>
<p class="last">save &lt;blueprint,…&gt; Save the blueprint to a file, &lt;blueprint-name&gt;.toml
delete &lt;blueprint&gt; Delete a blueprint from the server
depsolve &lt;blueprint,…&gt; Display the packages needed to install the blueprint.
push &lt;blueprint&gt; Push a blueprint TOML file to the server.
freeze &lt;blueprint,…&gt; Display the frozen blueprints modules and packages.
freeze show &lt;blueprint,…&gt; Display the frozen blueprint in TOML format.
freeze save &lt;blueprint,…&gt; Save the frozen blueprint to a file, &lt;blueprint-name&gt;.frozen.toml.
tag &lt;blueprint&gt; Tag the most recent blueprint commit as a release.
undo &lt;blueprint&gt; &lt;commit&gt; Undo changes to a blueprint by reverting to the selected commit.
workspace &lt;blueprint&gt; Push the blueprint TOML to the temporary workspace storage.</p>
</dd>
</dl>
<p>modules list List the available modules.
projects list List the available projects.
projects info &lt;project,…&gt; Show details about the listed projects.</p>
</p>
</div>
<div class="section" id="edit-a-blueprint">
<h2>Edit a Blueprint<a class="headerlink" href="#edit-a-blueprint" title="Permalink to this headline"></a></h2>
<p>Start out by listing the available blueprints using <code class="docutils literal notranslate"><span class="pre">composer-cli</span> <span class="pre">blueprints</span>
<span class="pre">list</span></code>, pick one and save it to the local directory by running <code class="docutils literal notranslate"><span class="pre">composer-cli</span>
<span class="pre">blueprints</span> <span class="pre">save</span> <span class="pre">http-server</span></code>. If there are no blueprints available you can
copy one of the examples <a class="reference external" href="https://github.com/weldr/lorax/tree/master/tests/pylorax/blueprints/">from the test suite</a>.</p>
<p>Edit the file (it will be saved with a .toml extension) and chance the
description, add a package or module to it. Send it back to the server by
running <code class="docutils literal notranslate"><span class="pre">composer-cli</span> <span class="pre">blueprints</span> <span class="pre">push</span> <span class="pre">http-server.toml</span></code>. You can verify that it was
saved by viewing the changelog - <code class="docutils literal notranslate"><span class="pre">composer-cli</span> <span class="pre">blueprints</span> <span class="pre">changes</span> <span class="pre">http-server</span></code>.</p>
</div>
<div class="section" id="build-an-image">
<h2>Build an image<a class="headerlink" href="#build-an-image" title="Permalink to this headline"></a></h2>
<p>Build a <code class="docutils literal notranslate"><span class="pre">qcow2</span></code> disk image from this blueprint by running <code class="docutils literal notranslate"><span class="pre">composer-cli</span>
<span class="pre">compose</span> <span class="pre">start</span> <span class="pre">http-server</span> <span class="pre">qcow2</span></code>. It will print a UUID that you can use to
keep track of the build. You can also cancel the build if needed.</p>
<p>The available types of images is displayed by <code class="docutils literal notranslate"><span class="pre">composer-cli</span> <span class="pre">compose</span> <span class="pre">types</span></code>.
Currently this consists of: ext4-filesystem, live-iso, partitioned-disk, qcow2,
tar</p>
</div>
<div class="section" id="monitor-the-build-status">
<h2>Monitor the build status<a class="headerlink" href="#monitor-the-build-status" title="Permalink to this headline"></a></h2>
<p>Monitor it using <code class="docutils literal notranslate"><span class="pre">composer-cli</span> <span class="pre">compose</span> <span class="pre">status</span></code>, which will show the status of
all the builds on the system. You can view the end of the anaconda build logs
once it is in the <code class="docutils literal notranslate"><span class="pre">RUNNING</span></code> state using <code class="docutils literal notranslate"><span class="pre">composer-cli</span> <span class="pre">compose</span> <span class="pre">log</span> <span class="pre">UUID</span></code>
where UUID is the UUID returned by the start command.</p>
<p>Once the build is in the <code class="docutils literal notranslate"><span class="pre">FINISHED</span></code> state you can download the image.</p>
</div>
<div class="section" id="download-the-image">
<h2>Download the image<a class="headerlink" href="#download-the-image" title="Permalink to this headline"></a></h2>
<p>Downloading the final image is done with <code class="docutils literal notranslate"><span class="pre">composer-cli</span> <span class="pre">compose</span> <span class="pre">image</span> <span class="pre">UUID</span></code> and it will
save the qcow2 image as <code class="docutils literal notranslate"><span class="pre">UUID-disk.qcow2</span></code> which you can then use to boot a VM like this:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">qemu</span><span class="o">-</span><span class="n">kvm</span> <span class="o">--</span><span class="n">name</span> <span class="n">test</span><span class="o">-</span><span class="n">image</span> <span class="o">-</span><span class="n">m</span> <span class="mi">1024</span> <span class="o">-</span><span class="n">hda</span> <span class="o">./</span><span class="n">UUID</span><span class="o">-</span><span class="n">disk</span><span class="o">.</span><span class="n">qcow2</span>
</pre></div>
</div>
</div>
</div>
</div>
</div>
<footer>
<div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
<a href="product-images.html" class="btn btn-neutral float-right" title="Product and Updates Images" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right"></span></a>
<a href="lorax-composer.html" class="btn btn-neutral" title="lorax-composer" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left"></span> Previous</a>
</div>
<hr/>
<div role="contentinfo">
<p>
&copy; Copyright 2018, Red Hat, Inc..
</p>
</div>
Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/rtfd/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>.
</footer>
</div>
</div>
</section>
</div>
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT:'./',
VERSION:'28.10',
LANGUAGE:'None',
COLLAPSE_INDEX:false,
FILE_SUFFIX:'.html',
HAS_SOURCE: true,
SOURCELINK_SUFFIX: '.txt'
};
</script>
<script type="text/javascript" src="_static/jquery.js"></script>
<script type="text/javascript" src="_static/underscore.js"></script>
<script type="text/javascript" src="_static/doctools.js"></script>
<script type="text/javascript" src="_static/js/theme.js"></script>
<script type="text/javascript">
jQuery(function () {
SphinxRtdTheme.Navigation.enableSticky();
});
</script>
</body>
</html>

View File

@ -9,8 +9,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Index &mdash; Lorax 28.9 documentation</title> <title>Index &mdash; Lorax 28.10 documentation</title>
@ -28,22 +27,16 @@
<link rel="stylesheet" href="_static/css/theme.css" type="text/css" /> <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="#" />
<link rel="index" title="Index"
href="#"/>
<link rel="search" title="Search" href="search.html" /> <link rel="search" title="Search" href="search.html" />
<link rel="top" title="Lorax 28.9 documentation" href="index.html"/>
<script src="_static/js/modernizr.min.js"></script> <script src="_static/js/modernizr.min.js"></script>
</head> </head>
<body class="wy-body-for-nav" role="document"> <body class="wy-body-for-nav">
<div class="wy-grid-for-nav"> <div class="wy-grid-for-nav">
@ -65,7 +58,7 @@
<div class="version"> <div class="version">
28.9 28.10
</div> </div>
@ -94,6 +87,8 @@
<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="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="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="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"><a class="reference internal" href="product-images.html">Product and Updates Images</a></li>
<li class="toctree-l1"><a class="reference internal" href="modules.html">pylorax</a></li> <li class="toctree-l1"><a class="reference internal" href="modules.html">pylorax</a></li>
</ul> </ul>
@ -107,7 +102,7 @@
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"> <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
<nav class="wy-nav-top" role="navigation" aria-label="top navigation"> <nav class="wy-nav-top" aria-label="top navigation">
<i data-toggle="wy-nav-top" class="fa fa-bars"></i> <i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="index.html">Lorax</a> <a href="index.html">Lorax</a>
@ -115,8 +110,8 @@
</nav> </nav>
<div class="wy-nav-content"> <div class="wy-nav-content">
<div class="rst-content"> <div class="rst-content">
@ -134,6 +129,7 @@
<div role="navigation" aria-label="breadcrumbs navigation"> <div role="navigation" aria-label="breadcrumbs navigation">
<ul class="wy-breadcrumbs"> <ul class="wy-breadcrumbs">
@ -174,7 +170,10 @@
| <a href="#K"><strong>K</strong></a> | <a href="#K"><strong>K</strong></a>
| <a href="#L"><strong>L</strong></a> | <a href="#L"><strong>L</strong></a>
| <a href="#M"><strong>M</strong></a> | <a href="#M"><strong>M</strong></a>
| <a href="#N"><strong>N</strong></a>
| <a href="#O"><strong>O</strong></a>
| <a href="#P"><strong>P</strong></a> | <a href="#P"><strong>P</strong></a>
| <a href="#Q"><strong>Q</strong></a>
| <a href="#R"><strong>R</strong></a> | <a href="#R"><strong>R</strong></a>
| <a href="#S"><strong>S</strong></a> | <a href="#S"><strong>S</strong></a>
| <a href="#T"><strong>T</strong></a> | <a href="#T"><strong>T</strong></a>
@ -186,12 +185,22 @@
<h2 id="A">A</h2> <h2 id="A">A</h2>
<table style="width: 100%" class="indextable genindextable"><tr> <table style="width: 100%" class="indextable genindextable"><tr>
<td style="width: 33%; vertical-align: top;"><ul> <td style="width: 33%; vertical-align: top;"><ul>
<li><a href="pylorax.api.html#pylorax.api.compose.add_customizations">add_customizations() (in module pylorax.api.compose)</a>
</li>
<li><a href="pylorax.html#pylorax.treeinfo.TreeInfo.add_section">add_section() (pylorax.treeinfo.TreeInfo method)</a> <li><a href="pylorax.html#pylorax.treeinfo.TreeInfo.add_section">add_section() (pylorax.treeinfo.TreeInfo method)</a>
</li> </li>
<li><a href="pylorax.html#pylorax.ltmpl.LoraxTemplateRunner.append">append() (pylorax.ltmpl.LoraxTemplateRunner method)</a> <li><a href="pylorax.html#pylorax.installer.anaconda_cleanup">anaconda_cleanup() (in module pylorax.installer)</a>
</li>
<li><a href="pylorax.api.html#pylorax.api.projects.api_changelog">api_changelog() (in module pylorax.api.projects)</a>
</li> </li>
</ul></td> </ul></td>
<td style="width: 33%; vertical-align: top;"><ul> <td style="width: 33%; vertical-align: top;"><ul>
<li><a href="pylorax.api.html#pylorax.api.projects.api_time">api_time() (in module pylorax.api.projects)</a>
</li>
<li><a href="pylorax.html#pylorax.ltmpl.LoraxTemplateRunner.append">append() (pylorax.ltmpl.LoraxTemplateRunner method)</a>
</li>
<li><a href="pylorax.html#pylorax.installer.append_initrd">append_initrd() (in module pylorax.installer)</a>
</li>
<li><a href="pylorax.html#pylorax.ArchData">ArchData (class in pylorax)</a> <li><a href="pylorax.html#pylorax.ArchData">ArchData (class in pylorax)</a>
</li> </li>
<li><a href="pylorax.html#pylorax.executils.augmentEnv">augmentEnv() (in module pylorax.executils)</a> <li><a href="pylorax.html#pylorax.executils.augmentEnv">augmentEnv() (in module pylorax.executils)</a>
@ -206,13 +215,17 @@
</li> </li>
<li><a href="pylorax.html#pylorax.ArchData.bcj_arch">bcj_arch (pylorax.ArchData attribute)</a> <li><a href="pylorax.html#pylorax.ArchData.bcj_arch">bcj_arch (pylorax.ArchData attribute)</a>
</li> </li>
</ul></td>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="pylorax.html#pylorax.ltmpl.brace_expand">brace_expand() (in module pylorax.ltmpl)</a> <li><a href="pylorax.html#pylorax.ltmpl.brace_expand">brace_expand() (in module pylorax.ltmpl)</a>
</li> </li>
</ul></td>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="pylorax.html#pylorax.treebuilder.TreeBuilder.build">build() (pylorax.treebuilder.TreeBuilder method)</a> <li><a href="pylorax.html#pylorax.treebuilder.TreeBuilder.build">build() (pylorax.treebuilder.TreeBuilder method)</a>
</li>
<li><a href="pylorax.api.html#pylorax.api.queue.build_status">build_status() (in module pylorax.api.queue)</a>
</li> </li>
<li><a href="pylorax.html#pylorax.buildstamp.BuildStamp">BuildStamp (class in pylorax.buildstamp)</a> <li><a href="pylorax.html#pylorax.buildstamp.BuildStamp">BuildStamp (class in pylorax.buildstamp)</a>
</li>
<li><a href="pylorax.api.html#pylorax.api.recipes.Recipe.bump_version">bump_version() (pylorax.api.recipes.Recipe method)</a>
</li> </li>
</ul></td> </ul></td>
</tr></table> </tr></table>
@ -220,6 +233,8 @@
<h2 id="C">C</h2> <h2 id="C">C</h2>
<table style="width: 100%" class="indextable genindextable"><tr> <table style="width: 100%" class="indextable genindextable"><tr>
<td style="width: 33%; vertical-align: top;"><ul> <td style="width: 33%; vertical-align: top;"><ul>
<li><a href="pylorax.html#pylorax.creator.calculate_disk_size">calculate_disk_size() (in module pylorax.creator)</a>
</li>
<li><a href="pylorax.html#pylorax.ltmpl.LoraxTemplateRunner.chmod">chmod() (pylorax.ltmpl.LoraxTemplateRunner method)</a> <li><a href="pylorax.html#pylorax.ltmpl.LoraxTemplateRunner.chmod">chmod() (pylorax.ltmpl.LoraxTemplateRunner method)</a>
</li> </li>
<li><a href="pylorax.html#pylorax.sysutils.chmod_">chmod_() (in module pylorax.sysutils)</a> <li><a href="pylorax.html#pylorax.sysutils.chmod_">chmod_() (in module pylorax.sysutils)</a>
@ -228,12 +243,34 @@
</li> </li>
<li><a href="pylorax.html#pylorax.treebuilder.RuntimeBuilder.cleanup">cleanup() (pylorax.treebuilder.RuntimeBuilder method)</a> <li><a href="pylorax.html#pylorax.treebuilder.RuntimeBuilder.cleanup">cleanup() (pylorax.treebuilder.RuntimeBuilder method)</a>
</li> </li>
<li><a href="pylorax.html#pylorax.imgutils.compress">compress() (in module pylorax.imgutils)</a> <li><a href="pylorax.api.html#pylorax.api.recipes.commit_recipe">commit_recipe() (in module pylorax.api.recipes)</a>
</li> </li>
<li><a href="pylorax.html#pylorax.Lorax.configure">configure() (pylorax.Lorax method)</a> <li><a href="pylorax.api.html#pylorax.api.recipes.commit_recipe_directory">commit_recipe_directory() (in module pylorax.api.recipes)</a>
</li>
<li><a href="pylorax.api.html#pylorax.api.recipes.commit_recipe_file">commit_recipe_file() (in module pylorax.api.recipes)</a>
</li>
<li><a href="pylorax.api.html#pylorax.api.recipes.CommitDetails">CommitDetails (class in pylorax.api.recipes)</a>
</li>
<li><a href="pylorax.api.html#pylorax.api.recipes.CommitTimeValError">CommitTimeValError</a>
</li>
<li><a href="pylorax.api.html#pylorax.api.compose.compose_args">compose_args() (in module pylorax.api.compose)</a>
</li>
<li><a href="pylorax.api.html#pylorax.api.queue.compose_detail">compose_detail() (in module pylorax.api.queue)</a>
</li>
<li><a href="pylorax.api.html#pylorax.api.compose.compose_types">compose_types() (in module pylorax.api.compose)</a>
</li> </li>
</ul></td> </ul></td>
<td style="width: 33%; vertical-align: top;"><ul> <td style="width: 33%; vertical-align: top;"><ul>
<li><a href="pylorax.api.html#pylorax.api.config.ComposerConfig">ComposerConfig (class in pylorax.api.config)</a>
</li>
<li><a href="pylorax.html#pylorax.imgutils.compress">compress() (in module pylorax.imgutils)</a>
</li>
<li><a href="pylorax.api.html#pylorax.api.config.configure">configure() (in module pylorax.api.config)</a>
<ul>
<li><a href="pylorax.html#pylorax.Lorax.configure">(pylorax.Lorax method)</a>
</li>
</ul></li>
<li><a href="pylorax.html#pylorax.base.DataHolder.copy">copy() (pylorax.base.DataHolder method)</a> <li><a href="pylorax.html#pylorax.base.DataHolder.copy">copy() (pylorax.base.DataHolder method)</a>
<ul> <ul>
@ -243,11 +280,21 @@
<li><a href="pylorax.html#pylorax.treebuilder.TreeBuilder.copy_dracut_hooks">copy_dracut_hooks() (pylorax.treebuilder.TreeBuilder method)</a> <li><a href="pylorax.html#pylorax.treebuilder.TreeBuilder.copy_dracut_hooks">copy_dracut_hooks() (pylorax.treebuilder.TreeBuilder method)</a>
</li> </li>
<li><a href="pylorax.html#pylorax.imgutils.copytree">copytree() (in module pylorax.imgutils)</a> <li><a href="pylorax.html#pylorax.imgutils.copytree">copytree() (in module pylorax.imgutils)</a>
</li>
<li><a href="pylorax.html#pylorax.creator.create_pxe_config">create_pxe_config() (in module pylorax.creator)</a>
</li> </li>
<li><a href="pylorax.html#pylorax.treebuilder.RuntimeBuilder.create_runtime">create_runtime() (pylorax.treebuilder.RuntimeBuilder method)</a> <li><a href="pylorax.html#pylorax.treebuilder.RuntimeBuilder.create_runtime">create_runtime() (pylorax.treebuilder.RuntimeBuilder method)</a>
</li>
<li><a href="pylorax.html#pylorax.installer.create_vagrant_metadata">create_vagrant_metadata() (in module pylorax.installer)</a>
</li> </li>
<li><a href="pylorax.html#pylorax.ltmpl.LoraxTemplateRunner.createaddrsize">createaddrsize() (pylorax.ltmpl.LoraxTemplateRunner method)</a> <li><a href="pylorax.html#pylorax.ltmpl.LoraxTemplateRunner.createaddrsize">createaddrsize() (pylorax.ltmpl.LoraxTemplateRunner method)</a>
</li> </li>
<li><a href="pylorax.api.html#pylorax.api.crossdomain">crossdomain() (in module pylorax.api)</a>
<ul>
<li><a href="pylorax.api.html#pylorax.api.crossdomain.crossdomain">(in module pylorax.api.crossdomain)</a>
</li>
</ul></li>
</ul></td> </ul></td>
</tr></table> </tr></table>
@ -255,13 +302,27 @@
<table style="width: 100%" class="indextable genindextable"><tr> <table style="width: 100%" class="indextable genindextable"><tr>
<td style="width: 33%; vertical-align: top;"><ul> <td style="width: 33%; vertical-align: top;"><ul>
<li><a href="pylorax.html#pylorax.base.DataHolder">DataHolder (class in pylorax.base)</a> <li><a href="pylorax.html#pylorax.base.DataHolder">DataHolder (class in pylorax.base)</a>
</li>
<li><a href="pylorax.html#pylorax.imgutils.default_image_name">default_image_name() (in module pylorax.imgutils)</a>
</li>
<li><a href="pylorax.api.html#pylorax.api.recipes.delete_file">delete_file() (in module pylorax.api.recipes)</a>
</li>
<li><a href="pylorax.api.html#pylorax.api.recipes.delete_recipe">delete_recipe() (in module pylorax.api.recipes)</a>
</li>
<li><a href="pylorax.api.html#pylorax.api.projects.dep_evra">dep_evra() (in module pylorax.api.projects)</a>
</li>
<li><a href="pylorax.api.html#pylorax.api.projects.dep_nevra">dep_nevra() (in module pylorax.api.projects)</a>
</li>
<li><a href="pylorax.api.html#pylorax.api.recipes.diff_items">diff_items() (in module pylorax.api.recipes)</a>
</li>
</ul></td>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="pylorax.api.html#pylorax.api.server.GitLock.dir">dir (pylorax.api.server.GitLock attribute)</a>
</li> </li>
<li><a href="pylorax.html#pylorax.discinfo.DiscInfo">DiscInfo (class in pylorax.discinfo)</a> <li><a href="pylorax.html#pylorax.discinfo.DiscInfo">DiscInfo (class in pylorax.discinfo)</a>
</li> </li>
<li><a href="pylorax.html#pylorax.imgutils.dm_attach">dm_attach() (in module pylorax.imgutils)</a> <li><a href="pylorax.html#pylorax.imgutils.dm_attach">dm_attach() (in module pylorax.imgutils)</a>
</li> </li>
</ul></td>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="pylorax.html#pylorax.imgutils.dm_detach">dm_detach() (in module pylorax.imgutils)</a> <li><a href="pylorax.html#pylorax.imgutils.dm_detach">dm_detach() (in module pylorax.imgutils)</a>
</li> </li>
<li><a href="pylorax.html#pylorax.imgutils.DMDev">DMDev (class in pylorax.imgutils)</a> <li><a href="pylorax.html#pylorax.imgutils.DMDev">DMDev (class in pylorax.imgutils)</a>
@ -280,8 +341,12 @@
</li> </li>
<li><a href="pylorax.html#pylorax.dnfhelper.LoraxRpmCallback.error">error() (pylorax.dnfhelper.LoraxRpmCallback method)</a> <li><a href="pylorax.html#pylorax.dnfhelper.LoraxRpmCallback.error">error() (pylorax.dnfhelper.LoraxRpmCallback method)</a>
</li> </li>
<li><a href="pylorax.html#pylorax.imgutils.estimate_size">estimate_size() (in module pylorax.imgutils)</a> <li><a href="pylorax.api.html#pylorax.api.projects.estimate_size">estimate_size() (in module pylorax.api.projects)</a>
<ul>
<li><a href="pylorax.html#pylorax.imgutils.estimate_size">(in module pylorax.imgutils)</a>
</li> </li>
</ul></li>
</ul></td> </ul></td>
<td style="width: 33%; vertical-align: top;"><ul> <td style="width: 33%; vertical-align: top;"><ul>
<li><a href="pylorax.html#pylorax.executils.ExecProduct">ExecProduct (class in pylorax.executils)</a> <li><a href="pylorax.html#pylorax.executils.ExecProduct">ExecProduct (class in pylorax.executils)</a>
@ -298,15 +363,29 @@
<h2 id="F">F</h2> <h2 id="F">F</h2>
<table style="width: 100%" class="indextable genindextable"><tr> <table style="width: 100%" class="indextable genindextable"><tr>
<td style="width: 33%; vertical-align: top;"><ul> <td style="width: 33%; vertical-align: top;"><ul>
<li><a href="pylorax.html#pylorax.creator.FakeDNF">FakeDNF (class in pylorax.creator)</a>
</li>
<li><a href="pylorax.api.html#pylorax.api.recipes.Recipe.filename">filename (pylorax.api.recipes.Recipe attribute)</a>
</li>
<li><a href="pylorax.api.html#pylorax.api.recipes.find_commit_tag">find_commit_tag() (in module pylorax.api.recipes)</a>
</li>
<li><a href="pylorax.html#pylorax.installer.find_free_port">find_free_port() (in module pylorax.installer)</a>
</li>
<li><a href="pylorax.api.html#pylorax.api.recipes.find_name">find_name() (in module pylorax.api.recipes)</a>
</li>
</ul></td>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="pylorax.html#pylorax.creator.find_ostree_root">find_ostree_root() (in module pylorax.creator)</a>
</li>
<li><a href="pylorax.html#pylorax.find_templates">find_templates() (in module pylorax)</a> <li><a href="pylorax.html#pylorax.find_templates">find_templates() (in module pylorax)</a>
</li> </li>
<li><a href="pylorax.html#pylorax.treebuilder.findkernels">findkernels() (in module pylorax.treebuilder)</a> <li><a href="pylorax.html#pylorax.treebuilder.findkernels">findkernels() (in module pylorax.treebuilder)</a>
</li> </li>
</ul></td>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="pylorax.html#pylorax.monitor.LogRequestHandler.finish">finish() (pylorax.monitor.LogRequestHandler method)</a> <li><a href="pylorax.html#pylorax.monitor.LogRequestHandler.finish">finish() (pylorax.monitor.LogRequestHandler method)</a>
</li> </li>
<li><a href="pylorax.html#pylorax.treebuilder.RuntimeBuilder.finished">finished() (pylorax.treebuilder.RuntimeBuilder method)</a> <li><a href="pylorax.html#pylorax.treebuilder.RuntimeBuilder.finished">finished() (pylorax.treebuilder.RuntimeBuilder method)</a>
</li>
<li><a href="pylorax.api.html#pylorax.api.recipes.Recipe.freeze">freeze() (pylorax.api.recipes.Recipe method)</a>
</li> </li>
</ul></td> </ul></td>
</tr></table> </tr></table>
@ -319,14 +398,30 @@
<li><a href="pylorax.html#pylorax.treebuilder.RuntimeBuilder.generate_module_data">generate_module_data() (pylorax.treebuilder.RuntimeBuilder method)</a> <li><a href="pylorax.html#pylorax.treebuilder.RuntimeBuilder.generate_module_data">generate_module_data() (pylorax.treebuilder.RuntimeBuilder method)</a>
</li> </li>
<li><a href="pylorax.html#pylorax.treebuilder.generate_module_info">generate_module_info() (in module pylorax.treebuilder)</a> <li><a href="pylorax.html#pylorax.treebuilder.generate_module_info">generate_module_info() (in module pylorax.treebuilder)</a>
</li>
<li><a href="pylorax.html#pylorax.creator.get_arch">get_arch() (in module pylorax.creator)</a>
</li>
<li><a href="pylorax.html#pylorax.get_buildarch">get_buildarch() (in module pylorax)</a>
</li>
<li><a href="pylorax.api.html#pylorax.api.recipes.get_commit_details">get_commit_details() (in module pylorax.api.recipes)</a>
</li>
<li><a href="pylorax.api.html#pylorax.api.queue.get_compose_type">get_compose_type() (in module pylorax.api.queue)</a>
</li> </li>
</ul></td> </ul></td>
<td style="width: 33%; vertical-align: top;"><ul> <td style="width: 33%; vertical-align: top;"><ul>
<li><a href="pylorax.html#pylorax.get_buildarch">get_buildarch() (in module pylorax)</a> <li><a href="pylorax.api.html#pylorax.api.config.ComposerConfig.get_default">get_default() (pylorax.api.config.ComposerConfig method)</a>
</li>
<li><a href="pylorax.api.html#pylorax.api.queue.get_image_name">get_image_name() (in module pylorax.api.queue)</a>
</li> </li>
<li><a href="pylorax.html#pylorax.mount.IsoMountpoint.get_iso_label">get_iso_label() (pylorax.mount.IsoMountpoint method)</a> <li><a href="pylorax.html#pylorax.mount.IsoMountpoint.get_iso_label">get_iso_label() (pylorax.mount.IsoMountpoint method)</a>
</li> </li>
<li><a href="pylorax.html#pylorax.imgutils.get_loop_name">get_loop_name() (in module pylorax.imgutils)</a> <li><a href="pylorax.html#pylorax.imgutils.get_loop_name">get_loop_name() (in module pylorax.imgutils)</a>
</li>
<li><a href="pylorax.api.html#pylorax.api.recipes.get_revision_from_tag">get_revision_from_tag() (in module pylorax.api.recipes)</a>
</li>
<li><a href="pylorax.api.html#pylorax.api.recipes.gfile">gfile() (in module pylorax.api.recipes)</a>
</li>
<li><a href="pylorax.api.html#pylorax.api.server.GitLock">GitLock (class in pylorax.api.server)</a>
</li> </li>
</ul></td> </ul></td>
</tr></table> </tr></table>
@ -339,6 +434,8 @@
</ul></td> </ul></td>
<td style="width: 33%; vertical-align: top;"><ul> <td style="width: 33%; vertical-align: top;"><ul>
<li><a href="pylorax.html#pylorax.ltmpl.LoraxTemplateRunner.hardlink">hardlink() (pylorax.ltmpl.LoraxTemplateRunner method)</a> <li><a href="pylorax.html#pylorax.ltmpl.LoraxTemplateRunner.hardlink">hardlink() (pylorax.ltmpl.LoraxTemplateRunner method)</a>
</li>
<li><a href="pylorax.api.html#pylorax.api.recipes.head_commit">head_commit() (in module pylorax.api.recipes)</a>
</li> </li>
</ul></td> </ul></td>
</tr></table> </tr></table>
@ -358,17 +455,25 @@
<li><a href="pylorax.html#pylorax.treebuilder.RuntimeBuilder.install">(pylorax.treebuilder.RuntimeBuilder method)</a> <li><a href="pylorax.html#pylorax.treebuilder.RuntimeBuilder.install">(pylorax.treebuilder.RuntimeBuilder method)</a>
</li> </li>
</ul></li> </ul></li>
<li><a href="pylorax.html#pylorax.installer.InstallError">InstallError</a>
</li>
<li><a href="pylorax.html#pylorax.ltmpl.LoraxTemplateRunner.installimg">installimg() (pylorax.ltmpl.LoraxTemplateRunner method)</a> <li><a href="pylorax.html#pylorax.ltmpl.LoraxTemplateRunner.installimg">installimg() (pylorax.ltmpl.LoraxTemplateRunner method)</a>
</li>
<li><a href="pylorax.html#pylorax.ltmpl.LoraxTemplateRunner.installinitrd">installinitrd() (pylorax.ltmpl.LoraxTemplateRunner method)</a>
</li> </li>
</ul></td> </ul></td>
<td style="width: 33%; vertical-align: top;"><ul> <td style="width: 33%; vertical-align: top;"><ul>
<li><a href="pylorax.html#pylorax.ltmpl.LoraxTemplateRunner.installinitrd">installinitrd() (pylorax.ltmpl.LoraxTemplateRunner method)</a>
</li>
<li><a href="pylorax.html#pylorax.ltmpl.LoraxTemplateRunner.installkernel">installkernel() (pylorax.ltmpl.LoraxTemplateRunner method)</a> <li><a href="pylorax.html#pylorax.ltmpl.LoraxTemplateRunner.installkernel">installkernel() (pylorax.ltmpl.LoraxTemplateRunner method)</a>
</li> </li>
<li><a href="pylorax.html#pylorax.ltmpl.LoraxTemplateRunner.installpkg">installpkg() (pylorax.ltmpl.LoraxTemplateRunner method)</a> <li><a href="pylorax.html#pylorax.ltmpl.LoraxTemplateRunner.installpkg">installpkg() (pylorax.ltmpl.LoraxTemplateRunner method)</a>
</li> </li>
<li><a href="pylorax.html#pylorax.ltmpl.LoraxTemplateRunner.installupgradeinitrd">installupgradeinitrd() (pylorax.ltmpl.LoraxTemplateRunner method)</a> <li><a href="pylorax.html#pylorax.ltmpl.LoraxTemplateRunner.installupgradeinitrd">installupgradeinitrd() (pylorax.ltmpl.LoraxTemplateRunner method)</a>
</li>
<li><a href="pylorax.api.html#pylorax.api.recipes.is_commit_tag">is_commit_tag() (in module pylorax.api.recipes)</a>
</li>
<li><a href="pylorax.html#pylorax.creator.is_image_mounted">is_image_mounted() (in module pylorax.creator)</a>
</li>
<li><a href="pylorax.api.html#pylorax.api.recipes.is_parent_diff">is_parent_diff() (in module pylorax.api.recipes)</a>
</li> </li>
<li><a href="pylorax.html#pylorax.monitor.LogRequestHandler.iserror">iserror() (pylorax.monitor.LogRequestHandler method)</a> <li><a href="pylorax.html#pylorax.monitor.LogRequestHandler.iserror">iserror() (pylorax.monitor.LogRequestHandler method)</a>
</li> </li>
@ -399,8 +504,16 @@
<li><a href="pylorax.html#pylorax.ArchData.lib64_arches">lib64_arches (pylorax.ArchData attribute)</a> <li><a href="pylorax.html#pylorax.ArchData.lib64_arches">lib64_arches (pylorax.ArchData attribute)</a>
</li> </li>
<li><a href="pylorax.html#pylorax.sysutils.linktree">linktree() (in module pylorax.sysutils)</a> <li><a href="pylorax.html#pylorax.sysutils.linktree">linktree() (in module pylorax.sysutils)</a>
</li>
<li><a href="pylorax.api.html#pylorax.api.recipes.list_branch_files">list_branch_files() (in module pylorax.api.recipes)</a>
</li>
<li><a href="pylorax.api.html#pylorax.api.recipes.list_commit_files">list_commit_files() (in module pylorax.api.recipes)</a>
</li>
<li><a href="pylorax.api.html#pylorax.api.recipes.list_commits">list_commits() (in module pylorax.api.recipes)</a>
</li> </li>
<li><a href="pylorax.html#pylorax.cmdline.lmc_parser">lmc_parser() (in module pylorax.cmdline)</a> <li><a href="pylorax.html#pylorax.cmdline.lmc_parser">lmc_parser() (in module pylorax.cmdline)</a>
</li>
<li><a href="pylorax.api.html#pylorax.api.server.GitLock.lock">lock (pylorax.api.server.GitLock attribute)</a>
</li> </li>
<li><a href="pylorax.html#pylorax.ltmpl.LoraxTemplateRunner.log">log() (pylorax.ltmpl.LoraxTemplateRunner method)</a> <li><a href="pylorax.html#pylorax.ltmpl.LoraxTemplateRunner.log">log() (pylorax.ltmpl.LoraxTemplateRunner method)</a>
</li> </li>
@ -410,12 +523,12 @@
</li> </li>
<li><a href="pylorax.html#pylorax.monitor.LogRequestHandler">LogRequestHandler (class in pylorax.monitor)</a> <li><a href="pylorax.html#pylorax.monitor.LogRequestHandler">LogRequestHandler (class in pylorax.monitor)</a>
</li> </li>
</ul></td>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="pylorax.html#pylorax.monitor.LogServer">LogServer (class in pylorax.monitor)</a> <li><a href="pylorax.html#pylorax.monitor.LogServer">LogServer (class in pylorax.monitor)</a>
</li> </li>
<li><a href="pylorax.html#pylorax.imgutils.loop_attach">loop_attach() (in module pylorax.imgutils)</a> <li><a href="pylorax.html#pylorax.imgutils.loop_attach">loop_attach() (in module pylorax.imgutils)</a>
</li> </li>
</ul></td>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="pylorax.html#pylorax.imgutils.loop_detach">loop_detach() (in module pylorax.imgutils)</a> <li><a href="pylorax.html#pylorax.imgutils.loop_detach">loop_detach() (in module pylorax.imgutils)</a>
</li> </li>
<li><a href="pylorax.html#pylorax.imgutils.loop_waitfor">loop_waitfor() (in module pylorax.imgutils)</a> <li><a href="pylorax.html#pylorax.imgutils.loop_waitfor">loop_waitfor() (in module pylorax.imgutils)</a>
@ -423,6 +536,8 @@
<li><a href="pylorax.html#pylorax.imgutils.LoopDev">LoopDev (class in pylorax.imgutils)</a> <li><a href="pylorax.html#pylorax.imgutils.LoopDev">LoopDev (class in pylorax.imgutils)</a>
</li> </li>
<li><a href="pylorax.html#pylorax.Lorax">Lorax (class in pylorax)</a> <li><a href="pylorax.html#pylorax.Lorax">Lorax (class in pylorax)</a>
</li>
<li><a href="pylorax.api.html#pylorax.api.cmdline.lorax_composer_parser">lorax_composer_parser() (in module pylorax.api.cmdline)</a>
</li> </li>
<li><a href="pylorax.html#pylorax.cmdline.lorax_parser">lorax_parser() (in module pylorax.cmdline)</a> <li><a href="pylorax.html#pylorax.cmdline.lorax_parser">lorax_parser() (in module pylorax.cmdline)</a>
</li> </li>
@ -440,6 +555,24 @@
<h2 id="M">M</h2> <h2 id="M">M</h2>
<table style="width: 100%" class="indextable genindextable"><tr> <table style="width: 100%" class="indextable genindextable"><tr>
<td style="width: 33%; vertical-align: top;"><ul> <td style="width: 33%; vertical-align: top;"><ul>
<li><a href="pylorax.html#pylorax.creator.make_appliance">make_appliance() (in module pylorax.creator)</a>
</li>
<li><a href="pylorax.api.html#pylorax.api.queue.make_compose">make_compose() (in module pylorax.api.queue)</a>
</li>
<li><a href="pylorax.api.html#pylorax.api.config.make_dnf_dirs">make_dnf_dirs() (in module pylorax.api.config)</a>
</li>
<li><a href="pylorax.html#pylorax.creator.make_image">make_image() (in module pylorax.creator)</a>
</li>
<li><a href="pylorax.html#pylorax.creator.make_live_images">make_live_images() (in module pylorax.creator)</a>
</li>
<li><a href="pylorax.html#pylorax.creator.make_livecd">make_livecd() (in module pylorax.creator)</a>
</li>
<li><a href="pylorax.api.html#pylorax.api.config.make_queue_dirs">make_queue_dirs() (in module pylorax.api.config)</a>
</li>
<li><a href="pylorax.html#pylorax.creator.make_runtime">make_runtime() (in module pylorax.creator)</a>
</li>
<li><a href="pylorax.html#pylorax.creator.make_squashfs">make_squashfs() (in module pylorax.creator)</a>
</li>
<li><a href="pylorax.html#pylorax.imgutils.mkbtrfsimg">mkbtrfsimg() (in module pylorax.imgutils)</a> <li><a href="pylorax.html#pylorax.imgutils.mkbtrfsimg">mkbtrfsimg() (in module pylorax.imgutils)</a>
</li> </li>
<li><a href="pylorax.html#pylorax.imgutils.mkcpio">mkcpio() (in module pylorax.imgutils)</a> <li><a href="pylorax.html#pylorax.imgutils.mkcpio">mkcpio() (in module pylorax.imgutils)</a>
@ -452,12 +585,14 @@
</li> </li>
<li><a href="pylorax.html#pylorax.imgutils.mkfsimage">mkfsimage() (in module pylorax.imgutils)</a> <li><a href="pylorax.html#pylorax.imgutils.mkfsimage">mkfsimage() (in module pylorax.imgutils)</a>
</li> </li>
<li><a href="pylorax.html#pylorax.imgutils.mkfsimage_from_disk">mkfsimage_from_disk() (in module pylorax.imgutils)</a>
</li>
</ul></td>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="pylorax.html#pylorax.imgutils.mkhfsimg">mkhfsimg() (in module pylorax.imgutils)</a> <li><a href="pylorax.html#pylorax.imgutils.mkhfsimg">mkhfsimg() (in module pylorax.imgutils)</a>
</li> </li>
<li><a href="pylorax.html#pylorax.imgutils.mkqcow2">mkqcow2() (in module pylorax.imgutils)</a> <li><a href="pylorax.html#pylorax.imgutils.mkqcow2">mkqcow2() (in module pylorax.imgutils)</a>
</li> </li>
</ul></td>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="pylorax.html#pylorax.imgutils.mkqemu_img">mkqemu_img() (in module pylorax.imgutils)</a> <li><a href="pylorax.html#pylorax.imgutils.mkqemu_img">mkqemu_img() (in module pylorax.imgutils)</a>
</li> </li>
<li><a href="pylorax.html#pylorax.imgutils.mkrootfsimg">mkrootfsimg() (in module pylorax.imgutils)</a> <li><a href="pylorax.html#pylorax.imgutils.mkrootfsimg">mkrootfsimg() (in module pylorax.imgutils)</a>
@ -467,12 +602,44 @@
<li><a href="pylorax.html#pylorax.imgutils.mksquashfs">mksquashfs() (in module pylorax.imgutils)</a> <li><a href="pylorax.html#pylorax.imgutils.mksquashfs">mksquashfs() (in module pylorax.imgutils)</a>
</li> </li>
<li><a href="pylorax.html#pylorax.imgutils.mktar">mktar() (in module pylorax.imgutils)</a> <li><a href="pylorax.html#pylorax.imgutils.mktar">mktar() (in module pylorax.imgutils)</a>
</li>
<li><a href="pylorax.api.html#pylorax.api.recipes.Recipe.module_names">module_names (pylorax.api.recipes.Recipe attribute)</a>
</li>
<li><a href="pylorax.api.html#pylorax.api.projects.modules_info">modules_info() (in module pylorax.api.projects)</a>
</li>
<li><a href="pylorax.api.html#pylorax.api.projects.modules_list">modules_list() (in module pylorax.api.projects)</a>
</li>
<li><a href="pylorax.api.html#pylorax.api.queue.monitor">monitor() (in module pylorax.api.queue)</a>
</li> </li>
<li><a href="pylorax.html#pylorax.imgutils.Mount">Mount (class in pylorax.imgutils)</a> <li><a href="pylorax.html#pylorax.imgutils.Mount">Mount (class in pylorax.imgutils)</a>
</li> </li>
<li><a href="pylorax.html#pylorax.imgutils.mount">mount() (in module pylorax.imgutils)</a> <li><a href="pylorax.html#pylorax.imgutils.mount">mount() (in module pylorax.imgutils)</a>
</li>
<li><a href="pylorax.html#pylorax.creator.mount_boot_part_over_root">mount_boot_part_over_root() (in module pylorax.creator)</a>
</li> </li>
<li><a href="pylorax.html#pylorax.ltmpl.LoraxTemplateRunner.move">move() (pylorax.ltmpl.LoraxTemplateRunner method)</a> <li><a href="pylorax.html#pylorax.ltmpl.LoraxTemplateRunner.move">move() (pylorax.ltmpl.LoraxTemplateRunner method)</a>
</li>
<li><a href="pylorax.api.html#pylorax.api.compose.move_compose_results">move_compose_results() (in module pylorax.api.compose)</a>
</li>
</ul></td>
</tr></table>
<h2 id="N">N</h2>
<table style="width: 100%" class="indextable genindextable"><tr>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="pylorax.html#pylorax.installer.novirt_install">novirt_install() (in module pylorax.installer)</a>
</li>
</ul></td>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="pylorax.html#pylorax.installer.novirt_log_check">novirt_log_check() (in module pylorax.installer)</a>
</li>
</ul></td>
</tr></table>
<h2 id="O">O</h2>
<table style="width: 100%" class="indextable genindextable"><tr>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="pylorax.api.html#pylorax.api.recipes.open_or_create_repo">open_or_create_repo() (in module pylorax.api.recipes)</a>
</li> </li>
</ul></td> </ul></td>
</tr></table> </tr></table>
@ -480,6 +647,8 @@
<h2 id="P">P</h2> <h2 id="P">P</h2>
<table style="width: 100%" class="indextable genindextable"><tr> <table style="width: 100%" class="indextable genindextable"><tr>
<td style="width: 33%; vertical-align: top;"><ul> <td style="width: 33%; vertical-align: top;"><ul>
<li><a href="pylorax.api.html#pylorax.api.recipes.Recipe.package_names">package_names (pylorax.api.recipes.Recipe attribute)</a>
</li>
<li><a href="pylorax.html#pylorax.ltmpl.LoraxTemplate.parse">parse() (pylorax.ltmpl.LoraxTemplate method)</a> <li><a href="pylorax.html#pylorax.ltmpl.LoraxTemplate.parse">parse() (pylorax.ltmpl.LoraxTemplate method)</a>
</li> </li>
<li><a href="pylorax.html#pylorax.imgutils.PartitionMount">PartitionMount (class in pylorax.imgutils)</a> <li><a href="pylorax.html#pylorax.imgutils.PartitionMount">PartitionMount (class in pylorax.imgutils)</a>
@ -491,8 +660,16 @@
<li><a href="pylorax.html#pylorax.base.BaseLoraxClass.perror">perror() (pylorax.base.BaseLoraxClass method)</a> <li><a href="pylorax.html#pylorax.base.BaseLoraxClass.perror">perror() (pylorax.base.BaseLoraxClass method)</a>
</li> </li>
<li><a href="pylorax.html#pylorax.base.BaseLoraxClass.pinfo">pinfo() (pylorax.base.BaseLoraxClass method)</a> <li><a href="pylorax.html#pylorax.base.BaseLoraxClass.pinfo">pinfo() (pylorax.base.BaseLoraxClass method)</a>
</li>
<li><a href="pylorax.api.html#pylorax.api.projects.pkg_to_dep">pkg_to_dep() (in module pylorax.api.projects)</a>
</li>
<li><a href="pylorax.api.html#pylorax.api.projects.pkg_to_project">pkg_to_project() (in module pylorax.api.projects)</a>
</li>
<li><a href="pylorax.api.html#pylorax.api.projects.pkg_to_project_info">pkg_to_project_info() (in module pylorax.api.projects)</a>
</li> </li>
<li><a href="pylorax.html#pylorax.treebuilder.RuntimeBuilder.postinstall">postinstall() (pylorax.treebuilder.RuntimeBuilder method)</a> <li><a href="pylorax.html#pylorax.treebuilder.RuntimeBuilder.postinstall">postinstall() (pylorax.treebuilder.RuntimeBuilder method)</a>
</li>
<li><a href="pylorax.api.html#pylorax.api.recipes.prepare_commit">prepare_commit() (in module pylorax.api.recipes)</a>
</li> </li>
<li><a href="pylorax.html#pylorax.dnfhelper.LoraxDownloadCallback.progress">progress() (pylorax.dnfhelper.LoraxDownloadCallback method)</a> <li><a href="pylorax.html#pylorax.dnfhelper.LoraxDownloadCallback.progress">progress() (pylorax.dnfhelper.LoraxDownloadCallback method)</a>
@ -500,17 +677,53 @@
<li><a href="pylorax.html#pylorax.dnfhelper.LoraxRpmCallback.progress">(pylorax.dnfhelper.LoraxRpmCallback method)</a> <li><a href="pylorax.html#pylorax.dnfhelper.LoraxRpmCallback.progress">(pylorax.dnfhelper.LoraxRpmCallback method)</a>
</li> </li>
</ul></li> </ul></li>
<li><a href="pylorax.api.html#pylorax.api.projects.proj_to_module">proj_to_module() (in module pylorax.api.projects)</a>
</li>
<li><a href="pylorax.api.html#pylorax.api.projects.projects_depsolve">projects_depsolve() (in module pylorax.api.projects)</a>
</li>
<li><a href="pylorax.api.html#pylorax.api.projects.projects_depsolve_with_size">projects_depsolve_with_size() (in module pylorax.api.projects)</a>
</li>
<li><a href="pylorax.api.html#pylorax.api.projects.projects_info">projects_info() (in module pylorax.api.projects)</a>
</li>
<li><a href="pylorax.api.html#pylorax.api.projects.projects_list">projects_list() (in module pylorax.api.projects)</a>
</li>
<li><a href="pylorax.api.html#pylorax.api.projects.ProjectsError">ProjectsError</a>
</li>
<li><a href="pylorax.html#pylorax.base.BaseLoraxClass.pwarning">pwarning() (pylorax.base.BaseLoraxClass method)</a> <li><a href="pylorax.html#pylorax.base.BaseLoraxClass.pwarning">pwarning() (pylorax.base.BaseLoraxClass method)</a>
</li> </li>
<li><a href="pylorax.html#module-pylorax">pylorax (module)</a> <li><a href="pylorax.html#module-pylorax">pylorax (module)</a>
</li>
<li><a href="pylorax.api.html#module-pylorax.api">pylorax.api (module)</a>
</li>
<li><a href="pylorax.api.html#module-pylorax.api.cmdline">pylorax.api.cmdline (module)</a>
</li>
<li><a href="pylorax.api.html#module-pylorax.api.compose">pylorax.api.compose (module)</a>
</li>
</ul></td>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="pylorax.api.html#module-pylorax.api.config">pylorax.api.config (module)</a>
</li>
<li><a href="pylorax.api.html#module-pylorax.api.crossdomain">pylorax.api.crossdomain (module)</a>
</li>
<li><a href="pylorax.api.html#module-pylorax.api.projects">pylorax.api.projects (module)</a>
</li>
<li><a href="pylorax.api.html#module-pylorax.api.queue">pylorax.api.queue (module)</a>
</li>
<li><a href="pylorax.api.html#module-pylorax.api.recipes">pylorax.api.recipes (module)</a>
</li>
<li><a href="pylorax.api.html#module-pylorax.api.server">pylorax.api.server (module)</a>
</li>
<li><a href="pylorax.api.html#module-pylorax.api.v0">pylorax.api.v0 (module)</a>
</li>
<li><a href="pylorax.api.html#module-pylorax.api.workspace">pylorax.api.workspace (module)</a>
</li> </li>
<li><a href="pylorax.html#module-pylorax.base">pylorax.base (module)</a> <li><a href="pylorax.html#module-pylorax.base">pylorax.base (module)</a>
</li> </li>
<li><a href="pylorax.html#module-pylorax.buildstamp">pylorax.buildstamp (module)</a> <li><a href="pylorax.html#module-pylorax.buildstamp">pylorax.buildstamp (module)</a>
</li> </li>
</ul></td>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="pylorax.html#module-pylorax.cmdline">pylorax.cmdline (module)</a> <li><a href="pylorax.html#module-pylorax.cmdline">pylorax.cmdline (module)</a>
</li>
<li><a href="pylorax.html#module-pylorax.creator">pylorax.creator (module)</a>
</li> </li>
<li><a href="pylorax.html#module-pylorax.decorators">pylorax.decorators (module)</a> <li><a href="pylorax.html#module-pylorax.decorators">pylorax.decorators (module)</a>
</li> </li>
@ -521,6 +734,8 @@
<li><a href="pylorax.html#module-pylorax.executils">pylorax.executils (module)</a> <li><a href="pylorax.html#module-pylorax.executils">pylorax.executils (module)</a>
</li> </li>
<li><a href="pylorax.html#module-pylorax.imgutils">pylorax.imgutils (module)</a> <li><a href="pylorax.html#module-pylorax.imgutils">pylorax.imgutils (module)</a>
</li>
<li><a href="pylorax.html#module-pylorax.installer">pylorax.installer (module)</a>
</li> </li>
<li><a href="pylorax.html#module-pylorax.ltmpl">pylorax.ltmpl (module)</a> <li><a href="pylorax.html#module-pylorax.ltmpl">pylorax.ltmpl (module)</a>
</li> </li>
@ -539,10 +754,54 @@
</ul></td> </ul></td>
</tr></table> </tr></table>
<h2 id="Q">Q</h2>
<table style="width: 100%" class="indextable genindextable"><tr>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="pylorax.html#pylorax.installer.QEMUInstall.QEMU_CMDS">QEMU_CMDS (pylorax.installer.QEMUInstall attribute)</a>
</li>
</ul></td>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="pylorax.html#pylorax.installer.QEMUInstall">QEMUInstall (class in pylorax.installer)</a>
</li>
<li><a href="pylorax.api.html#pylorax.api.queue.queue_status">queue_status() (in module pylorax.api.queue)</a>
</li>
</ul></td>
</tr></table>
<h2 id="R">R</h2> <h2 id="R">R</h2>
<table style="width: 100%" class="indextable genindextable"><tr> <table style="width: 100%" class="indextable genindextable"><tr>
<td style="width: 33%; vertical-align: top;"><ul> <td style="width: 33%; vertical-align: top;"><ul>
<li><a href="pylorax.api.html#pylorax.api.recipes.read_commit">read_commit() (in module pylorax.api.recipes)</a>
</li>
<li><a href="pylorax.api.html#pylorax.api.recipes.read_commit_spec">read_commit_spec() (in module pylorax.api.recipes)</a>
</li>
<li><a href="pylorax.api.html#pylorax.api.recipes.read_recipe_and_id">read_recipe_and_id() (in module pylorax.api.recipes)</a>
</li>
<li><a href="pylorax.api.html#pylorax.api.recipes.read_recipe_commit">read_recipe_commit() (in module pylorax.api.recipes)</a>
</li>
<li><a href="pylorax.html#pylorax.treebuilder.TreeBuilder.rebuild_initrds">rebuild_initrds() (pylorax.treebuilder.TreeBuilder method)</a> <li><a href="pylorax.html#pylorax.treebuilder.TreeBuilder.rebuild_initrds">rebuild_initrds() (pylorax.treebuilder.TreeBuilder method)</a>
</li>
<li><a href="pylorax.html#pylorax.creator.rebuild_initrds_for_live">rebuild_initrds_for_live() (in module pylorax.creator)</a>
</li>
<li><a href="pylorax.api.html#pylorax.api.recipes.Recipe">Recipe (class in pylorax.api.recipes)</a>
</li>
<li><a href="pylorax.api.html#pylorax.api.recipes.recipe_diff">recipe_diff() (in module pylorax.api.recipes)</a>
</li>
<li><a href="pylorax.api.html#pylorax.api.recipes.recipe_filename">recipe_filename() (in module pylorax.api.recipes)</a>
</li>
<li><a href="pylorax.api.html#pylorax.api.recipes.recipe_from_dict">recipe_from_dict() (in module pylorax.api.recipes)</a>
</li>
<li><a href="pylorax.api.html#pylorax.api.recipes.recipe_from_file">recipe_from_file() (in module pylorax.api.recipes)</a>
</li>
<li><a href="pylorax.api.html#pylorax.api.recipes.recipe_from_toml">recipe_from_toml() (in module pylorax.api.recipes)</a>
</li>
<li><a href="pylorax.api.html#pylorax.api.recipes.RecipeError">RecipeError</a>
</li>
<li><a href="pylorax.api.html#pylorax.api.recipes.RecipeFileError">RecipeFileError</a>
</li>
<li><a href="pylorax.api.html#pylorax.api.recipes.RecipeModule">RecipeModule (class in pylorax.api.recipes)</a>
</li>
<li><a href="pylorax.api.html#pylorax.api.recipes.RecipePackage">RecipePackage (class in pylorax.api.recipes)</a>
</li> </li>
<li><a href="pylorax.html#pylorax.sysutils.remove">remove() (in module pylorax.sysutils)</a> <li><a href="pylorax.html#pylorax.sysutils.remove">remove() (in module pylorax.sysutils)</a>
@ -552,6 +811,8 @@
</ul></li> </ul></li>
<li><a href="pylorax.html#pylorax.ltmpl.LoraxTemplateRunner.removefrom">removefrom() (pylorax.ltmpl.LoraxTemplateRunner method)</a> <li><a href="pylorax.html#pylorax.ltmpl.LoraxTemplateRunner.removefrom">removefrom() (pylorax.ltmpl.LoraxTemplateRunner method)</a>
</li> </li>
</ul></td>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="pylorax.html#pylorax.ltmpl.LoraxTemplateRunner.removekmod">removekmod() (pylorax.ltmpl.LoraxTemplateRunner method)</a> <li><a href="pylorax.html#pylorax.ltmpl.LoraxTemplateRunner.removekmod">removekmod() (pylorax.ltmpl.LoraxTemplateRunner method)</a>
</li> </li>
<li><a href="pylorax.html#pylorax.ltmpl.LoraxTemplateRunner.removepkg">removepkg() (pylorax.ltmpl.LoraxTemplateRunner method)</a> <li><a href="pylorax.html#pylorax.ltmpl.LoraxTemplateRunner.removepkg">removepkg() (pylorax.ltmpl.LoraxTemplateRunner method)</a>
@ -562,10 +823,18 @@
<li><a href="pylorax.html#pylorax.ltmpl.LoraxTemplateRunner.replace">(pylorax.ltmpl.LoraxTemplateRunner method)</a> <li><a href="pylorax.html#pylorax.ltmpl.LoraxTemplateRunner.replace">(pylorax.ltmpl.LoraxTemplateRunner method)</a>
</li> </li>
</ul></li> </ul></li>
<li><a href="pylorax.api.html#pylorax.api.server.GitLock.repo">repo (pylorax.api.server.GitLock attribute)</a>
</li>
<li><a href="pylorax.api.html#pylorax.api.compose.repo_to_ks">repo_to_ks() (in module pylorax.api.compose)</a>
</li>
<li><a href="pylorax.html#pylorax.creator.FakeDNF.reset">reset() (pylorax.creator.FakeDNF method)</a>
</li>
<li><a href="pylorax.api.html#pylorax.api.recipes.revert_file">revert_file() (in module pylorax.api.recipes)</a>
</li>
<li><a href="pylorax.api.html#pylorax.api.recipes.revert_recipe">revert_recipe() (in module pylorax.api.recipes)</a>
</li>
<li><a href="pylorax.html#pylorax.ltmpl.rexists">rexists() (in module pylorax.ltmpl)</a> <li><a href="pylorax.html#pylorax.ltmpl.rexists">rexists() (in module pylorax.ltmpl)</a>
</li> </li>
</ul></td>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="pylorax.html#pylorax.ltmpl.rglob">rglob() (in module pylorax.ltmpl)</a> <li><a href="pylorax.html#pylorax.ltmpl.rglob">rglob() (in module pylorax.ltmpl)</a>
</li> </li>
<li><a href="pylorax.html#pylorax.imgutils.round_to_blocks">round_to_blocks() (in module pylorax.imgutils)</a> <li><a href="pylorax.html#pylorax.imgutils.round_to_blocks">round_to_blocks() (in module pylorax.imgutils)</a>
@ -576,6 +845,8 @@
<li><a href="pylorax.html#pylorax.ltmpl.LoraxTemplateRunner.run">(pylorax.ltmpl.LoraxTemplateRunner method)</a> <li><a href="pylorax.html#pylorax.ltmpl.LoraxTemplateRunner.run">(pylorax.ltmpl.LoraxTemplateRunner method)</a>
</li> </li>
</ul></li> </ul></li>
<li><a href="pylorax.html#pylorax.creator.run_creator">run_creator() (in module pylorax.creator)</a>
</li>
<li><a href="pylorax.html#pylorax.ltmpl.LoraxTemplateRunner.run_pkg_transaction">run_pkg_transaction() (pylorax.ltmpl.LoraxTemplateRunner method)</a> <li><a href="pylorax.html#pylorax.ltmpl.LoraxTemplateRunner.run_pkg_transaction">run_pkg_transaction() (pylorax.ltmpl.LoraxTemplateRunner method)</a>
</li> </li>
<li><a href="pylorax.html#pylorax.executils.runcmd">runcmd() (in module pylorax.executils)</a> <li><a href="pylorax.html#pylorax.executils.runcmd">runcmd() (in module pylorax.executils)</a>
@ -604,11 +875,17 @@
</li> </li>
<li><a href="pylorax.html#pylorax.decorators.singleton">singleton() (in module pylorax.decorators)</a> <li><a href="pylorax.html#pylorax.decorators.singleton">singleton() (in module pylorax.decorators)</a>
</li> </li>
</ul></td>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="pylorax.html#pylorax.ltmpl.split_and_expand">split_and_expand() (in module pylorax.ltmpl)</a> <li><a href="pylorax.html#pylorax.ltmpl.split_and_expand">split_and_expand() (in module pylorax.ltmpl)</a>
</li> </li>
<li><a href="pylorax.html#pylorax.creator.squashfs_args">squashfs_args() (in module pylorax.creator)</a>
</li>
</ul></td>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="pylorax.html#pylorax.dnfhelper.LoraxDownloadCallback.start">start() (pylorax.dnfhelper.LoraxDownloadCallback method)</a> <li><a href="pylorax.html#pylorax.dnfhelper.LoraxDownloadCallback.start">start() (pylorax.dnfhelper.LoraxDownloadCallback method)</a>
</li>
<li><a href="pylorax.api.html#pylorax.api.compose.start_build">start_build() (in module pylorax.api.compose)</a>
</li>
<li><a href="pylorax.api.html#pylorax.api.queue.start_queue_monitor">start_queue_monitor() (in module pylorax.api.queue)</a>
</li> </li>
<li><a href="pylorax.html#pylorax.executils.startProgram">startProgram() (in module pylorax.executils)</a> <li><a href="pylorax.html#pylorax.executils.startProgram">startProgram() (in module pylorax.executils)</a>
</li> </li>
@ -624,14 +901,22 @@
<h2 id="T">T</h2> <h2 id="T">T</h2>
<table style="width: 100%" class="indextable genindextable"><tr> <table style="width: 100%" class="indextable genindextable"><tr>
<td style="width: 33%; vertical-align: top;"><ul> <td style="width: 33%; vertical-align: top;"><ul>
<li><a href="pylorax.api.html#pylorax.api.recipes.tag_file_commit">tag_file_commit() (in module pylorax.api.recipes)</a>
</li>
<li><a href="pylorax.api.html#pylorax.api.recipes.tag_recipe_commit">tag_recipe_commit() (in module pylorax.api.recipes)</a>
</li>
<li><a href="pylorax.api.html#pylorax.api.v0.take_limits">take_limits() (in module pylorax.api.v0)</a>
</li>
<li><a href="pylorax.html#pylorax.Lorax.templatedir">templatedir (pylorax.Lorax attribute)</a> <li><a href="pylorax.html#pylorax.Lorax.templatedir">templatedir (pylorax.Lorax attribute)</a>
</li> </li>
<li><a href="pylorax.html#pylorax.monitor.LogServer.timeout">timeout (pylorax.monitor.LogServer attribute)</a> <li><a href="pylorax.html#pylorax.monitor.LogServer.timeout">timeout (pylorax.monitor.LogServer attribute)</a>
</li>
<li><a href="pylorax.html#pylorax.sysutils.touch">touch() (in module pylorax.sysutils)</a>
</li> </li>
</ul></td> </ul></td>
<td style="width: 33%; vertical-align: top;"><ul> <td style="width: 33%; vertical-align: top;"><ul>
<li><a href="pylorax.api.html#pylorax.api.recipes.Recipe.toml">toml() (pylorax.api.recipes.Recipe method)</a>
</li>
<li><a href="pylorax.html#pylorax.sysutils.touch">touch() (in module pylorax.sysutils)</a>
</li>
<li><a href="pylorax.html#pylorax.treebuilder.TreeBuilder">TreeBuilder (class in pylorax.treebuilder)</a> <li><a href="pylorax.html#pylorax.treebuilder.TreeBuilder">TreeBuilder (class in pylorax.treebuilder)</a>
</li> </li>
<li><a href="pylorax.html#pylorax.treeinfo.TreeInfo">TreeInfo (class in pylorax.treeinfo)</a> <li><a href="pylorax.html#pylorax.treeinfo.TreeInfo">TreeInfo (class in pylorax.treeinfo)</a>
@ -646,21 +931,43 @@
<td style="width: 33%; vertical-align: top;"><ul> <td style="width: 33%; vertical-align: top;"><ul>
<li><a href="pylorax.html#pylorax.treebuilder.udev_escape">udev_escape() (in module pylorax.treebuilder)</a> <li><a href="pylorax.html#pylorax.treebuilder.udev_escape">udev_escape() (in module pylorax.treebuilder)</a>
</li> </li>
</ul></td>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="pylorax.html#pylorax.imgutils.umount">umount() (in module pylorax.imgutils)</a> <li><a href="pylorax.html#pylorax.imgutils.umount">umount() (in module pylorax.imgutils)</a>
<ul> <ul>
<li><a href="pylorax.html#pylorax.mount.IsoMountpoint.umount">(pylorax.mount.IsoMountpoint method)</a> <li><a href="pylorax.html#pylorax.mount.IsoMountpoint.umount">(pylorax.mount.IsoMountpoint method)</a>
</li> </li>
</ul></li> </ul></li>
<li><a href="pylorax.html#pylorax.installer.update_vagrant_metadata">update_vagrant_metadata() (in module pylorax.installer)</a>
</li>
<li><a href="pylorax.api.html#pylorax.api.queue.uuid_cancel">uuid_cancel() (in module pylorax.api.queue)</a>
</li>
</ul></td>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="pylorax.api.html#pylorax.api.queue.uuid_delete">uuid_delete() (in module pylorax.api.queue)</a>
</li>
<li><a href="pylorax.api.html#pylorax.api.queue.uuid_image">uuid_image() (in module pylorax.api.queue)</a>
</li>
<li><a href="pylorax.api.html#pylorax.api.queue.uuid_info">uuid_info() (in module pylorax.api.queue)</a>
</li>
<li><a href="pylorax.api.html#pylorax.api.queue.uuid_log">uuid_log() (in module pylorax.api.queue)</a>
</li>
<li><a href="pylorax.api.html#pylorax.api.queue.uuid_status">uuid_status() (in module pylorax.api.queue)</a>
</li>
<li><a href="pylorax.api.html#pylorax.api.queue.uuid_tar">uuid_tar() (in module pylorax.api.queue)</a>
</li>
</ul></td> </ul></td>
</tr></table> </tr></table>
<h2 id="V">V</h2> <h2 id="V">V</h2>
<table style="width: 100%" class="indextable genindextable"><tr> <table style="width: 100%" class="indextable genindextable"><tr>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="pylorax.api.html#pylorax.api.v0.v0_api">v0_api() (in module pylorax.api.v0)</a>
</li>
</ul></td>
<td style="width: 33%; vertical-align: top;"><ul> <td style="width: 33%; vertical-align: top;"><ul>
<li><a href="pylorax.html#pylorax.treebuilder.RuntimeBuilder.verify">verify() (pylorax.treebuilder.RuntimeBuilder method)</a> <li><a href="pylorax.html#pylorax.treebuilder.RuntimeBuilder.verify">verify() (pylorax.treebuilder.RuntimeBuilder method)</a>
</li>
<li><a href="pylorax.html#pylorax.installer.virt_install">virt_install() (in module pylorax.installer)</a>
</li> </li>
</ul></td> </ul></td>
</tr></table> </tr></table>
@ -668,6 +975,14 @@
<h2 id="W">W</h2> <h2 id="W">W</h2>
<table style="width: 100%" class="indextable genindextable"><tr> <table style="width: 100%" class="indextable genindextable"><tr>
<td style="width: 33%; vertical-align: top;"><ul> <td style="width: 33%; vertical-align: top;"><ul>
<li><a href="pylorax.api.html#pylorax.api.workspace.workspace_delete">workspace_delete() (in module pylorax.api.workspace)</a>
</li>
<li><a href="pylorax.api.html#pylorax.api.workspace.workspace_dir">workspace_dir() (in module pylorax.api.workspace)</a>
</li>
<li><a href="pylorax.api.html#pylorax.api.workspace.workspace_read">workspace_read() (in module pylorax.api.workspace)</a>
</li>
<li><a href="pylorax.api.html#pylorax.api.workspace.workspace_write">workspace_write() (in module pylorax.api.workspace)</a>
</li>
<li><a href="pylorax.html#pylorax.buildstamp.BuildStamp.write">write() (pylorax.buildstamp.BuildStamp method)</a> <li><a href="pylorax.html#pylorax.buildstamp.BuildStamp.write">write() (pylorax.buildstamp.BuildStamp method)</a>
<ul> <ul>
@ -678,6 +993,12 @@
</ul></li> </ul></li>
</ul></td> </ul></td>
<td style="width: 33%; vertical-align: top;"><ul> <td style="width: 33%; vertical-align: top;"><ul>
<li><a href="pylorax.api.html#pylorax.api.recipes.write_commit">write_commit() (in module pylorax.api.recipes)</a>
</li>
<li><a href="pylorax.api.html#pylorax.api.compose.write_ks_group">write_ks_group() (in module pylorax.api.compose)</a>
</li>
<li><a href="pylorax.api.html#pylorax.api.compose.write_ks_user">write_ks_user() (in module pylorax.api.compose)</a>
</li>
<li><a href="pylorax.html#pylorax.treebuilder.RuntimeBuilder.writepkglists">writepkglists() (pylorax.treebuilder.RuntimeBuilder method)</a> <li><a href="pylorax.html#pylorax.treebuilder.RuntimeBuilder.writepkglists">writepkglists() (pylorax.treebuilder.RuntimeBuilder method)</a>
</li> </li>
<li><a href="pylorax.html#pylorax.treebuilder.RuntimeBuilder.writepkgsizes">writepkgsizes() (pylorax.treebuilder.RuntimeBuilder method)</a> <li><a href="pylorax.html#pylorax.treebuilder.RuntimeBuilder.writepkgsizes">writepkgsizes() (pylorax.treebuilder.RuntimeBuilder method)</a>
@ -688,10 +1009,8 @@
</div> </div>
<div class="articleComments">
</div> </div>
</div>
<footer> <footer>
@ -703,7 +1022,7 @@
</p> </p>
</div> </div>
Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/snide/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>. 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> </footer>
@ -721,7 +1040,8 @@
<script type="text/javascript"> <script type="text/javascript">
var DOCUMENTATION_OPTIONS = { var DOCUMENTATION_OPTIONS = {
URL_ROOT:'./', URL_ROOT:'./',
VERSION:'28.9', VERSION:'28.10',
LANGUAGE:'None',
COLLAPSE_INDEX:false, COLLAPSE_INDEX:false,
FILE_SUFFIX:'.html', FILE_SUFFIX:'.html',
HAS_SOURCE: true, HAS_SOURCE: true,
@ -739,14 +1059,13 @@
<script type="text/javascript" src="_static/js/theme.js"></script> <script type="text/javascript" src="_static/js/theme.js"></script>
<script type="text/javascript"> <script type="text/javascript">
jQuery(function () { jQuery(function () {
SphinxRtdTheme.StickyNav.enable();
SphinxRtdTheme.Navigation.enableSticky();
}); });
</script> </script>
</body> </body>
</html> </html>

View File

@ -8,8 +8,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Welcome to Loraxs documentation! &mdash; Lorax 28.9 documentation</title> <title>Welcome to Loraxs documentation! &mdash; Lorax 28.10 documentation</title>
@ -27,15 +26,9 @@
<link rel="stylesheet" href="_static/css/theme.css" type="text/css" /> <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="index" title="Index"
href="genindex.html"/>
<link rel="search" title="Search" href="search.html" /> <link rel="search" title="Search" href="search.html" />
<link rel="top" title="Lorax 28.9 documentation" href="#"/>
<link rel="next" title="Introduction to Lorax" href="intro.html" /> <link rel="next" title="Introduction to Lorax" href="intro.html" />
@ -43,7 +36,7 @@
</head> </head>
<body class="wy-body-for-nav" role="document"> <body class="wy-body-for-nav">
<div class="wy-grid-for-nav"> <div class="wy-grid-for-nav">
@ -65,7 +58,7 @@
<div class="version"> <div class="version">
28.9 28.10
</div> </div>
@ -94,6 +87,8 @@
<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="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="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="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"><a class="reference internal" href="product-images.html">Product and Updates Images</a></li>
<li class="toctree-l1"><a class="reference internal" href="modules.html">pylorax</a></li> <li class="toctree-l1"><a class="reference internal" href="modules.html">pylorax</a></li>
</ul> </ul>
@ -107,7 +102,7 @@
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"> <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
<nav class="wy-nav-top" role="navigation" aria-label="top navigation"> <nav class="wy-nav-top" aria-label="top navigation">
<i data-toggle="wy-nav-top" class="fa fa-bars"></i> <i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="#">Lorax</a> <a href="#">Lorax</a>
@ -115,8 +110,8 @@
</nav> </nav>
<div class="wy-nav-content"> <div class="wy-nav-content">
<div class="rst-content"> <div class="rst-content">
@ -134,6 +129,7 @@
<div role="navigation" aria-label="breadcrumbs navigation"> <div role="navigation" aria-label="breadcrumbs navigation">
<ul class="wy-breadcrumbs"> <ul class="wy-breadcrumbs">
@ -168,11 +164,20 @@
<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="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="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="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"><a class="reference internal" href="product-images.html">Product and Updates Images</a></li>
<li class="toctree-l1"><a class="reference internal" href="modules.html">pylorax</a></li> <li class="toctree-l1"><a class="reference internal" href="modules.html">pylorax</a></li>
</ul> </ul>
</div> </div>
</div> </div>
<div class="section" id="documentation-for-other-lorax-branches">
<h1>Documentation for other Lorax Branches<a class="headerlink" href="#documentation-for-other-lorax-branches" title="Permalink to this headline"></a></h1>
<ul class="simple">
<li><a class="reference external" href="f28-branch/">Fedora 28</a></li>
<li><a class="reference external" href="lorax-composer/">RHEL7 lorax-composer</a></li>
</ul>
</div>
<div class="section" id="indices-and-tables"> <div class="section" id="indices-and-tables">
<h1>Indices and tables<a class="headerlink" href="#indices-and-tables" title="Permalink to this headline"></a></h1> <h1>Indices and tables<a class="headerlink" href="#indices-and-tables" title="Permalink to this headline"></a></h1>
<ul class="simple"> <ul class="simple">
@ -184,10 +189,8 @@
</div> </div>
<div class="articleComments">
</div> </div>
</div>
<footer> <footer>
<div class="rst-footer-buttons" role="navigation" aria-label="footer navigation"> <div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
@ -206,7 +209,7 @@
</p> </p>
</div> </div>
Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/snide/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>. 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> </footer>
@ -224,7 +227,8 @@
<script type="text/javascript"> <script type="text/javascript">
var DOCUMENTATION_OPTIONS = { var DOCUMENTATION_OPTIONS = {
URL_ROOT:'./', URL_ROOT:'./',
VERSION:'28.9', VERSION:'28.10',
LANGUAGE:'None',
COLLAPSE_INDEX:false, COLLAPSE_INDEX:false,
FILE_SUFFIX:'.html', FILE_SUFFIX:'.html',
HAS_SOURCE: true, HAS_SOURCE: true,
@ -242,14 +246,13 @@
<script type="text/javascript" src="_static/js/theme.js"></script> <script type="text/javascript" src="_static/js/theme.js"></script>
<script type="text/javascript"> <script type="text/javascript">
jQuery(function () { jQuery(function () {
SphinxRtdTheme.StickyNav.enable();
SphinxRtdTheme.Navigation.enableSticky();
}); });
</script> </script>
</body> </body>
</html> </html>

View File

@ -8,8 +8,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Introduction to Lorax &mdash; Lorax 28.9 documentation</title> <title>Introduction to Lorax &mdash; Lorax 28.10 documentation</title>
@ -27,15 +26,9 @@
<link rel="stylesheet" href="_static/css/theme.css" type="text/css" /> <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="index" title="Index"
href="genindex.html"/>
<link rel="search" title="Search" href="search.html" /> <link rel="search" title="Search" href="search.html" />
<link rel="top" title="Lorax 28.9 documentation" href="index.html"/>
<link rel="next" title="Lorax" href="lorax.html" /> <link rel="next" title="Lorax" href="lorax.html" />
<link rel="prev" title="Welcome to Loraxs documentation!" href="index.html" /> <link rel="prev" title="Welcome to Loraxs documentation!" href="index.html" />
@ -44,7 +37,7 @@
</head> </head>
<body class="wy-body-for-nav" role="document"> <body class="wy-body-for-nav">
<div class="wy-grid-for-nav"> <div class="wy-grid-for-nav">
@ -66,7 +59,7 @@
<div class="version"> <div class="version">
28.9 28.10
</div> </div>
@ -95,6 +88,8 @@
<li class="toctree-l1"><a class="reference internal" href="#before-lorax">Before Lorax</a></li> <li class="toctree-l1"><a class="reference internal" href="#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="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="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"><a class="reference internal" href="product-images.html">Product and Updates Images</a></li>
<li class="toctree-l1"><a class="reference internal" href="modules.html">pylorax</a></li> <li class="toctree-l1"><a class="reference internal" href="modules.html">pylorax</a></li>
</ul> </ul>
@ -108,7 +103,7 @@
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"> <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
<nav class="wy-nav-top" role="navigation" aria-label="top navigation"> <nav class="wy-nav-top" aria-label="top navigation">
<i data-toggle="wy-nav-top" class="fa fa-bars"></i> <i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="index.html">Lorax</a> <a href="index.html">Lorax</a>
@ -116,8 +111,8 @@
</nav> </nav>
<div class="wy-nav-content"> <div class="wy-nav-content">
<div class="rst-content"> <div class="rst-content">
@ -135,6 +130,7 @@
<div role="navigation" aria-label="breadcrumbs navigation"> <div role="navigation" aria-label="breadcrumbs navigation">
<ul class="wy-breadcrumbs"> <ul class="wy-breadcrumbs">
@ -214,10 +210,8 @@ upd-instroot and mk-images* scripts.</p>
</div> </div>
<div class="articleComments">
</div> </div>
</div>
<footer> <footer>
<div class="rst-footer-buttons" role="navigation" aria-label="footer navigation"> <div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
@ -238,7 +232,7 @@ upd-instroot and mk-images* scripts.</p>
</p> </p>
</div> </div>
Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/snide/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>. 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> </footer>
@ -256,7 +250,8 @@ upd-instroot and mk-images* scripts.</p>
<script type="text/javascript"> <script type="text/javascript">
var DOCUMENTATION_OPTIONS = { var DOCUMENTATION_OPTIONS = {
URL_ROOT:'./', URL_ROOT:'./',
VERSION:'28.9', VERSION:'28.10',
LANGUAGE:'None',
COLLAPSE_INDEX:false, COLLAPSE_INDEX:false,
FILE_SUFFIX:'.html', FILE_SUFFIX:'.html',
HAS_SOURCE: true, HAS_SOURCE: true,
@ -274,14 +269,13 @@ upd-instroot and mk-images* scripts.</p>
<script type="text/javascript" src="_static/js/theme.js"></script> <script type="text/javascript" src="_static/js/theme.js"></script>
<script type="text/javascript"> <script type="text/javascript">
jQuery(function () { jQuery(function () {
SphinxRtdTheme.StickyNav.enable();
SphinxRtdTheme.Navigation.enableSticky();
}); });
</script> </script>
</body> </body>
</html> </html>

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,544 @@
<!DOCTYPE html>
<!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]-->
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>lorax-composer &mdash; Lorax 28.10 documentation</title>
<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="composer-cli" href="composer-cli.html" />
<link rel="prev" title="livemedia-creator" href="livemedia-creator.html" />
<script src="_static/js/modernizr.min.js"></script>
</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">
28.10
</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 current"><a class="current reference internal" href="#">lorax-composer</a><ul>
<li class="toctree-l2"><a class="reference internal" href="#installation">Installation</a></li>
<li class="toctree-l2"><a class="reference internal" href="#quickstart">Quickstart</a></li>
<li class="toctree-l2"><a class="reference internal" href="#logs">Logs</a></li>
<li class="toctree-l2"><a class="reference internal" href="#security">Security</a></li>
<li class="toctree-l2"><a class="reference internal" href="#lorax-composer-cmdline-arguments">lorax-composer cmdline arguments</a><ul>
<li class="toctree-l3"><a class="reference internal" href="#Positional Arguments">Positional Arguments</a></li>
<li class="toctree-l3"><a class="reference internal" href="#Named Arguments">Named Arguments</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="#how-it-works">How it Works</a></li>
<li class="toctree-l2"><a class="reference internal" href="#composing-images">Composing Images</a></li>
<li class="toctree-l2"><a class="reference internal" href="#blueprints">Blueprints</a><ul>
<li class="toctree-l3"><a class="reference internal" href="#packages-and-modules">[[packages]] and [[modules]]</a></li>
<li class="toctree-l3"><a class="reference internal" href="#customizations">Customizations</a><ul>
<li class="toctree-l4"><a class="reference internal" href="#customizations-sshkey">[[customizations.sshkey]]</a></li>
<li class="toctree-l4"><a class="reference internal" href="#customizations-user">[[customizations.user]]</a></li>
<li class="toctree-l4"><a class="reference internal" href="#customizations-group">[[customizations.group]]</a></li>
</ul>
</li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="#adding-output-types">Adding Output Types</a><ul>
<li class="toctree-l3"><a class="reference internal" href="#example-add-partitioned-disk-support">Example: Add partitioned disk support</a></li>
</ul>
</li>
</ul>
</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"><a class="reference internal" href="modules.html">pylorax</a></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>lorax-composer</li>
<li class="wy-breadcrumbs-aside">
<a href="_sources/lorax-composer.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="lorax-composer">
<h1>lorax-composer<a class="headerlink" href="#lorax-composer" title="Permalink to this headline"></a></h1>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Authors:</th><td class="field-body">Brian C. Lane &lt;<a class="reference external" href="mailto:bcl&#37;&#52;&#48;redhat&#46;com">bcl<span>&#64;</span>redhat<span>&#46;</span>com</a>&gt;</td>
</tr>
</tbody>
</table>
<p><code class="docutils literal notranslate"><span class="pre">lorax-composer</span></code> is an API server that allows you to build disk images using
<a class="reference internal" href="#blueprints">Blueprints</a> to describe the package versions to be installed into the image.
It is compatible with the Weldr projects bdcs-api REST protocol. More
information on Weldr can be found <a class="reference external" href="http://www.weldr.io">on the Weldr blog</a>.</p>
<p>Behind the scenes it uses <a class="reference external" href="livemedia-creator.html">livemedia-creator</a> and
<a class="reference external" href="https://anaconda-installer.readthedocs.io/en/latest/">Anaconda</a> to handle the
installation and configuration of the images.</p>
<div class="section" id="installation">
<h2>Installation<a class="headerlink" href="#installation" title="Permalink to this headline"></a></h2>
<p>The best way to install <code class="docutils literal notranslate"><span class="pre">lorax-composer</span></code> is to use <code class="docutils literal notranslate"><span class="pre">sudo</span> <span class="pre">dnf</span> <span class="pre">install</span>
<span class="pre">lorax-composer</span> <span class="pre">composer-cli</span></code>, this will setup the weldr user and install the
systemd socket activation service. You will then need to enable it with <code class="docutils literal notranslate"><span class="pre">sudo</span>
<span class="pre">systemctl</span> <span class="pre">enable</span> <span class="pre">lorax-composer.socket</span> <span class="pre">&amp;&amp;</span> <span class="pre">sudo</span> <span class="pre">systemctl</span> <span class="pre">start</span>
<span class="pre">lorax-composer.socket</span></code>. This will leave the server off until the first request
is made. Systemd will then launch the server and it will remain running until
the system is rebooted.</p>
</div>
<div class="section" id="quickstart">
<h2>Quickstart<a class="headerlink" href="#quickstart" title="Permalink to this headline"></a></h2>
<ol class="arabic simple">
<li>Create a <code class="docutils literal notranslate"><span class="pre">weldr</span></code> user and group by running <code class="docutils literal notranslate"><span class="pre">useradd</span> <span class="pre">weldr</span></code></li>
<li>Remove any pre-existing socket directory with <code class="docutils literal notranslate"><span class="pre">rm</span> <span class="pre">-rf</span> <span class="pre">/run/weldr/</span></code>
A new directory with correct permissions will be created the first time the server runs.</li>
<li>Enable the socket activation with <code class="docutils literal notranslate"><span class="pre">systemctl</span> <span class="pre">enable</span> <span class="pre">lorax-composer.socket</span>
<span class="pre">&amp;&amp;</span> <span class="pre">sudo</span> <span class="pre">systemctl</span> <span class="pre">start</span> <span class="pre">lorax-composer.socket</span></code> or run it directly with
<code class="docutils literal notranslate"><span class="pre">lorax-composer</span> <span class="pre">/path/to/blueprints/</span></code></li>
</ol>
<p>The <code class="docutils literal notranslate"><span class="pre">/path/to/blueprints/</span></code> directory is where the blueprints git repo will
be created, and all the blueprints created with the <code class="docutils literal notranslate"><span class="pre">/api/v0/blueprints/new</span></code>
route will be stored. If there are blueprint <code class="docutils literal notranslate"><span class="pre">.toml</span></code> files in the top level
of the directory they will be imported into the blueprint git storage when
<code class="docutils literal notranslate"><span class="pre">lorax-composer</span></code> starts.</p>
</div>
<div class="section" id="logs">
<h2>Logs<a class="headerlink" href="#logs" title="Permalink to this headline"></a></h2>
<p>Logs are stored under <code class="docutils literal notranslate"><span class="pre">/var/log/lorax-composer/</span></code> and include all console
messages as well as extra debugging info and API requests.</p>
</div>
<div class="section" id="security">
<h2>Security<a class="headerlink" href="#security" title="Permalink to this headline"></a></h2>
<p>Some security related issues that you should be aware of before running <code class="docutils literal notranslate"><span class="pre">lorax-composer</span></code>:</p>
<ul class="simple">
<li>One of the API server threads needs to retain root privileges in order to run Anaconda.</li>
<li>SELinux must be set to Permissive or disabled to allow <code class="docutils literal notranslate"><span class="pre">livemedia-creator</span></code> to run Anaconda.</li>
<li>Only allow authorized users access to the <code class="docutils literal notranslate"><span class="pre">weldr</span></code> group and socket.</li>
</ul>
<p>Since Anaconda kickstarts are used there is the possibility that a user could
inject commands into a blueprint that would result in the kickstart executing
arbitrary code on the host. Only authorized users should be allowed to build
images using <code class="docutils literal notranslate"><span class="pre">lorax-composer</span></code>.</p>
</div>
<div class="section" id="lorax-composer-cmdline-arguments">
<h2>lorax-composer cmdline arguments<a class="headerlink" href="#lorax-composer-cmdline-arguments" title="Permalink to this headline"></a></h2>
<p>Lorax Composer API Server</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">usage</span><span class="p">:</span> <span class="n">lorax</span><span class="o">-</span><span class="n">composer</span> <span class="p">[</span><span class="o">-</span><span class="n">h</span><span class="p">]</span> <span class="p">[</span><span class="o">--</span><span class="n">socket</span> <span class="n">SOCKET</span><span class="p">]</span> <span class="p">[</span><span class="o">--</span><span class="n">user</span> <span class="n">USER</span><span class="p">]</span> <span class="p">[</span><span class="o">--</span><span class="n">group</span> <span class="n">GROUP</span><span class="p">]</span>
<span class="p">[</span><span class="o">--</span><span class="n">log</span> <span class="n">LOG</span><span class="p">]</span> <span class="p">[</span><span class="o">--</span><span class="n">mockfiles</span> <span class="n">MOCKFILES</span><span class="p">]</span>
<span class="p">[</span><span class="o">--</span><span class="n">sharedir</span> <span class="n">SHAREDIR</span><span class="p">]</span> <span class="p">[</span><span class="o">-</span><span class="n">V</span><span class="p">]</span> <span class="p">[</span><span class="o">-</span><span class="n">c</span> <span class="n">CONFIG</span><span class="p">]</span>
<span class="p">[</span><span class="o">--</span><span class="n">releasever</span> <span class="n">STRING</span><span class="p">]</span> <span class="p">[</span><span class="o">--</span><span class="n">tmp</span> <span class="n">TMP</span><span class="p">]</span> <span class="p">[</span><span class="o">--</span><span class="n">proxy</span> <span class="n">PROXY</span><span class="p">]</span>
<span class="n">BLUEPRINTS</span>
</pre></div>
</div>
<div class="section" id="Positional Arguments">
<h3>Positional Arguments<a class="headerlink" href="#Positional Arguments" title="Permalink to this headline"></a></h3>
<table class="docutils option-list" frame="void" rules="none">
<col class="option" />
<col class="description" />
<tbody valign="top">
<tr><td class="option-group">
<kbd>BLUEPRINTS</kbd></td>
<td>Path to the blueprints</td></tr>
</tbody>
</table>
</div>
<div class="section" id="Named Arguments">
<h3>Named Arguments<a class="headerlink" href="#Named Arguments" title="Permalink to this headline"></a></h3>
<table class="docutils option-list" frame="void" rules="none">
<col class="option" />
<col class="description" />
<tbody valign="top">
<tr><td class="option-group">
<kbd>--socket</kbd></td>
<td><p class="first">Path to the socket file to listen on</p>
<p class="last">Default: “/run/weldr/api.socket”</p>
</td></tr>
<tr><td class="option-group">
<kbd>--user</kbd></td>
<td><p class="first">User to use for reduced permissions</p>
<p class="last">Default: “weldr”</p>
</td></tr>
<tr><td class="option-group">
<kbd>--group</kbd></td>
<td><p class="first">Group to set ownership of the socket to</p>
<p class="last">Default: “weldr”</p>
</td></tr>
<tr><td class="option-group">
<kbd>--log</kbd></td>
<td><p class="first">Path to logfile (/var/log/lorax-composer/composer.log)</p>
<p class="last">Default: “/var/log/lorax-composer/composer.log”</p>
</td></tr>
<tr><td class="option-group">
<kbd>--mockfiles</kbd></td>
<td><p class="first">Path to JSON files used for /api/mock/ paths (/var/tmp/bdcs-mockfiles/)</p>
<p class="last">Default: “/var/tmp/bdcs-mockfiles/”</p>
</td></tr>
<tr><td class="option-group">
<kbd>--sharedir</kbd></td>
<td>Directory containing all the templates. Overrides config file sharedir</td></tr>
<tr><td class="option-group">
<kbd>-V</kbd></td>
<td><p class="first">show programs version number and exit</p>
<p class="last">Default: False</p>
</td></tr>
<tr><td class="option-group">
<kbd>-c, --config</kbd></td>
<td><p class="first">Path to lorax-composer configuration file.</p>
<p class="last">Default: “/etc/lorax/composer.conf”</p>
</td></tr>
<tr><td class="option-group">
<kbd>--releasever</kbd></td>
<td>Release version to use for $releasever in dnf repository urls</td></tr>
<tr><td class="option-group">
<kbd>--tmp</kbd></td>
<td><p class="first">Top level temporary directory</p>
<p class="last">Default: “/var/tmp”</p>
</td></tr>
<tr><td class="option-group">
<kbd>--proxy</kbd></td>
<td>Set proxy for DNF, overrides configuration file setting.</td></tr>
</tbody>
</table>
</div>
</div>
<div class="section" id="how-it-works">
<h2>How it Works<a class="headerlink" href="#how-it-works" title="Permalink to this headline"></a></h2>
<p>The server runs as root, and as <code class="docutils literal notranslate"><span class="pre">weldr</span></code>. Communication with it is via a unix
domain socket (<code class="docutils literal notranslate"><span class="pre">/run/weldr/api.socket</span></code> by default). The directory and socket
are owned by <code class="docutils literal notranslate"><span class="pre">root:weldr</span></code> so that any user in the <code class="docutils literal notranslate"><span class="pre">weldr</span></code> group can use the API
to control <code class="docutils literal notranslate"><span class="pre">lorax-composer</span></code>.</p>
<p>At startup the server will check for the correct permissions and
ownership of a pre-existing directory, or it will create a new one if it
doesnt exist. The socket path and group owners name can be changed from the
cmdline by passing it the <code class="docutils literal notranslate"><span class="pre">--socket</span></code> and <code class="docutils literal notranslate"><span class="pre">--group</span></code> arguments.</p>
<p>It will then drop root privileges for the API thread and run as the <code class="docutils literal notranslate"><span class="pre">weldr</span></code>
user. The queue and compose thread still runs as root because it needs to be
able to mount/umount files and run Anaconda.</p>
</div>
<div class="section" id="composing-images">
<h2>Composing Images<a class="headerlink" href="#composing-images" title="Permalink to this headline"></a></h2>
<p>The <a class="reference external" href="https://github.com/weldr/welder-web/">welder-web</a> GUI project can be used to construct
blueprints and create composes using a web browser.</p>
<p>Or use the command line with <a class="reference external" href="composer-cli.html">composer-cli</a>.</p>
</div>
<div class="section" id="blueprints">
<h2>Blueprints<a class="headerlink" href="#blueprints" title="Permalink to this headline"></a></h2>
<p>Blueprints are simple text files in <a class="reference external" href="https://github.com/toml-lang/toml">TOML</a> format that describe
which packages, and what versions, to install into the image. They can also define a limited set
of customizations to make to the final image.</p>
<p>Example blueprints can be found in the <code class="docutils literal notranslate"><span class="pre">lorax-composer</span></code> <a class="reference external" href="https://github.com/weldr/lorax/tree/master/tests/pylorax/blueprints/">test suite</a>, with a simple one
looking like this:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">name</span> <span class="o">=</span> <span class="s2">&quot;base&quot;</span>
<span class="n">description</span> <span class="o">=</span> <span class="s2">&quot;A base system with bash&quot;</span>
<span class="n">version</span> <span class="o">=</span> <span class="s2">&quot;0.0.1&quot;</span>
<span class="p">[[</span><span class="n">packages</span><span class="p">]]</span>
<span class="n">name</span> <span class="o">=</span> <span class="s2">&quot;bash&quot;</span>
<span class="n">version</span> <span class="o">=</span> <span class="s2">&quot;4.4.*&quot;</span>
</pre></div>
</div>
<p>The <code class="docutils literal notranslate"><span class="pre">name</span></code> field is the name of the blueprint. It can contain spaces, but they will be converted to <code class="docutils literal notranslate"><span class="pre">-</span></code>
when it is written to disk. It should be short and descriptive.</p>
<p><code class="docutils literal notranslate"><span class="pre">description</span></code> can be a longer description of the blueprint, it is only used for display purposes.</p>
<p><code class="docutils literal notranslate"><span class="pre">version</span></code> is a <a class="reference external" href="https://semver.org/">semver compatible</a> version number. If
a new blueprint is uploaded with the same <code class="docutils literal notranslate"><span class="pre">version</span></code> the server will
automatically bump the PATCH level of the <code class="docutils literal notranslate"><span class="pre">version</span></code>. If the <code class="docutils literal notranslate"><span class="pre">version</span></code>
doesnt match it will be used as is. eg. Uploading a blueprint with <code class="docutils literal notranslate"><span class="pre">version</span></code> set to <code class="docutils literal notranslate"><span class="pre">0.0.1</span></code> when the existing blueprint <code class="docutils literal notranslate"><span class="pre">version</span></code> is <code class="docutils literal notranslate"><span class="pre">0.0.1</span></code> will result in the new blueprint being stored as <code class="docutils literal notranslate"><span class="pre">version</span> <span class="pre">0.0.1</span></code>.</p>
<div class="section" id="packages-and-modules">
<h3>[[packages]] and [[modules]]<a class="headerlink" href="#packages-and-modules" title="Permalink to this headline"></a></h3>
<p>These entries describe the package names and matching version glob to be installed into the image.</p>
<p>The names must match the names exactly, and the versions can be an exact match
or a filesystem-like glob of the version using <code class="docutils literal notranslate"><span class="pre">*</span></code> wildcards and <code class="docutils literal notranslate"><span class="pre">?</span></code>
character matching.</p>
<p>NOTE: As of lorax-composer-29.2-1 the versions are not used for depsolving,
that is planned for a future release. And currently there are no differences
between <code class="docutils literal notranslate"><span class="pre">packages</span></code> and <code class="docutils literal notranslate"><span class="pre">modules</span></code> in <code class="docutils literal notranslate"><span class="pre">lorax-composer</span></code>.</p>
</div>
<div class="section" id="customizations">
<h3>Customizations<a class="headerlink" href="#customizations" title="Permalink to this headline"></a></h3>
<p>The <code class="docutils literal notranslate"><span class="pre">[[customizations]]</span></code> section can be used to configure the hostname of the final image. eg.:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="p">[[</span><span class="n">customizations</span><span class="p">]]</span>
<span class="n">hostname</span> <span class="o">=</span> <span class="s2">&quot;baseimage&quot;</span>
</pre></div>
</div>
<div class="section" id="customizations-sshkey">
<h4>[[customizations.sshkey]]<a class="headerlink" href="#customizations-sshkey" title="Permalink to this headline"></a></h4>
<p>Set an existing users ssh key in the final image:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="p">[[</span><span class="n">customizations</span><span class="o">.</span><span class="n">sshkey</span><span class="p">]]</span>
<span class="n">user</span> <span class="o">=</span> <span class="s2">&quot;root&quot;</span>
<span class="n">key</span> <span class="o">=</span> <span class="s2">&quot;PUBLIC SSH KEY&quot;</span>
</pre></div>
</div>
<p>The key will be added to the users authorized_keys file.</p>
</div>
<div class="section" id="customizations-user">
<h4>[[customizations.user]]<a class="headerlink" href="#customizations-user" title="Permalink to this headline"></a></h4>
<p>Add a user to the image, and/or set their ssh key.
All fields for this section are optional except for the <code class="docutils literal notranslate"><span class="pre">name</span></code>, here is a complete example:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="p">[[</span><span class="n">customizations</span><span class="o">.</span><span class="n">user</span><span class="p">]]</span>
<span class="n">name</span> <span class="o">=</span> <span class="s2">&quot;admin&quot;</span>
<span class="n">description</span> <span class="o">=</span> <span class="s2">&quot;Administrator account&quot;</span>
<span class="n">password</span> <span class="o">=</span> <span class="s2">&quot;$6$CHO2$3rN8eviE2t50lmVyBYihTgVRHcaecmeCk31L...&quot;</span>
<span class="n">key</span> <span class="o">=</span> <span class="s2">&quot;PUBLIC SSH KEY&quot;</span>
<span class="n">home</span> <span class="o">=</span> <span class="s2">&quot;/srv/widget/&quot;</span>
<span class="n">shell</span> <span class="o">=</span> <span class="s2">&quot;/usr/bin/bash&quot;</span>
<span class="n">groups</span> <span class="o">=</span> <span class="p">[</span><span class="s2">&quot;widget&quot;</span><span class="p">,</span> <span class="s2">&quot;users&quot;</span><span class="p">,</span> <span class="s2">&quot;wheel&quot;</span><span class="p">]</span>
<span class="n">uid</span> <span class="o">=</span> <span class="mi">1200</span>
<span class="n">gid</span> <span class="o">=</span> <span class="mi">1200</span>
</pre></div>
</div>
<p>If the password starts with <code class="docutils literal notranslate"><span class="pre">$6$</span></code>, <code class="docutils literal notranslate"><span class="pre">$5$</span></code>, or <code class="docutils literal notranslate"><span class="pre">$2b$</span></code> it will be stored as
an encrypted password. Otherwise it will be treated as a plain text password.</p>
</div>
<div class="section" id="customizations-group">
<h4>[[customizations.group]]<a class="headerlink" href="#customizations-group" title="Permalink to this headline"></a></h4>
<p>Add a group to the image. <code class="docutils literal notranslate"><span class="pre">name</span></code> is required and <code class="docutils literal notranslate"><span class="pre">gid</span></code> is optional:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="p">[[</span><span class="n">customizations</span><span class="o">.</span><span class="n">group</span><span class="p">]]</span>
<span class="n">name</span> <span class="o">=</span> <span class="s2">&quot;widget&quot;</span>
<span class="n">gid</span> <span class="o">=</span> <span class="mi">1130</span>
</pre></div>
</div>
</div>
</div>
</div>
<div class="section" id="adding-output-types">
<h2>Adding Output Types<a class="headerlink" href="#adding-output-types" title="Permalink to this headline"></a></h2>
<p><code class="docutils literal notranslate"><span class="pre">livemedia-creator</span></code> supports a large number of output types, and only some of
these are currently available via <code class="docutils literal notranslate"><span class="pre">lorax-composer</span></code>. To add a new output type to
lorax-composer a kickstart file needs to be added to <code class="docutils literal notranslate"><span class="pre">./share/composer/</span></code>. The
name of the kickstart is what will be used by the <code class="docutils literal notranslate"><span class="pre">/compose/types</span></code> route, and the
<code class="docutils literal notranslate"><span class="pre">compose_type</span></code> field of the POST to start a compose. It also needs to have
code added to the <a class="reference internal" href="pylorax.api.html#pylorax.api.compose.compose_args" title="pylorax.api.compose.compose_args"><code class="xref py py-func docutils literal notranslate"><span class="pre">pylorax.api.compose.compose_args()</span></code></a> function. The
<code class="docutils literal notranslate"><span class="pre">_MAP</span></code> entry in this function defines what lorax-composer will pass to
<a class="reference internal" href="pylorax.html#pylorax.installer.novirt_install" title="pylorax.installer.novirt_install"><code class="xref py py-func docutils literal notranslate"><span class="pre">pylorax.installer.novirt_install()</span></code></a> when it runs the compose. When the
compose is finished the output files need to be copied out of the build
directory (<code class="docutils literal notranslate"><span class="pre">/var/lib/lorax/composer/results/&lt;UUID&gt;/compose/</span></code>),
<a class="reference internal" href="pylorax.api.html#pylorax.api.compose.move_compose_results" title="pylorax.api.compose.move_compose_results"><code class="xref py py-func docutils literal notranslate"><span class="pre">pylorax.api.compose.move_compose_results()</span></code></a> handles this for each type.
You should move them instead of copying to save space.</p>
<p>If the new output type does not have support in livemedia-creator it should be
added there first. This will make the output available to the widest number of
users.</p>
<div class="section" id="example-add-partitioned-disk-support">
<h3>Example: Add partitioned disk support<a class="headerlink" href="#example-add-partitioned-disk-support" title="Permalink to this headline"></a></h3>
<p>Partitioned disk support is something that livemedia-creator already supports
via the <code class="docutils literal notranslate"><span class="pre">--make-disk</span></code> cmdline argument. To add this to lorax-composer it
needs 3 things:</p>
<ul class="simple">
<li>A <code class="docutils literal notranslate"><span class="pre">partitioned-disk.ks</span></code> file in <code class="docutils literal notranslate"><span class="pre">./share/composer/</span></code></li>
<li>A new entry in the _MAP in <a class="reference internal" href="pylorax.api.html#pylorax.api.compose.compose_args" title="pylorax.api.compose.compose_args"><code class="xref py py-func docutils literal notranslate"><span class="pre">pylorax.api.compose.compose_args()</span></code></a></li>
<li>Add a bit of code to <a class="reference internal" href="pylorax.api.html#pylorax.api.compose.move_compose_results" title="pylorax.api.compose.move_compose_results"><code class="xref py py-func docutils literal notranslate"><span class="pre">pylorax.api.compose.move_compose_results()</span></code></a> to move the disk image from
the compose directory to the results directory.</li>
</ul>
<p>The <code class="docutils literal notranslate"><span class="pre">partitioned-disk.ks</span></code> is pretty similar to the example minimal kickstart
in <code class="docutils literal notranslate"><span class="pre">./docs/fedora-minimal.ks</span></code>. You should remove the <code class="docutils literal notranslate"><span class="pre">url</span></code> and <code class="docutils literal notranslate"><span class="pre">repo</span></code>
commands, they will be added by the compose process. Make sure the bootloader
packages are included in the <code class="docutils literal notranslate"><span class="pre">%packages</span></code> section at the end of the kickstart,
and you will want to leave off the <code class="docutils literal notranslate"><span class="pre">%end</span></code> so that the compose can append the
list of packages from the blueprint.</p>
<p>The new <code class="docutils literal notranslate"><span class="pre">_MAP</span></code> entry should be a copy of one of the existing entries, but with <code class="docutils literal notranslate"><span class="pre">make_disk</span></code> set
to <code class="docutils literal notranslate"><span class="pre">True</span></code>. Make sure that none of the other <code class="docutils literal notranslate"><span class="pre">make_*</span></code> options are <code class="docutils literal notranslate"><span class="pre">True</span></code>. The <code class="docutils literal notranslate"><span class="pre">image_name</span></code> is
what the name of the final image will be.</p>
<p><code class="docutils literal notranslate"><span class="pre">move_compose_results()</span></code> can be as simple as moving the output file into
the results directory, or it could do some post-processing on it. The end of
the function should always clean up the <code class="docutils literal notranslate"><span class="pre">./compose/</span></code> directory, removing any
unneeded extra files. This is especially true for the <code class="docutils literal notranslate"><span class="pre">live-iso</span></code> since it produces
the contents of the iso as well as the boot.iso itself.</p>
</div>
</div>
</div>
</div>
</div>
<footer>
<div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
<a href="composer-cli.html" class="btn btn-neutral float-right" title="composer-cli" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right"></span></a>
<a href="livemedia-creator.html" class="btn btn-neutral" title="livemedia-creator" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left"></span> Previous</a>
</div>
<hr/>
<div role="contentinfo">
<p>
&copy; Copyright 2018, Red Hat, Inc..
</p>
</div>
Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/rtfd/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>.
</footer>
</div>
</div>
</section>
</div>
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT:'./',
VERSION:'28.10',
LANGUAGE:'None',
COLLAPSE_INDEX:false,
FILE_SUFFIX:'.html',
HAS_SOURCE: true,
SOURCELINK_SUFFIX: '.txt'
};
</script>
<script type="text/javascript" src="_static/jquery.js"></script>
<script type="text/javascript" src="_static/underscore.js"></script>
<script type="text/javascript" src="_static/doctools.js"></script>
<script type="text/javascript" src="_static/js/theme.js"></script>
<script type="text/javascript">
jQuery(function () {
SphinxRtdTheme.Navigation.enableSticky();
});
</script>
</body>
</html>

View File

@ -8,8 +8,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Lorax &mdash; Lorax 28.9 documentation</title> <title>Lorax &mdash; Lorax 28.10 documentation</title>
@ -27,15 +26,9 @@
<link rel="stylesheet" href="_static/css/theme.css" type="text/css" /> <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="index" title="Index"
href="genindex.html"/>
<link rel="search" title="Search" href="search.html" /> <link rel="search" title="Search" href="search.html" />
<link rel="top" title="Lorax 28.9 documentation" href="index.html"/>
<link rel="next" title="livemedia-creator" href="livemedia-creator.html" /> <link rel="next" title="livemedia-creator" href="livemedia-creator.html" />
<link rel="prev" title="Introduction to Lorax" href="intro.html" /> <link rel="prev" title="Introduction to Lorax" href="intro.html" />
@ -44,7 +37,7 @@
</head> </head>
<body class="wy-body-for-nav" role="document"> <body class="wy-body-for-nav">
<div class="wy-grid-for-nav"> <div class="wy-grid-for-nav">
@ -66,7 +59,7 @@
<div class="version"> <div class="version">
28.9 28.10
</div> </div>
@ -94,7 +87,13 @@
<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">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="intro.html#before-lorax">Before Lorax</a></li>
<li class="toctree-l1 current"><a class="current reference internal" href="#">Lorax</a><ul> <li class="toctree-l1 current"><a class="current reference internal" href="#">Lorax</a><ul>
<li class="toctree-l2"><a class="reference internal" href="#lorax-cmdline-arguments">lorax cmdline arguments</a></li> <li class="toctree-l2"><a class="reference internal" href="#lorax-cmdline-arguments">lorax cmdline arguments</a><ul>
<li class="toctree-l3"><a class="reference internal" href="#Positional Arguments">Positional Arguments</a></li>
<li class="toctree-l3"><a class="reference internal" href="#Named Arguments">Named Arguments</a></li>
<li class="toctree-l3"><a class="reference internal" href="#required arguments">required arguments</a></li>
<li class="toctree-l3"><a class="reference internal" href="#Named Arguments_repeat1">Named Arguments</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="#quickstart">Quickstart</a></li> <li class="toctree-l2"><a class="reference internal" href="#quickstart">Quickstart</a></li>
<li class="toctree-l2"><a class="reference internal" href="#running-inside-of-mock">Running inside of mock</a></li> <li class="toctree-l2"><a class="reference internal" href="#running-inside-of-mock">Running inside of mock</a></li>
<li class="toctree-l2"><a class="reference internal" href="#how-it-works">How it works</a><ul> <li class="toctree-l2"><a class="reference internal" href="#how-it-works">How it works</a><ul>
@ -109,6 +108,8 @@
</ul> </ul>
</li> </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="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"><a class="reference internal" href="product-images.html">Product and Updates Images</a></li>
<li class="toctree-l1"><a class="reference internal" href="modules.html">pylorax</a></li> <li class="toctree-l1"><a class="reference internal" href="modules.html">pylorax</a></li>
</ul> </ul>
@ -122,7 +123,7 @@
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"> <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
<nav class="wy-nav-top" role="navigation" aria-label="top navigation"> <nav class="wy-nav-top" aria-label="top navigation">
<i data-toggle="wy-nav-top" class="fa fa-bars"></i> <i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="index.html">Lorax</a> <a href="index.html">Lorax</a>
@ -130,8 +131,8 @@
</nav> </nav>
<div class="wy-nav-content"> <div class="wy-nav-content">
<div class="rst-content"> <div class="rst-content">
@ -149,6 +150,7 @@
<div role="navigation" aria-label="breadcrumbs navigation"> <div role="navigation" aria-label="breadcrumbs navigation">
<ul class="wy-breadcrumbs"> <ul class="wy-breadcrumbs">
@ -196,7 +198,7 @@ repositories.</p>
<div class="section" id="lorax-cmdline-arguments"> <div class="section" id="lorax-cmdline-arguments">
<h2>lorax cmdline arguments<a class="headerlink" href="#lorax-cmdline-arguments" title="Permalink to this headline"></a></h2> <h2>lorax cmdline arguments<a class="headerlink" href="#lorax-cmdline-arguments" title="Permalink to this headline"></a></h2>
<p>Create the Anaconda boot.iso</p> <p>Create the Anaconda boot.iso</p>
<div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">usage</span><span class="p">:</span> <span class="n">lorax</span> <span class="p">[</span><span class="o">-</span><span class="n">h</span><span class="p">]</span> <span class="o">-</span><span class="n">p</span> <span class="n">PRODUCT</span> <span class="o">-</span><span class="n">v</span> <span class="n">VERSION</span> <span class="o">-</span><span class="n">r</span> <span class="n">RELEASE</span> <span class="p">[</span><span class="o">-</span><span class="n">s</span> <span class="n">REPOSITORY</span><span class="p">]</span> <div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">usage</span><span class="p">:</span> <span class="n">lorax</span> <span class="p">[</span><span class="o">-</span><span class="n">h</span><span class="p">]</span> <span class="o">-</span><span class="n">p</span> <span class="n">PRODUCT</span> <span class="o">-</span><span class="n">v</span> <span class="n">VERSION</span> <span class="o">-</span><span class="n">r</span> <span class="n">RELEASE</span> <span class="p">[</span><span class="o">-</span><span class="n">s</span> <span class="n">REPOSITORY</span><span class="p">]</span>
<span class="p">[</span><span class="o">--</span><span class="n">repo</span> <span class="n">REPOSITORY</span><span class="p">]</span> <span class="p">[</span><span class="o">-</span><span class="n">m</span> <span class="n">REPOSITORY</span><span class="p">]</span> <span class="p">[</span><span class="o">-</span><span class="n">t</span> <span class="n">VARIANT</span><span class="p">]</span> <span class="p">[</span><span class="o">-</span><span class="n">b</span> <span class="n">URL</span><span class="p">]</span> <span class="p">[</span><span class="o">--</span><span class="n">repo</span> <span class="n">REPOSITORY</span><span class="p">]</span> <span class="p">[</span><span class="o">-</span><span class="n">m</span> <span class="n">REPOSITORY</span><span class="p">]</span> <span class="p">[</span><span class="o">-</span><span class="n">t</span> <span class="n">VARIANT</span><span class="p">]</span> <span class="p">[</span><span class="o">-</span><span class="n">b</span> <span class="n">URL</span><span class="p">]</span>
<span class="p">[</span><span class="o">--</span><span class="n">isfinal</span><span class="p">]</span> <span class="p">[</span><span class="o">-</span><span class="n">c</span> <span class="n">CONFIGFILE</span><span class="p">]</span> <span class="p">[</span><span class="o">--</span><span class="n">proxy</span> <span class="n">HOST</span><span class="p">]</span> <span class="p">[</span><span class="o">-</span><span class="n">i</span> <span class="n">PACKAGE</span><span class="p">]</span> <span class="p">[</span><span class="o">--</span><span class="n">isfinal</span><span class="p">]</span> <span class="p">[</span><span class="o">-</span><span class="n">c</span> <span class="n">CONFIGFILE</span><span class="p">]</span> <span class="p">[</span><span class="o">--</span><span class="n">proxy</span> <span class="n">HOST</span><span class="p">]</span> <span class="p">[</span><span class="o">-</span><span class="n">i</span> <span class="n">PACKAGE</span><span class="p">]</span>
<span class="p">[</span><span class="o">-</span><span class="n">e</span> <span class="n">PACKAGE</span><span class="p">]</span> <span class="p">[</span><span class="o">--</span><span class="n">buildarch</span> <span class="n">ARCH</span><span class="p">]</span> <span class="p">[</span><span class="o">--</span><span class="n">volid</span> <span class="n">VOLID</span><span class="p">]</span> <span class="p">[</span><span class="o">--</span><span class="n">macboot</span><span class="p">]</span> <span class="p">[</span><span class="o">-</span><span class="n">e</span> <span class="n">PACKAGE</span><span class="p">]</span> <span class="p">[</span><span class="o">--</span><span class="n">buildarch</span> <span class="n">ARCH</span><span class="p">]</span> <span class="p">[</span><span class="o">--</span><span class="n">volid</span> <span class="n">VOLID</span><span class="p">]</span> <span class="p">[</span><span class="o">--</span><span class="n">macboot</span><span class="p">]</span>
@ -212,154 +214,198 @@ repositories.</p>
<span class="n">OUTPUTDIR</span> <span class="n">OUTPUTDIR</span>
</pre></div> </pre></div>
</div> </div>
<dl class="docutils"> <div class="section" id="Positional Arguments">
<dt>Positional arguments:</dt> <h3>Positional Arguments<a class="headerlink" href="#Positional Arguments" title="Permalink to this headline"></a></h3>
<dd><table class="first last docutils option-list" frame="void" rules="none"> <table class="docutils option-list" frame="void" rules="none">
<col class="option" /> <col class="option" />
<col class="description" /> <col class="description" />
<tbody valign="top"> <tbody valign="top">
<tr><td class="option-group"> <tr><td class="option-group">
<kbd>outputdir</kbd></td> <kbd>OUTPUTDIR</kbd></td>
<td>Output directory</td></tr> <td>Output directory</td></tr>
</tbody> </tbody>
</table> </table>
</dd> </div>
<dt>Options:</dt> <div class="section" id="Named Arguments">
<dd><table class="first last docutils option-list" frame="void" rules="none"> <h3>Named Arguments<a class="headerlink" href="#Named Arguments" title="Permalink to this headline"></a></h3>
<table class="docutils option-list" frame="void" rules="none">
<col class="option" /> <col class="option" />
<col class="description" /> <col class="description" />
<tbody valign="top"> <tbody valign="top">
<tr><td class="option-group"> <tr><td class="option-group">
<kbd><span class="option">-p</span>, <span class="option">--product</span></kbd></td> <kbd>-V</kbd></td>
<td>product name</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-v</span>, <span class="option">--version</span></kbd></td>
<td>version identifier</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-r</span>, <span class="option">--release</span></kbd></td>
<td>release information</td></tr>
<tr><td class="option-group" colspan="2">
<kbd><span class="option">-s=[]</span>, <span class="option">--source=[]</span></kbd></td>
</tr>
<tr><td>&#160;</td><td>source repository (may be listed multiple times)</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--repo=[]</span></kbd></td>
<td>source dnf repository file</td></tr>
<tr><td class="option-group" colspan="2">
<kbd><span class="option">-m=[]</span>, <span class="option">--mirrorlist=[]</span></kbd></td>
</tr>
<tr><td>&#160;</td><td>mirrorlist repository (may be listed multiple times)</td></tr>
<tr><td class="option-group" colspan="2">
<kbd><span class="option">-t=</span>, <span class="option">--variant=</span></kbd></td>
</tr>
<tr><td>&#160;</td><td>variant name</td></tr>
<tr><td class="option-group" colspan="2">
<kbd><span class="option">-b=your distribution provided bug reporting tool</span>, <span class="option">--bugurl=your distribution provided bug reporting tool</span></kbd></td>
</tr>
<tr><td>&#160;</td><td>bug reporting URL for the product</td></tr>
<tr><td class="option-group" colspan="2">
<kbd><span class="option">--isfinal=False</span></kbd></td>
</tr>
<tr><td>&#160;</td><td>Undocumented</td></tr>
<tr><td class="option-group" colspan="2">
<kbd><span class="option">-c=/etc/lorax/lorax.conf</span>, <span class="option">--config=/etc/lorax/lorax.conf</span></kbd></td>
</tr>
<tr><td>&#160;</td><td>config file</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--proxy</span></kbd></td>
<td>repo proxy url:port</td></tr>
<tr><td class="option-group" colspan="2">
<kbd><span class="option">-i=[]</span>, <span class="option">--installpkgs=[]</span></kbd></td>
</tr>
<tr><td>&#160;</td><td>package glob to install before runtime-install.tmpl runs. (may be listed multiple times)</td></tr>
<tr><td class="option-group" colspan="2">
<kbd><span class="option">-e=[]</span>, <span class="option">--excludepkgs=[]</span></kbd></td>
</tr>
<tr><td>&#160;</td><td>package glob to remove before runtime-install.tmpl runs. (may be listed multiple times)</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--buildarch</span></kbd></td>
<td>build architecture</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--volid</span></kbd></td>
<td>volume id</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--macboot=True</span></kbd></td>
<td>Undocumented</td></tr>
<tr><td class="option-group" colspan="2">
<kbd><span class="option">--nomacboot=True</span></kbd></td>
</tr>
<tr><td>&#160;</td><td>Undocumented</td></tr>
<tr><td class="option-group" colspan="2">
<kbd><span class="option">--noupgrade=True</span></kbd></td>
</tr>
<tr><td>&#160;</td><td>Undocumented</td></tr>
<tr><td class="option-group" colspan="2">
<kbd><span class="option">--logfile=./lorax.log</span></kbd></td>
</tr>
<tr><td>&#160;</td><td>Path to logfile</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--tmp=/var/tmp</span></kbd></td>
<td>Top level temporary directory</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--cachedir</span></kbd></td>
<td>DNF cache directory. Default is a temporary dir.</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--workdir</span></kbd></td>
<td>Work directory, overrides tmp. Default is a temporary dir under /var/tmp</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--force=False</span></kbd></td>
<td>Run even when the destination directory exists</td></tr>
<tr><td class="option-group" colspan="2">
<kbd><span class="option">--add-template=[]</span></kbd></td>
</tr>
<tr><td>&#160;</td><td>Additional template for runtime image</td></tr>
<tr><td class="option-group" colspan="2">
<kbd><span class="option">--add-template-var=[]</span></kbd></td>
</tr>
<tr><td>&#160;</td><td>Set variable for runtime image template</td></tr>
<tr><td class="option-group" colspan="2">
<kbd><span class="option">--add-arch-template=[]</span></kbd></td>
</tr>
<tr><td>&#160;</td><td>Additional template for architecture-specific image</td></tr>
<tr><td class="option-group" colspan="2">
<kbd><span class="option">--add-arch-template-var=[]</span></kbd></td>
</tr>
<tr><td>&#160;</td><td>Set variable for architecture-specific image</td></tr>
<tr><td class="option-group" colspan="2">
<kbd><span class="option">--noverify=True</span></kbd></td>
</tr>
<tr><td>&#160;</td><td>Do not verify the install root</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--sharedir</span></kbd></td>
<td>Directory containing all the templates. Overrides config file sharedir</td></tr>
<tr><td class="option-group" colspan="2">
<kbd><span class="option">--enablerepo=[]</span></kbd></td>
</tr>
<tr><td>&#160;</td><td>Names of repos to enable</td></tr>
<tr><td class="option-group" colspan="2">
<kbd><span class="option">--disablerepo=[]</span></kbd></td>
</tr>
<tr><td>&#160;</td><td>Names of repos to disable</td></tr>
<tr><td class="option-group" colspan="2">
<kbd><span class="option">--rootfs-size=2</span></kbd></td>
</tr>
<tr><td>&#160;</td><td>Size of root filesystem in GiB. Defaults to 2.</td></tr>
<tr><td class="option-group" colspan="2">
<kbd><span class="option">--noverifyssl=False</span></kbd></td>
</tr>
<tr><td>&#160;</td><td>Do not verify SSL certificates</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-V</span></kbd></td>
<td>show programs version number and exit</td></tr> <td>show programs version number and exit</td></tr>
</tbody> </tbody>
</table> </table>
</dd> </div>
</dl> <div class="section" id="required arguments">
<h3>required arguments<a class="headerlink" href="#required arguments" title="Permalink to this headline"></a></h3>
<table class="docutils option-list" frame="void" rules="none">
<col class="option" />
<col class="description" />
<tbody valign="top">
<tr><td class="option-group">
<kbd>-p, --product</kbd></td>
<td>product name</td></tr>
<tr><td class="option-group">
<kbd>-v, --version</kbd></td>
<td>version identifier</td></tr>
<tr><td class="option-group">
<kbd>-r, --release</kbd></td>
<td>release information</td></tr>
<tr><td class="option-group">
<kbd>-s, --source</kbd></td>
<td><p class="first">source repository (may be listed multiple times)</p>
<p class="last">Default: []</p>
</td></tr>
<tr><td class="option-group">
<kbd>--repo</kbd></td>
<td><p class="first">source dnf repository file</p>
<p class="last">Default: []</p>
</td></tr>
</tbody>
</table>
</div>
<div class="section" id="Named Arguments_repeat1">
<h3>Named Arguments<a class="headerlink" href="#Named Arguments_repeat1" title="Permalink to this headline"></a></h3>
<table class="docutils option-list" frame="void" rules="none">
<col class="option" />
<col class="description" />
<tbody valign="top">
<tr><td class="option-group" colspan="2">
<kbd>-m, --mirrorlist</kbd></td>
</tr>
<tr><td>&#160;</td><td><p class="first">mirrorlist repository (may be listed multiple times)</p>
<p class="last">Default: []</p>
</td></tr>
<tr><td class="option-group">
<kbd>-t, --variant</kbd></td>
<td><p class="first">variant name</p>
<p class="last">Default: “”</p>
</td></tr>
<tr><td class="option-group">
<kbd>-b, --bugurl</kbd></td>
<td><p class="first">bug reporting URL for the product</p>
<p class="last">Default: “your distribution provided bug reporting tool”</p>
</td></tr>
<tr><td class="option-group">
<kbd>--isfinal</kbd></td>
<td>Default: False</td></tr>
<tr><td class="option-group">
<kbd>-c, --config</kbd></td>
<td><p class="first">config file</p>
<p class="last">Default: “/etc/lorax/lorax.conf”</p>
</td></tr>
<tr><td class="option-group">
<kbd>--proxy</kbd></td>
<td>repo proxy url:port</td></tr>
<tr><td class="option-group" colspan="2">
<kbd>-i, --installpkgs</kbd></td>
</tr>
<tr><td>&#160;</td><td><p class="first">package glob to install before runtime-install.tmpl runs. (may be listed multiple times)</p>
<p class="last">Default: []</p>
</td></tr>
<tr><td class="option-group" colspan="2">
<kbd>-e, --excludepkgs</kbd></td>
</tr>
<tr><td>&#160;</td><td><p class="first">package glob to remove before runtime-install.tmpl runs. (may be listed multiple times)</p>
<p class="last">Default: []</p>
</td></tr>
<tr><td class="option-group">
<kbd>--buildarch</kbd></td>
<td>build architecture</td></tr>
<tr><td class="option-group">
<kbd>--volid</kbd></td>
<td>volume id</td></tr>
<tr><td class="option-group">
<kbd>--macboot</kbd></td>
<td>Default: True</td></tr>
<tr><td class="option-group">
<kbd>--nomacboot</kbd></td>
<td>Default: True</td></tr>
<tr><td class="option-group">
<kbd>--noupgrade</kbd></td>
<td>Default: True</td></tr>
<tr><td class="option-group">
<kbd>--logfile</kbd></td>
<td><p class="first">Path to logfile</p>
<p class="last">Default: ./lorax.log</p>
</td></tr>
<tr><td class="option-group">
<kbd>--tmp</kbd></td>
<td><p class="first">Top level temporary directory</p>
<p class="last">Default: “/var/tmp”</p>
</td></tr>
<tr><td class="option-group">
<kbd>--cachedir</kbd></td>
<td>DNF cache directory. Default is a temporary dir.</td></tr>
<tr><td class="option-group">
<kbd>--workdir</kbd></td>
<td>Work directory, overrides tmp. Default is a temporary dir under /var/tmp</td></tr>
<tr><td class="option-group">
<kbd>--force</kbd></td>
<td><p class="first">Run even when the destination directory exists</p>
<p class="last">Default: False</p>
</td></tr>
<tr><td class="option-group">
<kbd>--add-template</kbd></td>
<td><p class="first">Additional template for runtime image</p>
<p class="last">Default: []</p>
</td></tr>
<tr><td class="option-group" colspan="2">
<kbd>--add-template-var</kbd></td>
</tr>
<tr><td>&#160;</td><td><p class="first">Set variable for runtime image template</p>
<p class="last">Default: []</p>
</td></tr>
<tr><td class="option-group" colspan="2">
<kbd>--add-arch-template</kbd></td>
</tr>
<tr><td>&#160;</td><td><p class="first">Additional template for architecture-specific image</p>
<p class="last">Default: []</p>
</td></tr>
<tr><td class="option-group" colspan="2">
<kbd>--add-arch-template-var</kbd></td>
</tr>
<tr><td>&#160;</td><td><p class="first">Set variable for architecture-specific image</p>
<p class="last">Default: []</p>
</td></tr>
<tr><td class="option-group">
<kbd>--noverify</kbd></td>
<td><p class="first">Do not verify the install root</p>
<p class="last">Default: True</p>
</td></tr>
<tr><td class="option-group">
<kbd>--sharedir</kbd></td>
<td>Directory containing all the templates. Overrides config file sharedir</td></tr>
<tr><td class="option-group">
<kbd>--enablerepo</kbd></td>
<td><p class="first">Names of repos to enable</p>
<p class="last">Default: []</p>
</td></tr>
<tr><td class="option-group">
<kbd>--disablerepo</kbd></td>
<td><p class="first">Names of repos to disable</p>
<p class="last">Default: []</p>
</td></tr>
<tr><td class="option-group">
<kbd>--rootfs-size</kbd></td>
<td><p class="first">Size of root filesystem in GiB. Defaults to 2.</p>
<p class="last">Default: 2</p>
</td></tr>
<tr><td class="option-group">
<kbd>--noverifyssl</kbd></td>
<td><p class="first">Do not verify SSL certificates</p>
<p class="last">Default: False</p>
</td></tr>
</tbody>
</table>
</div>
</div> </div>
<div class="section" id="quickstart"> <div class="section" id="quickstart">
<h2>Quickstart<a class="headerlink" href="#quickstart" title="Permalink to this headline"></a></h2> <h2>Quickstart<a class="headerlink" href="#quickstart" title="Permalink to this headline"></a></h2>
<p>Run this as root to create a boot.iso in <code class="docutils literal"><span class="pre">./results/</span></code>:</p> <p>Run this as root to create a boot.iso in <code class="docutils literal notranslate"><span class="pre">./results/</span></code>:</p>
<div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">dnf</span> <span class="n">install</span> <span class="n">lorax</span> <div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">dnf</span> <span class="n">install</span> <span class="n">lorax</span>
<span class="n">setenforce</span> <span class="mi">0</span> <span class="n">setenforce</span> <span class="mi">0</span>
<span class="n">lorax</span> <span class="o">-</span><span class="n">p</span> <span class="n">Fedora</span> <span class="o">-</span><span class="n">v</span> <span class="mi">23</span> <span class="o">-</span><span class="n">r</span> <span class="mi">23</span> \ <span class="n">lorax</span> <span class="o">-</span><span class="n">p</span> <span class="n">Fedora</span> <span class="o">-</span><span class="n">v</span> <span class="mi">23</span> <span class="o">-</span><span class="n">r</span> <span class="mi">23</span> \
<span class="o">-</span><span class="n">s</span> <span class="n">http</span><span class="p">:</span><span class="o">//</span><span class="n">dl</span><span class="o">.</span><span class="n">fedoraproject</span><span class="o">.</span><span class="n">org</span><span class="o">/</span><span class="n">pub</span><span class="o">/</span><span class="n">fedora</span><span class="o">/</span><span class="n">linux</span><span class="o">/</span><span class="n">releases</span><span class="o">/</span><span class="mi">23</span><span class="o">/</span><span class="n">Everything</span><span class="o">/</span><span class="n">x86_64</span><span class="o">/</span><span class="n">os</span><span class="o">/</span> \ <span class="o">-</span><span class="n">s</span> <span class="n">http</span><span class="p">:</span><span class="o">//</span><span class="n">dl</span><span class="o">.</span><span class="n">fedoraproject</span><span class="o">.</span><span class="n">org</span><span class="o">/</span><span class="n">pub</span><span class="o">/</span><span class="n">fedora</span><span class="o">/</span><span class="n">linux</span><span class="o">/</span><span class="n">releases</span><span class="o">/</span><span class="mi">23</span><span class="o">/</span><span class="n">Everything</span><span class="o">/</span><span class="n">x86_64</span><span class="o">/</span><span class="n">os</span><span class="o">/</span> \
@ -368,17 +414,17 @@ repositories.</p>
<span class="n">setenforce</span> <span class="mi">1</span> <span class="n">setenforce</span> <span class="mi">1</span>
</pre></div> </pre></div>
</div> </div>
<p>You can add your own repos with <code class="docutils literal"><span class="pre">-s</span></code> and packages with higher NVRs will <p>You can add your own repos with <code class="docutils literal notranslate"><span class="pre">-s</span></code> and packages with higher NVRs will
override the ones in the distribution repositories.</p> override the ones in the distribution repositories.</p>
<p>Under <code class="docutils literal"><span class="pre">./results/</span></code> will be the release tree files: .discinfo, .treeinfo, everything that <p>Under <code class="docutils literal notranslate"><span class="pre">./results/</span></code> will be the release tree files: .discinfo, .treeinfo, everything that
goes onto the boot.iso, the pxeboot directory, and the boot.iso under <code class="docutils literal"><span class="pre">./images/</span></code>.</p> goes onto the boot.iso, the pxeboot directory, and the boot.iso under <code class="docutils literal notranslate"><span class="pre">./images/</span></code>.</p>
</div> </div>
<div class="section" id="running-inside-of-mock"> <div class="section" id="running-inside-of-mock">
<h2>Running inside of mock<a class="headerlink" href="#running-inside-of-mock" title="Permalink to this headline"></a></h2> <h2>Running inside of mock<a class="headerlink" href="#running-inside-of-mock" title="Permalink to this headline"></a></h2>
<p>If you are using lorax with mock v1.3.4 or later you will need to pass <p>If you are using lorax with mock v1.3.4 or later you will need to pass
<code class="docutils literal"><span class="pre">--old-chroot</span></code> to mock. Mock now defaults to using systemd-nspawn which cannot <code class="docutils literal notranslate"><span class="pre">--old-chroot</span></code> to mock. Mock now defaults to using systemd-nspawn which cannot
create the needed loop device nodes. Passing <code class="docutils literal"><span class="pre">--old-chroot</span></code> will use the old create the needed loop device nodes. Passing <code class="docutils literal notranslate"><span class="pre">--old-chroot</span></code> will use the old
system where <code class="docutils literal"><span class="pre">/dev/loop*</span></code> is setup for you.</p> system where <code class="docutils literal notranslate"><span class="pre">/dev/loop*</span></code> is setup for you.</p>
</div> </div>
<div class="section" id="how-it-works"> <div class="section" id="how-it-works">
<h2>How it works<a class="headerlink" href="#how-it-works" title="Permalink to this headline"></a></h2> <h2>How it works<a class="headerlink" href="#how-it-works" title="Permalink to this headline"></a></h2>
@ -389,58 +435,58 @@ files. The iso is then built using a generic initramfs and the kernel from the
selected repositories.</p> selected repositories.</p>
<p>To drive these processes Lorax uses a custom template system, based on <a class="reference external" href="http://www.makotemplates.org/">Mako <p>To drive these processes Lorax uses a custom template system, based on <a class="reference external" href="http://www.makotemplates.org/">Mako
templates</a> with the addition of custom templates</a> with the addition of custom
commands (documented in <a class="reference internal" href="pylorax.html#pylorax.ltmpl.LoraxTemplateRunner" title="pylorax.ltmpl.LoraxTemplateRunner"><code class="xref py py-class docutils literal"><span class="pre">pylorax.ltmpl.LoraxTemplateRunner</span></code></a>). Mako commands (documented in <a class="reference internal" href="pylorax.html#pylorax.ltmpl.LoraxTemplateRunner" title="pylorax.ltmpl.LoraxTemplateRunner"><code class="xref py py-class docutils literal notranslate"><span class="pre">pylorax.ltmpl.LoraxTemplateRunner</span></code></a>). Mako
supports <code class="docutils literal"><span class="pre">%if/%endif</span></code> blocks as well as free-form python code inside <code class="docutils literal"><span class="pre">&lt;%</span> supports <code class="docutils literal notranslate"><span class="pre">%if/%endif</span></code> blocks as well as free-form python code inside <code class="docutils literal notranslate"><span class="pre">&lt;%</span>
<span class="pre">%&gt;</span></code> tags and variable substitution with <code class="docutils literal"><span class="pre">${}</span></code>. The default templates are <span class="pre">%&gt;</span></code> tags and variable substitution with <code class="docutils literal notranslate"><span class="pre">${}</span></code>. The default templates are
shipped with lorax in <code class="docutils literal"><span class="pre">/usr/share/lorax/templates.d/99-generic/</span></code> and use the shipped with lorax in <code class="docutils literal notranslate"><span class="pre">/usr/share/lorax/templates.d/99-generic/</span></code> and use the
<code class="docutils literal"><span class="pre">.tmpl</span></code> extension.</p> <code class="docutils literal notranslate"><span class="pre">.tmpl</span></code> extension.</p>
<div class="section" id="runtime-install-tmpl"> <div class="section" id="runtime-install-tmpl">
<h3>runtime-install.tmpl<a class="headerlink" href="#runtime-install-tmpl" title="Permalink to this headline"></a></h3> <h3>runtime-install.tmpl<a class="headerlink" href="#runtime-install-tmpl" title="Permalink to this headline"></a></h3>
<p>The <code class="docutils literal"><span class="pre">runtime-install.tmpl</span></code> template lists packages to be installed using the <p>The <code class="docutils literal notranslate"><span class="pre">runtime-install.tmpl</span></code> template lists packages to be installed using the
<code class="docutils literal"><span class="pre">installpkg</span></code> command. This template is fairly simple, installing common packages and <code class="docutils literal notranslate"><span class="pre">installpkg</span></code> command. This template is fairly simple, installing common packages and
architecture specific packages. It must end with the <code class="docutils literal"><span class="pre">run_pkg_transaction</span></code> architecture specific packages. It must end with the <code class="docutils literal notranslate"><span class="pre">run_pkg_transaction</span></code>
command which tells dnf to download and install the packages.</p> command which tells dnf to download and install the packages.</p>
</div> </div>
<div class="section" id="runtime-postinstall-tmpl"> <div class="section" id="runtime-postinstall-tmpl">
<h3>runtime-postinstall.tmpl<a class="headerlink" href="#runtime-postinstall-tmpl" title="Permalink to this headline"></a></h3> <h3>runtime-postinstall.tmpl<a class="headerlink" href="#runtime-postinstall-tmpl" title="Permalink to this headline"></a></h3>
<p>The <code class="docutils literal"><span class="pre">runtime-postinstall.tmpl</span></code> template is where the system configuration <p>The <code class="docutils literal notranslate"><span class="pre">runtime-postinstall.tmpl</span></code> template is where the system configuration
happens. The installer environment is similar to a normal running system, but happens. The installer environment is similar to a normal running system, but
needs some special handling. Configuration files are setup, systemd is told to needs some special handling. Configuration files are setup, systemd is told to
start the anaconda.target instead of a default system target, and a number of start the anaconda.target instead of a default system target, and a number of
unneeded services are disabled, some of which can interfere with the unneeded services are disabled, some of which can interfere with the
installation. A number of template commands are used here:</p> installation. A number of template commands are used here:</p>
<ul class="simple"> <ul class="simple">
<li><a class="reference internal" href="pylorax.html#pylorax.ltmpl.LoraxTemplateRunner.append" title="pylorax.ltmpl.LoraxTemplateRunner.append"><code class="xref py py-func docutils literal"><span class="pre">append</span></code></a> to add text to a file.</li> <li><a class="reference internal" href="pylorax.html#pylorax.ltmpl.LoraxTemplateRunner.append" title="pylorax.ltmpl.LoraxTemplateRunner.append"><code class="xref py py-func docutils literal notranslate"><span class="pre">append</span></code></a> to add text to a file.</li>
<li><a class="reference internal" href="pylorax.html#pylorax.ltmpl.LoraxTemplateRunner.chmod" title="pylorax.ltmpl.LoraxTemplateRunner.chmod"><code class="xref py py-func docutils literal"><span class="pre">chmod</span></code></a> changes the files mode.</li> <li><a class="reference internal" href="pylorax.html#pylorax.ltmpl.LoraxTemplateRunner.chmod" title="pylorax.ltmpl.LoraxTemplateRunner.chmod"><code class="xref py py-func docutils literal notranslate"><span class="pre">chmod</span></code></a> changes the files mode.</li>
<li><a class="reference internal" href="pylorax.html#pylorax.ltmpl.LoraxTemplateRunner.gconfset" title="pylorax.ltmpl.LoraxTemplateRunner.gconfset"><code class="xref py py-func docutils literal"><span class="pre">gconfset</span></code></a> runs gconfset.</li> <li><a class="reference internal" href="pylorax.html#pylorax.ltmpl.LoraxTemplateRunner.gconfset" title="pylorax.ltmpl.LoraxTemplateRunner.gconfset"><code class="xref py py-func docutils literal notranslate"><span class="pre">gconfset</span></code></a> runs gconfset.</li>
<li><a class="reference internal" href="pylorax.html#pylorax.ltmpl.LoraxTemplateRunner.install" title="pylorax.ltmpl.LoraxTemplateRunner.install"><code class="xref py py-func docutils literal"><span class="pre">install</span></code></a> to install a file into the installroot.</li> <li><a class="reference internal" href="pylorax.html#pylorax.ltmpl.LoraxTemplateRunner.install" title="pylorax.ltmpl.LoraxTemplateRunner.install"><code class="xref py py-func docutils literal notranslate"><span class="pre">install</span></code></a> to install a file into the installroot.</li>
<li><a class="reference internal" href="pylorax.html#pylorax.ltmpl.LoraxTemplateRunner.mkdir" title="pylorax.ltmpl.LoraxTemplateRunner.mkdir"><code class="xref py py-func docutils literal"><span class="pre">mkdir</span></code></a> makes a new directory.</li> <li><a class="reference internal" href="pylorax.html#pylorax.ltmpl.LoraxTemplateRunner.mkdir" title="pylorax.ltmpl.LoraxTemplateRunner.mkdir"><code class="xref py py-func docutils literal notranslate"><span class="pre">mkdir</span></code></a> makes a new directory.</li>
<li><a class="reference internal" href="pylorax.html#pylorax.ltmpl.LoraxTemplateRunner.move" title="pylorax.ltmpl.LoraxTemplateRunner.move"><code class="xref py py-func docutils literal"><span class="pre">move</span></code></a> to move a file into the installroot</li> <li><a class="reference internal" href="pylorax.html#pylorax.ltmpl.LoraxTemplateRunner.move" title="pylorax.ltmpl.LoraxTemplateRunner.move"><code class="xref py py-func docutils literal notranslate"><span class="pre">move</span></code></a> to move a file into the installroot</li>
<li><a class="reference internal" href="pylorax.html#pylorax.ltmpl.LoraxTemplateRunner.replace" title="pylorax.ltmpl.LoraxTemplateRunner.replace"><code class="xref py py-func docutils literal"><span class="pre">replace</span></code></a> does text substitution in a file</li> <li><a class="reference internal" href="pylorax.html#pylorax.ltmpl.LoraxTemplateRunner.replace" title="pylorax.ltmpl.LoraxTemplateRunner.replace"><code class="xref py py-func docutils literal notranslate"><span class="pre">replace</span></code></a> does text substitution in a file</li>
<li><a class="reference internal" href="pylorax.html#pylorax.ltmpl.LoraxTemplateRunner.remove" title="pylorax.ltmpl.LoraxTemplateRunner.remove"><code class="xref py py-func docutils literal"><span class="pre">remove</span></code></a> deletes a file</li> <li><a class="reference internal" href="pylorax.html#pylorax.ltmpl.LoraxTemplateRunner.remove" title="pylorax.ltmpl.LoraxTemplateRunner.remove"><code class="xref py py-func docutils literal notranslate"><span class="pre">remove</span></code></a> deletes a file</li>
<li><a class="reference internal" href="pylorax.html#pylorax.ltmpl.LoraxTemplateRunner.runcmd" title="pylorax.ltmpl.LoraxTemplateRunner.runcmd"><code class="xref py py-func docutils literal"><span class="pre">runcmd</span></code></a> run arbitrary commands.</li> <li><a class="reference internal" href="pylorax.html#pylorax.ltmpl.LoraxTemplateRunner.runcmd" title="pylorax.ltmpl.LoraxTemplateRunner.runcmd"><code class="xref py py-func docutils literal notranslate"><span class="pre">runcmd</span></code></a> run arbitrary commands.</li>
<li><a class="reference internal" href="pylorax.html#pylorax.ltmpl.LoraxTemplateRunner.symlink" title="pylorax.ltmpl.LoraxTemplateRunner.symlink"><code class="xref py py-func docutils literal"><span class="pre">symlink</span></code></a> creates a symlink</li> <li><a class="reference internal" href="pylorax.html#pylorax.ltmpl.LoraxTemplateRunner.symlink" title="pylorax.ltmpl.LoraxTemplateRunner.symlink"><code class="xref py py-func docutils literal notranslate"><span class="pre">symlink</span></code></a> creates a symlink</li>
<li><a class="reference internal" href="pylorax.html#pylorax.ltmpl.LoraxTemplateRunner.systemctl" title="pylorax.ltmpl.LoraxTemplateRunner.systemctl"><code class="xref py py-func docutils literal"><span class="pre">systemctl</span></code></a> runs systemctl in the installroot</li> <li><a class="reference internal" href="pylorax.html#pylorax.ltmpl.LoraxTemplateRunner.systemctl" title="pylorax.ltmpl.LoraxTemplateRunner.systemctl"><code class="xref py py-func docutils literal notranslate"><span class="pre">systemctl</span></code></a> runs systemctl in the installroot</li>
</ul> </ul>
</div> </div>
<div class="section" id="runtime-cleanup-tmpl"> <div class="section" id="runtime-cleanup-tmpl">
<h3>runtime-cleanup.tmpl<a class="headerlink" href="#runtime-cleanup-tmpl" title="Permalink to this headline"></a></h3> <h3>runtime-cleanup.tmpl<a class="headerlink" href="#runtime-cleanup-tmpl" title="Permalink to this headline"></a></h3>
<p>The <code class="docutils literal"><span class="pre">runtime-cleanup.tmpl</span></code> template is used to remove files that arent strictly needed <p>The <code class="docutils literal notranslate"><span class="pre">runtime-cleanup.tmpl</span></code> template is used to remove files that arent strictly needed
by the installation environment. In addition to the <code class="docutils literal"><span class="pre">remove</span></code> template command it uses:</p> by the installation environment. In addition to the <code class="docutils literal notranslate"><span class="pre">remove</span></code> template command it uses:</p>
<ul class="simple"> <ul class="simple">
<li><a class="reference internal" href="pylorax.html#pylorax.ltmpl.LoraxTemplateRunner.removepkg" title="pylorax.ltmpl.LoraxTemplateRunner.removepkg"><code class="xref py py-func docutils literal"><span class="pre">removepkg</span></code></a> <li><a class="reference internal" href="pylorax.html#pylorax.ltmpl.LoraxTemplateRunner.removepkg" title="pylorax.ltmpl.LoraxTemplateRunner.removepkg"><code class="xref py py-func docutils literal notranslate"><span class="pre">removepkg</span></code></a>
remove all of a specific packages contents. A package may be pulled in as a dependency, but remove all of a specific packages contents. A package may be pulled in as a dependency, but
not really used. eg. sound support.</li> not really used. eg. sound support.</li>
<li><a class="reference internal" href="pylorax.html#pylorax.ltmpl.LoraxTemplateRunner.removefrom" title="pylorax.ltmpl.LoraxTemplateRunner.removefrom"><code class="xref py py-func docutils literal"><span class="pre">removefrom</span></code></a> <li><a class="reference internal" href="pylorax.html#pylorax.ltmpl.LoraxTemplateRunner.removefrom" title="pylorax.ltmpl.LoraxTemplateRunner.removefrom"><code class="xref py py-func docutils literal notranslate"><span class="pre">removefrom</span></code></a>
Removes some files from a package. A file glob can be used, or the allbut option to Removes some files from a package. A file glob can be used, or the allbut option to
remove everything except a select few.</li> remove everything except a select few.</li>
<li><a class="reference internal" href="pylorax.html#pylorax.ltmpl.LoraxTemplateRunner.removekmod" title="pylorax.ltmpl.LoraxTemplateRunner.removekmod"><code class="xref py py-func docutils literal"><span class="pre">removekmod</span></code></a> <li><a class="reference internal" href="pylorax.html#pylorax.ltmpl.LoraxTemplateRunner.removekmod" title="pylorax.ltmpl.LoraxTemplateRunner.removekmod"><code class="xref py py-func docutils literal notranslate"><span class="pre">removekmod</span></code></a>
Removes kernel modules</li> Removes kernel modules</li>
</ul> </ul>
</div> </div>
<div class="section" id="the-squashfs-filesystem"> <div class="section" id="the-squashfs-filesystem">
<h3>The squashfs filesystem<a class="headerlink" href="#the-squashfs-filesystem" title="Permalink to this headline"></a></h3> <h3>The squashfs filesystem<a class="headerlink" href="#the-squashfs-filesystem" title="Permalink to this headline"></a></h3>
<p>After <code class="docutils literal"><span class="pre">runtime-*.tmpl</span></code> templates have finished their work lorax creates an <p>After <code class="docutils literal notranslate"><span class="pre">runtime-*.tmpl</span></code> templates have finished their work lorax creates an
empty ext4 filesystem, copies the remaining files to it, and makes a squashfs empty ext4 filesystem, copies the remaining files to it, and makes a squashfs
filesystem of it. This file is the / of the boot.isos installer environment filesystem of it. This file is the / of the boot.isos installer environment
and is what is in the LiveOS/squashfs.img file on the iso.</p> and is what is in the LiveOS/squashfs.img file on the iso.</p>
@ -449,10 +495,10 @@ and is what is in the LiveOS/squashfs.img file on the iso.</p>
<h3>iso creation<a class="headerlink" href="#iso-creation" title="Permalink to this headline"></a></h3> <h3>iso creation<a class="headerlink" href="#iso-creation" title="Permalink to this headline"></a></h3>
<p>The iso creation is handled by another set of templates. The one used depends <p>The iso creation is handled by another set of templates. The one used depends
on the architecture that the iso is being created for. They are also stored in on the architecture that the iso is being created for. They are also stored in
<code class="docutils literal"><span class="pre">/usr/share/lorax/templates.d/99-generic</span></code> and are named after the arch, like <code class="docutils literal notranslate"><span class="pre">/usr/share/lorax/templates.d/99-generic</span></code> and are named after the arch, like
<code class="docutils literal"><span class="pre">x86.tmpl</span></code> and <code class="docutils literal"><span class="pre">aarch64.tmpl</span></code>. They handle creation of the tree, copying <code class="docutils literal notranslate"><span class="pre">x86.tmpl</span></code> and <code class="docutils literal notranslate"><span class="pre">aarch64.tmpl</span></code>. They handle creation of the tree, copying
configuration template files, configuration variable substitution, treeinfo configuration template files, configuration variable substitution, treeinfo
metadata (via the <a class="reference internal" href="pylorax.html#pylorax.ltmpl.LoraxTemplateRunner.treeinfo" title="pylorax.ltmpl.LoraxTemplateRunner.treeinfo"><code class="xref py py-func docutils literal"><span class="pre">treeinfo</span></code></a> metadata (via the <a class="reference internal" href="pylorax.html#pylorax.ltmpl.LoraxTemplateRunner.treeinfo" title="pylorax.ltmpl.LoraxTemplateRunner.treeinfo"><code class="xref py py-func docutils literal notranslate"><span class="pre">treeinfo</span></code></a>
template command). Kernel and initrd are copied from the installroot to their template command). Kernel and initrd are copied from the installroot to their
final locations and then mkisofs is run to create the boot.iso</p> final locations and then mkisofs is run to create the boot.iso</p>
</div> </div>
@ -460,20 +506,18 @@ final locations and then mkisofs is run to create the boot.iso</p>
<div class="section" id="custom-templates"> <div class="section" id="custom-templates">
<h2>Custom Templates<a class="headerlink" href="#custom-templates" title="Permalink to this headline"></a></h2> <h2>Custom Templates<a class="headerlink" href="#custom-templates" title="Permalink to this headline"></a></h2>
<p>The default set of templates and configuration files from the lorax-generic-templates package <p>The default set of templates and configuration files from the lorax-generic-templates package
are shipped in the <code class="docutils literal"><span class="pre">/usr/share/lorax/templates.d/99-generic/</span></code> directory. You can are shipped in the <code class="docutils literal notranslate"><span class="pre">/usr/share/lorax/templates.d/99-generic/</span></code> directory. You can
make a copy of them and place them into another directory under <code class="docutils literal"><span class="pre">templates.d</span></code> make a copy of them and place them into another directory under <code class="docutils literal notranslate"><span class="pre">templates.d</span></code>
and they will be used instead if their sort order is below all other directories. This and they will be used instead if their sort order is below all other directories. This
allows multiple packages to ship lorax templates without conflict. You can (and probably allows multiple packages to ship lorax templates without conflict. You can (and probably
should) select the specific template directory by passing <code class="docutils literal"><span class="pre">--sharedir</span></code> to lorax.</p> should) select the specific template directory by passing <code class="docutils literal notranslate"><span class="pre">--sharedir</span></code> to lorax.</p>
</div> </div>
</div> </div>
</div> </div>
<div class="articleComments">
</div> </div>
</div>
<footer> <footer>
<div class="rst-footer-buttons" role="navigation" aria-label="footer navigation"> <div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
@ -494,7 +538,7 @@ should) select the specific template directory by passing <code class="docutils
</p> </p>
</div> </div>
Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/snide/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>. 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> </footer>
@ -512,7 +556,8 @@ should) select the specific template directory by passing <code class="docutils
<script type="text/javascript"> <script type="text/javascript">
var DOCUMENTATION_OPTIONS = { var DOCUMENTATION_OPTIONS = {
URL_ROOT:'./', URL_ROOT:'./',
VERSION:'28.9', VERSION:'28.10',
LANGUAGE:'None',
COLLAPSE_INDEX:false, COLLAPSE_INDEX:false,
FILE_SUFFIX:'.html', FILE_SUFFIX:'.html',
HAS_SOURCE: true, HAS_SOURCE: true,
@ -530,14 +575,13 @@ should) select the specific template directory by passing <code class="docutils
<script type="text/javascript" src="_static/js/theme.js"></script> <script type="text/javascript" src="_static/js/theme.js"></script>
<script type="text/javascript"> <script type="text/javascript">
jQuery(function () { jQuery(function () {
SphinxRtdTheme.StickyNav.enable();
SphinxRtdTheme.Navigation.enableSticky();
}); });
</script> </script>
</body> </body>
</html> </html>

View File

@ -8,8 +8,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>pylorax &mdash; Lorax 28.9 documentation</title> <title>pylorax &mdash; Lorax 28.10 documentation</title>
@ -27,15 +26,9 @@
<link rel="stylesheet" href="_static/css/theme.css" type="text/css" /> <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="index" title="Index"
href="genindex.html"/>
<link rel="search" title="Search" href="search.html" /> <link rel="search" title="Search" href="search.html" />
<link rel="top" title="Lorax 28.9 documentation" href="index.html"/>
<link rel="next" title="pylorax package" href="pylorax.html" /> <link rel="next" title="pylorax package" href="pylorax.html" />
<link rel="prev" title="Product and Updates Images" href="product-images.html" /> <link rel="prev" title="Product and Updates Images" href="product-images.html" />
@ -44,7 +37,7 @@
</head> </head>
<body class="wy-body-for-nav" role="document"> <body class="wy-body-for-nav">
<div class="wy-grid-for-nav"> <div class="wy-grid-for-nav">
@ -66,7 +59,7 @@
<div class="version"> <div class="version">
28.9 28.10
</div> </div>
@ -95,6 +88,8 @@
<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="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="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="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"><a class="reference internal" href="product-images.html">Product and Updates Images</a></li>
<li class="toctree-l1 current"><a class="current reference internal" href="#">pylorax</a><ul> <li class="toctree-l1 current"><a class="current reference internal" href="#">pylorax</a><ul>
<li class="toctree-l2"><a class="reference internal" href="pylorax.html">pylorax package</a></li> <li class="toctree-l2"><a class="reference internal" href="pylorax.html">pylorax package</a></li>
@ -111,7 +106,7 @@
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"> <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
<nav class="wy-nav-top" role="navigation" aria-label="top navigation"> <nav class="wy-nav-top" aria-label="top navigation">
<i data-toggle="wy-nav-top" class="fa fa-bars"></i> <i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="index.html">Lorax</a> <a href="index.html">Lorax</a>
@ -119,8 +114,8 @@
</nav> </nav>
<div class="wy-nav-content"> <div class="wy-nav-content">
<div class="rst-content"> <div class="rst-content">
@ -138,6 +133,7 @@
<div role="navigation" aria-label="breadcrumbs navigation"> <div role="navigation" aria-label="breadcrumbs navigation">
<ul class="wy-breadcrumbs"> <ul class="wy-breadcrumbs">
@ -168,15 +164,36 @@
<div class="toctree-wrapper compound"> <div class="toctree-wrapper compound">
<ul> <ul>
<li class="toctree-l1"><a class="reference internal" href="pylorax.html">pylorax package</a><ul> <li class="toctree-l1"><a class="reference internal" href="pylorax.html">pylorax package</a><ul>
<li class="toctree-l2"><a class="reference internal" href="pylorax.html#subpackages">Subpackages</a><ul>
<li class="toctree-l3"><a class="reference internal" href="pylorax.api.html">pylorax.api package</a><ul>
<li class="toctree-l4"><a class="reference internal" href="pylorax.api.html#submodules">Submodules</a></li>
<li class="toctree-l4"><a class="reference internal" href="pylorax.api.html#module-pylorax.api.cmdline">pylorax.api.cmdline module</a></li>
<li class="toctree-l4"><a class="reference internal" href="pylorax.api.html#module-pylorax.api.compose">pylorax.api.compose module</a></li>
<li class="toctree-l4"><a class="reference internal" href="pylorax.api.html#module-pylorax.api.config">pylorax.api.config module</a></li>
<li class="toctree-l4"><a class="reference internal" href="pylorax.api.html#module-pylorax.api.crossdomain">pylorax.api.crossdomain module</a></li>
<li class="toctree-l4"><a class="reference internal" href="pylorax.api.html#pylorax-api-dnfbase-module">pylorax.api.dnfbase module</a></li>
<li class="toctree-l4"><a class="reference internal" href="pylorax.api.html#module-pylorax.api.projects">pylorax.api.projects module</a></li>
<li class="toctree-l4"><a class="reference internal" href="pylorax.api.html#module-pylorax.api.queue">pylorax.api.queue module</a></li>
<li class="toctree-l4"><a class="reference internal" href="pylorax.api.html#module-pylorax.api.recipes">pylorax.api.recipes module</a></li>
<li class="toctree-l4"><a class="reference internal" href="pylorax.api.html#module-pylorax.api.server">pylorax.api.server module</a></li>
<li class="toctree-l4"><a class="reference internal" href="pylorax.api.html#module-pylorax.api.v0">pylorax.api.v0 module</a></li>
<li class="toctree-l4"><a class="reference internal" href="pylorax.api.html#module-pylorax.api.workspace">pylorax.api.workspace module</a></li>
<li class="toctree-l4"><a class="reference internal" href="pylorax.api.html#module-pylorax.api">Module contents</a></li>
</ul>
</li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="pylorax.html#submodules">Submodules</a></li> <li class="toctree-l2"><a class="reference internal" href="pylorax.html#submodules">Submodules</a></li>
<li class="toctree-l2"><a class="reference internal" href="pylorax.html#module-pylorax.base">pylorax.base module</a></li> <li class="toctree-l2"><a class="reference internal" href="pylorax.html#module-pylorax.base">pylorax.base module</a></li>
<li class="toctree-l2"><a class="reference internal" href="pylorax.html#module-pylorax.buildstamp">pylorax.buildstamp module</a></li> <li class="toctree-l2"><a class="reference internal" href="pylorax.html#module-pylorax.buildstamp">pylorax.buildstamp module</a></li>
<li class="toctree-l2"><a class="reference internal" href="pylorax.html#module-pylorax.cmdline">pylorax.cmdline module</a></li> <li class="toctree-l2"><a class="reference internal" href="pylorax.html#module-pylorax.cmdline">pylorax.cmdline module</a></li>
<li class="toctree-l2"><a class="reference internal" href="pylorax.html#module-pylorax.creator">pylorax.creator module</a></li>
<li class="toctree-l2"><a class="reference internal" href="pylorax.html#module-pylorax.decorators">pylorax.decorators module</a></li> <li class="toctree-l2"><a class="reference internal" href="pylorax.html#module-pylorax.decorators">pylorax.decorators module</a></li>
<li class="toctree-l2"><a class="reference internal" href="pylorax.html#module-pylorax.discinfo">pylorax.discinfo module</a></li> <li class="toctree-l2"><a class="reference internal" href="pylorax.html#module-pylorax.discinfo">pylorax.discinfo module</a></li>
<li class="toctree-l2"><a class="reference internal" href="pylorax.html#module-pylorax.dnfhelper">pylorax.dnfhelper module</a></li> <li class="toctree-l2"><a class="reference internal" href="pylorax.html#module-pylorax.dnfhelper">pylorax.dnfhelper module</a></li>
<li class="toctree-l2"><a class="reference internal" href="pylorax.html#module-pylorax.executils">pylorax.executils module</a></li> <li class="toctree-l2"><a class="reference internal" href="pylorax.html#module-pylorax.executils">pylorax.executils module</a></li>
<li class="toctree-l2"><a class="reference internal" href="pylorax.html#module-pylorax.imgutils">pylorax.imgutils module</a></li> <li class="toctree-l2"><a class="reference internal" href="pylorax.html#module-pylorax.imgutils">pylorax.imgutils module</a></li>
<li class="toctree-l2"><a class="reference internal" href="pylorax.html#module-pylorax.installer">pylorax.installer module</a></li>
<li class="toctree-l2"><a class="reference internal" href="pylorax.html#module-pylorax.ltmpl">pylorax.ltmpl module</a></li> <li class="toctree-l2"><a class="reference internal" href="pylorax.html#module-pylorax.ltmpl">pylorax.ltmpl module</a></li>
<li class="toctree-l2"><a class="reference internal" href="pylorax.html#module-pylorax.monitor">pylorax.monitor module</a></li> <li class="toctree-l2"><a class="reference internal" href="pylorax.html#module-pylorax.monitor">pylorax.monitor module</a></li>
<li class="toctree-l2"><a class="reference internal" href="pylorax.html#module-pylorax.mount">pylorax.mount module</a></li> <li class="toctree-l2"><a class="reference internal" href="pylorax.html#module-pylorax.mount">pylorax.mount module</a></li>
@ -193,10 +210,8 @@
</div> </div>
<div class="articleComments">
</div> </div>
</div>
<footer> <footer>
<div class="rst-footer-buttons" role="navigation" aria-label="footer navigation"> <div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
@ -217,7 +232,7 @@
</p> </p>
</div> </div>
Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/snide/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>. 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> </footer>
@ -235,7 +250,8 @@
<script type="text/javascript"> <script type="text/javascript">
var DOCUMENTATION_OPTIONS = { var DOCUMENTATION_OPTIONS = {
URL_ROOT:'./', URL_ROOT:'./',
VERSION:'28.9', VERSION:'28.10',
LANGUAGE:'None',
COLLAPSE_INDEX:false, COLLAPSE_INDEX:false,
FILE_SUFFIX:'.html', FILE_SUFFIX:'.html',
HAS_SOURCE: true, HAS_SOURCE: true,
@ -253,14 +269,13 @@
<script type="text/javascript" src="_static/js/theme.js"></script> <script type="text/javascript" src="_static/js/theme.js"></script>
<script type="text/javascript"> <script type="text/javascript">
jQuery(function () { jQuery(function () {
SphinxRtdTheme.StickyNav.enable();
SphinxRtdTheme.Navigation.enableSticky();
}); });
</script> </script>
</body> </body>
</html> </html>

Binary file not shown.

View File

@ -8,8 +8,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Product and Updates Images &mdash; Lorax 28.9 documentation</title> <title>Product and Updates Images &mdash; Lorax 28.10 documentation</title>
@ -27,24 +26,18 @@
<link rel="stylesheet" href="_static/css/theme.css" type="text/css" /> <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="index" title="Index"
href="genindex.html"/>
<link rel="search" title="Search" href="search.html" /> <link rel="search" title="Search" href="search.html" />
<link rel="top" title="Lorax 28.9 documentation" href="index.html"/>
<link rel="next" title="pylorax" href="modules.html" /> <link rel="next" title="pylorax" href="modules.html" />
<link rel="prev" title="livemedia-creator" href="livemedia-creator.html"/> <link rel="prev" title="composer-cli" href="composer-cli.html" />
<script src="_static/js/modernizr.min.js"></script> <script src="_static/js/modernizr.min.js"></script>
</head> </head>
<body class="wy-body-for-nav" role="document"> <body class="wy-body-for-nav">
<div class="wy-grid-for-nav"> <div class="wy-grid-for-nav">
@ -66,7 +59,7 @@
<div class="version"> <div class="version">
28.9 28.10
</div> </div>
@ -95,6 +88,8 @@
<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="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="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="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 current"><a class="current reference internal" href="#">Product and Updates Images</a></li> <li class="toctree-l1 current"><a class="current reference internal" href="#">Product and Updates Images</a></li>
<li class="toctree-l1"><a class="reference internal" href="modules.html">pylorax</a></li> <li class="toctree-l1"><a class="reference internal" href="modules.html">pylorax</a></li>
</ul> </ul>
@ -108,7 +103,7 @@
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"> <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
<nav class="wy-nav-top" role="navigation" aria-label="top navigation"> <nav class="wy-nav-top" aria-label="top navigation">
<i data-toggle="wy-nav-top" class="fa fa-bars"></i> <i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="index.html">Lorax</a> <a href="index.html">Lorax</a>
@ -116,8 +111,8 @@
</nav> </nav>
<div class="wy-nav-content"> <div class="wy-nav-content">
<div class="rst-content"> <div class="rst-content">
@ -135,6 +130,7 @@
<div role="navigation" aria-label="breadcrumbs navigation"> <div role="navigation" aria-label="breadcrumbs navigation">
<ul class="wy-breadcrumbs"> <ul class="wy-breadcrumbs">
@ -166,7 +162,7 @@
process. This is implemented using the installimg template command which will process. This is implemented using the installimg template command which will
take the contents of a directory and create a compressed archive from it. The take the contents of a directory and create a compressed archive from it. The
directory must be created by one of the packages installed by directory must be created by one of the packages installed by
runtime-install.tmpl or by passing <code class="docutils literal"><span class="pre">--installpkgs</span> <span class="pre">&lt;pkgname&gt;</span></code> to lorax at runtime-install.tmpl or by passing <code class="docutils literal notranslate"><span class="pre">--installpkgs</span> <span class="pre">&lt;pkgname&gt;</span></code> to lorax at
runtime. The x86, ppc, ppc64le and aarch64 templates all look for runtime. The x86, ppc, ppc64le and aarch64 templates all look for
/usr/share/lorax/product/ and /usr/share/lorax/updates/ directories in the /usr/share/lorax/product/ and /usr/share/lorax/updates/ directories in the
install chroot while creating the final install tree. If there are files in install chroot while creating the final install tree. If there are files in
@ -178,18 +174,16 @@ files to add to or replace anything on the filesystem.</p>
<p>Anaconda has several places that it looks for updates, the one for product.img <p>Anaconda has several places that it looks for updates, the one for product.img
is in /run/install/product. So for example, to add an installclass to Anaconda is in /run/install/product. So for example, to add an installclass to Anaconda
you would put your custom class here:</p> you would put your custom class here:</p>
<p><code class="docutils literal"><span class="pre">/usr/share/lorax/product/run/install/product/pyanaconda/installclasses/custom.py</span></code></p> <p><code class="docutils literal notranslate"><span class="pre">/usr/share/lorax/product/run/install/product/pyanaconda/installclasses/custom.py</span></code></p>
<p>If the packages containing the product/updates files are not included as part <p>If the packages containing the product/updates files are not included as part
of normal dependencies you can add specific packages with the <code class="docutils literal"><span class="pre">--installpkgs</span></code> of normal dependencies you can add specific packages with the <code class="docutils literal notranslate"><span class="pre">--installpkgs</span></code>
command or the installpkgs paramater of <a class="reference internal" href="pylorax.html#pylorax.treebuilder.RuntimeBuilder" title="pylorax.treebuilder.RuntimeBuilder"><code class="xref py py-class docutils literal"><span class="pre">pylorax.treebuilder.RuntimeBuilder</span></code></a></p> command or the installpkgs paramater of <a class="reference internal" href="pylorax.html#pylorax.treebuilder.RuntimeBuilder" title="pylorax.treebuilder.RuntimeBuilder"><code class="xref py py-class docutils literal notranslate"><span class="pre">pylorax.treebuilder.RuntimeBuilder</span></code></a></p>
</div> </div>
</div> </div>
<div class="articleComments">
</div> </div>
</div>
<footer> <footer>
<div class="rst-footer-buttons" role="navigation" aria-label="footer navigation"> <div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
@ -197,7 +191,7 @@ command or the installpkgs paramater of <a class="reference internal" href="pylo
<a href="modules.html" class="btn btn-neutral float-right" title="pylorax" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right"></span></a> <a href="modules.html" class="btn btn-neutral float-right" title="pylorax" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right"></span></a>
<a href="livemedia-creator.html" class="btn btn-neutral" title="livemedia-creator" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left"></span> Previous</a> <a href="composer-cli.html" class="btn btn-neutral" title="composer-cli" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left"></span> Previous</a>
</div> </div>
@ -210,7 +204,7 @@ command or the installpkgs paramater of <a class="reference internal" href="pylo
</p> </p>
</div> </div>
Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/snide/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>. 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> </footer>
@ -228,7 +222,8 @@ command or the installpkgs paramater of <a class="reference internal" href="pylo
<script type="text/javascript"> <script type="text/javascript">
var DOCUMENTATION_OPTIONS = { var DOCUMENTATION_OPTIONS = {
URL_ROOT:'./', URL_ROOT:'./',
VERSION:'28.9', VERSION:'28.10',
LANGUAGE:'None',
COLLAPSE_INDEX:false, COLLAPSE_INDEX:false,
FILE_SUFFIX:'.html', FILE_SUFFIX:'.html',
HAS_SOURCE: true, HAS_SOURCE: true,
@ -246,14 +241,13 @@ command or the installpkgs paramater of <a class="reference internal" href="pylo
<script type="text/javascript" src="_static/js/theme.js"></script> <script type="text/javascript" src="_static/js/theme.js"></script>
<script type="text/javascript"> <script type="text/javascript">
jQuery(function () { jQuery(function () {
SphinxRtdTheme.StickyNav.enable();
SphinxRtdTheme.Navigation.enableSticky();
}); });
</script> </script>
</body> </body>
</html> </html>

View File

@ -8,8 +8,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Python Module Index &mdash; Lorax 28.9 documentation</title> <title>Python Module Index &mdash; Lorax 28.10 documentation</title>
@ -27,15 +26,9 @@
<link rel="stylesheet" href="_static/css/theme.css" type="text/css" /> <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="index" title="Index"
href="genindex.html"/>
<link rel="search" title="Search" href="search.html" /> <link rel="search" title="Search" href="search.html" />
<link rel="top" title="Lorax 28.9 documentation" href="index.html"/>
@ -45,7 +38,7 @@
</head> </head>
<body class="wy-body-for-nav" role="document"> <body class="wy-body-for-nav">
<div class="wy-grid-for-nav"> <div class="wy-grid-for-nav">
@ -67,7 +60,7 @@
<div class="version"> <div class="version">
28.9 28.10
</div> </div>
@ -96,6 +89,8 @@
<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="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="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="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"><a class="reference internal" href="product-images.html">Product and Updates Images</a></li>
<li class="toctree-l1"><a class="reference internal" href="modules.html">pylorax</a></li> <li class="toctree-l1"><a class="reference internal" href="modules.html">pylorax</a></li>
</ul> </ul>
@ -109,7 +104,7 @@
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"> <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
<nav class="wy-nav-top" role="navigation" aria-label="top navigation"> <nav class="wy-nav-top" aria-label="top navigation">
<i data-toggle="wy-nav-top" class="fa fa-bars"></i> <i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="index.html">Lorax</a> <a href="index.html">Lorax</a>
@ -117,8 +112,8 @@
</nav> </nav>
<div class="wy-nav-content"> <div class="wy-nav-content">
<div class="rst-content"> <div class="rst-content">
@ -136,6 +131,7 @@
<div role="navigation" aria-label="breadcrumbs navigation"> <div role="navigation" aria-label="breadcrumbs navigation">
<ul class="wy-breadcrumbs"> <ul class="wy-breadcrumbs">
@ -147,8 +143,6 @@
<li class="wy-breadcrumbs-aside"> <li class="wy-breadcrumbs-aside">
</li> </li>
</ul> </ul>
@ -176,6 +170,61 @@
<td> <td>
<a href="pylorax.html#module-pylorax"><code class="xref">pylorax</code></a></td><td> <a href="pylorax.html#module-pylorax"><code class="xref">pylorax</code></a></td><td>
<em></em></td></tr> <em></em></td></tr>
<tr class="cg-1">
<td></td>
<td>&#160;&#160;&#160;
<a href="pylorax.api.html#module-pylorax.api"><code class="xref">pylorax.api</code></a></td><td>
<em></em></td></tr>
<tr class="cg-1">
<td></td>
<td>&#160;&#160;&#160;
<a href="pylorax.api.html#module-pylorax.api.cmdline"><code class="xref">pylorax.api.cmdline</code></a></td><td>
<em></em></td></tr>
<tr class="cg-1">
<td></td>
<td>&#160;&#160;&#160;
<a href="pylorax.api.html#module-pylorax.api.compose"><code class="xref">pylorax.api.compose</code></a></td><td>
<em></em></td></tr>
<tr class="cg-1">
<td></td>
<td>&#160;&#160;&#160;
<a href="pylorax.api.html#module-pylorax.api.config"><code class="xref">pylorax.api.config</code></a></td><td>
<em></em></td></tr>
<tr class="cg-1">
<td></td>
<td>&#160;&#160;&#160;
<a href="pylorax.api.html#module-pylorax.api.crossdomain"><code class="xref">pylorax.api.crossdomain</code></a></td><td>
<em></em></td></tr>
<tr class="cg-1">
<td></td>
<td>&#160;&#160;&#160;
<a href="pylorax.api.html#module-pylorax.api.projects"><code class="xref">pylorax.api.projects</code></a></td><td>
<em></em></td></tr>
<tr class="cg-1">
<td></td>
<td>&#160;&#160;&#160;
<a href="pylorax.api.html#module-pylorax.api.queue"><code class="xref">pylorax.api.queue</code></a></td><td>
<em></em></td></tr>
<tr class="cg-1">
<td></td>
<td>&#160;&#160;&#160;
<a href="pylorax.api.html#module-pylorax.api.recipes"><code class="xref">pylorax.api.recipes</code></a></td><td>
<em></em></td></tr>
<tr class="cg-1">
<td></td>
<td>&#160;&#160;&#160;
<a href="pylorax.api.html#module-pylorax.api.server"><code class="xref">pylorax.api.server</code></a></td><td>
<em></em></td></tr>
<tr class="cg-1">
<td></td>
<td>&#160;&#160;&#160;
<a href="pylorax.api.html#module-pylorax.api.v0"><code class="xref">pylorax.api.v0</code></a></td><td>
<em></em></td></tr>
<tr class="cg-1">
<td></td>
<td>&#160;&#160;&#160;
<a href="pylorax.api.html#module-pylorax.api.workspace"><code class="xref">pylorax.api.workspace</code></a></td><td>
<em></em></td></tr>
<tr class="cg-1"> <tr class="cg-1">
<td></td> <td></td>
<td>&#160;&#160;&#160; <td>&#160;&#160;&#160;
@ -191,6 +240,11 @@
<td>&#160;&#160;&#160; <td>&#160;&#160;&#160;
<a href="pylorax.html#module-pylorax.cmdline"><code class="xref">pylorax.cmdline</code></a></td><td> <a href="pylorax.html#module-pylorax.cmdline"><code class="xref">pylorax.cmdline</code></a></td><td>
<em></em></td></tr> <em></em></td></tr>
<tr class="cg-1">
<td></td>
<td>&#160;&#160;&#160;
<a href="pylorax.html#module-pylorax.creator"><code class="xref">pylorax.creator</code></a></td><td>
<em></em></td></tr>
<tr class="cg-1"> <tr class="cg-1">
<td></td> <td></td>
<td>&#160;&#160;&#160; <td>&#160;&#160;&#160;
@ -216,6 +270,11 @@
<td>&#160;&#160;&#160; <td>&#160;&#160;&#160;
<a href="pylorax.html#module-pylorax.imgutils"><code class="xref">pylorax.imgutils</code></a></td><td> <a href="pylorax.html#module-pylorax.imgutils"><code class="xref">pylorax.imgutils</code></a></td><td>
<em></em></td></tr> <em></em></td></tr>
<tr class="cg-1">
<td></td>
<td>&#160;&#160;&#160;
<a href="pylorax.html#module-pylorax.installer"><code class="xref">pylorax.installer</code></a></td><td>
<em></em></td></tr>
<tr class="cg-1"> <tr class="cg-1">
<td></td> <td></td>
<td>&#160;&#160;&#160; <td>&#160;&#160;&#160;
@ -255,10 +314,8 @@
</div> </div>
<div class="articleComments">
</div> </div>
</div>
<footer> <footer>
@ -270,7 +327,7 @@
</p> </p>
</div> </div>
Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/snide/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>. 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> </footer>
@ -288,7 +345,8 @@
<script type="text/javascript"> <script type="text/javascript">
var DOCUMENTATION_OPTIONS = { var DOCUMENTATION_OPTIONS = {
URL_ROOT:'./', URL_ROOT:'./',
VERSION:'28.9', VERSION:'28.10',
LANGUAGE:'None',
COLLAPSE_INDEX:false, COLLAPSE_INDEX:false,
FILE_SUFFIX:'.html', FILE_SUFFIX:'.html',
HAS_SOURCE: true, HAS_SOURCE: true,
@ -306,14 +364,13 @@
<script type="text/javascript" src="_static/js/theme.js"></script> <script type="text/javascript" src="_static/js/theme.js"></script>
<script type="text/javascript"> <script type="text/javascript">
jQuery(function () { jQuery(function () {
SphinxRtdTheme.StickyNav.enable();
SphinxRtdTheme.Navigation.enableSticky();
}); });
</script> </script>
</body> </body>
</html> </html>

3244
docs/html/pylorax.api.html Normal file

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -8,8 +8,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Search &mdash; Lorax 28.9 documentation</title> <title>Search &mdash; Lorax 28.10 documentation</title>
@ -27,22 +26,16 @@
<link rel="stylesheet" href="_static/css/theme.css" type="text/css" /> <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="index" title="Index"
href="genindex.html"/>
<link rel="search" title="Search" href="#" /> <link rel="search" title="Search" href="#" />
<link rel="top" title="Lorax 28.9 documentation" href="index.html"/>
<script src="_static/js/modernizr.min.js"></script> <script src="_static/js/modernizr.min.js"></script>
</head> </head>
<body class="wy-body-for-nav" role="document"> <body class="wy-body-for-nav">
<div class="wy-grid-for-nav"> <div class="wy-grid-for-nav">
@ -64,7 +57,7 @@
<div class="version"> <div class="version">
28.9 28.10
</div> </div>
@ -93,6 +86,8 @@
<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="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="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="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"><a class="reference internal" href="product-images.html">Product and Updates Images</a></li>
<li class="toctree-l1"><a class="reference internal" href="modules.html">pylorax</a></li> <li class="toctree-l1"><a class="reference internal" href="modules.html">pylorax</a></li>
</ul> </ul>
@ -106,7 +101,7 @@
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"> <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
<nav class="wy-nav-top" role="navigation" aria-label="top navigation"> <nav class="wy-nav-top" aria-label="top navigation">
<i data-toggle="wy-nav-top" class="fa fa-bars"></i> <i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="index.html">Lorax</a> <a href="index.html">Lorax</a>
@ -114,8 +109,8 @@
</nav> </nav>
<div class="wy-nav-content"> <div class="wy-nav-content">
<div class="rst-content"> <div class="rst-content">
@ -133,6 +128,7 @@
<div role="navigation" aria-label="breadcrumbs navigation"> <div role="navigation" aria-label="breadcrumbs navigation">
<ul class="wy-breadcrumbs"> <ul class="wy-breadcrumbs">
@ -144,6 +140,8 @@
<li class="wy-breadcrumbs-aside"> <li class="wy-breadcrumbs-aside">
</li> </li>
</ul> </ul>
@ -169,10 +167,8 @@
</div> </div>
</div> </div>
<div class="articleComments">
</div> </div>
</div>
<footer> <footer>
@ -184,7 +180,7 @@
</p> </p>
</div> </div>
Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/snide/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>. 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> </footer>
@ -202,7 +198,8 @@
<script type="text/javascript"> <script type="text/javascript">
var DOCUMENTATION_OPTIONS = { var DOCUMENTATION_OPTIONS = {
URL_ROOT:'./', URL_ROOT:'./',
VERSION:'28.9', VERSION:'28.10',
LANGUAGE:'None',
COLLAPSE_INDEX:false, COLLAPSE_INDEX:false,
FILE_SUFFIX:'.html', FILE_SUFFIX:'.html',
HAS_SOURCE: true, HAS_SOURCE: true,
@ -221,14 +218,13 @@
<script type="text/javascript" src="_static/js/theme.js"></script> <script type="text/javascript" src="_static/js/theme.js"></script>
<script type="text/javascript"> <script type="text/javascript">
jQuery(function () { jQuery(function () {
SphinxRtdTheme.StickyNav.enable();
SphinxRtdTheme.Navigation.enableSticky();
}); });
</script> </script>
<script type="text/javascript"> <script type="text/javascript">
jQuery(function() { Search.loadIndex("searchindex.js"); }); jQuery(function() { Search.loadIndex("searchindex.js"); });
</script> </script>

File diff suppressed because one or more lines are too long