Update lorax 19.7.43 (lorax-composer) Documentation

This commit is contained in:
Brian C. Lane 2021-04-23 14:43:15 -07:00
parent a4173a577b
commit 0773739e95
74 changed files with 2672 additions and 568 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: 50e837e886c9cb44ee8f8828f75d7ded config: 12d527250403177f77175f9f02bc8463
tags: fbb0d17656682115ca4d033fb2f83ba1 tags: fbb0d17656682115ca4d033fb2f83ba1

View File

@ -8,7 +8,7 @@
<head> <head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>composer.cli &mdash; Lorax 19.7.22 documentation</title> <title>composer.cli &mdash; Lorax 19.7.43 documentation</title>
<link rel="stylesheet" href="../../_static/default.css" type="text/css" /> <link rel="stylesheet" href="../../_static/default.css" type="text/css" />
<link rel="stylesheet" href="../../_static/pygments.css" type="text/css" /> <link rel="stylesheet" href="../../_static/pygments.css" type="text/css" />
@ -16,7 +16,7 @@
<script type="text/javascript"> <script type="text/javascript">
var DOCUMENTATION_OPTIONS = { var DOCUMENTATION_OPTIONS = {
URL_ROOT: '../../', URL_ROOT: '../../',
VERSION: '19.7.22', VERSION: '19.7.43',
COLLAPSE_INDEX: false, COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html', FILE_SUFFIX: '.html',
HAS_SOURCE: true HAS_SOURCE: true
@ -25,7 +25,7 @@
<script type="text/javascript" src="../../_static/jquery.js"></script> <script type="text/javascript" src="../../_static/jquery.js"></script>
<script type="text/javascript" src="../../_static/underscore.js"></script> <script type="text/javascript" src="../../_static/underscore.js"></script>
<script type="text/javascript" src="../../_static/doctools.js"></script> <script type="text/javascript" src="../../_static/doctools.js"></script>
<link rel="top" title="Lorax 19.7.22 documentation" href="../../index.html" /> <link rel="top" title="Lorax 19.7.43 documentation" href="../../index.html" />
<link rel="up" title="Module code" href="../index.html" /> <link rel="up" title="Module code" href="../index.html" />
</head> </head>
<body> <body>
@ -38,7 +38,7 @@
<li class="right" > <li class="right" >
<a href="../../py-modindex.html" title="Python Module Index" <a href="../../py-modindex.html" title="Python Module Index"
>modules</a> |</li> >modules</a> |</li>
<li><a href="../../index.html">Lorax 19.7.22 documentation</a> &raquo;</li> <li><a href="../../index.html">Lorax 19.7.43 documentation</a> &raquo;</li>
<li><a href="../index.html" accesskey="U">Module code</a> &raquo;</li> <li><a href="../index.html" accesskey="U">Module code</a> &raquo;</li>
</ul> </ul>
</div> </div>
@ -138,7 +138,7 @@
<li class="right" > <li class="right" >
<a href="../../py-modindex.html" title="Python Module Index" <a href="../../py-modindex.html" title="Python Module Index"
>modules</a> |</li> >modules</a> |</li>
<li><a href="../../index.html">Lorax 19.7.22 documentation</a> &raquo;</li> <li><a href="../../index.html">Lorax 19.7.43 documentation</a> &raquo;</li>
<li><a href="../index.html" >Module code</a> &raquo;</li> <li><a href="../index.html" >Module code</a> &raquo;</li>
</ul> </ul>
</div> </div>

View File

@ -8,7 +8,7 @@
<head> <head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>composer.cli.blueprints &mdash; Lorax 19.7.22 documentation</title> <title>composer.cli.blueprints &mdash; Lorax 19.7.43 documentation</title>
<link rel="stylesheet" href="../../../_static/default.css" type="text/css" /> <link rel="stylesheet" href="../../../_static/default.css" type="text/css" />
<link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" /> <link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" />
@ -16,7 +16,7 @@
<script type="text/javascript"> <script type="text/javascript">
var DOCUMENTATION_OPTIONS = { var DOCUMENTATION_OPTIONS = {
URL_ROOT: '../../../', URL_ROOT: '../../../',
VERSION: '19.7.22', VERSION: '19.7.43',
COLLAPSE_INDEX: false, COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html', FILE_SUFFIX: '.html',
HAS_SOURCE: true HAS_SOURCE: true
@ -25,7 +25,7 @@
<script type="text/javascript" src="../../../_static/jquery.js"></script> <script type="text/javascript" src="../../../_static/jquery.js"></script>
<script type="text/javascript" src="../../../_static/underscore.js"></script> <script type="text/javascript" src="../../../_static/underscore.js"></script>
<script type="text/javascript" src="../../../_static/doctools.js"></script> <script type="text/javascript" src="../../../_static/doctools.js"></script>
<link rel="top" title="Lorax 19.7.22 documentation" href="../../../index.html" /> <link rel="top" title="Lorax 19.7.43 documentation" href="../../../index.html" />
<link rel="up" title="composer.cli" href="../cli.html" /> <link rel="up" title="composer.cli" href="../cli.html" />
</head> </head>
<body> <body>
@ -38,7 +38,7 @@
<li class="right" > <li class="right" >
<a href="../../../py-modindex.html" title="Python Module Index" <a href="../../../py-modindex.html" title="Python Module Index"
>modules</a> |</li> >modules</a> |</li>
<li><a href="../../../index.html">Lorax 19.7.22 documentation</a> &raquo;</li> <li><a href="../../../index.html">Lorax 19.7.43 documentation</a> &raquo;</li>
<li><a href="../../index.html" >Module code</a> &raquo;</li> <li><a href="../../index.html" >Module code</a> &raquo;</li>
<li><a href="../cli.html" accesskey="U">composer.cli</a> &raquo;</li> <li><a href="../cli.html" accesskey="U">composer.cli</a> &raquo;</li>
</ul> </ul>
@ -239,62 +239,129 @@
<span class="k">return</span> <span class="n">rc</span> <span class="k">return</span> <span class="n">rc</span>
<span class="k">for</span> <span class="n">diff</span> <span class="ow">in</span> <span class="n">result</span><span class="p">[</span><span class="s">&quot;diff&quot;</span><span class="p">]:</span> <span class="k">for</span> <span class="n">diff</span> <span class="ow">in</span> <span class="n">result</span><span class="p">[</span><span class="s">&quot;diff&quot;</span><span class="p">]:</span>
<span class="k">print</span><span class="p">(</span><span class="n">prettyDiffEntry</span><span class="p">(</span><span class="n">diff</span><span class="p">))</span> <span class="k">print</span><span class="p">(</span><span class="n">pretty_diff_entry</span><span class="p">(</span><span class="n">diff</span><span class="p">))</span>
<span class="k">return</span> <span class="n">rc</span> <span class="k">return</span> <span class="n">rc</span>
</div> </div>
<div class="viewcode-block" id="prettyDiffEntry"><a class="viewcode-back" href="../../../composer.cli.html#composer.cli.blueprints.prettyDiffEntry">[docs]</a><span class="k">def</span> <span class="nf">prettyDiffEntry</span><span class="p">(</span><span class="n">diff</span><span class="p">):</span> <div class="viewcode-block" id="pretty_dict"><a class="viewcode-back" href="../../../composer.cli.html#composer.cli.blueprints.pretty_dict">[docs]</a><span class="k">def</span> <span class="nf">pretty_dict</span><span class="p">(</span><span class="n">d</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;Return the dict as a human readable single line</span>
<span class="sd"> :param d: key/values</span>
<span class="sd"> :type d: dict</span>
<span class="sd"> :returns: String of the dict&#39;s keys and values</span>
<span class="sd"> :rtype: str</span>
<span class="sd"> key=&quot;str&quot;, key=&quot;str1,str2&quot;, ...</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="n">result</span> <span class="o">=</span> <span class="p">[]</span>
<span class="k">for</span> <span class="n">k</span> <span class="ow">in</span> <span class="nb">sorted</span><span class="p">(</span><span class="n">d</span><span class="o">.</span><span class="n">keys</span><span class="p">()):</span>
<span class="k">if</span> <span class="nb">type</span><span class="p">(</span><span class="n">d</span><span class="p">[</span><span class="n">k</span><span class="p">])</span> <span class="o">==</span> <span class="nb">type</span><span class="p">(</span><span class="s">&quot;&quot;</span><span class="p">):</span>
<span class="n">result</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="s">&#39;</span><span class="si">%s</span><span class="s">=&quot;</span><span class="si">%s</span><span class="s">&quot;&#39;</span> <span class="o">%</span> <span class="p">(</span><span class="n">k</span><span class="p">,</span> <span class="n">d</span><span class="p">[</span><span class="n">k</span><span class="p">]))</span>
<span class="k">elif</span> <span class="nb">type</span><span class="p">(</span><span class="n">d</span><span class="p">[</span><span class="n">k</span><span class="p">])</span> <span class="o">==</span> <span class="nb">type</span><span class="p">([])</span> <span class="ow">and</span> <span class="nb">type</span><span class="p">(</span><span class="n">d</span><span class="p">[</span><span class="n">k</span><span class="p">][</span><span class="mi">0</span><span class="p">])</span> <span class="o">==</span> <span class="nb">type</span><span class="p">(</span><span class="s">&quot;&quot;</span><span class="p">):</span>
<span class="n">result</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="s">&#39;</span><span class="si">%s</span><span class="s">=&quot;</span><span class="si">%s</span><span class="s">&quot;&#39;</span> <span class="o">%</span> <span class="p">(</span><span class="n">k</span><span class="p">,</span> <span class="s">&quot;, &quot;</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="n">d</span><span class="p">[</span><span class="n">k</span><span class="p">])))</span>
<span class="k">elif</span> <span class="nb">type</span><span class="p">(</span><span class="n">d</span><span class="p">[</span><span class="n">k</span><span class="p">])</span> <span class="o">==</span> <span class="nb">type</span><span class="p">([])</span> <span class="ow">and</span> <span class="nb">type</span><span class="p">(</span><span class="n">d</span><span class="p">[</span><span class="n">k</span><span class="p">][</span><span class="mi">0</span><span class="p">])</span> <span class="o">==</span> <span class="nb">type</span><span class="p">({}):</span>
<span class="n">result</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="s">&#39;</span><span class="si">%s</span><span class="s">=&quot;</span><span class="si">%s</span><span class="s">&quot;&#39;</span> <span class="o">%</span> <span class="p">(</span><span class="n">k</span><span class="p">,</span> <span class="n">pretty_dict</span><span class="p">(</span><span class="n">d</span><span class="p">[</span><span class="n">k</span><span class="p">])))</span>
<span class="k">return</span> <span class="s">&quot; &quot;</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="n">result</span><span class="p">)</span>
</div>
<div class="viewcode-block" id="dict_names"><a class="viewcode-back" href="../../../composer.cli.html#composer.cli.blueprints.dict_names">[docs]</a><span class="k">def</span> <span class="nf">dict_names</span><span class="p">(</span><span class="n">lst</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;Return comma-separated list of the dict&#39;s name/user fields</span>
<span class="sd"> :param d: key/values</span>
<span class="sd"> :type d: dict</span>
<span class="sd"> :returns: String of the dict&#39;s keys and values</span>
<span class="sd"> :rtype: str</span>
<span class="sd"> root, norm</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="k">if</span> <span class="s">&quot;user&quot;</span> <span class="ow">in</span> <span class="n">lst</span><span class="p">[</span><span class="mi">0</span><span class="p">]:</span>
<span class="n">field_name</span> <span class="o">=</span> <span class="s">&quot;user&quot;</span>
<span class="k">elif</span> <span class="s">&quot;name&quot;</span> <span class="ow">in</span> <span class="n">lst</span><span class="p">[</span><span class="mi">0</span><span class="p">]:</span>
<span class="n">field_name</span> <span class="o">=</span> <span class="s">&quot;name&quot;</span>
<span class="k">else</span><span class="p">:</span>
<span class="c"># Use first fields in sorted keys</span>
<span class="n">field_name</span> <span class="o">=</span> <span class="nb">sorted</span><span class="p">(</span><span class="n">lst</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span><span class="o">.</span><span class="n">keys</span><span class="p">())[</span><span class="mi">0</span><span class="p">]</span>
<span class="k">return</span> <span class="s">&quot;, &quot;</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="n">d</span><span class="p">[</span><span class="n">field_name</span><span class="p">]</span> <span class="k">for</span> <span class="n">d</span> <span class="ow">in</span> <span class="n">lst</span><span class="p">)</span>
</div>
<div class="viewcode-block" id="pretty_diff_entry"><a class="viewcode-back" href="../../../composer.cli.html#composer.cli.blueprints.pretty_diff_entry">[docs]</a><span class="k">def</span> <span class="nf">pretty_diff_entry</span><span class="p">(</span><span class="n">diff</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;Generate nice diff entry string.</span> <span class="sd">&quot;&quot;&quot;Generate nice diff entry string.</span>
<span class="sd"> :param diff: Difference entry dict</span> <span class="sd"> :param diff: Difference entry dict</span>
<span class="sd"> :type diff: dict</span> <span class="sd"> :type diff: dict</span>
<span class="sd"> :returns: Nice string</span> <span class="sd"> :returns: Nice string</span>
<span class="sd"> &quot;&quot;&quot;</span> <span class="sd"> &quot;&quot;&quot;</span>
<span class="k">def</span> <span class="nf">change</span><span class="p">(</span><span class="n">diff</span><span class="p">):</span>
<span class="k">if</span> <span class="n">diff</span><span class="p">[</span><span class="s">&quot;old&quot;</span><span class="p">]</span> <span class="ow">and</span> <span class="n">diff</span><span class="p">[</span><span class="s">&quot;new&quot;</span><span class="p">]:</span> <span class="k">if</span> <span class="n">diff</span><span class="p">[</span><span class="s">&quot;old&quot;</span><span class="p">]</span> <span class="ow">and</span> <span class="n">diff</span><span class="p">[</span><span class="s">&quot;new&quot;</span><span class="p">]:</span>
<span class="k">return</span> <span class="s">&quot;Changed&quot;</span> <span class="n">change</span> <span class="o">=</span> <span class="s">&quot;Changed&quot;</span>
<span class="k">elif</span> <span class="n">diff</span><span class="p">[</span><span class="s">&quot;new&quot;</span><span class="p">]</span> <span class="ow">and</span> <span class="ow">not</span> <span class="n">diff</span><span class="p">[</span><span class="s">&quot;old&quot;</span><span class="p">]:</span> <span class="k">elif</span> <span class="n">diff</span><span class="p">[</span><span class="s">&quot;new&quot;</span><span class="p">]</span> <span class="ow">and</span> <span class="ow">not</span> <span class="n">diff</span><span class="p">[</span><span class="s">&quot;old&quot;</span><span class="p">]:</span>
<span class="k">return</span> <span class="s">&quot;Added&quot;</span> <span class="n">change</span> <span class="o">=</span> <span class="s">&quot;Added&quot;</span>
<span class="k">elif</span> <span class="n">diff</span><span class="p">[</span><span class="s">&quot;old&quot;</span><span class="p">]</span> <span class="ow">and</span> <span class="ow">not</span> <span class="n">diff</span><span class="p">[</span><span class="s">&quot;new&quot;</span><span class="p">]:</span> <span class="k">elif</span> <span class="n">diff</span><span class="p">[</span><span class="s">&quot;old&quot;</span><span class="p">]</span> <span class="ow">and</span> <span class="ow">not</span> <span class="n">diff</span><span class="p">[</span><span class="s">&quot;new&quot;</span><span class="p">]:</span>
<span class="k">return</span> <span class="s">&quot;Removed&quot;</span> <span class="n">change</span> <span class="o">=</span> <span class="s">&quot;Removed&quot;</span>
<span class="k">else</span><span class="p">:</span> <span class="k">else</span><span class="p">:</span>
<span class="k">return</span> <span class="s">&quot;Unknown&quot;</span> <span class="n">change</span> <span class="o">=</span> <span class="s">&quot;Unknown&quot;</span>
<span class="k">def</span> <span class="nf">name</span><span class="p">(</span><span class="n">diff</span><span class="p">):</span>
<span class="k">if</span> <span class="n">diff</span><span class="p">[</span><span class="s">&quot;old&quot;</span><span class="p">]:</span> <span class="k">if</span> <span class="n">diff</span><span class="p">[</span><span class="s">&quot;old&quot;</span><span class="p">]:</span>
<span class="k">return</span> <span class="n">diff</span><span class="p">[</span><span class="s">&quot;old&quot;</span><span class="p">]</span><span class="o">.</span><span class="n">keys</span><span class="p">()[</span><span class="mi">0</span><span class="p">]</span> <span class="n">name</span> <span class="o">=</span> <span class="nb">list</span><span class="p">(</span><span class="n">diff</span><span class="p">[</span><span class="s">&quot;old&quot;</span><span class="p">]</span><span class="o">.</span><span class="n">keys</span><span class="p">())[</span><span class="mi">0</span><span class="p">]</span>
<span class="k">elif</span> <span class="n">diff</span><span class="p">[</span><span class="s">&quot;new&quot;</span><span class="p">]:</span> <span class="k">elif</span> <span class="n">diff</span><span class="p">[</span><span class="s">&quot;new&quot;</span><span class="p">]:</span>
<span class="k">return</span> <span class="n">diff</span><span class="p">[</span><span class="s">&quot;new&quot;</span><span class="p">]</span><span class="o">.</span><span class="n">keys</span><span class="p">()[</span><span class="mi">0</span><span class="p">]</span> <span class="n">name</span> <span class="o">=</span> <span class="nb">list</span><span class="p">(</span><span class="n">diff</span><span class="p">[</span><span class="s">&quot;new&quot;</span><span class="p">]</span><span class="o">.</span><span class="n">keys</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="k">else</span><span class="p">:</span>
<span class="k">return</span> <span class="s">&quot;Unknown&quot;</span> <span class="n">name</span> <span class="o">=</span> <span class="s">&quot;Unknown&quot;</span>
<span class="k">def</span> <span class="nf">details</span><span class="p">(</span><span class="n">diff</span><span class="p">):</span> <span class="k">def</span> <span class="nf">details</span><span class="p">(</span><span class="n">diff</span><span class="p">):</span>
<span class="k">if</span> <span class="n">change</span><span class="p">(</span><span class="n">diff</span><span class="p">)</span> <span class="o">==</span> <span class="s">&quot;Changed&quot;</span><span class="p">:</span> <span class="k">if</span> <span class="n">change</span> <span class="o">==</span> <span class="s">&quot;Changed&quot;</span><span class="p">:</span>
<span class="k">if</span> <span class="n">name</span><span class="p">(</span><span class="n">diff</span><span class="p">)</span> <span class="o">==</span> <span class="s">&quot;Description&quot;</span><span class="p">:</span> <span class="k">if</span> <span class="nb">type</span><span class="p">(</span><span class="n">diff</span><span class="p">[</span><span class="s">&quot;old&quot;</span><span class="p">][</span><span class="n">name</span><span class="p">])</span> <span class="o">==</span> <span class="nb">type</span><span class="p">(</span><span class="s">&quot;&quot;</span><span class="p">):</span>
<span class="k">return</span> <span class="s">&#39;&quot;</span><span class="si">%s</span><span class="s">&quot; -&gt; &quot;</span><span class="si">%s</span><span class="s">&quot;&#39;</span> <span class="o">%</span> <span class="p">(</span><span class="n">diff</span><span class="p">[</span><span class="s">&quot;old&quot;</span><span class="p">][</span><span class="n">name</span><span class="p">(</span><span class="n">diff</span><span class="p">)],</span> <span class="n">diff</span><span class="p">[</span><span class="s">&quot;new&quot;</span><span class="p">][</span><span class="n">name</span><span class="p">(</span><span class="n">diff</span><span class="p">)])</span> <span class="k">if</span> <span class="n">name</span> <span class="o">==</span> <span class="s">&quot;Description&quot;</span> <span class="ow">or</span> <span class="s">&quot; &quot;</span> <span class="ow">in</span> <span class="n">diff</span><span class="p">[</span><span class="s">&quot;old&quot;</span><span class="p">][</span><span class="n">name</span><span class="p">]:</span>
<span class="k">elif</span> <span class="n">name</span><span class="p">(</span><span class="n">diff</span><span class="p">)</span> <span class="o">==</span> <span class="s">&quot;Version&quot;</span><span class="p">:</span> <span class="k">return</span> <span class="s">&#39;&quot;</span><span class="si">%s</span><span class="s">&quot; -&gt; &quot;</span><span class="si">%s</span><span class="s">&quot;&#39;</span> <span class="o">%</span> <span class="p">(</span><span class="n">diff</span><span class="p">[</span><span class="s">&quot;old&quot;</span><span class="p">][</span><span class="n">name</span><span class="p">],</span> <span class="n">diff</span><span class="p">[</span><span class="s">&quot;new&quot;</span><span class="p">][</span><span class="n">name</span><span class="p">])</span>
<span class="k">return</span> <span class="s">&quot;</span><span class="si">%s</span><span class="s"> -&gt; </span><span class="si">%s</span><span class="s">&quot;</span> <span class="o">%</span> <span class="p">(</span><span class="n">diff</span><span class="p">[</span><span class="s">&quot;old&quot;</span><span class="p">][</span><span class="n">name</span><span class="p">(</span><span class="n">diff</span><span class="p">)],</span> <span class="n">diff</span><span class="p">[</span><span class="s">&quot;new&quot;</span><span class="p">][</span><span class="n">name</span><span class="p">(</span><span class="n">diff</span><span class="p">)])</span> <span class="k">else</span><span class="p">:</span>
<span class="k">elif</span> <span class="n">name</span><span class="p">(</span><span class="n">diff</span><span class="p">)</span> <span class="ow">in</span> <span class="p">[</span><span class="s">&quot;Module&quot;</span><span class="p">,</span> <span class="s">&quot;Package&quot;</span><span class="p">]:</span> <span class="k">return</span> <span class="s">&quot;</span><span class="si">%s</span><span class="s"> -&gt; </span><span class="si">%s</span><span class="s">&quot;</span> <span class="o">%</span> <span class="p">(</span><span class="n">diff</span><span class="p">[</span><span class="s">&quot;old&quot;</span><span class="p">][</span><span class="n">name</span><span class="p">],</span> <span class="n">diff</span><span class="p">[</span><span class="s">&quot;new&quot;</span><span class="p">][</span><span class="n">name</span><span class="p">])</span>
<span class="k">return</span> <span class="s">&quot;</span><span class="si">%s</span><span class="s"> </span><span class="si">%s</span><span class="s"> -&gt; </span><span class="si">%s</span><span class="s">&quot;</span> <span class="o">%</span> <span class="p">(</span><span class="n">diff</span><span class="p">[</span><span class="s">&quot;old&quot;</span><span class="p">][</span><span class="n">name</span><span class="p">(</span><span class="n">diff</span><span class="p">)][</span><span class="s">&quot;name&quot;</span><span class="p">],</span> <span class="n">diff</span><span class="p">[</span><span class="s">&quot;old&quot;</span><span class="p">][</span><span class="n">name</span><span class="p">(</span><span class="n">diff</span><span class="p">)][</span><span class="s">&quot;version&quot;</span><span class="p">],</span> <span class="k">elif</span> <span class="n">name</span> <span class="ow">in</span> <span class="p">[</span><span class="s">&quot;Module&quot;</span><span class="p">,</span> <span class="s">&quot;Package&quot;</span><span class="p">]:</span>
<span class="n">diff</span><span class="p">[</span><span class="s">&quot;new&quot;</span><span class="p">][</span><span class="n">name</span><span class="p">(</span><span class="n">diff</span><span class="p">)][</span><span class="s">&quot;version&quot;</span><span class="p">])</span> <span class="k">return</span> <span class="s">&quot;</span><span class="si">%s</span><span class="s"> </span><span class="si">%s</span><span class="s"> -&gt; </span><span class="si">%s</span><span class="s">&quot;</span> <span class="o">%</span> <span class="p">(</span><span class="n">diff</span><span class="p">[</span><span class="s">&quot;old&quot;</span><span class="p">][</span><span class="n">name</span><span class="p">][</span><span class="s">&quot;name&quot;</span><span class="p">],</span> <span class="n">diff</span><span class="p">[</span><span class="s">&quot;old&quot;</span><span class="p">][</span><span class="n">name</span><span class="p">][</span><span class="s">&quot;version&quot;</span><span class="p">],</span>
<span class="n">diff</span><span class="p">[</span><span class="s">&quot;new&quot;</span><span class="p">][</span><span class="n">name</span><span class="p">][</span><span class="s">&quot;version&quot;</span><span class="p">])</span>
<span class="k">elif</span> <span class="nb">type</span><span class="p">(</span><span class="n">diff</span><span class="p">[</span><span class="s">&quot;old&quot;</span><span class="p">][</span><span class="n">name</span><span class="p">])</span> <span class="o">==</span> <span class="nb">type</span><span class="p">([]):</span>
<span class="k">if</span> <span class="nb">type</span><span class="p">(</span><span class="n">diff</span><span class="p">[</span><span class="s">&quot;old&quot;</span><span class="p">][</span><span class="n">name</span><span class="p">][</span><span class="mi">0</span><span class="p">])</span> <span class="o">==</span> <span class="nb">type</span><span class="p">(</span><span class="s">&quot;&quot;</span><span class="p">):</span>
<span class="k">return</span> <span class="s">&quot;</span><span class="si">%s</span><span class="s"> -&gt; </span><span class="si">%s</span><span class="s">&quot;</span> <span class="o">%</span> <span class="p">(</span><span class="s">&quot; &quot;</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="n">diff</span><span class="p">[</span><span class="s">&quot;old&quot;</span><span class="p">][</span><span class="n">name</span><span class="p">]),</span> <span class="s">&quot; &quot;</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="n">diff</span><span class="p">[</span><span class="s">&quot;new&quot;</span><span class="p">][</span><span class="n">name</span><span class="p">]))</span>
<span class="k">elif</span> <span class="nb">type</span><span class="p">(</span><span class="n">diff</span><span class="p">[</span><span class="s">&quot;old&quot;</span><span class="p">][</span><span class="n">name</span><span class="p">][</span><span class="mi">0</span><span class="p">])</span> <span class="o">==</span> <span class="nb">type</span><span class="p">({}):</span>
<span class="c"># Lists of dicts are too long to display in detail, just show their names</span>
<span class="k">return</span> <span class="s">&quot;</span><span class="si">%s</span><span class="s"> -&gt; </span><span class="si">%s</span><span class="s">&quot;</span> <span class="o">%</span> <span class="p">(</span><span class="n">dict_names</span><span class="p">(</span><span class="n">diff</span><span class="p">[</span><span class="s">&quot;old&quot;</span><span class="p">][</span><span class="n">name</span><span class="p">]),</span> <span class="n">dict_names</span><span class="p">(</span><span class="n">diff</span><span class="p">[</span><span class="s">&quot;new&quot;</span><span class="p">][</span><span class="n">name</span><span class="p">]))</span>
<span class="k">elif</span> <span class="nb">type</span><span class="p">(</span><span class="n">diff</span><span class="p">[</span><span class="s">&quot;old&quot;</span><span class="p">][</span><span class="n">name</span><span class="p">])</span> <span class="o">==</span> <span class="nb">type</span><span class="p">({}):</span>
<span class="k">return</span> <span class="s">&quot;</span><span class="si">%s</span><span class="s"> -&gt; </span><span class="si">%s</span><span class="s">&quot;</span> <span class="o">%</span> <span class="p">(</span><span class="n">pretty_dict</span><span class="p">(</span><span class="n">diff</span><span class="p">[</span><span class="s">&quot;old&quot;</span><span class="p">][</span><span class="n">name</span><span class="p">]),</span> <span class="n">pretty_dict</span><span class="p">(</span><span class="n">diff</span><span class="p">[</span><span class="s">&quot;new&quot;</span><span class="p">][</span><span class="n">name</span><span class="p">]))</span>
<span class="k">else</span><span class="p">:</span> <span class="k">else</span><span class="p">:</span>
<span class="k">return</span> <span class="s">&quot;Unknown&quot;</span> <span class="k">return</span> <span class="s">&quot;Unknown&quot;</span>
<span class="k">elif</span> <span class="n">change</span><span class="p">(</span><span class="n">diff</span><span class="p">)</span> <span class="o">==</span> <span class="s">&quot;Added&quot;</span><span class="p">:</span> <span class="k">elif</span> <span class="n">change</span> <span class="o">==</span> <span class="s">&quot;Added&quot;</span><span class="p">:</span>
<span class="k">if</span> <span class="n">name</span><span class="p">(</span><span class="n">diff</span><span class="p">)</span> <span class="ow">in</span> <span class="p">[</span><span class="s">&quot;Module&quot;</span><span class="p">,</span> <span class="s">&quot;Package&quot;</span><span class="p">]:</span> <span class="k">if</span> <span class="n">name</span> <span class="ow">in</span> <span class="p">[</span><span class="s">&quot;Module&quot;</span><span class="p">,</span> <span class="s">&quot;Package&quot;</span><span class="p">]:</span>
<span class="k">return</span> <span class="s">&quot;</span><span class="si">%s</span><span class="s"> </span><span class="si">%s</span><span class="s">&quot;</span> <span class="o">%</span> <span class="p">(</span><span class="n">diff</span><span class="p">[</span><span class="s">&quot;new&quot;</span><span class="p">][</span><span class="n">name</span><span class="p">(</span><span class="n">diff</span><span class="p">)][</span><span class="s">&quot;name&quot;</span><span class="p">],</span> <span class="n">diff</span><span class="p">[</span><span class="s">&quot;new&quot;</span><span class="p">][</span><span class="n">name</span><span class="p">(</span><span class="n">diff</span><span class="p">)][</span><span class="s">&quot;version&quot;</span><span class="p">])</span> <span class="k">return</span> <span class="s">&quot;</span><span class="si">%s</span><span class="s"> </span><span class="si">%s</span><span class="s">&quot;</span> <span class="o">%</span> <span class="p">(</span><span class="n">diff</span><span class="p">[</span><span class="s">&quot;new&quot;</span><span class="p">][</span><span class="n">name</span><span class="p">][</span><span class="s">&quot;name&quot;</span><span class="p">],</span> <span class="n">diff</span><span class="p">[</span><span class="s">&quot;new&quot;</span><span class="p">][</span><span class="n">name</span><span class="p">][</span><span class="s">&quot;version&quot;</span><span class="p">])</span>
<span class="k">elif</span> <span class="n">name</span><span class="p">(</span><span class="n">diff</span><span class="p">)</span> <span class="ow">in</span> <span class="p">[</span><span class="s">&quot;Group&quot;</span><span class="p">]:</span> <span class="k">elif</span> <span class="n">name</span> <span class="ow">in</span> <span class="p">[</span><span class="s">&quot;Group&quot;</span><span class="p">]:</span>
<span class="k">return</span> <span class="n">diff</span><span class="p">[</span><span class="s">&quot;new&quot;</span><span class="p">][</span><span class="n">name</span><span class="p">(</span><span class="n">diff</span><span class="p">)][</span><span class="s">&quot;name&quot;</span><span class="p">]</span> <span class="k">return</span> <span class="n">diff</span><span class="p">[</span><span class="s">&quot;new&quot;</span><span class="p">][</span><span class="n">name</span><span class="p">][</span><span class="s">&quot;name&quot;</span><span class="p">]</span>
<span class="k">elif</span> <span class="nb">type</span><span class="p">(</span><span class="n">diff</span><span class="p">[</span><span class="s">&quot;new&quot;</span><span class="p">][</span><span class="n">name</span><span class="p">])</span> <span class="o">==</span> <span class="nb">type</span><span class="p">(</span><span class="s">&quot;&quot;</span><span class="p">):</span>
<span class="k">return</span> <span class="n">diff</span><span class="p">[</span><span class="s">&quot;new&quot;</span><span class="p">][</span><span class="n">name</span><span class="p">]</span>
<span class="k">elif</span> <span class="nb">type</span><span class="p">(</span><span class="n">diff</span><span class="p">[</span><span class="s">&quot;new&quot;</span><span class="p">][</span><span class="n">name</span><span class="p">])</span> <span class="o">==</span> <span class="nb">type</span><span class="p">([]):</span>
<span class="k">if</span> <span class="nb">type</span><span class="p">(</span><span class="n">diff</span><span class="p">[</span><span class="s">&quot;new&quot;</span><span class="p">][</span><span class="n">name</span><span class="p">][</span><span class="mi">0</span><span class="p">])</span> <span class="o">==</span> <span class="nb">type</span><span class="p">(</span><span class="s">&quot;&quot;</span><span class="p">):</span>
<span class="k">return</span> <span class="s">&quot; &quot;</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="n">diff</span><span class="p">[</span><span class="s">&quot;new&quot;</span><span class="p">][</span><span class="n">name</span><span class="p">])</span>
<span class="k">elif</span> <span class="nb">type</span><span class="p">(</span><span class="n">diff</span><span class="p">[</span><span class="s">&quot;new&quot;</span><span class="p">][</span><span class="n">name</span><span class="p">][</span><span class="mi">0</span><span class="p">])</span> <span class="o">==</span> <span class="nb">type</span><span class="p">({}):</span>
<span class="c"># Lists of dicts are too long to display in detail, just show their names</span>
<span class="k">return</span> <span class="n">dict_names</span><span class="p">(</span><span class="n">diff</span><span class="p">[</span><span class="s">&quot;new&quot;</span><span class="p">][</span><span class="n">name</span><span class="p">])</span>
<span class="k">elif</span> <span class="nb">type</span><span class="p">(</span><span class="n">diff</span><span class="p">[</span><span class="s">&quot;new&quot;</span><span class="p">][</span><span class="n">name</span><span class="p">])</span> <span class="o">==</span> <span class="nb">type</span><span class="p">({}):</span>
<span class="k">return</span> <span class="n">pretty_dict</span><span class="p">(</span><span class="n">diff</span><span class="p">[</span><span class="s">&quot;new&quot;</span><span class="p">][</span><span class="n">name</span><span class="p">])</span>
<span class="k">else</span><span class="p">:</span> <span class="k">else</span><span class="p">:</span>
<span class="k">return</span> <span class="s">&quot; &quot;</span><span class="o">.</span><span class="n">join</span><span class="p">([</span><span class="n">diff</span><span class="p">[</span><span class="s">&quot;new&quot;</span><span class="p">][</span><span class="n">k</span><span class="p">]</span> <span class="k">for</span> <span class="n">k</span> <span class="ow">in</span> <span class="n">diff</span><span class="p">[</span><span class="s">&quot;new&quot;</span><span class="p">]])</span> <span class="k">return</span> <span class="s">&quot;unknown/todo: </span><span class="si">%s</span><span class="s">&quot;</span> <span class="o">%</span> <span class="nb">type</span><span class="p">(</span><span class="n">diff</span><span class="p">[</span><span class="s">&quot;new&quot;</span><span class="p">][</span><span class="n">name</span><span class="p">])</span>
<span class="k">elif</span> <span class="n">change</span><span class="p">(</span><span class="n">diff</span><span class="p">)</span> <span class="o">==</span> <span class="s">&quot;Removed&quot;</span><span class="p">:</span> <span class="k">elif</span> <span class="n">change</span> <span class="o">==</span> <span class="s">&quot;Removed&quot;</span><span class="p">:</span>
<span class="k">if</span> <span class="n">name</span><span class="p">(</span><span class="n">diff</span><span class="p">)</span> <span class="ow">in</span> <span class="p">[</span><span class="s">&quot;Module&quot;</span><span class="p">,</span> <span class="s">&quot;Package&quot;</span><span class="p">]:</span> <span class="k">if</span> <span class="n">name</span> <span class="ow">in</span> <span class="p">[</span><span class="s">&quot;Module&quot;</span><span class="p">,</span> <span class="s">&quot;Package&quot;</span><span class="p">]:</span>
<span class="k">return</span> <span class="s">&quot;</span><span class="si">%s</span><span class="s"> </span><span class="si">%s</span><span class="s">&quot;</span> <span class="o">%</span> <span class="p">(</span><span class="n">diff</span><span class="p">[</span><span class="s">&quot;old&quot;</span><span class="p">][</span><span class="n">name</span><span class="p">(</span><span class="n">diff</span><span class="p">)][</span><span class="s">&quot;name&quot;</span><span class="p">],</span> <span class="n">diff</span><span class="p">[</span><span class="s">&quot;old&quot;</span><span class="p">][</span><span class="n">name</span><span class="p">(</span><span class="n">diff</span><span class="p">)][</span><span class="s">&quot;version&quot;</span><span class="p">])</span> <span class="k">return</span> <span class="s">&quot;</span><span class="si">%s</span><span class="s"> </span><span class="si">%s</span><span class="s">&quot;</span> <span class="o">%</span> <span class="p">(</span><span class="n">diff</span><span class="p">[</span><span class="s">&quot;old&quot;</span><span class="p">][</span><span class="n">name</span><span class="p">][</span><span class="s">&quot;name&quot;</span><span class="p">],</span> <span class="n">diff</span><span class="p">[</span><span class="s">&quot;old&quot;</span><span class="p">][</span><span class="n">name</span><span class="p">][</span><span class="s">&quot;version&quot;</span><span class="p">])</span>
<span class="k">elif</span> <span class="n">name</span><span class="p">(</span><span class="n">diff</span><span class="p">)</span> <span class="ow">in</span> <span class="p">[</span><span class="s">&quot;Group&quot;</span><span class="p">]:</span> <span class="k">elif</span> <span class="n">name</span> <span class="ow">in</span> <span class="p">[</span><span class="s">&quot;Group&quot;</span><span class="p">]:</span>
<span class="k">return</span> <span class="n">diff</span><span class="p">[</span><span class="s">&quot;old&quot;</span><span class="p">][</span><span class="n">name</span><span class="p">(</span><span class="n">diff</span><span class="p">)][</span><span class="s">&quot;name&quot;</span><span class="p">]</span> <span class="k">return</span> <span class="n">diff</span><span class="p">[</span><span class="s">&quot;old&quot;</span><span class="p">][</span><span class="n">name</span><span class="p">][</span><span class="s">&quot;name&quot;</span><span class="p">]</span>
<span class="k">elif</span> <span class="nb">type</span><span class="p">(</span><span class="n">diff</span><span class="p">[</span><span class="s">&quot;old&quot;</span><span class="p">][</span><span class="n">name</span><span class="p">])</span> <span class="o">==</span> <span class="nb">type</span><span class="p">(</span><span class="s">&quot;&quot;</span><span class="p">):</span>
<span class="k">return</span> <span class="n">diff</span><span class="p">[</span><span class="s">&quot;old&quot;</span><span class="p">][</span><span class="n">name</span><span class="p">]</span>
<span class="k">elif</span> <span class="nb">type</span><span class="p">(</span><span class="n">diff</span><span class="p">[</span><span class="s">&quot;old&quot;</span><span class="p">][</span><span class="n">name</span><span class="p">])</span> <span class="o">==</span> <span class="nb">type</span><span class="p">([]):</span>
<span class="k">if</span> <span class="nb">type</span><span class="p">(</span><span class="n">diff</span><span class="p">[</span><span class="s">&quot;old&quot;</span><span class="p">][</span><span class="n">name</span><span class="p">][</span><span class="mi">0</span><span class="p">])</span> <span class="o">==</span> <span class="nb">type</span><span class="p">(</span><span class="s">&quot;&quot;</span><span class="p">):</span>
<span class="k">return</span> <span class="s">&quot; &quot;</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="n">diff</span><span class="p">[</span><span class="s">&quot;old&quot;</span><span class="p">][</span><span class="n">name</span><span class="p">])</span>
<span class="k">elif</span> <span class="nb">type</span><span class="p">(</span><span class="n">diff</span><span class="p">[</span><span class="s">&quot;old&quot;</span><span class="p">][</span><span class="n">name</span><span class="p">][</span><span class="mi">0</span><span class="p">])</span> <span class="o">==</span> <span class="nb">type</span><span class="p">({}):</span>
<span class="c"># Lists of dicts are too long to display in detail, just show their names</span>
<span class="k">return</span> <span class="n">dict_names</span><span class="p">(</span><span class="n">diff</span><span class="p">[</span><span class="s">&quot;old&quot;</span><span class="p">][</span><span class="n">name</span><span class="p">])</span>
<span class="k">elif</span> <span class="nb">type</span><span class="p">(</span><span class="n">diff</span><span class="p">[</span><span class="s">&quot;old&quot;</span><span class="p">][</span><span class="n">name</span><span class="p">])</span> <span class="o">==</span> <span class="nb">type</span><span class="p">({}):</span>
<span class="k">return</span> <span class="n">pretty_dict</span><span class="p">(</span><span class="n">diff</span><span class="p">[</span><span class="s">&quot;old&quot;</span><span class="p">][</span><span class="n">name</span><span class="p">])</span>
<span class="k">else</span><span class="p">:</span> <span class="k">else</span><span class="p">:</span>
<span class="k">return</span> <span class="s">&quot; &quot;</span><span class="o">.</span><span class="n">join</span><span class="p">([</span><span class="n">diff</span><span class="p">[</span><span class="s">&quot;old&quot;</span><span class="p">][</span><span class="n">k</span><span class="p">]</span> <span class="k">for</span> <span class="n">k</span> <span class="ow">in</span> <span class="n">diff</span><span class="p">[</span><span class="s">&quot;old&quot;</span><span class="p">]])</span> <span class="k">return</span> <span class="s">&quot;unknown/todo: </span><span class="si">%s</span><span class="s">&quot;</span> <span class="o">%</span> <span class="nb">type</span><span class="p">(</span><span class="n">diff</span><span class="p">[</span><span class="s">&quot;new&quot;</span><span class="p">][</span><span class="n">name</span><span class="p">])</span>
<span class="k">return</span> <span class="n">change</span><span class="p">(</span><span class="n">diff</span><span class="p">)</span> <span class="o">+</span> <span class="s">&quot; &quot;</span> <span class="o">+</span> <span class="n">name</span><span class="p">(</span><span class="n">diff</span><span class="p">)</span> <span class="o">+</span> <span class="s">&quot; &quot;</span> <span class="o">+</span> <span class="n">details</span><span class="p">(</span><span class="n">diff</span><span class="p">)</span> <span class="k">return</span> <span class="n">change</span> <span class="o">+</span> <span class="s">&quot; &quot;</span> <span class="o">+</span> <span class="n">name</span> <span class="o">+</span> <span class="s">&quot; &quot;</span> <span class="o">+</span> <span class="n">details</span><span class="p">(</span><span class="n">diff</span><span class="p">)</span>
</div> </div>
<div class="viewcode-block" id="blueprints_save"><a class="viewcode-back" href="../../../composer.cli.html#composer.cli.blueprints.blueprints_save">[docs]</a><span class="k">def</span> <span class="nf">blueprints_save</span><span class="p">(</span><span class="n">socket_path</span><span class="p">,</span> <span class="n">api_version</span><span class="p">,</span> <span class="n">args</span><span class="p">,</span> <span class="n">show_json</span><span class="o">=</span><span class="bp">False</span><span class="p">):</span> <div class="viewcode-block" id="blueprints_save"><a class="viewcode-back" href="../../../composer.cli.html#composer.cli.blueprints.blueprints_save">[docs]</a><span class="k">def</span> <span class="nf">blueprints_save</span><span class="p">(</span><span class="n">socket_path</span><span class="p">,</span> <span class="n">api_version</span><span class="p">,</span> <span class="n">args</span><span class="p">,</span> <span class="n">show_json</span><span class="o">=</span><span class="bp">False</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;Save the blueprint to a TOML file</span> <span class="sd">&quot;&quot;&quot;Save the blueprint to a TOML file</span>
@ -594,7 +661,7 @@
<li class="right" > <li class="right" >
<a href="../../../py-modindex.html" title="Python Module Index" <a href="../../../py-modindex.html" title="Python Module Index"
>modules</a> |</li> >modules</a> |</li>
<li><a href="../../../index.html">Lorax 19.7.22 documentation</a> &raquo;</li> <li><a href="../../../index.html">Lorax 19.7.43 documentation</a> &raquo;</li>
<li><a href="../../index.html" >Module code</a> &raquo;</li> <li><a href="../../index.html" >Module code</a> &raquo;</li>
<li><a href="../cli.html" >composer.cli</a> &raquo;</li> <li><a href="../cli.html" >composer.cli</a> &raquo;</li>
</ul> </ul>

View File

@ -8,7 +8,7 @@
<head> <head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>composer.cli.compose &mdash; Lorax 19.7.22 documentation</title> <title>composer.cli.compose &mdash; Lorax 19.7.43 documentation</title>
<link rel="stylesheet" href="../../../_static/default.css" type="text/css" /> <link rel="stylesheet" href="../../../_static/default.css" type="text/css" />
<link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" /> <link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" />
@ -16,7 +16,7 @@
<script type="text/javascript"> <script type="text/javascript">
var DOCUMENTATION_OPTIONS = { var DOCUMENTATION_OPTIONS = {
URL_ROOT: '../../../', URL_ROOT: '../../../',
VERSION: '19.7.22', VERSION: '19.7.43',
COLLAPSE_INDEX: false, COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html', FILE_SUFFIX: '.html',
HAS_SOURCE: true HAS_SOURCE: true
@ -25,7 +25,7 @@
<script type="text/javascript" src="../../../_static/jquery.js"></script> <script type="text/javascript" src="../../../_static/jquery.js"></script>
<script type="text/javascript" src="../../../_static/underscore.js"></script> <script type="text/javascript" src="../../../_static/underscore.js"></script>
<script type="text/javascript" src="../../../_static/doctools.js"></script> <script type="text/javascript" src="../../../_static/doctools.js"></script>
<link rel="top" title="Lorax 19.7.22 documentation" href="../../../index.html" /> <link rel="top" title="Lorax 19.7.43 documentation" href="../../../index.html" />
<link rel="up" title="composer.cli" href="../cli.html" /> <link rel="up" title="composer.cli" href="../cli.html" />
</head> </head>
<body> <body>
@ -38,7 +38,7 @@
<li class="right" > <li class="right" >
<a href="../../../py-modindex.html" title="Python Module Index" <a href="../../../py-modindex.html" title="Python Module Index"
>modules</a> |</li> >modules</a> |</li>
<li><a href="../../../index.html">Lorax 19.7.22 documentation</a> &raquo;</li> <li><a href="../../../index.html">Lorax 19.7.43 documentation</a> &raquo;</li>
<li><a href="../../index.html" >Module code</a> &raquo;</li> <li><a href="../../index.html" >Module code</a> &raquo;</li>
<li><a href="../cli.html" accesskey="U">composer.cli</a> &raquo;</li> <li><a href="../cli.html" accesskey="U">composer.cli</a> &raquo;</li>
</ul> </ul>
@ -596,7 +596,7 @@
<li class="right" > <li class="right" >
<a href="../../../py-modindex.html" title="Python Module Index" <a href="../../../py-modindex.html" title="Python Module Index"
>modules</a> |</li> >modules</a> |</li>
<li><a href="../../../index.html">Lorax 19.7.22 documentation</a> &raquo;</li> <li><a href="../../../index.html">Lorax 19.7.43 documentation</a> &raquo;</li>
<li><a href="../../index.html" >Module code</a> &raquo;</li> <li><a href="../../index.html" >Module code</a> &raquo;</li>
<li><a href="../cli.html" >composer.cli</a> &raquo;</li> <li><a href="../cli.html" >composer.cli</a> &raquo;</li>
</ul> </ul>

View File

@ -8,7 +8,7 @@
<head> <head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>composer.cli.modules &mdash; Lorax 19.7.22 documentation</title> <title>composer.cli.modules &mdash; Lorax 19.7.43 documentation</title>
<link rel="stylesheet" href="../../../_static/default.css" type="text/css" /> <link rel="stylesheet" href="../../../_static/default.css" type="text/css" />
<link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" /> <link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" />
@ -16,7 +16,7 @@
<script type="text/javascript"> <script type="text/javascript">
var DOCUMENTATION_OPTIONS = { var DOCUMENTATION_OPTIONS = {
URL_ROOT: '../../../', URL_ROOT: '../../../',
VERSION: '19.7.22', VERSION: '19.7.43',
COLLAPSE_INDEX: false, COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html', FILE_SUFFIX: '.html',
HAS_SOURCE: true HAS_SOURCE: true
@ -25,7 +25,7 @@
<script type="text/javascript" src="../../../_static/jquery.js"></script> <script type="text/javascript" src="../../../_static/jquery.js"></script>
<script type="text/javascript" src="../../../_static/underscore.js"></script> <script type="text/javascript" src="../../../_static/underscore.js"></script>
<script type="text/javascript" src="../../../_static/doctools.js"></script> <script type="text/javascript" src="../../../_static/doctools.js"></script>
<link rel="top" title="Lorax 19.7.22 documentation" href="../../../index.html" /> <link rel="top" title="Lorax 19.7.43 documentation" href="../../../index.html" />
<link rel="up" title="composer.cli" href="../cli.html" /> <link rel="up" title="composer.cli" href="../cli.html" />
</head> </head>
<body> <body>
@ -38,7 +38,7 @@
<li class="right" > <li class="right" >
<a href="../../../py-modindex.html" title="Python Module Index" <a href="../../../py-modindex.html" title="Python Module Index"
>modules</a> |</li> >modules</a> |</li>
<li><a href="../../../index.html">Lorax 19.7.22 documentation</a> &raquo;</li> <li><a href="../../../index.html">Lorax 19.7.43 documentation</a> &raquo;</li>
<li><a href="../../index.html" >Module code</a> &raquo;</li> <li><a href="../../index.html" >Module code</a> &raquo;</li>
<li><a href="../cli.html" accesskey="U">composer.cli</a> &raquo;</li> <li><a href="../cli.html" accesskey="U">composer.cli</a> &raquo;</li>
</ul> </ul>
@ -131,7 +131,7 @@
<li class="right" > <li class="right" >
<a href="../../../py-modindex.html" title="Python Module Index" <a href="../../../py-modindex.html" title="Python Module Index"
>modules</a> |</li> >modules</a> |</li>
<li><a href="../../../index.html">Lorax 19.7.22 documentation</a> &raquo;</li> <li><a href="../../../index.html">Lorax 19.7.43 documentation</a> &raquo;</li>
<li><a href="../../index.html" >Module code</a> &raquo;</li> <li><a href="../../index.html" >Module code</a> &raquo;</li>
<li><a href="../cli.html" >composer.cli</a> &raquo;</li> <li><a href="../cli.html" >composer.cli</a> &raquo;</li>
</ul> </ul>

View File

@ -8,7 +8,7 @@
<head> <head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>composer.cli.projects &mdash; Lorax 19.7.22 documentation</title> <title>composer.cli.projects &mdash; Lorax 19.7.43 documentation</title>
<link rel="stylesheet" href="../../../_static/default.css" type="text/css" /> <link rel="stylesheet" href="../../../_static/default.css" type="text/css" />
<link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" /> <link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" />
@ -16,7 +16,7 @@
<script type="text/javascript"> <script type="text/javascript">
var DOCUMENTATION_OPTIONS = { var DOCUMENTATION_OPTIONS = {
URL_ROOT: '../../../', URL_ROOT: '../../../',
VERSION: '19.7.22', VERSION: '19.7.43',
COLLAPSE_INDEX: false, COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html', FILE_SUFFIX: '.html',
HAS_SOURCE: true HAS_SOURCE: true
@ -25,7 +25,7 @@
<script type="text/javascript" src="../../../_static/jquery.js"></script> <script type="text/javascript" src="../../../_static/jquery.js"></script>
<script type="text/javascript" src="../../../_static/underscore.js"></script> <script type="text/javascript" src="../../../_static/underscore.js"></script>
<script type="text/javascript" src="../../../_static/doctools.js"></script> <script type="text/javascript" src="../../../_static/doctools.js"></script>
<link rel="top" title="Lorax 19.7.22 documentation" href="../../../index.html" /> <link rel="top" title="Lorax 19.7.43 documentation" href="../../../index.html" />
<link rel="up" title="composer.cli" href="../cli.html" /> <link rel="up" title="composer.cli" href="../cli.html" />
</head> </head>
<body> <body>
@ -38,7 +38,7 @@
<li class="right" > <li class="right" >
<a href="../../../py-modindex.html" title="Python Module Index" <a href="../../../py-modindex.html" title="Python Module Index"
>modules</a> |</li> >modules</a> |</li>
<li><a href="../../../index.html">Lorax 19.7.22 documentation</a> &raquo;</li> <li><a href="../../../index.html">Lorax 19.7.43 documentation</a> &raquo;</li>
<li><a href="../../index.html" >Module code</a> &raquo;</li> <li><a href="../../index.html" >Module code</a> &raquo;</li>
<li><a href="../cli.html" accesskey="U">composer.cli</a> &raquo;</li> <li><a href="../cli.html" accesskey="U">composer.cli</a> &raquo;</li>
</ul> </ul>
@ -193,7 +193,7 @@
<li class="right" > <li class="right" >
<a href="../../../py-modindex.html" title="Python Module Index" <a href="../../../py-modindex.html" title="Python Module Index"
>modules</a> |</li> >modules</a> |</li>
<li><a href="../../../index.html">Lorax 19.7.22 documentation</a> &raquo;</li> <li><a href="../../../index.html">Lorax 19.7.43 documentation</a> &raquo;</li>
<li><a href="../../index.html" >Module code</a> &raquo;</li> <li><a href="../../index.html" >Module code</a> &raquo;</li>
<li><a href="../cli.html" >composer.cli</a> &raquo;</li> <li><a href="../cli.html" >composer.cli</a> &raquo;</li>
</ul> </ul>

View File

@ -8,7 +8,7 @@
<head> <head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>composer.cli.sources &mdash; Lorax 19.7.22 documentation</title> <title>composer.cli.sources &mdash; Lorax 19.7.43 documentation</title>
<link rel="stylesheet" href="../../../_static/default.css" type="text/css" /> <link rel="stylesheet" href="../../../_static/default.css" type="text/css" />
<link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" /> <link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" />
@ -16,7 +16,7 @@
<script type="text/javascript"> <script type="text/javascript">
var DOCUMENTATION_OPTIONS = { var DOCUMENTATION_OPTIONS = {
URL_ROOT: '../../../', URL_ROOT: '../../../',
VERSION: '19.7.22', VERSION: '19.7.43',
COLLAPSE_INDEX: false, COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html', FILE_SUFFIX: '.html',
HAS_SOURCE: true HAS_SOURCE: true
@ -25,7 +25,7 @@
<script type="text/javascript" src="../../../_static/jquery.js"></script> <script type="text/javascript" src="../../../_static/jquery.js"></script>
<script type="text/javascript" src="../../../_static/underscore.js"></script> <script type="text/javascript" src="../../../_static/underscore.js"></script>
<script type="text/javascript" src="../../../_static/doctools.js"></script> <script type="text/javascript" src="../../../_static/doctools.js"></script>
<link rel="top" title="Lorax 19.7.22 documentation" href="../../../index.html" /> <link rel="top" title="Lorax 19.7.43 documentation" href="../../../index.html" />
<link rel="up" title="composer.cli" href="../cli.html" /> <link rel="up" title="composer.cli" href="../cli.html" />
</head> </head>
<body> <body>
@ -38,7 +38,7 @@
<li class="right" > <li class="right" >
<a href="../../../py-modindex.html" title="Python Module Index" <a href="../../../py-modindex.html" title="Python Module Index"
>modules</a> |</li> >modules</a> |</li>
<li><a href="../../../index.html">Lorax 19.7.22 documentation</a> &raquo;</li> <li><a href="../../../index.html">Lorax 19.7.43 documentation</a> &raquo;</li>
<li><a href="../../index.html" >Module code</a> &raquo;</li> <li><a href="../../index.html" >Module code</a> &raquo;</li>
<li><a href="../cli.html" accesskey="U">composer.cli</a> &raquo;</li> <li><a href="../cli.html" accesskey="U">composer.cli</a> &raquo;</li>
</ul> </ul>
@ -235,7 +235,7 @@
<li class="right" > <li class="right" >
<a href="../../../py-modindex.html" title="Python Module Index" <a href="../../../py-modindex.html" title="Python Module Index"
>modules</a> |</li> >modules</a> |</li>
<li><a href="../../../index.html">Lorax 19.7.22 documentation</a> &raquo;</li> <li><a href="../../../index.html">Lorax 19.7.43 documentation</a> &raquo;</li>
<li><a href="../../index.html" >Module code</a> &raquo;</li> <li><a href="../../index.html" >Module code</a> &raquo;</li>
<li><a href="../cli.html" >composer.cli</a> &raquo;</li> <li><a href="../cli.html" >composer.cli</a> &raquo;</li>
</ul> </ul>

View File

@ -8,7 +8,7 @@
<head> <head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>composer.cli.status &mdash; Lorax 19.7.22 documentation</title> <title>composer.cli.status &mdash; Lorax 19.7.43 documentation</title>
<link rel="stylesheet" href="../../../_static/default.css" type="text/css" /> <link rel="stylesheet" href="../../../_static/default.css" type="text/css" />
<link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" /> <link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" />
@ -16,7 +16,7 @@
<script type="text/javascript"> <script type="text/javascript">
var DOCUMENTATION_OPTIONS = { var DOCUMENTATION_OPTIONS = {
URL_ROOT: '../../../', URL_ROOT: '../../../',
VERSION: '19.7.22', VERSION: '19.7.43',
COLLAPSE_INDEX: false, COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html', FILE_SUFFIX: '.html',
HAS_SOURCE: true HAS_SOURCE: true
@ -25,7 +25,7 @@
<script type="text/javascript" src="../../../_static/jquery.js"></script> <script type="text/javascript" src="../../../_static/jquery.js"></script>
<script type="text/javascript" src="../../../_static/underscore.js"></script> <script type="text/javascript" src="../../../_static/underscore.js"></script>
<script type="text/javascript" src="../../../_static/doctools.js"></script> <script type="text/javascript" src="../../../_static/doctools.js"></script>
<link rel="top" title="Lorax 19.7.22 documentation" href="../../../index.html" /> <link rel="top" title="Lorax 19.7.43 documentation" href="../../../index.html" />
<link rel="up" title="composer.cli" href="../cli.html" /> <link rel="up" title="composer.cli" href="../cli.html" />
</head> </head>
<body> <body>
@ -38,7 +38,7 @@
<li class="right" > <li class="right" >
<a href="../../../py-modindex.html" title="Python Module Index" <a href="../../../py-modindex.html" title="Python Module Index"
>modules</a> |</li> >modules</a> |</li>
<li><a href="../../../index.html">Lorax 19.7.22 documentation</a> &raquo;</li> <li><a href="../../../index.html">Lorax 19.7.43 documentation</a> &raquo;</li>
<li><a href="../../index.html" >Module code</a> &raquo;</li> <li><a href="../../index.html" >Module code</a> &raquo;</li>
<li><a href="../cli.html" accesskey="U">composer.cli</a> &raquo;</li> <li><a href="../cli.html" accesskey="U">composer.cli</a> &raquo;</li>
</ul> </ul>
@ -139,7 +139,7 @@
<li class="right" > <li class="right" >
<a href="../../../py-modindex.html" title="Python Module Index" <a href="../../../py-modindex.html" title="Python Module Index"
>modules</a> |</li> >modules</a> |</li>
<li><a href="../../../index.html">Lorax 19.7.22 documentation</a> &raquo;</li> <li><a href="../../../index.html">Lorax 19.7.43 documentation</a> &raquo;</li>
<li><a href="../../index.html" >Module code</a> &raquo;</li> <li><a href="../../index.html" >Module code</a> &raquo;</li>
<li><a href="../cli.html" >composer.cli</a> &raquo;</li> <li><a href="../cli.html" >composer.cli</a> &raquo;</li>
</ul> </ul>

View File

@ -8,7 +8,7 @@
<head> <head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>composer.cli.utilities &mdash; Lorax 19.7.22 documentation</title> <title>composer.cli.utilities &mdash; Lorax 19.7.43 documentation</title>
<link rel="stylesheet" href="../../../_static/default.css" type="text/css" /> <link rel="stylesheet" href="../../../_static/default.css" type="text/css" />
<link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" /> <link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" />
@ -16,7 +16,7 @@
<script type="text/javascript"> <script type="text/javascript">
var DOCUMENTATION_OPTIONS = { var DOCUMENTATION_OPTIONS = {
URL_ROOT: '../../../', URL_ROOT: '../../../',
VERSION: '19.7.22', VERSION: '19.7.43',
COLLAPSE_INDEX: false, COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html', FILE_SUFFIX: '.html',
HAS_SOURCE: true HAS_SOURCE: true
@ -25,7 +25,7 @@
<script type="text/javascript" src="../../../_static/jquery.js"></script> <script type="text/javascript" src="../../../_static/jquery.js"></script>
<script type="text/javascript" src="../../../_static/underscore.js"></script> <script type="text/javascript" src="../../../_static/underscore.js"></script>
<script type="text/javascript" src="../../../_static/doctools.js"></script> <script type="text/javascript" src="../../../_static/doctools.js"></script>
<link rel="top" title="Lorax 19.7.22 documentation" href="../../../index.html" /> <link rel="top" title="Lorax 19.7.43 documentation" href="../../../index.html" />
<link rel="up" title="composer.cli" href="../cli.html" /> <link rel="up" title="composer.cli" href="../cli.html" />
</head> </head>
<body> <body>
@ -38,7 +38,7 @@
<li class="right" > <li class="right" >
<a href="../../../py-modindex.html" title="Python Module Index" <a href="../../../py-modindex.html" title="Python Module Index"
>modules</a> |</li> >modules</a> |</li>
<li><a href="../../../index.html">Lorax 19.7.22 documentation</a> &raquo;</li> <li><a href="../../../index.html">Lorax 19.7.43 documentation</a> &raquo;</li>
<li><a href="../../index.html" >Module code</a> &raquo;</li> <li><a href="../../index.html" >Module code</a> &raquo;</li>
<li><a href="../cli.html" accesskey="U">composer.cli</a> &raquo;</li> <li><a href="../cli.html" accesskey="U">composer.cli</a> &raquo;</li>
</ul> </ul>
@ -178,7 +178,7 @@
<li class="right" > <li class="right" >
<a href="../../../py-modindex.html" title="Python Module Index" <a href="../../../py-modindex.html" title="Python Module Index"
>modules</a> |</li> >modules</a> |</li>
<li><a href="../../../index.html">Lorax 19.7.22 documentation</a> &raquo;</li> <li><a href="../../../index.html">Lorax 19.7.43 documentation</a> &raquo;</li>
<li><a href="../../index.html" >Module code</a> &raquo;</li> <li><a href="../../index.html" >Module code</a> &raquo;</li>
<li><a href="../cli.html" >composer.cli</a> &raquo;</li> <li><a href="../cli.html" >composer.cli</a> &raquo;</li>
</ul> </ul>

View File

@ -8,7 +8,7 @@
<head> <head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>composer.http_client &mdash; Lorax 19.7.22 documentation</title> <title>composer.http_client &mdash; Lorax 19.7.43 documentation</title>
<link rel="stylesheet" href="../../_static/default.css" type="text/css" /> <link rel="stylesheet" href="../../_static/default.css" type="text/css" />
<link rel="stylesheet" href="../../_static/pygments.css" type="text/css" /> <link rel="stylesheet" href="../../_static/pygments.css" type="text/css" />
@ -16,7 +16,7 @@
<script type="text/javascript"> <script type="text/javascript">
var DOCUMENTATION_OPTIONS = { var DOCUMENTATION_OPTIONS = {
URL_ROOT: '../../', URL_ROOT: '../../',
VERSION: '19.7.22', VERSION: '19.7.43',
COLLAPSE_INDEX: false, COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html', FILE_SUFFIX: '.html',
HAS_SOURCE: true HAS_SOURCE: true
@ -25,7 +25,7 @@
<script type="text/javascript" src="../../_static/jquery.js"></script> <script type="text/javascript" src="../../_static/jquery.js"></script>
<script type="text/javascript" src="../../_static/underscore.js"></script> <script type="text/javascript" src="../../_static/underscore.js"></script>
<script type="text/javascript" src="../../_static/doctools.js"></script> <script type="text/javascript" src="../../_static/doctools.js"></script>
<link rel="top" title="Lorax 19.7.22 documentation" href="../../index.html" /> <link rel="top" title="Lorax 19.7.43 documentation" href="../../index.html" />
<link rel="up" title="Module code" href="../index.html" /> <link rel="up" title="Module code" href="../index.html" />
</head> </head>
<body> <body>
@ -38,7 +38,7 @@
<li class="right" > <li class="right" >
<a href="../../py-modindex.html" title="Python Module Index" <a href="../../py-modindex.html" title="Python Module Index"
>modules</a> |</li> >modules</a> |</li>
<li><a href="../../index.html">Lorax 19.7.22 documentation</a> &raquo;</li> <li><a href="../../index.html">Lorax 19.7.43 documentation</a> &raquo;</li>
<li><a href="../index.html" accesskey="U">Module code</a> &raquo;</li> <li><a href="../index.html" accesskey="U">Module code</a> &raquo;</li>
</ul> </ul>
</div> </div>
@ -342,7 +342,7 @@
<li class="right" > <li class="right" >
<a href="../../py-modindex.html" title="Python Module Index" <a href="../../py-modindex.html" title="Python Module Index"
>modules</a> |</li> >modules</a> |</li>
<li><a href="../../index.html">Lorax 19.7.22 documentation</a> &raquo;</li> <li><a href="../../index.html">Lorax 19.7.43 documentation</a> &raquo;</li>
<li><a href="../index.html" >Module code</a> &raquo;</li> <li><a href="../index.html" >Module code</a> &raquo;</li>
</ul> </ul>
</div> </div>

View File

@ -8,7 +8,7 @@
<head> <head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>composer.unix_socket &mdash; Lorax 19.7.22 documentation</title> <title>composer.unix_socket &mdash; Lorax 19.7.43 documentation</title>
<link rel="stylesheet" href="../../_static/default.css" type="text/css" /> <link rel="stylesheet" href="../../_static/default.css" type="text/css" />
<link rel="stylesheet" href="../../_static/pygments.css" type="text/css" /> <link rel="stylesheet" href="../../_static/pygments.css" type="text/css" />
@ -16,7 +16,7 @@
<script type="text/javascript"> <script type="text/javascript">
var DOCUMENTATION_OPTIONS = { var DOCUMENTATION_OPTIONS = {
URL_ROOT: '../../', URL_ROOT: '../../',
VERSION: '19.7.22', VERSION: '19.7.43',
COLLAPSE_INDEX: false, COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html', FILE_SUFFIX: '.html',
HAS_SOURCE: true HAS_SOURCE: true
@ -25,7 +25,7 @@
<script type="text/javascript" src="../../_static/jquery.js"></script> <script type="text/javascript" src="../../_static/jquery.js"></script>
<script type="text/javascript" src="../../_static/underscore.js"></script> <script type="text/javascript" src="../../_static/underscore.js"></script>
<script type="text/javascript" src="../../_static/doctools.js"></script> <script type="text/javascript" src="../../_static/doctools.js"></script>
<link rel="top" title="Lorax 19.7.22 documentation" href="../../index.html" /> <link rel="top" title="Lorax 19.7.43 documentation" href="../../index.html" />
<link rel="up" title="Module code" href="../index.html" /> <link rel="up" title="Module code" href="../index.html" />
</head> </head>
<body> <body>
@ -38,7 +38,7 @@
<li class="right" > <li class="right" >
<a href="../../py-modindex.html" title="Python Module Index" <a href="../../py-modindex.html" title="Python Module Index"
>modules</a> |</li> >modules</a> |</li>
<li><a href="../../index.html">Lorax 19.7.22 documentation</a> &raquo;</li> <li><a href="../../index.html">Lorax 19.7.43 documentation</a> &raquo;</li>
<li><a href="../index.html" accesskey="U">Module code</a> &raquo;</li> <li><a href="../index.html" accesskey="U">Module code</a> &raquo;</li>
</ul> </ul>
</div> </div>
@ -77,7 +77,7 @@
<span class="c"># https://github.com/docker/docker-py/blob/master/docker/transport/unixconn.py</span> <span class="c"># https://github.com/docker/docker-py/blob/master/docker/transport/unixconn.py</span>
<div class="viewcode-block" id="UnixHTTPConnection"><a class="viewcode-back" href="../../composer.html#composer.unix_socket.UnixHTTPConnection">[docs]</a><span class="k">class</span> <span class="nc">UnixHTTPConnection</span><span class="p">(</span><span class="n">httplib</span><span class="o">.</span><span class="n">HTTPConnection</span><span class="p">,</span> <span class="nb">object</span><span class="p">):</span> <div class="viewcode-block" id="UnixHTTPConnection"><a class="viewcode-back" href="../../composer.html#composer.unix_socket.UnixHTTPConnection">[docs]</a><span class="k">class</span> <span class="nc">UnixHTTPConnection</span><span class="p">(</span><span class="n">httplib</span><span class="o">.</span><span class="n">HTTPConnection</span><span class="p">,</span> <span class="nb">object</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">socket_path</span><span class="p">,</span> <span class="n">timeout</span><span class="o">=</span><span class="mi">60</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">socket_path</span><span class="p">,</span> <span class="n">timeout</span><span class="o">=</span><span class="mi">60</span><span class="o">*</span><span class="mi">5</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;Create an HTTP connection to a unix domain socket</span> <span class="sd">&quot;&quot;&quot;Create an HTTP connection to a unix domain socket</span>
<span class="sd"> :param socket_path: The path to the Unix domain socket</span> <span class="sd"> :param socket_path: The path to the Unix domain socket</span>
@ -99,13 +99,15 @@
</div></div> </div></div>
<div class="viewcode-block" id="UnixHTTPConnectionPool"><a class="viewcode-back" href="../../composer.html#composer.unix_socket.UnixHTTPConnectionPool">[docs]</a><span class="k">class</span> <span class="nc">UnixHTTPConnectionPool</span><span class="p">(</span><span class="n">urllib3</span><span class="o">.</span><span class="n">connectionpool</span><span class="o">.</span><span class="n">HTTPConnectionPool</span><span class="p">):</span> <div class="viewcode-block" id="UnixHTTPConnectionPool"><a class="viewcode-back" href="../../composer.html#composer.unix_socket.UnixHTTPConnectionPool">[docs]</a><span class="k">class</span> <span class="nc">UnixHTTPConnectionPool</span><span class="p">(</span><span class="n">urllib3</span><span class="o">.</span><span class="n">connectionpool</span><span class="o">.</span><span class="n">HTTPConnectionPool</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">socket_path</span><span class="p">,</span> <span class="n">timeout</span><span class="o">=</span><span class="mi">60</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">socket_path</span><span class="p">,</span> <span class="n">timeout</span><span class="o">=</span><span class="mi">60</span><span class="o">*</span><span class="mi">5</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;Create a connection pool using a Unix domain socket</span> <span class="sd">&quot;&quot;&quot;Create a connection pool using a Unix domain socket</span>
<span class="sd"> :param socket_path: The path to the Unix domain socket</span> <span class="sd"> :param socket_path: The path to the Unix domain socket</span>
<span class="sd"> :param timeout: Number of seconds to timeout the connection</span> <span class="sd"> :param timeout: Number of seconds to timeout the connection</span>
<span class="sd"> NOTE: retries are disabled for these connections, they are never useful</span>
<span class="sd"> &quot;&quot;&quot;</span> <span class="sd"> &quot;&quot;&quot;</span>
<span class="nb">super</span><span class="p">(</span><span class="n">UnixHTTPConnectionPool</span><span class="p">,</span> <span class="bp">self</span><span class="p">)</span><span class="o">.</span><span class="n">__init__</span><span class="p">(</span><span class="s">&#39;localhost&#39;</span><span class="p">,</span> <span class="n">timeout</span><span class="o">=</span><span class="n">timeout</span><span class="p">)</span> <span class="nb">super</span><span class="p">(</span><span class="n">UnixHTTPConnectionPool</span><span class="p">,</span> <span class="bp">self</span><span class="p">)</span><span class="o">.</span><span class="n">__init__</span><span class="p">(</span><span class="s">&#39;localhost&#39;</span><span class="p">,</span> <span class="n">timeout</span><span class="o">=</span><span class="n">timeout</span><span class="p">,</span> <span class="n">retries</span><span class="o">=</span><span class="bp">False</span><span class="p">)</span>
<span class="bp">self</span><span class="o">.</span><span class="n">socket_path</span> <span class="o">=</span> <span class="n">socket_path</span> <span class="bp">self</span><span class="o">.</span><span class="n">socket_path</span> <span class="o">=</span> <span class="n">socket_path</span>
<span class="k">def</span> <span class="nf">_new_conn</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> <span class="k">def</span> <span class="nf">_new_conn</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
@ -143,7 +145,7 @@
<li class="right" > <li class="right" >
<a href="../../py-modindex.html" title="Python Module Index" <a href="../../py-modindex.html" title="Python Module Index"
>modules</a> |</li> >modules</a> |</li>
<li><a href="../../index.html">Lorax 19.7.22 documentation</a> &raquo;</li> <li><a href="../../index.html">Lorax 19.7.43 documentation</a> &raquo;</li>
<li><a href="../index.html" >Module code</a> &raquo;</li> <li><a href="../index.html" >Module code</a> &raquo;</li>
</ul> </ul>
</div> </div>

View File

@ -8,7 +8,7 @@
<head> <head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Overview: module code &mdash; Lorax 19.7.22 documentation</title> <title>Overview: module code &mdash; Lorax 19.7.43 documentation</title>
<link rel="stylesheet" href="../_static/default.css" type="text/css" /> <link rel="stylesheet" href="../_static/default.css" type="text/css" />
<link rel="stylesheet" href="../_static/pygments.css" type="text/css" /> <link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
@ -16,7 +16,7 @@
<script type="text/javascript"> <script type="text/javascript">
var DOCUMENTATION_OPTIONS = { var DOCUMENTATION_OPTIONS = {
URL_ROOT: '../', URL_ROOT: '../',
VERSION: '19.7.22', VERSION: '19.7.43',
COLLAPSE_INDEX: false, COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html', FILE_SUFFIX: '.html',
HAS_SOURCE: true HAS_SOURCE: true
@ -25,7 +25,7 @@
<script type="text/javascript" src="../_static/jquery.js"></script> <script type="text/javascript" src="../_static/jquery.js"></script>
<script type="text/javascript" src="../_static/underscore.js"></script> <script type="text/javascript" src="../_static/underscore.js"></script>
<script type="text/javascript" src="../_static/doctools.js"></script> <script type="text/javascript" src="../_static/doctools.js"></script>
<link rel="top" title="Lorax 19.7.22 documentation" href="../index.html" /> <link rel="top" title="Lorax 19.7.43 documentation" href="../index.html" />
</head> </head>
<body> <body>
<div class="related"> <div class="related">
@ -37,7 +37,7 @@
<li class="right" > <li class="right" >
<a href="../py-modindex.html" title="Python Module Index" <a href="../py-modindex.html" title="Python Module Index"
>modules</a> |</li> >modules</a> |</li>
<li><a href="../index.html">Lorax 19.7.22 documentation</a> &raquo;</li> <li><a href="../index.html">Lorax 19.7.43 documentation</a> &raquo;</li>
</ul> </ul>
</div> </div>
@ -59,7 +59,8 @@
<li><a href="composer/unix_socket.html">composer.unix_socket</a></li> <li><a href="composer/unix_socket.html">composer.unix_socket</a></li>
<li><a href="pylorax.html">pylorax</a></li> <li><a href="pylorax.html">pylorax</a></li>
<ul><li><a href="pylorax/api.html">pylorax.api</a></li> <ul><li><a href="pylorax/api.html">pylorax.api</a></li>
<ul><li><a href="pylorax/api/checkparams.html">pylorax.api.checkparams</a></li> <ul><li><a href="pylorax/api/bisect.html">pylorax.api.bisect</a></li>
<li><a href="pylorax/api/checkparams.html">pylorax.api.checkparams</a></li>
<li><a href="pylorax/api/compose.html">pylorax.api.compose</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/config.html">pylorax.api.config</a></li>
<li><a href="pylorax/api/crossdomain.html">pylorax.api.crossdomain</a></li> <li><a href="pylorax/api/crossdomain.html">pylorax.api.crossdomain</a></li>
@ -118,7 +119,7 @@
<li class="right" > <li class="right" >
<a href="../py-modindex.html" title="Python Module Index" <a href="../py-modindex.html" title="Python Module Index"
>modules</a> |</li> >modules</a> |</li>
<li><a href="../index.html">Lorax 19.7.22 documentation</a> &raquo;</li> <li><a href="../index.html">Lorax 19.7.43 documentation</a> &raquo;</li>
</ul> </ul>
</div> </div>
<div class="footer"> <div class="footer">

View File

@ -8,7 +8,7 @@
<head> <head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>pylorax &mdash; Lorax 19.7.22 documentation</title> <title>pylorax &mdash; Lorax 19.7.43 documentation</title>
<link rel="stylesheet" href="../_static/default.css" type="text/css" /> <link rel="stylesheet" href="../_static/default.css" type="text/css" />
<link rel="stylesheet" href="../_static/pygments.css" type="text/css" /> <link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
@ -16,7 +16,7 @@
<script type="text/javascript"> <script type="text/javascript">
var DOCUMENTATION_OPTIONS = { var DOCUMENTATION_OPTIONS = {
URL_ROOT: '../', URL_ROOT: '../',
VERSION: '19.7.22', VERSION: '19.7.43',
COLLAPSE_INDEX: false, COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html', FILE_SUFFIX: '.html',
HAS_SOURCE: true HAS_SOURCE: true
@ -25,7 +25,7 @@
<script type="text/javascript" src="../_static/jquery.js"></script> <script type="text/javascript" src="../_static/jquery.js"></script>
<script type="text/javascript" src="../_static/underscore.js"></script> <script type="text/javascript" src="../_static/underscore.js"></script>
<script type="text/javascript" src="../_static/doctools.js"></script> <script type="text/javascript" src="../_static/doctools.js"></script>
<link rel="top" title="Lorax 19.7.22 documentation" href="../index.html" /> <link rel="top" title="Lorax 19.7.43 documentation" href="../index.html" />
<link rel="up" title="Module code" href="index.html" /> <link rel="up" title="Module code" href="index.html" />
</head> </head>
<body> <body>
@ -38,7 +38,7 @@
<li class="right" > <li class="right" >
<a href="../py-modindex.html" title="Python Module Index" <a href="../py-modindex.html" title="Python Module Index"
>modules</a> |</li> >modules</a> |</li>
<li><a href="../index.html">Lorax 19.7.22 documentation</a> &raquo;</li> <li><a href="../index.html">Lorax 19.7.43 documentation</a> &raquo;</li>
<li><a href="index.html" accesskey="U">Module code</a> &raquo;</li> <li><a href="index.html" accesskey="U">Module code</a> &raquo;</li>
</ul> </ul>
</div> </div>
@ -245,6 +245,8 @@
<span class="bp">self</span><span class="o">.</span><span class="n">init_file_logging</span><span class="p">(</span><span class="n">logdir</span><span class="p">)</span> <span class="bp">self</span><span class="o">.</span><span class="n">init_file_logging</span><span class="p">(</span><span class="n">logdir</span><span class="p">)</span>
<span class="n">logger</span><span class="o">.</span><span class="n">debug</span><span class="p">(</span><span class="s">&quot;version is </span><span class="si">%s</span><span class="s">&quot;</span><span class="p">,</span> <span class="n">vernum</span><span class="p">)</span> <span class="n">logger</span><span class="o">.</span><span class="n">debug</span><span class="p">(</span><span class="s">&quot;version is </span><span class="si">%s</span><span class="s">&quot;</span><span class="p">,</span> <span class="n">vernum</span><span class="p">)</span>
<span class="n">log_selinux_state</span><span class="p">()</span>
<span class="n">logger</span><span class="o">.</span><span class="n">debug</span><span class="p">(</span><span class="s">&quot;using work directory </span><span class="si">%s</span><span class="s">&quot;</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">workdir</span><span class="p">)</span> <span class="n">logger</span><span class="o">.</span><span class="n">debug</span><span class="p">(</span><span class="s">&quot;using work directory </span><span class="si">%s</span><span class="s">&quot;</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">workdir</span><span class="p">)</span>
<span class="n">logger</span><span class="o">.</span><span class="n">debug</span><span class="p">(</span><span class="s">&quot;using log directory </span><span class="si">%s</span><span class="s">&quot;</span><span class="p">,</span> <span class="n">logdir</span><span class="p">)</span> <span class="n">logger</span><span class="o">.</span><span class="n">debug</span><span class="p">(</span><span class="s">&quot;using log directory </span><span class="si">%s</span><span class="s">&quot;</span><span class="p">,</span> <span class="n">logdir</span><span class="p">)</span>
@ -260,22 +262,6 @@
<span class="n">logger</span><span class="o">.</span><span class="n">critical</span><span class="p">(</span><span class="s">&quot;no root privileges&quot;</span><span class="p">)</span> <span class="n">logger</span><span class="o">.</span><span class="n">critical</span><span class="p">(</span><span class="s">&quot;no root privileges&quot;</span><span class="p">)</span>
<span class="n">sys</span><span class="o">.</span><span class="n">exit</span><span class="p">(</span><span class="mi">1</span><span class="p">)</span> <span class="n">sys</span><span class="o">.</span><span class="n">exit</span><span class="p">(</span><span class="mi">1</span><span class="p">)</span>
<span class="c"># is selinux disabled?</span>
<span class="c"># With selinux in enforcing mode the rpcbind package required for</span>
<span class="c"># dracut nfs module, which is in turn required by anaconda module,</span>
<span class="c"># will not get installed, because it&#39;s preinstall scriptlet fails,</span>
<span class="c"># resulting in an incomplete initial ramdisk image.</span>
<span class="c"># The reason is that the scriptlet runs tools from the shadow-utils</span>
<span class="c"># package in chroot, particularly groupadd and useradd to add the</span>
<span class="c"># required rpc group and rpc user. This operation fails, because</span>
<span class="c"># the selinux context on files in the chroot, that the shadow-utils</span>
<span class="c"># tools need to access (/etc/group, /etc/passwd, /etc/shadow etc.),</span>
<span class="c"># is wrong and selinux therefore disallows access to these files.</span>
<span class="n">logger</span><span class="o">.</span><span class="n">info</span><span class="p">(</span><span class="s">&quot;checking the selinux mode&quot;</span><span class="p">)</span>
<span class="k">if</span> <span class="n">selinux</span><span class="o">.</span><span class="n">is_selinux_enabled</span><span class="p">()</span> <span class="ow">and</span> <span class="n">selinux</span><span class="o">.</span><span class="n">security_getenforce</span><span class="p">():</span>
<span class="n">logger</span><span class="o">.</span><span class="n">critical</span><span class="p">(</span><span class="s">&quot;selinux must be disabled or in Permissive mode&quot;</span><span class="p">)</span>
<span class="n">sys</span><span class="o">.</span><span class="n">exit</span><span class="p">(</span><span class="mi">1</span><span class="p">)</span>
<span class="c"># do we have a proper yum base object?</span> <span class="c"># do we have a proper yum base object?</span>
<span class="n">logger</span><span class="o">.</span><span class="n">info</span><span class="p">(</span><span class="s">&quot;checking yum base object&quot;</span><span class="p">)</span> <span class="n">logger</span><span class="o">.</span><span class="n">info</span><span class="p">(</span><span class="s">&quot;checking yum base object&quot;</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">ybo</span><span class="p">,</span> <span class="n">yum</span><span class="o">.</span><span class="n">YumBase</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">ybo</span><span class="p">,</span> <span class="n">yum</span><span class="o">.</span><span class="n">YumBase</span><span class="p">):</span>
@ -359,7 +345,8 @@
<span class="k">else</span><span class="p">:</span> <span class="k">else</span><span class="p">:</span>
<span class="n">logger</span><span class="o">.</span><span class="n">info</span><span class="p">(</span><span class="s">&quot;no BCJ filter for arch </span><span class="si">%s</span><span class="s">&quot;</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">arch</span><span class="o">.</span><span class="n">basearch</span><span class="p">)</span> <span class="n">logger</span><span class="o">.</span><span class="n">info</span><span class="p">(</span><span class="s">&quot;no BCJ filter for arch </span><span class="si">%s</span><span class="s">&quot;</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">arch</span><span class="o">.</span><span class="n">basearch</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">installroot</span><span class="p">,</span><span class="n">runtime</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">installroot</span><span class="p">,</span><span class="n">runtime</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> <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>
<span class="n">size</span><span class="o">=</span><span class="n">size</span><span class="p">)</span>
<span class="n">logger</span><span class="o">.</span><span class="n">info</span><span class="p">(</span><span class="s">&quot;preparing to build output tree and boot images&quot;</span><span class="p">)</span> <span class="n">logger</span><span class="o">.</span><span class="n">info</span><span class="p">(</span><span class="s">&quot;preparing to build output tree and boot images&quot;</span><span class="p">)</span>
<span class="n">treebuilder</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="bp">self</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="bp">self</span><span class="o">.</span><span class="n">arch</span><span class="p">,</span> <span class="n">treebuilder</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="bp">self</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="bp">self</span><span class="o">.</span><span class="n">arch</span><span class="p">,</span>
@ -434,7 +421,17 @@
<span class="n">logger</span><span class="o">.</span><span class="n">critical</span><span class="p">(</span><span class="s">&quot;no anaconda package in the repository&quot;</span><span class="p">)</span> <span class="n">logger</span><span class="o">.</span><span class="n">critical</span><span class="p">(</span><span class="s">&quot;no anaconda package in the repository&quot;</span><span class="p">)</span>
<span class="n">sys</span><span class="o">.</span><span class="n">exit</span><span class="p">(</span><span class="mi">1</span><span class="p">)</span> <span class="n">sys</span><span class="o">.</span><span class="n">exit</span><span class="p">(</span><span class="mi">1</span><span class="p">)</span>
<span class="k">return</span> <span class="n">buildarch</span></div> <span class="k">return</span> <span class="n">buildarch</span>
</div>
<div class="viewcode-block" id="log_selinux_state"><a class="viewcode-back" href="../pylorax.html#pylorax.log_selinux_state">[docs]</a><span class="k">def</span> <span class="nf">log_selinux_state</span><span class="p">():</span>
<span class="sd">&quot;&quot;&quot;Log the current state of selinux&quot;&quot;&quot;</span>
<span class="k">if</span> <span class="n">selinux</span><span class="o">.</span><span class="n">is_selinux_enabled</span><span class="p">():</span>
<span class="k">if</span> <span class="n">selinux</span><span class="o">.</span><span class="n">security_getenforce</span><span class="p">():</span>
<span class="n">logger</span><span class="o">.</span><span class="n">info</span><span class="p">(</span><span class="s">&quot;selinux is enabled and in Enforcing mode&quot;</span><span class="p">)</span>
<span class="k">else</span><span class="p">:</span>
<span class="n">logger</span><span class="o">.</span><span class="n">info</span><span class="p">(</span><span class="s">&quot;selinux is enabled and in Permissive mode&quot;</span><span class="p">)</span>
<span class="k">else</span><span class="p">:</span>
<span class="n">logger</span><span class="o">.</span><span class="n">info</span><span class="p">(</span><span class="s">&quot;selinux is Disabled&quot;</span><span class="p">)</span></div>
</pre></div> </pre></div>
</div> </div>
@ -468,7 +465,7 @@
<li class="right" > <li class="right" >
<a href="../py-modindex.html" title="Python Module Index" <a href="../py-modindex.html" title="Python Module Index"
>modules</a> |</li> >modules</a> |</li>
<li><a href="../index.html">Lorax 19.7.22 documentation</a> &raquo;</li> <li><a href="../index.html">Lorax 19.7.43 documentation</a> &raquo;</li>
<li><a href="index.html" >Module code</a> &raquo;</li> <li><a href="index.html" >Module code</a> &raquo;</li>
</ul> </ul>
</div> </div>

View File

@ -8,7 +8,7 @@
<head> <head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>pylorax.api &mdash; Lorax 19.7.22 documentation</title> <title>pylorax.api &mdash; Lorax 19.7.43 documentation</title>
<link rel="stylesheet" href="../../_static/default.css" type="text/css" /> <link rel="stylesheet" href="../../_static/default.css" type="text/css" />
<link rel="stylesheet" href="../../_static/pygments.css" type="text/css" /> <link rel="stylesheet" href="../../_static/pygments.css" type="text/css" />
@ -16,7 +16,7 @@
<script type="text/javascript"> <script type="text/javascript">
var DOCUMENTATION_OPTIONS = { var DOCUMENTATION_OPTIONS = {
URL_ROOT: '../../', URL_ROOT: '../../',
VERSION: '19.7.22', VERSION: '19.7.43',
COLLAPSE_INDEX: false, COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html', FILE_SUFFIX: '.html',
HAS_SOURCE: true HAS_SOURCE: true
@ -25,7 +25,7 @@
<script type="text/javascript" src="../../_static/jquery.js"></script> <script type="text/javascript" src="../../_static/jquery.js"></script>
<script type="text/javascript" src="../../_static/underscore.js"></script> <script type="text/javascript" src="../../_static/underscore.js"></script>
<script type="text/javascript" src="../../_static/doctools.js"></script> <script type="text/javascript" src="../../_static/doctools.js"></script>
<link rel="top" title="Lorax 19.7.22 documentation" href="../../index.html" /> <link rel="top" title="Lorax 19.7.43 documentation" href="../../index.html" />
<link rel="up" title="pylorax" href="../pylorax.html" /> <link rel="up" title="pylorax" href="../pylorax.html" />
</head> </head>
<body> <body>
@ -38,7 +38,7 @@
<li class="right" > <li class="right" >
<a href="../../py-modindex.html" title="Python Module Index" <a href="../../py-modindex.html" title="Python Module Index"
>modules</a> |</li> >modules</a> |</li>
<li><a href="../../index.html">Lorax 19.7.22 documentation</a> &raquo;</li> <li><a href="../../index.html">Lorax 19.7.43 documentation</a> &raquo;</li>
<li><a href="../index.html" >Module code</a> &raquo;</li> <li><a href="../index.html" >Module code</a> &raquo;</li>
<li><a href="../pylorax.html" accesskey="U">pylorax</a> &raquo;</li> <li><a href="../pylorax.html" accesskey="U">pylorax</a> &raquo;</li>
</ul> </ul>
@ -109,7 +109,7 @@
<li class="right" > <li class="right" >
<a href="../../py-modindex.html" title="Python Module Index" <a href="../../py-modindex.html" title="Python Module Index"
>modules</a> |</li> >modules</a> |</li>
<li><a href="../../index.html">Lorax 19.7.22 documentation</a> &raquo;</li> <li><a href="../../index.html">Lorax 19.7.43 documentation</a> &raquo;</li>
<li><a href="../index.html" >Module code</a> &raquo;</li> <li><a href="../index.html" >Module code</a> &raquo;</li>
<li><a href="../pylorax.html" >pylorax</a> &raquo;</li> <li><a href="../pylorax.html" >pylorax</a> &raquo;</li>
</ul> </ul>

View File

@ -0,0 +1,147 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>pylorax.api.bisect &mdash; Lorax 19.7.43 documentation</title>
<link rel="stylesheet" href="../../../_static/default.css" type="text/css" />
<link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" />
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: '../../../',
VERSION: '19.7.43',
COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html',
HAS_SOURCE: true
};
</script>
<script type="text/javascript" src="../../../_static/jquery.js"></script>
<script type="text/javascript" src="../../../_static/underscore.js"></script>
<script type="text/javascript" src="../../../_static/doctools.js"></script>
<link rel="top" title="Lorax 19.7.43 documentation" href="../../../index.html" />
<link rel="up" title="pylorax.api" href="../api.html" />
</head>
<body>
<div class="related">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="../../../genindex.html" title="General Index"
accesskey="I">index</a></li>
<li class="right" >
<a href="../../../py-modindex.html" title="Python Module Index"
>modules</a> |</li>
<li><a href="../../../index.html">Lorax 19.7.43 documentation</a> &raquo;</li>
<li><a href="../../index.html" >Module code</a> &raquo;</li>
<li><a href="../../pylorax.html" >pylorax</a> &raquo;</li>
<li><a href="../api.html" accesskey="U">pylorax.api</a> &raquo;</li>
</ul>
</div>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body">
<h1>Source code for pylorax.api.bisect</h1><div class="highlight"><pre>
<span class="c">#</span>
<span class="c"># Copyright (C) 2018 Red Hat, Inc.</span>
<span class="c">#</span>
<span class="c"># This program is free software; you can redistribute it and/or modify</span>
<span class="c"># it under the terms of the GNU General Public License as published by</span>
<span class="c"># the Free Software Foundation; either version 2 of the License, or</span>
<span class="c"># (at your option) any later version.</span>
<span class="c">#</span>
<span class="c"># This program is distributed in the hope that it will be useful,</span>
<span class="c"># but WITHOUT ANY WARRANTY; without even the implied warranty of</span>
<span class="c"># MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the</span>
<span class="c"># GNU General Public License for more details.</span>
<span class="c">#</span>
<span class="c"># You should have received a copy of the GNU General Public License</span>
<span class="c"># along with this program. If not, see &lt;http://www.gnu.org/licenses/&gt;.</span>
<span class="c">#</span>
<div class="viewcode-block" id="insort_left"><a class="viewcode-back" href="../../../pylorax.api.html#pylorax.api.bisect.insort_left">[docs]</a><span class="k">def</span> <span class="nf">insort_left</span><span class="p">(</span><span class="n">a</span><span class="p">,</span> <span class="n">x</span><span class="p">,</span> <span class="n">key</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span> <span class="n">lo</span><span class="o">=</span><span class="mi">0</span><span class="p">,</span> <span class="n">hi</span><span class="o">=</span><span class="bp">None</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;Insert item x in list a, and keep it sorted assuming a is sorted.</span>
<span class="sd"> :param a: sorted list</span>
<span class="sd"> :type a: list</span>
<span class="sd"> :param x: item to insert into the list</span>
<span class="sd"> :type x: object</span>
<span class="sd"> :param key: Function to use to compare items in the list</span>
<span class="sd"> :type key: function</span>
<span class="sd"> :returns: index where the item was inserted</span>
<span class="sd"> :rtype: int</span>
<span class="sd"> If x is already in a, insert it to the left of the leftmost x.</span>
<span class="sd"> Optional args lo (default 0) and hi (default len(a)) bound the</span>
<span class="sd"> slice of a to be searched.</span>
<span class="sd"> This is a modified version of bisect.insort_left that can use a</span>
<span class="sd"> function for the compare, and returns the index position where it</span>
<span class="sd"> was inserted.</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="k">if</span> <span class="n">key</span> <span class="ow">is</span> <span class="bp">None</span><span class="p">:</span>
<span class="n">key</span> <span class="o">=</span> <span class="k">lambda</span> <span class="n">i</span><span class="p">:</span> <span class="n">i</span>
<span class="k">if</span> <span class="n">lo</span> <span class="o">&lt;</span> <span class="mi">0</span><span class="p">:</span>
<span class="k">raise</span> <span class="ne">ValueError</span><span class="p">(</span><span class="s">&#39;lo must be non-negative&#39;</span><span class="p">)</span>
<span class="k">if</span> <span class="n">hi</span> <span class="ow">is</span> <span class="bp">None</span><span class="p">:</span>
<span class="n">hi</span> <span class="o">=</span> <span class="nb">len</span><span class="p">(</span><span class="n">a</span><span class="p">)</span>
<span class="k">while</span> <span class="n">lo</span> <span class="o">&lt;</span> <span class="n">hi</span><span class="p">:</span>
<span class="n">mid</span> <span class="o">=</span> <span class="p">(</span><span class="n">lo</span><span class="o">+</span><span class="n">hi</span><span class="p">)</span><span class="o">//</span><span class="mi">2</span>
<span class="k">if</span> <span class="n">key</span><span class="p">(</span><span class="n">a</span><span class="p">[</span><span class="n">mid</span><span class="p">])</span> <span class="o">&lt;</span> <span class="n">key</span><span class="p">(</span><span class="n">x</span><span class="p">):</span> <span class="n">lo</span> <span class="o">=</span> <span class="n">mid</span><span class="o">+</span><span class="mi">1</span>
<span class="k">else</span><span class="p">:</span> <span class="n">hi</span> <span class="o">=</span> <span class="n">mid</span>
<span class="n">a</span><span class="o">.</span><span class="n">insert</span><span class="p">(</span><span class="n">lo</span><span class="p">,</span> <span class="n">x</span><span class="p">)</span>
<span class="k">return</span> <span class="n">lo</span></div>
</pre></div>
</div>
</div>
</div>
<div class="sphinxsidebar">
<div class="sphinxsidebarwrapper">
<div id="searchbox" style="display: none">
<h3>Quick search</h3>
<form class="search" action="../../../search.html" method="get">
<input type="text" name="q" />
<input type="submit" value="Go" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
<p class="searchtip" style="font-size: 90%">
Enter search terms or a module, class or function name.
</p>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="related">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="../../../genindex.html" title="General Index"
>index</a></li>
<li class="right" >
<a href="../../../py-modindex.html" title="Python Module Index"
>modules</a> |</li>
<li><a href="../../../index.html">Lorax 19.7.43 documentation</a> &raquo;</li>
<li><a href="../../index.html" >Module code</a> &raquo;</li>
<li><a href="../../pylorax.html" >pylorax</a> &raquo;</li>
<li><a href="../api.html" >pylorax.api</a> &raquo;</li>
</ul>
</div>
<div class="footer">
&copy; Copyright 2018, Red Hat, Inc..
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.1.3.
</div>
</body>
</html>

View File

@ -8,7 +8,7 @@
<head> <head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>pylorax.api.checkparams &mdash; Lorax 19.7.22 documentation</title> <title>pylorax.api.checkparams &mdash; Lorax 19.7.43 documentation</title>
<link rel="stylesheet" href="../../../_static/default.css" type="text/css" /> <link rel="stylesheet" href="../../../_static/default.css" type="text/css" />
<link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" /> <link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" />
@ -16,7 +16,7 @@
<script type="text/javascript"> <script type="text/javascript">
var DOCUMENTATION_OPTIONS = { var DOCUMENTATION_OPTIONS = {
URL_ROOT: '../../../', URL_ROOT: '../../../',
VERSION: '19.7.22', VERSION: '19.7.43',
COLLAPSE_INDEX: false, COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html', FILE_SUFFIX: '.html',
HAS_SOURCE: true HAS_SOURCE: true
@ -25,7 +25,7 @@
<script type="text/javascript" src="../../../_static/jquery.js"></script> <script type="text/javascript" src="../../../_static/jquery.js"></script>
<script type="text/javascript" src="../../../_static/underscore.js"></script> <script type="text/javascript" src="../../../_static/underscore.js"></script>
<script type="text/javascript" src="../../../_static/doctools.js"></script> <script type="text/javascript" src="../../../_static/doctools.js"></script>
<link rel="top" title="Lorax 19.7.22 documentation" href="../../../index.html" /> <link rel="top" title="Lorax 19.7.43 documentation" href="../../../index.html" />
<link rel="up" title="pylorax.api" href="../api.html" /> <link rel="up" title="pylorax.api" href="../api.html" />
</head> </head>
<body> <body>
@ -38,7 +38,7 @@
<li class="right" > <li class="right" >
<a href="../../../py-modindex.html" title="Python Module Index" <a href="../../../py-modindex.html" title="Python Module Index"
>modules</a> |</li> >modules</a> |</li>
<li><a href="../../../index.html">Lorax 19.7.22 documentation</a> &raquo;</li> <li><a href="../../../index.html">Lorax 19.7.43 documentation</a> &raquo;</li>
<li><a href="../../index.html" >Module code</a> &raquo;</li> <li><a href="../../index.html" >Module code</a> &raquo;</li>
<li><a href="../../pylorax.html" >pylorax</a> &raquo;</li> <li><a href="../../pylorax.html" >pylorax</a> &raquo;</li>
<li><a href="../api.html" accesskey="U">pylorax.api</a> &raquo;</li> <li><a href="../api.html" accesskey="U">pylorax.api</a> &raquo;</li>
@ -128,7 +128,7 @@
<li class="right" > <li class="right" >
<a href="../../../py-modindex.html" title="Python Module Index" <a href="../../../py-modindex.html" title="Python Module Index"
>modules</a> |</li> >modules</a> |</li>
<li><a href="../../../index.html">Lorax 19.7.22 documentation</a> &raquo;</li> <li><a href="../../../index.html">Lorax 19.7.43 documentation</a> &raquo;</li>
<li><a href="../../index.html" >Module code</a> &raquo;</li> <li><a href="../../index.html" >Module code</a> &raquo;</li>
<li><a href="../../pylorax.html" >pylorax</a> &raquo;</li> <li><a href="../../pylorax.html" >pylorax</a> &raquo;</li>
<li><a href="../api.html" >pylorax.api</a> &raquo;</li> <li><a href="../api.html" >pylorax.api</a> &raquo;</li>

View File

@ -8,7 +8,7 @@
<head> <head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>pylorax.api.compose &mdash; Lorax 19.7.22 documentation</title> <title>pylorax.api.compose &mdash; Lorax 19.7.43 documentation</title>
<link rel="stylesheet" href="../../../_static/default.css" type="text/css" /> <link rel="stylesheet" href="../../../_static/default.css" type="text/css" />
<link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" /> <link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" />
@ -16,7 +16,7 @@
<script type="text/javascript"> <script type="text/javascript">
var DOCUMENTATION_OPTIONS = { var DOCUMENTATION_OPTIONS = {
URL_ROOT: '../../../', URL_ROOT: '../../../',
VERSION: '19.7.22', VERSION: '19.7.43',
COLLAPSE_INDEX: false, COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html', FILE_SUFFIX: '.html',
HAS_SOURCE: true HAS_SOURCE: true
@ -25,7 +25,7 @@
<script type="text/javascript" src="../../../_static/jquery.js"></script> <script type="text/javascript" src="../../../_static/jquery.js"></script>
<script type="text/javascript" src="../../../_static/underscore.js"></script> <script type="text/javascript" src="../../../_static/underscore.js"></script>
<script type="text/javascript" src="../../../_static/doctools.js"></script> <script type="text/javascript" src="../../../_static/doctools.js"></script>
<link rel="top" title="Lorax 19.7.22 documentation" href="../../../index.html" /> <link rel="top" title="Lorax 19.7.43 documentation" href="../../../index.html" />
<link rel="up" title="pylorax.api" href="../api.html" /> <link rel="up" title="pylorax.api" href="../api.html" />
</head> </head>
<body> <body>
@ -38,7 +38,7 @@
<li class="right" > <li class="right" >
<a href="../../../py-modindex.html" title="Python Module Index" <a href="../../../py-modindex.html" title="Python Module Index"
>modules</a> |</li> >modules</a> |</li>
<li><a href="../../../index.html">Lorax 19.7.22 documentation</a> &raquo;</li> <li><a href="../../../index.html">Lorax 19.7.43 documentation</a> &raquo;</li>
<li><a href="../../index.html" >Module code</a> &raquo;</li> <li><a href="../../index.html" >Module code</a> &raquo;</li>
<li><a href="../../pylorax.html" >pylorax</a> &raquo;</li> <li><a href="../../pylorax.html" >pylorax</a> &raquo;</li>
<li><a href="../api.html" accesskey="U">pylorax.api</a> &raquo;</li> <li><a href="../api.html" accesskey="U">pylorax.api</a> &raquo;</li>
@ -51,7 +51,7 @@
<div class="body"> <div class="body">
<h1>Source code for pylorax.api.compose</h1><div class="highlight"><pre> <h1>Source code for pylorax.api.compose</h1><div class="highlight"><pre>
<span class="c"># Copyright (C) 2018 Red Hat, Inc.</span> <span class="c"># Copyright (C) 2018-2019 Red Hat, Inc.</span>
<span class="c">#</span> <span class="c">#</span>
<span class="c"># This program is free software; you can redistribute it and/or modify</span> <span class="c"># This program is free software; you can redistribute it and/or modify</span>
<span class="c"># it under the terms of the GNU General Public License as published by</span> <span class="c"># it under the terms of the GNU General Public License as published by</span>
@ -83,11 +83,13 @@
<span class="sd">parameters needed to generate the desired output. Other types should be set to False.</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="sd">&quot;&quot;&quot;</span>
<span class="kn">from</span> <span class="nn">__future__</span> <span class="kn">import</span> <span class="n">print_function</span>
<span class="kn">import</span> <span class="nn">logging</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="s">&quot;lorax-composer&quot;</span><span class="p">)</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="s">&quot;lorax-composer&quot;</span><span class="p">)</span>
<span class="kn">import</span> <span class="nn">os</span> <span class="kn">import</span> <span class="nn">os</span>
<span class="kn">from</span> <span class="nn">glob</span> <span class="kn">import</span> <span class="n">glob</span> <span class="kn">from</span> <span class="nn">glob</span> <span class="kn">import</span> <span class="n">glob</span>
<span class="kn">from</span> <span class="nn">StringIO</span> <span class="kn">import</span> <span class="n">StringIO</span>
<span class="kn">from</span> <span class="nn">math</span> <span class="kn">import</span> <span class="n">ceil</span> <span class="kn">from</span> <span class="nn">math</span> <span class="kn">import</span> <span class="n">ceil</span>
<span class="kn">import</span> <span class="nn">pytoml</span> <span class="kn">as</span> <span class="nn">toml</span> <span class="kn">import</span> <span class="nn">pytoml</span> <span class="kn">as</span> <span class="nn">toml</span>
<span class="kn">import</span> <span class="nn">shutil</span> <span class="kn">import</span> <span class="nn">shutil</span>
@ -103,6 +105,7 @@
<span class="kn">from</span> <span class="nn">pylorax.api.projects</span> <span class="kn">import</span> <span class="n">ProjectsError</span> <span class="kn">from</span> <span class="nn">pylorax.api.projects</span> <span class="kn">import</span> <span class="n">ProjectsError</span>
<span class="kn">from</span> <span class="nn">pylorax.api.recipes</span> <span class="kn">import</span> <span class="n">read_recipe_and_id</span> <span class="kn">from</span> <span class="nn">pylorax.api.recipes</span> <span class="kn">import</span> <span class="n">read_recipe_and_id</span>
<span class="kn">from</span> <span class="nn">pylorax.api.timestamp</span> <span class="kn">import</span> <span class="n">TS_CREATED</span><span class="p">,</span> <span class="n">write_timestamp</span> <span class="kn">from</span> <span class="nn">pylorax.api.timestamp</span> <span class="kn">import</span> <span class="n">TS_CREATED</span><span class="p">,</span> <span class="n">write_timestamp</span>
<span class="kn">from</span> <span class="nn">pylorax.executils</span> <span class="kn">import</span> <span class="n">runcmd_output</span>
<span class="kn">from</span> <span class="nn">pylorax.imgutils</span> <span class="kn">import</span> <span class="n">default_image_name</span> <span class="kn">from</span> <span class="nn">pylorax.imgutils</span> <span class="kn">import</span> <span class="n">default_image_name</span>
<span class="kn">from</span> <span class="nn">pylorax.sysutils</span> <span class="kn">import</span> <span class="n">joinpaths</span> <span class="kn">from</span> <span class="nn">pylorax.sysutils</span> <span class="kn">import</span> <span class="n">joinpaths</span>
@ -172,9 +175,391 @@
<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="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="s">&#39;--noverifyssl&#39;</span> <span class="n">cmd</span> <span class="o">+=</span> <span class="s">&#39;--noverifyssl&#39;</span>
<span class="k">if</span> <span class="n">r</span><span class="o">.</span><span class="n">sslcacert</span><span class="p">:</span>
<span class="n">cmd</span> <span class="o">+=</span> <span class="s">&#39; --sslcacert=&quot;</span><span class="si">%s</span><span class="s">&quot;&#39;</span> <span class="o">%</span> <span class="n">r</span><span class="o">.</span><span class="n">sslcacert</span>
<span class="k">if</span> <span class="n">r</span><span class="o">.</span><span class="n">sslclientcert</span><span class="p">:</span>
<span class="n">cmd</span> <span class="o">+=</span> <span class="s">&#39; --sslclientcert=&quot;</span><span class="si">%s</span><span class="s">&quot;&#39;</span> <span class="o">%</span> <span class="n">r</span><span class="o">.</span><span class="n">sslclientcert</span>
<span class="k">if</span> <span class="n">r</span><span class="o">.</span><span class="n">sslclientkey</span><span class="p">:</span>
<span class="n">cmd</span> <span class="o">+=</span> <span class="s">&#39; --sslclientkey=&quot;</span><span class="si">%s</span><span class="s">&quot;&#39;</span> <span class="o">%</span> <span class="n">r</span><span class="o">.</span><span class="n">sslclientkey</span>
<span class="k">return</span> <span class="n">cmd</span> <span class="k">return</span> <span class="n">cmd</span>
</div> </div>
<div class="viewcode-block" id="bootloader_append"><a class="viewcode-back" href="../../../pylorax.api.html#pylorax.api.compose.bootloader_append">[docs]</a><span class="k">def</span> <span class="nf">bootloader_append</span><span class="p">(</span><span class="n">line</span><span class="p">,</span> <span class="n">kernel_append</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot; Insert the kernel_append string into the --append argument</span>
<span class="sd"> :param line: The bootloader ... line</span>
<span class="sd"> :type line: str</span>
<span class="sd"> :param kernel_append: The arguments to append to the --append section</span>
<span class="sd"> :type kernel_append: str</span>
<span class="sd"> Using pykickstart to process the line is the best way to make sure it</span>
<span class="sd"> is parsed correctly, and re-assembled for inclusion into the final kickstart</span>
<span class="sd"> &quot;&quot;&quot;</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="bp">False</span><span class="p">,</span> <span class="n">missingIncludeIsFatal</span><span class="o">=</span><span class="bp">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">line</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">bootloader</span><span class="o">.</span><span class="n">appendLine</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">bootloader</span><span class="o">.</span><span class="n">appendLine</span> <span class="o">+=</span> <span class="s">&quot; </span><span class="si">%s</span><span class="s">&quot;</span> <span class="o">%</span> <span class="n">kernel_append</span>
<span class="k">else</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">bootloader</span><span class="o">.</span><span class="n">appendLine</span> <span class="o">=</span> <span class="n">kernel_append</span>
<span class="c"># Converting back to a string includes a comment, return just the bootloader line</span>
<span class="k">return</span> <span class="nb">str</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">bootloader</span><span class="p">)</span><span class="o">.</span><span class="n">splitlines</span><span class="p">()[</span><span class="o">-</span><span class="mi">1</span><span class="p">]</span>
</div>
<div class="viewcode-block" id="get_kernel_append"><a class="viewcode-back" href="../../../pylorax.api.html#pylorax.api.compose.get_kernel_append">[docs]</a><span class="k">def</span> <span class="nf">get_kernel_append</span><span class="p">(</span><span class="n">recipe</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;Return the customizations.kernel append value</span>
<span class="sd"> :param recipe:</span>
<span class="sd"> :type recipe: Recipe object</span>
<span class="sd"> :returns: append value or empty string</span>
<span class="sd"> :rtype: str</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="k">if</span> <span class="s">&quot;customizations&quot;</span> <span class="ow">not</span> <span class="ow">in</span> <span class="n">recipe</span> <span class="ow">or</span> \
<span class="s">&quot;kernel&quot;</span> <span class="ow">not</span> <span class="ow">in</span> <span class="n">recipe</span><span class="p">[</span><span class="s">&quot;customizations&quot;</span><span class="p">]</span> <span class="ow">or</span> \
<span class="s">&quot;append&quot;</span> <span class="ow">not</span> <span class="ow">in</span> <span class="n">recipe</span><span class="p">[</span><span class="s">&quot;customizations&quot;</span><span class="p">][</span><span class="s">&quot;kernel&quot;</span><span class="p">]:</span>
<span class="k">return</span> <span class="s">&quot;&quot;</span>
<span class="k">return</span> <span class="n">recipe</span><span class="p">[</span><span class="s">&quot;customizations&quot;</span><span class="p">][</span><span class="s">&quot;kernel&quot;</span><span class="p">][</span><span class="s">&quot;append&quot;</span><span class="p">]</span>
</div>
<div class="viewcode-block" id="timezone_cmd"><a class="viewcode-back" href="../../../pylorax.api.html#pylorax.api.compose.timezone_cmd">[docs]</a><span class="k">def</span> <span class="nf">timezone_cmd</span><span class="p">(</span><span class="n">line</span><span class="p">,</span> <span class="n">settings</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot; Update the timezone line with the settings</span>
<span class="sd"> :param line: The timezone ... line</span>
<span class="sd"> :type line: str</span>
<span class="sd"> :param settings: A dict with timezone and/or ntpservers list</span>
<span class="sd"> :type settings: dict</span>
<span class="sd"> Using pykickstart to process the line is the best way to make sure it</span>
<span class="sd"> is parsed correctly, and re-assembled for inclusion into the final kickstart</span>
<span class="sd"> &quot;&quot;&quot;</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="bp">False</span><span class="p">,</span> <span class="n">missingIncludeIsFatal</span><span class="o">=</span><span class="bp">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">line</span><span class="p">)</span>
<span class="k">if</span> <span class="s">&quot;timezone&quot;</span> <span class="ow">in</span> <span class="n">settings</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">timezone</span><span class="o">.</span><span class="n">timezone</span> <span class="o">=</span> <span class="n">settings</span><span class="p">[</span><span class="s">&quot;timezone&quot;</span><span class="p">]</span>
<span class="k">if</span> <span class="s">&quot;ntpservers&quot;</span> <span class="ow">in</span> <span class="n">settings</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">timezone</span><span class="o">.</span><span class="n">ntpservers</span> <span class="o">=</span> <span class="n">settings</span><span class="p">[</span><span class="s">&quot;ntpservers&quot;</span><span class="p">]</span>
<span class="c"># Converting back to a string includes a comment, return just the timezone line</span>
<span class="k">return</span> <span class="nb">str</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">timezone</span><span class="p">)</span><span class="o">.</span><span class="n">splitlines</span><span class="p">()[</span><span class="o">-</span><span class="mi">1</span><span class="p">]</span>
</div>
<div class="viewcode-block" id="get_timezone_settings"><a class="viewcode-back" href="../../../pylorax.api.html#pylorax.api.compose.get_timezone_settings">[docs]</a><span class="k">def</span> <span class="nf">get_timezone_settings</span><span class="p">(</span><span class="n">recipe</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;Return the customizations.timezone dict</span>
<span class="sd"> :param recipe:</span>
<span class="sd"> :type recipe: Recipe object</span>
<span class="sd"> :returns: append value or empty string</span>
<span class="sd"> :rtype: dict</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="k">if</span> <span class="s">&quot;customizations&quot;</span> <span class="ow">not</span> <span class="ow">in</span> <span class="n">recipe</span> <span class="ow">or</span> \
<span class="s">&quot;timezone&quot;</span> <span class="ow">not</span> <span class="ow">in</span> <span class="n">recipe</span><span class="p">[</span><span class="s">&quot;customizations&quot;</span><span class="p">]:</span>
<span class="k">return</span> <span class="p">{}</span>
<span class="k">return</span> <span class="n">recipe</span><span class="p">[</span><span class="s">&quot;customizations&quot;</span><span class="p">][</span><span class="s">&quot;timezone&quot;</span><span class="p">]</span>
</div>
<div class="viewcode-block" id="lang_cmd"><a class="viewcode-back" href="../../../pylorax.api.html#pylorax.api.compose.lang_cmd">[docs]</a><span class="k">def</span> <span class="nf">lang_cmd</span><span class="p">(</span><span class="n">line</span><span class="p">,</span> <span class="n">languages</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot; Update the lang line with the languages</span>
<span class="sd"> :param line: The lang ... line</span>
<span class="sd"> :type line: str</span>
<span class="sd"> :param settings: The list of languages</span>
<span class="sd"> :type settings: list</span>
<span class="sd"> Using pykickstart to process the line is the best way to make sure it</span>
<span class="sd"> is parsed correctly, and re-assembled for inclusion into the final kickstart</span>
<span class="sd"> &quot;&quot;&quot;</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="bp">False</span><span class="p">,</span> <span class="n">missingIncludeIsFatal</span><span class="o">=</span><span class="bp">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">line</span><span class="p">)</span>
<span class="k">if</span> <span class="n">languages</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">lang</span><span class="o">.</span><span class="n">lang</span> <span class="o">=</span> <span class="n">languages</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span>
<span class="k">if</span> <span class="nb">len</span><span class="p">(</span><span class="n">languages</span><span class="p">)</span> <span class="o">&gt;</span> <span class="mi">1</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">lang</span><span class="o">.</span><span class="n">addsupport</span> <span class="o">=</span> <span class="n">languages</span><span class="p">[</span><span class="mi">1</span><span class="p">:]</span>
<span class="c"># Converting back to a string includes a comment, return just the lang line</span>
<span class="k">return</span> <span class="nb">str</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">lang</span><span class="p">)</span><span class="o">.</span><span class="n">splitlines</span><span class="p">()[</span><span class="o">-</span><span class="mi">1</span><span class="p">]</span>
</div>
<div class="viewcode-block" id="get_languages"><a class="viewcode-back" href="../../../pylorax.api.html#pylorax.api.compose.get_languages">[docs]</a><span class="k">def</span> <span class="nf">get_languages</span><span class="p">(</span><span class="n">recipe</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;Return the customizations.locale.languages list</span>
<span class="sd"> :param recipe: The recipe</span>
<span class="sd"> :type recipe: Recipe object</span>
<span class="sd"> :returns: list of language strings</span>
<span class="sd"> :rtype: list</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="k">if</span> <span class="s">&quot;customizations&quot;</span> <span class="ow">not</span> <span class="ow">in</span> <span class="n">recipe</span> <span class="ow">or</span> \
<span class="s">&quot;locale&quot;</span> <span class="ow">not</span> <span class="ow">in</span> <span class="n">recipe</span><span class="p">[</span><span class="s">&quot;customizations&quot;</span><span class="p">]</span> <span class="ow">or</span> \
<span class="s">&quot;languages&quot;</span> <span class="ow">not</span> <span class="ow">in</span> <span class="n">recipe</span><span class="p">[</span><span class="s">&quot;customizations&quot;</span><span class="p">][</span><span class="s">&quot;locale&quot;</span><span class="p">]:</span>
<span class="k">return</span> <span class="p">[]</span>
<span class="k">return</span> <span class="n">recipe</span><span class="p">[</span><span class="s">&quot;customizations&quot;</span><span class="p">][</span><span class="s">&quot;locale&quot;</span><span class="p">][</span><span class="s">&quot;languages&quot;</span><span class="p">]</span>
</div>
<div class="viewcode-block" id="keyboard_cmd"><a class="viewcode-back" href="../../../pylorax.api.html#pylorax.api.compose.keyboard_cmd">[docs]</a><span class="k">def</span> <span class="nf">keyboard_cmd</span><span class="p">(</span><span class="n">line</span><span class="p">,</span> <span class="n">layout</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot; Update the keyboard line with the layout</span>
<span class="sd"> :param line: The keyboard ... line</span>
<span class="sd"> :type line: str</span>
<span class="sd"> :param settings: The keyboard layout</span>
<span class="sd"> :type settings: str</span>
<span class="sd"> Using pykickstart to process the line is the best way to make sure it</span>
<span class="sd"> is parsed correctly, and re-assembled for inclusion into the final kickstart</span>
<span class="sd"> &quot;&quot;&quot;</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="bp">False</span><span class="p">,</span> <span class="n">missingIncludeIsFatal</span><span class="o">=</span><span class="bp">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">line</span><span class="p">)</span>
<span class="k">if</span> <span class="n">layout</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">keyboard</span><span class="o">.</span><span class="n">keyboard</span> <span class="o">=</span> <span class="n">layout</span>
<span class="n">ks</span><span class="o">.</span><span class="n">handler</span><span class="o">.</span><span class="n">keyboard</span><span class="o">.</span><span class="n">vc_keymap</span> <span class="o">=</span> <span class="s">&quot;&quot;</span>
<span class="n">ks</span><span class="o">.</span><span class="n">handler</span><span class="o">.</span><span class="n">keyboard</span><span class="o">.</span><span class="n">x_layouts</span> <span class="o">=</span> <span class="p">[]</span>
<span class="c"># Converting back to a string includes a comment, return just the keyboard line</span>
<span class="k">return</span> <span class="nb">str</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">keyboard</span><span class="p">)</span><span class="o">.</span><span class="n">splitlines</span><span class="p">()[</span><span class="o">-</span><span class="mi">1</span><span class="p">]</span>
</div>
<div class="viewcode-block" id="get_keyboard_layout"><a class="viewcode-back" href="../../../pylorax.api.html#pylorax.api.compose.get_keyboard_layout">[docs]</a><span class="k">def</span> <span class="nf">get_keyboard_layout</span><span class="p">(</span><span class="n">recipe</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;Return the customizations.locale.keyboard list</span>
<span class="sd"> :param recipe: The recipe</span>
<span class="sd"> :type recipe: Recipe object</span>
<span class="sd"> :returns: The keyboard layout string</span>
<span class="sd"> :rtype: str</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="k">if</span> <span class="s">&quot;customizations&quot;</span> <span class="ow">not</span> <span class="ow">in</span> <span class="n">recipe</span> <span class="ow">or</span> \
<span class="s">&quot;locale&quot;</span> <span class="ow">not</span> <span class="ow">in</span> <span class="n">recipe</span><span class="p">[</span><span class="s">&quot;customizations&quot;</span><span class="p">]</span> <span class="ow">or</span> \
<span class="s">&quot;keyboard&quot;</span> <span class="ow">not</span> <span class="ow">in</span> <span class="n">recipe</span><span class="p">[</span><span class="s">&quot;customizations&quot;</span><span class="p">][</span><span class="s">&quot;locale&quot;</span><span class="p">]:</span>
<span class="k">return</span> <span class="p">[]</span>
<span class="k">return</span> <span class="n">recipe</span><span class="p">[</span><span class="s">&quot;customizations&quot;</span><span class="p">][</span><span class="s">&quot;locale&quot;</span><span class="p">][</span><span class="s">&quot;keyboard&quot;</span><span class="p">]</span>
</div>
<div class="viewcode-block" id="firewall_cmd"><a class="viewcode-back" href="../../../pylorax.api.html#pylorax.api.compose.firewall_cmd">[docs]</a><span class="k">def</span> <span class="nf">firewall_cmd</span><span class="p">(</span><span class="n">line</span><span class="p">,</span> <span class="n">settings</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot; Update the firewall line with the new ports and services</span>
<span class="sd"> :param line: The firewall ... line</span>
<span class="sd"> :type line: str</span>
<span class="sd"> :param settings: A dict with the list of services and ports to enable and disable</span>
<span class="sd"> :type settings: dict</span>
<span class="sd"> Using pykickstart to process the line is the best way to make sure it</span>
<span class="sd"> is parsed correctly, and re-assembled for inclusion into the final kickstart</span>
<span class="sd"> &quot;&quot;&quot;</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="bp">False</span><span class="p">,</span> <span class="n">missingIncludeIsFatal</span><span class="o">=</span><span class="bp">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">line</span><span class="p">)</span>
<span class="c"># Do not override firewall --disabled</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">firewall</span><span class="o">.</span><span class="n">enabled</span> <span class="o">!=</span> <span class="bp">False</span> <span class="ow">and</span> <span class="n">settings</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">firewall</span><span class="o">.</span><span class="n">ports</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">settings</span><span class="p">[</span><span class="s">&quot;ports&quot;</span><span class="p">]</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">firewall</span><span class="o">.</span><span class="n">ports</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">firewall</span><span class="o">.</span><span class="n">services</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">settings</span><span class="p">[</span><span class="s">&quot;enabled&quot;</span><span class="p">]</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">firewall</span><span class="o">.</span><span class="n">services</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">firewall</span><span class="o">.</span><span class="n">remove_services</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">settings</span><span class="p">[</span><span class="s">&quot;disabled&quot;</span><span class="p">]</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">firewall</span><span class="o">.</span><span class="n">remove_services</span><span class="p">))</span>
<span class="c"># Converting back to a string includes a comment, return just the keyboard line</span>
<span class="k">return</span> <span class="nb">str</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">firewall</span><span class="p">)</span><span class="o">.</span><span class="n">splitlines</span><span class="p">()[</span><span class="o">-</span><span class="mi">1</span><span class="p">]</span>
</div>
<div class="viewcode-block" id="get_firewall_settings"><a class="viewcode-back" href="../../../pylorax.api.html#pylorax.api.compose.get_firewall_settings">[docs]</a><span class="k">def</span> <span class="nf">get_firewall_settings</span><span class="p">(</span><span class="n">recipe</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;Return the customizations.firewall settings</span>
<span class="sd"> :param recipe: The recipe</span>
<span class="sd"> :type recipe: Recipe object</span>
<span class="sd"> :returns: A dict of settings</span>
<span class="sd"> :rtype: dict</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="n">settings</span> <span class="o">=</span> <span class="p">{</span><span class="s">&quot;ports&quot;</span><span class="p">:</span> <span class="p">[],</span> <span class="s">&quot;enabled&quot;</span><span class="p">:</span> <span class="p">[],</span> <span class="s">&quot;disabled&quot;</span><span class="p">:</span> <span class="p">[]}</span>
<span class="k">if</span> <span class="s">&quot;customizations&quot;</span> <span class="ow">not</span> <span class="ow">in</span> <span class="n">recipe</span> <span class="ow">or</span> \
<span class="s">&quot;firewall&quot;</span> <span class="ow">not</span> <span class="ow">in</span> <span class="n">recipe</span><span class="p">[</span><span class="s">&quot;customizations&quot;</span><span class="p">]:</span>
<span class="k">return</span> <span class="n">settings</span>
<span class="n">settings</span><span class="p">[</span><span class="s">&quot;ports&quot;</span><span class="p">]</span> <span class="o">=</span> <span class="n">recipe</span><span class="p">[</span><span class="s">&quot;customizations&quot;</span><span class="p">][</span><span class="s">&quot;firewall&quot;</span><span class="p">]</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s">&quot;ports&quot;</span><span class="p">,</span> <span class="p">[])</span>
<span class="k">if</span> <span class="s">&quot;services&quot;</span> <span class="ow">in</span> <span class="n">recipe</span><span class="p">[</span><span class="s">&quot;customizations&quot;</span><span class="p">][</span><span class="s">&quot;firewall&quot;</span><span class="p">]:</span>
<span class="n">settings</span><span class="p">[</span><span class="s">&quot;enabled&quot;</span><span class="p">]</span> <span class="o">=</span> <span class="n">recipe</span><span class="p">[</span><span class="s">&quot;customizations&quot;</span><span class="p">][</span><span class="s">&quot;firewall&quot;</span><span class="p">][</span><span class="s">&quot;services&quot;</span><span class="p">]</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s">&quot;enabled&quot;</span><span class="p">,</span> <span class="p">[])</span>
<span class="n">settings</span><span class="p">[</span><span class="s">&quot;disabled&quot;</span><span class="p">]</span> <span class="o">=</span> <span class="n">recipe</span><span class="p">[</span><span class="s">&quot;customizations&quot;</span><span class="p">][</span><span class="s">&quot;firewall&quot;</span><span class="p">][</span><span class="s">&quot;services&quot;</span><span class="p">]</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s">&quot;disabled&quot;</span><span class="p">,</span> <span class="p">[])</span>
<span class="k">return</span> <span class="n">settings</span>
</div>
<div class="viewcode-block" id="services_cmd"><a class="viewcode-back" href="../../../pylorax.api.html#pylorax.api.compose.services_cmd">[docs]</a><span class="k">def</span> <span class="nf">services_cmd</span><span class="p">(</span><span class="n">line</span><span class="p">,</span> <span class="n">settings</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot; Update the services line with additional services to enable/disable</span>
<span class="sd"> :param line: The services ... line</span>
<span class="sd"> :type line: str</span>
<span class="sd"> :param settings: A dict with the list of services to enable and disable</span>
<span class="sd"> :type settings: dict</span>
<span class="sd"> Using pykickstart to process the line is the best way to make sure it</span>
<span class="sd"> is parsed correctly, and re-assembled for inclusion into the final kickstart</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="c"># Empty services and no additional settings, return an empty string</span>
<span class="k">if</span> <span class="ow">not</span> <span class="n">line</span> <span class="ow">and</span> <span class="ow">not</span> <span class="n">settings</span><span class="p">[</span><span class="s">&quot;enabled&quot;</span><span class="p">]</span> <span class="ow">and</span> <span class="ow">not</span> <span class="n">settings</span><span class="p">[</span><span class="s">&quot;disabled&quot;</span><span class="p">]:</span>
<span class="k">return</span> <span class="s">&quot;&quot;</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="bp">False</span><span class="p">,</span> <span class="n">missingIncludeIsFatal</span><span class="o">=</span><span class="bp">False</span><span class="p">)</span>
<span class="c"># Allow passing in a &#39;default&#39; so that the enable/disable may be applied to it, without</span>
<span class="c"># parsing it and emitting a kickstart error message</span>
<span class="k">if</span> <span class="n">line</span> <span class="o">!=</span> <span class="s">&quot;services&quot;</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">line</span><span class="p">)</span>
<span class="c"># Add to any existing services, removing any duplicates</span>
<span class="n">ks</span><span class="o">.</span><span class="n">handler</span><span class="o">.</span><span class="n">services</span><span class="o">.</span><span class="n">enabled</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">settings</span><span class="p">[</span><span class="s">&quot;enabled&quot;</span><span class="p">]</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">services</span><span class="o">.</span><span class="n">enabled</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">services</span><span class="o">.</span><span class="n">disabled</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">settings</span><span class="p">[</span><span class="s">&quot;disabled&quot;</span><span class="p">]</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">services</span><span class="o">.</span><span class="n">disabled</span><span class="p">))</span>
<span class="c"># Converting back to a string includes a comment, return just the keyboard line</span>
<span class="k">return</span> <span class="nb">str</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">services</span><span class="p">)</span><span class="o">.</span><span class="n">splitlines</span><span class="p">()[</span><span class="o">-</span><span class="mi">1</span><span class="p">]</span>
</div>
<div class="viewcode-block" id="get_services"><a class="viewcode-back" href="../../../pylorax.api.html#pylorax.api.compose.get_services">[docs]</a><span class="k">def</span> <span class="nf">get_services</span><span class="p">(</span><span class="n">recipe</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;Return the customizations.services settings</span>
<span class="sd"> :param recipe: The recipe</span>
<span class="sd"> :type recipe: Recipe object</span>
<span class="sd"> :returns: A dict of settings</span>
<span class="sd"> :rtype: dict</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="n">settings</span> <span class="o">=</span> <span class="p">{</span><span class="s">&quot;enabled&quot;</span><span class="p">:</span> <span class="p">[],</span> <span class="s">&quot;disabled&quot;</span><span class="p">:</span> <span class="p">[]}</span>
<span class="k">if</span> <span class="s">&quot;customizations&quot;</span> <span class="ow">not</span> <span class="ow">in</span> <span class="n">recipe</span> <span class="ow">or</span> \
<span class="s">&quot;services&quot;</span> <span class="ow">not</span> <span class="ow">in</span> <span class="n">recipe</span><span class="p">[</span><span class="s">&quot;customizations&quot;</span><span class="p">]:</span>
<span class="k">return</span> <span class="n">settings</span>
<span class="n">settings</span><span class="p">[</span><span class="s">&quot;enabled&quot;</span><span class="p">]</span> <span class="o">=</span> <span class="nb">sorted</span><span class="p">(</span><span class="n">recipe</span><span class="p">[</span><span class="s">&quot;customizations&quot;</span><span class="p">][</span><span class="s">&quot;services&quot;</span><span class="p">]</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s">&quot;enabled&quot;</span><span class="p">,</span> <span class="p">[]))</span>
<span class="n">settings</span><span class="p">[</span><span class="s">&quot;disabled&quot;</span><span class="p">]</span> <span class="o">=</span> <span class="nb">sorted</span><span class="p">(</span><span class="n">recipe</span><span class="p">[</span><span class="s">&quot;customizations&quot;</span><span class="p">][</span><span class="s">&quot;services&quot;</span><span class="p">]</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s">&quot;disabled&quot;</span><span class="p">,</span> <span class="p">[]))</span>
<span class="k">return</span> <span class="n">settings</span>
</div>
<div class="viewcode-block" id="get_default_services"><a class="viewcode-back" href="../../../pylorax.api.html#pylorax.api.compose.get_default_services">[docs]</a><span class="k">def</span> <span class="nf">get_default_services</span><span class="p">(</span><span class="n">recipe</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;Get the default string for services, based on recipe</span>
<span class="sd"> :param recipe: The recipe</span>
<span class="sd"> :type recipe: Recipe object</span>
<span class="sd"> :returns: string with &quot;services&quot; or &quot;&quot;</span>
<span class="sd"> :rtype: str</span>
<span class="sd"> When no services have been selected we don&#39;t need to add anything to the kickstart</span>
<span class="sd"> so return an empty string. Otherwise return &quot;services&quot; which will be updated with</span>
<span class="sd"> the settings.</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="n">services</span> <span class="o">=</span> <span class="n">get_services</span><span class="p">(</span><span class="n">recipe</span><span class="p">)</span>
<span class="k">if</span> <span class="n">services</span><span class="p">[</span><span class="s">&quot;enabled&quot;</span><span class="p">]</span> <span class="ow">or</span> <span class="n">services</span><span class="p">[</span><span class="s">&quot;disabled&quot;</span><span class="p">]:</span>
<span class="k">return</span> <span class="s">&quot;services&quot;</span>
<span class="k">else</span><span class="p">:</span>
<span class="k">return</span> <span class="s">&quot;&quot;</span>
</div>
<div class="viewcode-block" id="customize_ks_template"><a class="viewcode-back" href="../../../pylorax.api.html#pylorax.api.compose.customize_ks_template">[docs]</a><span class="k">def</span> <span class="nf">customize_ks_template</span><span class="p">(</span><span class="n">ks_template</span><span class="p">,</span> <span class="n">recipe</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot; Customize the kickstart template and return it</span>
<span class="sd"> :param ks_template: The kickstart template</span>
<span class="sd"> :type ks_template: str</span>
<span class="sd"> :param recipe:</span>
<span class="sd"> :type recipe: Recipe object</span>
<span class="sd"> Apply customizations to existing template commands, or add defaults for ones that are</span>
<span class="sd"> missing and required.</span>
<span class="sd"> Apply customizations.kernel.append to the bootloader argument in the template.</span>
<span class="sd"> Add bootloader line if it is missing.</span>
<span class="sd"> Add default timezone if needed. It does NOT replace an existing timezone entry</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="c"># Commands to be modified [NEW-COMMAND-FUNC, NEW-VALUE, DEFAULT, REPLACE]</span>
<span class="c"># The function is called with a kickstart command string and the value to replace</span>
<span class="c"># The value is specific to the command, and is understood by the function</span>
<span class="c"># The default is a complete kickstart command string, suitable for writing to the template</span>
<span class="c"># If REPLACE is False it will not change an existing entry only add a missing one</span>
<span class="n">commands</span> <span class="o">=</span> <span class="p">{</span><span class="s">&quot;bootloader&quot;</span><span class="p">:</span> <span class="p">[</span><span class="n">bootloader_append</span><span class="p">,</span>
<span class="n">get_kernel_append</span><span class="p">(</span><span class="n">recipe</span><span class="p">),</span>
<span class="s">&#39;bootloader --location=none&#39;</span><span class="p">,</span> <span class="bp">True</span><span class="p">],</span>
<span class="s">&quot;timezone&quot;</span><span class="p">:</span> <span class="p">[</span><span class="n">timezone_cmd</span><span class="p">,</span>
<span class="n">get_timezone_settings</span><span class="p">(</span><span class="n">recipe</span><span class="p">),</span>
<span class="s">&#39;timezone UTC&#39;</span><span class="p">,</span> <span class="bp">False</span><span class="p">],</span>
<span class="s">&quot;lang&quot;</span><span class="p">:</span> <span class="p">[</span><span class="n">lang_cmd</span><span class="p">,</span>
<span class="n">get_languages</span><span class="p">(</span><span class="n">recipe</span><span class="p">),</span>
<span class="s">&#39;lang en_US.UTF-8&#39;</span><span class="p">,</span> <span class="bp">True</span><span class="p">],</span>
<span class="s">&quot;keyboard&quot;</span><span class="p">:</span> <span class="p">[</span><span class="n">keyboard_cmd</span><span class="p">,</span>
<span class="n">get_keyboard_layout</span><span class="p">(</span><span class="n">recipe</span><span class="p">),</span>
<span class="s">&#39;keyboard --xlayouts us --vckeymap us&#39;</span><span class="p">,</span> <span class="bp">True</span><span class="p">],</span>
<span class="s">&quot;firewall&quot;</span><span class="p">:</span> <span class="p">[</span><span class="n">firewall_cmd</span><span class="p">,</span>
<span class="n">get_firewall_settings</span><span class="p">(</span><span class="n">recipe</span><span class="p">),</span>
<span class="s">&#39;firewall --enabled&#39;</span><span class="p">,</span> <span class="bp">True</span><span class="p">],</span>
<span class="s">&quot;services&quot;</span><span class="p">:</span> <span class="p">[</span><span class="n">services_cmd</span><span class="p">,</span>
<span class="n">get_services</span><span class="p">(</span><span class="n">recipe</span><span class="p">),</span>
<span class="n">get_default_services</span><span class="p">(</span><span class="n">recipe</span><span class="p">),</span> <span class="bp">True</span><span class="p">]</span>
<span class="p">}</span>
<span class="n">found</span> <span class="o">=</span> <span class="p">{}</span>
<span class="n">output</span> <span class="o">=</span> <span class="n">StringIO</span><span class="p">()</span>
<span class="k">for</span> <span class="n">line</span> <span class="ow">in</span> <span class="n">ks_template</span><span class="o">.</span><span class="n">splitlines</span><span class="p">():</span>
<span class="k">for</span> <span class="n">cmd</span> <span class="ow">in</span> <span class="nb">sorted</span><span class="p">(</span><span class="n">commands</span><span class="o">.</span><span class="n">keys</span><span class="p">()):</span>
<span class="p">(</span><span class="n">new_command</span><span class="p">,</span> <span class="n">value</span><span class="p">,</span> <span class="n">default</span><span class="p">,</span> <span class="n">replace</span><span class="p">)</span> <span class="o">=</span> <span class="n">commands</span><span class="p">[</span><span class="n">cmd</span><span class="p">]</span>
<span class="k">if</span> <span class="n">line</span><span class="o">.</span><span class="n">startswith</span><span class="p">(</span><span class="n">cmd</span><span class="p">):</span>
<span class="n">found</span><span class="p">[</span><span class="n">cmd</span><span class="p">]</span> <span class="o">=</span> <span class="bp">True</span>
<span class="k">if</span> <span class="n">value</span> <span class="ow">and</span> <span class="n">replace</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="s">&quot;Replacing </span><span class="si">%s</span><span class="s"> with </span><span class="si">%s</span><span class="s">&quot;</span><span class="p">,</span> <span class="n">cmd</span><span class="p">,</span> <span class="n">value</span><span class="p">)</span>
<span class="k">print</span><span class="p">(</span><span class="n">new_command</span><span class="p">(</span><span class="n">line</span><span class="p">,</span> <span class="n">value</span><span class="p">),</span> <span class="nb">file</span><span class="o">=</span><span class="n">output</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="s">&quot;Skipping </span><span class="si">%s</span><span class="s">&quot;</span><span class="p">,</span> <span class="n">cmd</span><span class="p">)</span>
<span class="k">print</span><span class="p">(</span><span class="n">line</span><span class="p">,</span> <span class="nb">file</span><span class="o">=</span><span class="n">output</span><span class="p">)</span>
<span class="k">break</span>
<span class="k">else</span><span class="p">:</span>
<span class="c"># No matches, write the line as-is</span>
<span class="k">print</span><span class="p">(</span><span class="n">line</span><span class="p">,</span> <span class="nb">file</span><span class="o">=</span><span class="n">output</span><span class="p">)</span>
<span class="c"># Write out defaults for the ones not found</span>
<span class="c"># These must go FIRST because the template still needs to have the packages added</span>
<span class="n">defaults</span> <span class="o">=</span> <span class="n">StringIO</span><span class="p">()</span>
<span class="k">for</span> <span class="n">cmd</span> <span class="ow">in</span> <span class="nb">sorted</span><span class="p">(</span><span class="n">commands</span><span class="o">.</span><span class="n">keys</span><span class="p">()):</span>
<span class="k">if</span> <span class="n">cmd</span> <span class="ow">in</span> <span class="n">found</span><span class="p">:</span>
<span class="k">continue</span>
<span class="p">(</span><span class="n">new_command</span><span class="p">,</span> <span class="n">value</span><span class="p">,</span> <span class="n">default</span><span class="p">,</span> <span class="n">_</span><span class="p">)</span> <span class="o">=</span> <span class="n">commands</span><span class="p">[</span><span class="n">cmd</span><span class="p">]</span>
<span class="k">if</span> <span class="n">value</span> <span class="ow">and</span> <span class="n">default</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="s">&quot;Setting </span><span class="si">%s</span><span class="s"> to use </span><span class="si">%s</span><span class="s">&quot;</span><span class="p">,</span> <span class="n">cmd</span><span class="p">,</span> <span class="n">value</span><span class="p">)</span>
<span class="k">print</span><span class="p">(</span><span class="n">new_command</span><span class="p">(</span><span class="n">default</span><span class="p">,</span> <span class="n">value</span><span class="p">),</span> <span class="nb">file</span><span class="o">=</span><span class="n">defaults</span><span class="p">)</span>
<span class="k">elif</span> <span class="n">default</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="s">&quot;Setting </span><span class="si">%s</span><span class="s"> to </span><span class="si">%s</span><span class="s">&quot;</span><span class="p">,</span> <span class="n">cmd</span><span class="p">,</span> <span class="n">default</span><span class="p">)</span>
<span class="k">print</span><span class="p">(</span><span class="n">default</span><span class="p">,</span> <span class="nb">file</span><span class="o">=</span><span class="n">defaults</span><span class="p">)</span>
<span class="k">return</span> <span class="n">defaults</span><span class="o">.</span><span class="n">getvalue</span><span class="p">()</span> <span class="o">+</span> <span class="n">output</span><span class="o">.</span><span class="n">getvalue</span><span class="p">()</span>
</div>
<div class="viewcode-block" id="write_ks_root"><a class="viewcode-back" href="../../../pylorax.api.html#pylorax.api.compose.write_ks_root">[docs]</a><span class="k">def</span> <span class="nf">write_ks_root</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 root password 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"> If it contains password, use rootpw to set it</span>
<span class="sd"> root cannot be used with the user command. So only key and password are supported</span>
<span class="sd"> for root.</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="c"># ssh key uses the sshkey kickstart command</span>
<span class="k">if</span> <span class="s">&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="s">&#39;sshkey --user </span><span class="si">%s</span><span class="s"> &quot;</span><span class="si">%s</span><span class="s">&quot;</span><span class="se">\n</span><span class="s">&#39;</span> <span class="o">%</span> <span class="p">(</span><span class="n">user</span><span class="p">[</span><span class="s">&quot;name&quot;</span><span class="p">],</span> <span class="n">user</span><span class="p">[</span><span class="s">&quot;key&quot;</span><span class="p">]))</span>
<span class="k">if</span> <span class="s">&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="s">&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="s">&quot;$2b$&quot;</span><span class="p">,</span> <span class="s">&quot;$6$&quot;</span><span class="p">,</span> <span class="s">&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="s">&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="s">&#39;rootpw --iscrypted &quot;</span><span class="si">%s</span><span class="s">&quot;</span><span class="se">\n</span><span class="s">&#39;</span> <span class="o">%</span> <span class="n">user</span><span class="p">[</span><span class="s">&quot;password&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="s">&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="s">&#39;rootpw --plaintext &quot;</span><span class="si">%s</span><span class="s">&quot;</span><span class="se">\n</span><span class="s">&#39;</span> <span class="o">%</span> <span class="n">user</span><span class="p">[</span><span class="s">&quot;password&quot;</span><span class="p">])</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> <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">&quot;&quot;&quot; Write kickstart user and sshkey entry</span>
@ -187,9 +572,6 @@
<span class="sd"> All of the user fields are optional, except name, write out a kickstart user entry</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"> with whatever options are relevant.</span>
<span class="sd"> &quot;&quot;&quot;</span> <span class="sd"> &quot;&quot;&quot;</span>
<span class="k">if</span> <span class="s">&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="s">&quot;user entry requires a name&quot;</span><span class="p">)</span>
<span class="c"># ssh key uses the sshkey kickstart command</span> <span class="c"># ssh key uses the sshkey kickstart command</span>
<span class="k">if</span> <span class="s">&quot;key&quot;</span> <span class="ow">in</span> <span class="n">user</span><span class="p">:</span> <span class="k">if</span> <span class="s">&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="s">&#39;sshkey --user </span><span class="si">%s</span><span class="s"> &quot;</span><span class="si">%s</span><span class="s">&quot;</span><span class="se">\n</span><span class="s">&#39;</span> <span class="o">%</span> <span class="p">(</span><span class="n">user</span><span class="p">[</span><span class="s">&quot;name&quot;</span><span class="p">],</span> <span class="n">user</span><span class="p">[</span><span class="s">&quot;key&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="s">&#39;sshkey --user </span><span class="si">%s</span><span class="s"> &quot;</span><span class="si">%s</span><span class="s">&quot;</span><span class="se">\n</span><span class="s">&#39;</span> <span class="o">%</span> <span class="p">(</span><span class="n">user</span><span class="p">[</span><span class="s">&quot;name&quot;</span><span class="p">],</span> <span class="n">user</span><span class="p">[</span><span class="s">&quot;key&quot;</span><span class="p">]))</span>
@ -261,6 +643,10 @@
<span class="k">return</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="s">&quot;customizations&quot;</span><span class="p">]</span> <span class="n">customizations</span> <span class="o">=</span> <span class="n">recipe</span><span class="p">[</span><span class="s">&quot;customizations&quot;</span><span class="p">]</span>
<span class="c"># allow customizations to be incorrectly specified as [[customizations]] instead of [customizations]</span>
<span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">customizations</span><span class="p">,</span> <span class="nb">list</span><span class="p">):</span>
<span class="n">customizations</span> <span class="o">=</span> <span class="n">customizations</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span>
<span class="k">if</span> <span class="s">&quot;hostname&quot;</span> <span class="ow">in</span> <span class="n">customizations</span><span class="p">:</span> <span class="k">if</span> <span class="s">&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="s">&quot;network --hostname=</span><span class="si">%s</span><span class="se">\n</span><span class="s">&quot;</span> <span class="o">%</span> <span class="n">customizations</span><span class="p">[</span><span class="s">&quot;hostname&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="s">&quot;network --hostname=</span><span class="si">%s</span><span class="se">\n</span><span class="s">&quot;</span> <span class="o">%</span> <span class="n">customizations</span><span class="p">[</span><span class="s">&quot;hostname&quot;</span><span class="p">])</span>
@ -278,6 +664,14 @@
<span class="k">if</span> <span class="s">&quot;user&quot;</span> <span class="ow">in</span> <span class="n">customizations</span><span class="p">:</span> <span class="k">if</span> <span class="s">&quot;user&quot;</span> <span class="ow">in</span> <span class="n">customizations</span><span class="p">:</span>
<span class="c"># only name is required, everything else is optional</span> <span class="c"># 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="s">&quot;user&quot;</span><span class="p">]:</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="s">&quot;user&quot;</span><span class="p">]:</span>
<span class="k">if</span> <span class="s">&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="s">&quot;user entry requires a name&quot;</span><span class="p">)</span>
<span class="c"># root is special, cannot use normal user command for it</span>
<span class="k">if</span> <span class="n">user</span><span class="p">[</span><span class="s">&quot;name&quot;</span><span class="p">]</span> <span class="o">==</span> <span class="s">&quot;root&quot;</span><span class="p">:</span>
<span class="n">write_ks_root</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="k">continue</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">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="s">&quot;name&quot;</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="s">&quot;name&quot;</span><span class="p">])</span>
@ -287,6 +681,25 @@
<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="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="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="s">&quot;Skipping group </span><span class="si">%s</span><span class="s">, already created by user&quot;</span><span class="p">,</span> <span class="n">group</span><span class="p">[</span><span class="s">&quot;name&quot;</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="s">&quot;Skipping group </span><span class="si">%s</span><span class="s">, already created by user&quot;</span><span class="p">,</span> <span class="n">group</span><span class="p">[</span><span class="s">&quot;name&quot;</span><span class="p">])</span>
</div>
<div class="viewcode-block" id="get_md_size"><a class="viewcode-back" href="../../../pylorax.api.html#pylorax.api.compose.get_md_size">[docs]</a><span class="k">def</span> <span class="nf">get_md_size</span><span class="p">(</span><span class="n">yum_path</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;Estimate the amount of space needed by anaconda</span>
<span class="sd"> Anaconda doesn&#39;t download the filelists or &#39;other&#39; metadata, which can add</span>
<span class="sd"> up to a significant difference, so exclude those from the calculation.</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="k">try</span><span class="p">:</span>
<span class="n">du_output</span> <span class="o">=</span> <span class="n">runcmd_output</span><span class="p">([</span><span class="s">&quot;/usr/bin/du&quot;</span><span class="p">,</span>
<span class="s">&quot;--exclude&quot;</span><span class="p">,</span> <span class="s">&quot;*other*&quot;</span><span class="p">,</span>
<span class="s">&quot;--exclude&quot;</span><span class="p">,</span> <span class="s">&quot;*filelists*&quot;</span><span class="p">,</span>
<span class="s">&quot;-sb&quot;</span><span class="p">,</span>
<span class="n">yum_path</span><span class="p">])</span>
<span class="k">return</span> <span class="nb">int</span><span class="p">(</span><span class="n">du_output</span><span class="o">.</span><span class="n">split</span><span class="p">()[</span><span class="mi">0</span><span class="p">])</span>
<span class="k">except</span> <span class="p">(</span><span class="ne">ValueError</span><span class="p">,</span> <span class="ne">IndexError</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="s">&quot;Problem calculating metadata size from &#39;</span><span class="si">%s</span><span class="s">&#39;: </span><span class="si">%s</span><span class="s">&quot;</span><span class="p">,</span> <span class="n">du_output</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">return</span> <span class="mi">0</span>
</div> </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">yumlock</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> <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">yumlock</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">&quot;&quot;&quot; Start the build</span>
@ -318,8 +731,9 @@
<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_nver</span><span class="o">+</span><span class="n">package_nver</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="mi">0</span><span class="p">]</span><span class="o">.</span><span class="n">lower</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_nver</span><span class="o">+</span><span class="n">package_nver</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="mi">0</span><span class="p">]</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="n">deps</span> <span class="o">=</span> <span class="p">[]</span>
<span class="k">try</span><span class="p">:</span> <span class="k">try</span><span class="p">:</span>
<span class="k">with</span> <span class="n">yumlock</span><span class="o">.</span><span class="n">lock</span><span class="p">:</span> <span class="c"># This can possibly update repodata and reset the YumBase object.</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">yumlock</span><span class="o">.</span><span class="n">yb</span><span class="p">,</span> <span class="n">projects</span><span class="p">,</span> <span class="n">recipe</span><span class="o">.</span><span class="n">group_names</span><span class="p">,</span> <span class="n">with_core</span><span class="o">=</span><span class="bp">False</span><span class="p">)</span> <span class="k">with</span> <span class="n">yumlock</span><span class="o">.</span><span class="n">lock_check</span><span class="p">:</span>
<span class="p">(</span><span class="n">installed_size</span><span class="p">,</span> <span class="n">anaconda_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">yumlock</span><span class="o">.</span><span class="n">yb</span><span class="p">,</span> <span class="n">projects</span><span class="p">,</span> <span class="n">recipe</span><span class="o">.</span><span class="n">group_names</span><span class="p">,</span> <span class="n">with_core</span><span class="o">=</span><span class="bp">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="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="s">&quot;start_build depsolve: </span><span class="si">%s</span><span class="s">&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">error</span><span class="p">(</span><span class="s">&quot;start_build depsolve: </span><span class="si">%s</span><span class="s">&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="s">&quot;Problem depsolving </span><span class="si">%s</span><span class="s">: </span><span class="si">%s</span><span class="s">&quot;</span> <span class="o">%</span> <span class="p">(</span><span class="n">recipe</span><span class="p">[</span><span class="s">&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="k">raise</span> <span class="ne">RuntimeError</span><span class="p">(</span><span class="s">&quot;Problem depsolving </span><span class="si">%s</span><span class="s">: </span><span class="si">%s</span><span class="s">&quot;</span> <span class="o">%</span> <span class="p">(</span><span class="n">recipe</span><span class="p">[</span><span class="s">&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>
@ -328,7 +742,7 @@
<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="s">&quot;composer&quot;</span><span class="p">,</span> <span class="n">compose_type</span><span class="p">)</span> <span class="o">+</span> <span class="s">&quot;.ks&quot;</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="s">&quot;composer&quot;</span><span class="p">,</span> <span class="n">compose_type</span><span class="p">)</span> <span class="o">+</span> <span class="s">&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="s">&quot;r&quot;</span><span class="p">)</span><span class="o">.</span><span class="n">read</span><span class="p">()</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="s">&quot;r&quot;</span><span class="p">)</span><span class="o">.</span><span class="n">read</span><span class="p">()</span>
<span class="c"># How much space will the packages in the default template take?</span> <span class="c"># How much space will the packages in the selected 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">RHEL7</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">RHEL7</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="bp">False</span><span class="p">,</span> <span class="n">missingIncludeIsFatal</span><span class="o">=</span><span class="bp">False</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="bp">False</span><span class="p">,</span> <span class="n">missingIncludeIsFatal</span><span class="o">=</span><span class="bp">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="s">&quot;</span><span class="se">\n</span><span class="si">%e</span><span class="s">nd</span><span class="se">\n</span><span class="s">&quot;</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="s">&quot;</span><span class="se">\n</span><span class="si">%e</span><span class="s">nd</span><span class="se">\n</span><span class="s">&quot;</span><span class="p">)</span>
@ -336,16 +750,29 @@
<span class="n">grps</span> <span class="o">=</span> <span class="p">[</span><span class="n">grp</span><span class="o">.</span><span class="n">name</span> <span class="k">for</span> <span class="n">grp</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">groupList</span><span class="p">]</span> <span class="n">grps</span> <span class="o">=</span> <span class="p">[</span><span class="n">grp</span><span class="o">.</span><span class="n">name</span> <span class="k">for</span> <span class="n">grp</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">groupList</span><span class="p">]</span>
<span class="k">try</span><span class="p">:</span> <span class="k">try</span><span class="p">:</span>
<span class="k">with</span> <span class="n">yumlock</span><span class="o">.</span><span class="n">lock</span><span class="p">:</span> <span class="k">with</span> <span class="n">yumlock</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">yumlock</span><span class="o">.</span><span class="n">yb</span><span class="p">,</span> <span class="n">pkgs</span><span class="p">,</span> <span class="n">grps</span><span class="p">,</span> <span class="p">(</span><span class="n">template_size</span><span class="p">,</span> <span class="n">anaconda_tmpl_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">yumlock</span><span class="o">.</span><span class="n">yb</span><span class="p">,</span> <span class="n">pkgs</span><span class="p">,</span> <span class="n">grps</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="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="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="s">&quot;start_build depsolve: </span><span class="si">%s</span><span class="s">&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">error</span><span class="p">(</span><span class="s">&quot;start_build depsolve: </span><span class="si">%s</span><span class="s">&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="s">&quot;Problem depsolving </span><span class="si">%s</span><span class="s">: </span><span class="si">%s</span><span class="s">&quot;</span> <span class="o">%</span> <span class="p">(</span><span class="n">recipe</span><span class="p">[</span><span class="s">&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="k">raise</span> <span class="ne">RuntimeError</span><span class="p">(</span><span class="s">&quot;Problem depsolving </span><span class="si">%s</span><span class="s">: </span><span class="si">%s</span><span class="s">&quot;</span> <span class="o">%</span> <span class="p">(</span><span class="n">recipe</span><span class="p">[</span><span class="s">&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="s">&quot;installed_size = </span><span class="si">%d</span><span class="s">, template_size=</span><span class="si">%d</span><span class="s">&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="c"># Minimum LMC disk size is 1GiB, and anaconda bumps the estimated size up by 35% (which doesn&#39;t always work).</span> <span class="c"># Anaconda also stores the metadata on the disk once it is partitioned, try to take this into account by</span>
<span class="n">installed_size</span> <span class="o">=</span> <span class="nb">max</span><span class="p">(</span><span class="mi">1024</span><span class="o">**</span><span class="mi">3</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.4</span><span class="p">))</span> <span class="c"># adding the size of the lorax-composer metadata storage.</span>
<span class="n">log</span><span class="o">.</span><span class="n">debug</span><span class="p">(</span><span class="s">&quot;/ partition size = </span><span class="si">%d</span><span class="s">&quot;</span><span class="p">,</span> <span class="n">installed_size</span><span class="p">)</span> <span class="k">with</span> <span class="n">yumlock</span><span class="o">.</span><span class="n">lock</span><span class="p">:</span>
<span class="n">metadata_size</span> <span class="o">=</span> <span class="n">get_md_size</span><span class="p">(</span><span class="n">yumlock</span><span class="o">.</span><span class="n">yb</span><span class="o">.</span><span class="n">conf</span><span class="o">.</span><span class="n">installroot</span><span class="p">)</span>
<span class="c"># Anaconda estimates size differently, only taking into account installed size and adding 35%</span>
<span class="c"># But we must make sure that our actual disk size is at least as big as the anaconda size, otherwise the install will fail</span>
<span class="n">anaconda_minimum</span> <span class="o">=</span> <span class="nb">int</span><span class="p">((</span><span class="n">anaconda_size</span><span class="o">+</span><span class="n">anaconda_tmpl_size</span><span class="p">)</span> <span class="o">*</span> <span class="mf">1.35</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="s">&quot;anaconda_size = </span><span class="si">%d</span><span class="s">, anaconda_template_size=</span><span class="si">%d</span><span class="s">, anaconda_minimum=</span><span class="si">%d</span><span class="s">&quot;</span><span class="p">,</span> <span class="n">anaconda_size</span><span class="p">,</span> <span class="n">anaconda_tmpl_size</span><span class="p">,</span> <span class="n">anaconda_minimum</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="s">&quot;installed_size = </span><span class="si">%d</span><span class="s">, template_size=</span><span class="si">%d</span><span class="s">, metadata_size=</span><span class="si">%d</span><span class="s">&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="n">metadata_size</span><span class="p">)</span>
<span class="c"># Add 10% to the composer estimate</span>
<span class="n">installed_size</span> <span class="o">=</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="o">+</span><span class="n">metadata_size</span><span class="p">)</span> <span class="o">*</span> <span class="mf">1.10</span><span class="p">)</span>
<span class="c"># Select the largest size for the partition</span>
<span class="n">partition_size</span> <span class="o">=</span> <span class="nb">max</span><span class="p">(</span><span class="mi">1024</span><span class="o">**</span><span class="mi">3</span><span class="p">,</span> <span class="n">anaconda_minimum</span><span class="p">,</span> <span class="n">installed_size</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="s">&quot;/ partition size = </span><span class="si">%d</span><span class="s">&quot;</span><span class="p">,</span> <span class="n">partition_size</span><span class="p">)</span>
<span class="c"># Create the results directory</span> <span class="c"># 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">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>
@ -397,14 +824,16 @@
<span class="n">f</span><span class="o">.</span><span class="n">write</span><span class="p">(</span><span class="s">&#39;clearpart --all</span><span class="se">\n</span><span class="s">&#39;</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="s">&#39;clearpart --all</span><span class="se">\n</span><span class="s">&#39;</span><span class="p">)</span>
<span class="c"># Write the root partition and it&#39;s size in MB (rounded up)</span> <span class="c"># 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="s">&#39;part / --fstype=&quot;ext4&quot; --size=</span><span class="si">%d</span><span class="se">\n</span><span class="s">&#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="s">&#39;part / --size=</span><span class="si">%d</span><span class="se">\n</span><span class="s">&#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="c"># Some customizations modify the template before writing it</span>
<span class="n">f</span><span class="o">.</span><span class="n">write</span><span class="p">(</span><span class="n">customize_ks_template</span><span class="p">(</span><span class="n">ks_template</span><span class="p">,</span> <span class="n">recipe</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="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="s">&quot;</span><span class="se">\n</span><span class="s">&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="n">dep_nevra</span><span class="p">(</span><span class="n">d</span><span class="p">)</span><span class="o">+</span><span class="s">&quot;</span><span class="se">\n</span><span class="s">&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="s">&quot;</span><span class="si">%e</span><span class="s">nd</span><span class="se">\n</span><span class="s">&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="s">&quot;</span><span class="si">%e</span><span class="s">nd</span><span class="se">\n</span><span class="s">&quot;</span><span class="p">)</span>
<span class="c"># Other customizations can be appended to the kickstart</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="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="c"># Setup the config to pass to novirt_install</span> <span class="c"># Setup the config to pass to novirt_install</span>
@ -423,6 +852,7 @@
<span class="n">cfg_args</span><span class="p">[</span><span class="s">&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="s">&quot;NAME&quot;</span><span class="p">)</span> <span class="n">cfg_args</span><span class="p">[</span><span class="s">&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="s">&quot;NAME&quot;</span><span class="p">)</span>
<span class="n">cfg_args</span><span class="p">[</span><span class="s">&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="s">&quot;VERSION_ID&quot;</span><span class="p">)</span> <span class="n">cfg_args</span><span class="p">[</span><span class="s">&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="s">&quot;VERSION_ID&quot;</span><span class="p">)</span>
<span class="n">cfg_args</span><span class="p">[</span><span class="s">&quot;volid&quot;</span><span class="p">]</span> <span class="o">=</span> <span class="s">&quot;&quot;</span> <span class="n">cfg_args</span><span class="p">[</span><span class="s">&quot;volid&quot;</span><span class="p">]</span> <span class="o">=</span> <span class="s">&quot;&quot;</span>
<span class="n">cfg_args</span><span class="p">[</span><span class="s">&quot;extra_boot_args&quot;</span><span class="p">]</span> <span class="o">=</span> <span class="n">get_kernel_append</span><span class="p">(</span><span class="n">recipe</span><span class="p">)</span>
<span class="n">cfg_args</span><span class="o">.</span><span class="n">update</span><span class="p">({</span> <span class="n">cfg_args</span><span class="o">.</span><span class="n">update</span><span class="p">({</span>
<span class="s">&quot;compression&quot;</span><span class="p">:</span> <span class="s">&quot;xz&quot;</span><span class="p">,</span> <span class="s">&quot;compression&quot;</span><span class="p">:</span> <span class="s">&quot;xz&quot;</span><span class="p">,</span>
@ -565,6 +995,86 @@
<span class="s">&quot;app_template&quot;</span><span class="p">:</span> <span class="bp">None</span><span class="p">,</span> <span class="s">&quot;app_template&quot;</span><span class="p">:</span> <span class="bp">None</span><span class="p">,</span>
<span class="s">&quot;app_file&quot;</span><span class="p">:</span> <span class="bp">None</span> <span class="s">&quot;app_file&quot;</span><span class="p">:</span> <span class="bp">None</span>
<span class="p">},</span> <span class="p">},</span>
<span class="s">&quot;ami&quot;</span><span class="p">:</span> <span class="p">{</span><span class="s">&quot;make_iso&quot;</span><span class="p">:</span> <span class="bp">False</span><span class="p">,</span>
<span class="s">&quot;make_disk&quot;</span><span class="p">:</span> <span class="bp">True</span><span class="p">,</span>
<span class="s">&quot;make_fsimage&quot;</span><span class="p">:</span> <span class="bp">False</span><span class="p">,</span>
<span class="s">&quot;make_appliance&quot;</span><span class="p">:</span> <span class="bp">False</span><span class="p">,</span>
<span class="s">&quot;make_ami&quot;</span><span class="p">:</span> <span class="bp">False</span><span class="p">,</span>
<span class="s">&quot;make_tar&quot;</span><span class="p">:</span> <span class="bp">False</span><span class="p">,</span>
<span class="s">&quot;make_pxe_live&quot;</span><span class="p">:</span> <span class="bp">False</span><span class="p">,</span>
<span class="s">&quot;make_ostree_live&quot;</span><span class="p">:</span> <span class="bp">False</span><span class="p">,</span>
<span class="s">&quot;ostree&quot;</span><span class="p">:</span> <span class="bp">False</span><span class="p">,</span>
<span class="s">&quot;live_rootfs_keep_size&quot;</span><span class="p">:</span> <span class="bp">False</span><span class="p">,</span>
<span class="s">&quot;live_rootfs_size&quot;</span><span class="p">:</span> <span class="mi">0</span><span class="p">,</span>
<span class="s">&quot;qcow2&quot;</span><span class="p">:</span> <span class="bp">False</span><span class="p">,</span>
<span class="s">&quot;qcow2_args&quot;</span><span class="p">:</span> <span class="p">[],</span>
<span class="s">&quot;image_name&quot;</span><span class="p">:</span> <span class="s">&quot;disk.ami&quot;</span><span class="p">,</span>
<span class="s">&quot;fs_label&quot;</span><span class="p">:</span> <span class="s">&quot;&quot;</span><span class="p">,</span>
<span class="s">&quot;image_only&quot;</span><span class="p">:</span> <span class="bp">True</span><span class="p">,</span>
<span class="s">&quot;app_name&quot;</span><span class="p">:</span> <span class="bp">None</span><span class="p">,</span>
<span class="s">&quot;app_template&quot;</span><span class="p">:</span> <span class="bp">None</span><span class="p">,</span>
<span class="s">&quot;app_file&quot;</span><span class="p">:</span> <span class="bp">None</span><span class="p">,</span>
<span class="p">},</span>
<span class="s">&quot;vhd&quot;</span><span class="p">:</span> <span class="p">{</span><span class="s">&quot;make_iso&quot;</span><span class="p">:</span> <span class="bp">False</span><span class="p">,</span>
<span class="s">&quot;make_disk&quot;</span><span class="p">:</span> <span class="bp">True</span><span class="p">,</span>
<span class="s">&quot;make_fsimage&quot;</span><span class="p">:</span> <span class="bp">False</span><span class="p">,</span>
<span class="s">&quot;make_appliance&quot;</span><span class="p">:</span> <span class="bp">False</span><span class="p">,</span>
<span class="s">&quot;make_ami&quot;</span><span class="p">:</span> <span class="bp">False</span><span class="p">,</span>
<span class="s">&quot;make_tar&quot;</span><span class="p">:</span> <span class="bp">False</span><span class="p">,</span>
<span class="s">&quot;make_pxe_live&quot;</span><span class="p">:</span> <span class="bp">False</span><span class="p">,</span>
<span class="s">&quot;make_ostree_live&quot;</span><span class="p">:</span> <span class="bp">False</span><span class="p">,</span>
<span class="s">&quot;ostree&quot;</span><span class="p">:</span> <span class="bp">False</span><span class="p">,</span>
<span class="s">&quot;live_rootfs_keep_size&quot;</span><span class="p">:</span> <span class="bp">False</span><span class="p">,</span>
<span class="s">&quot;live_rootfs_size&quot;</span><span class="p">:</span> <span class="mi">0</span><span class="p">,</span>
<span class="s">&quot;qcow2&quot;</span><span class="p">:</span> <span class="bp">True</span><span class="p">,</span>
<span class="s">&quot;qcow2_args&quot;</span><span class="p">:</span> <span class="p">[</span><span class="s">&quot;-O&quot;</span><span class="p">,</span> <span class="s">&quot;vpc&quot;</span><span class="p">,</span> <span class="s">&quot;-o&quot;</span><span class="p">,</span> <span class="s">&quot;subformat=fixed&quot;</span><span class="p">],</span>
<span class="s">&quot;image_name&quot;</span><span class="p">:</span> <span class="s">&quot;disk.vhd&quot;</span><span class="p">,</span>
<span class="s">&quot;fs_label&quot;</span><span class="p">:</span> <span class="s">&quot;&quot;</span><span class="p">,</span>
<span class="s">&quot;image_only&quot;</span><span class="p">:</span> <span class="bp">True</span><span class="p">,</span>
<span class="s">&quot;app_name&quot;</span><span class="p">:</span> <span class="bp">None</span><span class="p">,</span>
<span class="s">&quot;app_template&quot;</span><span class="p">:</span> <span class="bp">None</span><span class="p">,</span>
<span class="s">&quot;app_file&quot;</span><span class="p">:</span> <span class="bp">None</span><span class="p">,</span>
<span class="p">},</span>
<span class="s">&quot;vmdk&quot;</span><span class="p">:</span> <span class="p">{</span><span class="s">&quot;make_iso&quot;</span><span class="p">:</span> <span class="bp">False</span><span class="p">,</span>
<span class="s">&quot;make_disk&quot;</span><span class="p">:</span> <span class="bp">True</span><span class="p">,</span>
<span class="s">&quot;make_fsimage&quot;</span><span class="p">:</span> <span class="bp">False</span><span class="p">,</span>
<span class="s">&quot;make_appliance&quot;</span><span class="p">:</span> <span class="bp">False</span><span class="p">,</span>
<span class="s">&quot;make_ami&quot;</span><span class="p">:</span> <span class="bp">False</span><span class="p">,</span>
<span class="s">&quot;make_tar&quot;</span><span class="p">:</span> <span class="bp">False</span><span class="p">,</span>
<span class="s">&quot;make_pxe_live&quot;</span><span class="p">:</span> <span class="bp">False</span><span class="p">,</span>
<span class="s">&quot;make_ostree_live&quot;</span><span class="p">:</span> <span class="bp">False</span><span class="p">,</span>
<span class="s">&quot;ostree&quot;</span><span class="p">:</span> <span class="bp">False</span><span class="p">,</span>
<span class="s">&quot;live_rootfs_keep_size&quot;</span><span class="p">:</span> <span class="bp">False</span><span class="p">,</span>
<span class="s">&quot;live_rootfs_size&quot;</span><span class="p">:</span> <span class="mi">0</span><span class="p">,</span>
<span class="s">&quot;qcow2&quot;</span><span class="p">:</span> <span class="bp">True</span><span class="p">,</span>
<span class="s">&quot;qcow2_args&quot;</span><span class="p">:</span> <span class="p">[</span><span class="s">&quot;-O&quot;</span><span class="p">,</span> <span class="s">&quot;vmdk&quot;</span><span class="p">],</span>
<span class="s">&quot;image_name&quot;</span><span class="p">:</span> <span class="s">&quot;disk.vmdk&quot;</span><span class="p">,</span>
<span class="s">&quot;fs_label&quot;</span><span class="p">:</span> <span class="s">&quot;&quot;</span><span class="p">,</span>
<span class="s">&quot;image_only&quot;</span><span class="p">:</span> <span class="bp">True</span><span class="p">,</span>
<span class="s">&quot;app_name&quot;</span><span class="p">:</span> <span class="bp">None</span><span class="p">,</span>
<span class="s">&quot;app_template&quot;</span><span class="p">:</span> <span class="bp">None</span><span class="p">,</span>
<span class="s">&quot;app_file&quot;</span><span class="p">:</span> <span class="bp">None</span><span class="p">,</span>
<span class="p">},</span>
<span class="s">&quot;openstack&quot;</span><span class="p">:</span> <span class="p">{</span><span class="s">&quot;make_iso&quot;</span><span class="p">:</span> <span class="bp">False</span><span class="p">,</span>
<span class="s">&quot;make_disk&quot;</span><span class="p">:</span> <span class="bp">True</span><span class="p">,</span>
<span class="s">&quot;make_fsimage&quot;</span><span class="p">:</span> <span class="bp">False</span><span class="p">,</span>
<span class="s">&quot;make_appliance&quot;</span><span class="p">:</span> <span class="bp">False</span><span class="p">,</span>
<span class="s">&quot;make_ami&quot;</span><span class="p">:</span> <span class="bp">False</span><span class="p">,</span>
<span class="s">&quot;make_tar&quot;</span><span class="p">:</span> <span class="bp">False</span><span class="p">,</span>
<span class="s">&quot;make_pxe_live&quot;</span><span class="p">:</span> <span class="bp">False</span><span class="p">,</span>
<span class="s">&quot;make_ostree_live&quot;</span><span class="p">:</span> <span class="bp">False</span><span class="p">,</span>
<span class="s">&quot;ostree&quot;</span><span class="p">:</span> <span class="bp">False</span><span class="p">,</span>
<span class="s">&quot;live_rootfs_keep_size&quot;</span><span class="p">:</span> <span class="bp">False</span><span class="p">,</span>
<span class="s">&quot;live_rootfs_size&quot;</span><span class="p">:</span> <span class="mi">0</span><span class="p">,</span>
<span class="s">&quot;qcow2&quot;</span><span class="p">:</span> <span class="bp">True</span><span class="p">,</span>
<span class="s">&quot;qcow2_args&quot;</span><span class="p">:</span> <span class="p">[],</span>
<span class="s">&quot;image_name&quot;</span><span class="p">:</span> <span class="s">&quot;disk.qcow2&quot;</span><span class="p">,</span>
<span class="s">&quot;fs_label&quot;</span><span class="p">:</span> <span class="s">&quot;&quot;</span><span class="p">,</span>
<span class="s">&quot;image_only&quot;</span><span class="p">:</span> <span class="bp">True</span><span class="p">,</span>
<span class="s">&quot;app_name&quot;</span><span class="p">:</span> <span class="bp">None</span><span class="p">,</span>
<span class="s">&quot;app_template&quot;</span><span class="p">:</span> <span class="bp">None</span><span class="p">,</span>
<span class="s">&quot;app_file&quot;</span><span class="p">:</span> <span class="bp">None</span><span class="p">,</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> <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>
@ -623,7 +1133,7 @@
<li class="right" > <li class="right" >
<a href="../../../py-modindex.html" title="Python Module Index" <a href="../../../py-modindex.html" title="Python Module Index"
>modules</a> |</li> >modules</a> |</li>
<li><a href="../../../index.html">Lorax 19.7.22 documentation</a> &raquo;</li> <li><a href="../../../index.html">Lorax 19.7.43 documentation</a> &raquo;</li>
<li><a href="../../index.html" >Module code</a> &raquo;</li> <li><a href="../../index.html" >Module code</a> &raquo;</li>
<li><a href="../../pylorax.html" >pylorax</a> &raquo;</li> <li><a href="../../pylorax.html" >pylorax</a> &raquo;</li>
<li><a href="../api.html" >pylorax.api</a> &raquo;</li> <li><a href="../api.html" >pylorax.api</a> &raquo;</li>

View File

@ -8,7 +8,7 @@
<head> <head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>pylorax.api.config &mdash; Lorax 19.7.22 documentation</title> <title>pylorax.api.config &mdash; Lorax 19.7.43 documentation</title>
<link rel="stylesheet" href="../../../_static/default.css" type="text/css" /> <link rel="stylesheet" href="../../../_static/default.css" type="text/css" />
<link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" /> <link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" />
@ -16,7 +16,7 @@
<script type="text/javascript"> <script type="text/javascript">
var DOCUMENTATION_OPTIONS = { var DOCUMENTATION_OPTIONS = {
URL_ROOT: '../../../', URL_ROOT: '../../../',
VERSION: '19.7.22', VERSION: '19.7.43',
COLLAPSE_INDEX: false, COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html', FILE_SUFFIX: '.html',
HAS_SOURCE: true HAS_SOURCE: true
@ -25,7 +25,7 @@
<script type="text/javascript" src="../../../_static/jquery.js"></script> <script type="text/javascript" src="../../../_static/jquery.js"></script>
<script type="text/javascript" src="../../../_static/underscore.js"></script> <script type="text/javascript" src="../../../_static/underscore.js"></script>
<script type="text/javascript" src="../../../_static/doctools.js"></script> <script type="text/javascript" src="../../../_static/doctools.js"></script>
<link rel="top" title="Lorax 19.7.22 documentation" href="../../../index.html" /> <link rel="top" title="Lorax 19.7.43 documentation" href="../../../index.html" />
<link rel="up" title="pylorax.api" href="../api.html" /> <link rel="up" title="pylorax.api" href="../api.html" />
</head> </head>
<body> <body>
@ -38,7 +38,7 @@
<li class="right" > <li class="right" >
<a href="../../../py-modindex.html" title="Python Module Index" <a href="../../../py-modindex.html" title="Python Module Index"
>modules</a> |</li> >modules</a> |</li>
<li><a href="../../../index.html">Lorax 19.7.22 documentation</a> &raquo;</li> <li><a href="../../../index.html">Lorax 19.7.43 documentation</a> &raquo;</li>
<li><a href="../../index.html" >Module code</a> &raquo;</li> <li><a href="../../index.html" >Module code</a> &raquo;</li>
<li><a href="../../pylorax.html" >pylorax</a> &raquo;</li> <li><a href="../../pylorax.html" >pylorax</a> &raquo;</li>
<li><a href="../api.html" accesskey="U">pylorax.api</a> &raquo;</li> <li><a href="../api.html" accesskey="U">pylorax.api</a> &raquo;</li>
@ -197,7 +197,7 @@
<li class="right" > <li class="right" >
<a href="../../../py-modindex.html" title="Python Module Index" <a href="../../../py-modindex.html" title="Python Module Index"
>modules</a> |</li> >modules</a> |</li>
<li><a href="../../../index.html">Lorax 19.7.22 documentation</a> &raquo;</li> <li><a href="../../../index.html">Lorax 19.7.43 documentation</a> &raquo;</li>
<li><a href="../../index.html" >Module code</a> &raquo;</li> <li><a href="../../index.html" >Module code</a> &raquo;</li>
<li><a href="../../pylorax.html" >pylorax</a> &raquo;</li> <li><a href="../../pylorax.html" >pylorax</a> &raquo;</li>
<li><a href="../api.html" >pylorax.api</a> &raquo;</li> <li><a href="../api.html" >pylorax.api</a> &raquo;</li>

View File

@ -8,7 +8,7 @@
<head> <head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>pylorax.api.crossdomain &mdash; Lorax 19.7.22 documentation</title> <title>pylorax.api.crossdomain &mdash; Lorax 19.7.43 documentation</title>
<link rel="stylesheet" href="../../../_static/default.css" type="text/css" /> <link rel="stylesheet" href="../../../_static/default.css" type="text/css" />
<link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" /> <link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" />
@ -16,7 +16,7 @@
<script type="text/javascript"> <script type="text/javascript">
var DOCUMENTATION_OPTIONS = { var DOCUMENTATION_OPTIONS = {
URL_ROOT: '../../../', URL_ROOT: '../../../',
VERSION: '19.7.22', VERSION: '19.7.43',
COLLAPSE_INDEX: false, COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html', FILE_SUFFIX: '.html',
HAS_SOURCE: true HAS_SOURCE: true
@ -25,7 +25,7 @@
<script type="text/javascript" src="../../../_static/jquery.js"></script> <script type="text/javascript" src="../../../_static/jquery.js"></script>
<script type="text/javascript" src="../../../_static/underscore.js"></script> <script type="text/javascript" src="../../../_static/underscore.js"></script>
<script type="text/javascript" src="../../../_static/doctools.js"></script> <script type="text/javascript" src="../../../_static/doctools.js"></script>
<link rel="top" title="Lorax 19.7.22 documentation" href="../../../index.html" /> <link rel="top" title="Lorax 19.7.43 documentation" href="../../../index.html" />
<link rel="up" title="pylorax.api" href="../api.html" /> <link rel="up" title="pylorax.api" href="../api.html" />
</head> </head>
<body> <body>
@ -38,7 +38,7 @@
<li class="right" > <li class="right" >
<a href="../../../py-modindex.html" title="Python Module Index" <a href="../../../py-modindex.html" title="Python Module Index"
>modules</a> |</li> >modules</a> |</li>
<li><a href="../../../index.html">Lorax 19.7.22 documentation</a> &raquo;</li> <li><a href="../../../index.html">Lorax 19.7.43 documentation</a> &raquo;</li>
<li><a href="../../index.html" >Module code</a> &raquo;</li> <li><a href="../../index.html" >Module code</a> &raquo;</li>
<li><a href="../../pylorax.html" >pylorax</a> &raquo;</li> <li><a href="../../pylorax.html" >pylorax</a> &raquo;</li>
<li><a href="../api.html" accesskey="U">pylorax.api</a> &raquo;</li> <li><a href="../api.html" accesskey="U">pylorax.api</a> &raquo;</li>
@ -148,7 +148,7 @@
<li class="right" > <li class="right" >
<a href="../../../py-modindex.html" title="Python Module Index" <a href="../../../py-modindex.html" title="Python Module Index"
>modules</a> |</li> >modules</a> |</li>
<li><a href="../../../index.html">Lorax 19.7.22 documentation</a> &raquo;</li> <li><a href="../../../index.html">Lorax 19.7.43 documentation</a> &raquo;</li>
<li><a href="../../index.html" >Module code</a> &raquo;</li> <li><a href="../../index.html" >Module code</a> &raquo;</li>
<li><a href="../../pylorax.html" >pylorax</a> &raquo;</li> <li><a href="../../pylorax.html" >pylorax</a> &raquo;</li>
<li><a href="../api.html" >pylorax.api</a> &raquo;</li> <li><a href="../api.html" >pylorax.api</a> &raquo;</li>

View File

@ -8,7 +8,7 @@
<head> <head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>pylorax.api.projects &mdash; Lorax 19.7.22 documentation</title> <title>pylorax.api.projects &mdash; Lorax 19.7.43 documentation</title>
<link rel="stylesheet" href="../../../_static/default.css" type="text/css" /> <link rel="stylesheet" href="../../../_static/default.css" type="text/css" />
<link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" /> <link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" />
@ -16,7 +16,7 @@
<script type="text/javascript"> <script type="text/javascript">
var DOCUMENTATION_OPTIONS = { var DOCUMENTATION_OPTIONS = {
URL_ROOT: '../../../', URL_ROOT: '../../../',
VERSION: '19.7.22', VERSION: '19.7.43',
COLLAPSE_INDEX: false, COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html', FILE_SUFFIX: '.html',
HAS_SOURCE: true HAS_SOURCE: true
@ -25,7 +25,7 @@
<script type="text/javascript" src="../../../_static/jquery.js"></script> <script type="text/javascript" src="../../../_static/jquery.js"></script>
<script type="text/javascript" src="../../../_static/underscore.js"></script> <script type="text/javascript" src="../../../_static/underscore.js"></script>
<script type="text/javascript" src="../../../_static/doctools.js"></script> <script type="text/javascript" src="../../../_static/doctools.js"></script>
<link rel="top" title="Lorax 19.7.22 documentation" href="../../../index.html" /> <link rel="top" title="Lorax 19.7.43 documentation" href="../../../index.html" />
<link rel="up" title="pylorax.api" href="../api.html" /> <link rel="up" title="pylorax.api" href="../api.html" />
</head> </head>
<body> <body>
@ -38,7 +38,7 @@
<li class="right" > <li class="right" >
<a href="../../../py-modindex.html" title="Python Module Index" <a href="../../../py-modindex.html" title="Python Module Index"
>modules</a> |</li> >modules</a> |</li>
<li><a href="../../../index.html">Lorax 19.7.22 documentation</a> &raquo;</li> <li><a href="../../../index.html">Lorax 19.7.43 documentation</a> &raquo;</li>
<li><a href="../../index.html" >Module code</a> &raquo;</li> <li><a href="../../index.html" >Module code</a> &raquo;</li>
<li><a href="../../pylorax.html" >pylorax</a> &raquo;</li> <li><a href="../../pylorax.html" >pylorax</a> &raquo;</li>
<li><a href="../api.html" accesskey="U">pylorax.api</a> &raquo;</li> <li><a href="../api.html" accesskey="U">pylorax.api</a> &raquo;</li>
@ -70,12 +70,14 @@
<span class="kn">import</span> <span class="nn">logging</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="s">&quot;lorax-composer&quot;</span><span class="p">)</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="s">&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">ConfigParser</span> <span class="kn">import</span> <span class="n">ConfigParser</span> <span class="kn">from</span> <span class="nn">ConfigParser</span> <span class="kn">import</span> <span class="n">ConfigParser</span>
<span class="kn">import</span> <span class="nn">fnmatch</span>
<span class="kn">from</span> <span class="nn">glob</span> <span class="kn">import</span> <span class="n">glob</span> <span class="kn">from</span> <span class="nn">glob</span> <span class="kn">import</span> <span class="n">glob</span>
<span class="kn">import</span> <span class="nn">os</span>
<span class="kn">import</span> <span class="nn">time</span> <span class="kn">import</span> <span class="nn">time</span>
<span class="kn">from</span> <span class="nn">yum.Errors</span> <span class="kn">import</span> <span class="n">YumBaseError</span> <span class="kn">from</span> <span class="nn">yum.Errors</span> <span class="kn">import</span> <span class="n">YumBaseError</span>
<span class="kn">from</span> <span class="nn">pylorax.api.bisect</span> <span class="kn">import</span> <span class="n">insort_left</span>
<span class="n">TIME_FORMAT</span> <span class="o">=</span> <span class="s">&quot;%Y-%m-</span><span class="si">%d</span><span class="s">T%H:%M:%S&quot;</span> <span class="n">TIME_FORMAT</span> <span class="o">=</span> <span class="s">&quot;%Y-%m-</span><span class="si">%d</span><span class="s">T%H:%M:%S&quot;</span>
@ -129,17 +131,19 @@
<span class="s">&quot;upstream_vcs&quot;</span><span class="p">:</span> <span class="s">&quot;UPSTREAM_VCS&quot;</span><span class="p">}</span> <span class="s">&quot;upstream_vcs&quot;</span><span class="p">:</span> <span class="s">&quot;UPSTREAM_VCS&quot;</span><span class="p">}</span>
</div> </div>
<div class="viewcode-block" id="yaps_to_project_info"><a class="viewcode-back" href="../../../pylorax.api.html#pylorax.api.projects.yaps_to_project_info">[docs]</a><span class="k">def</span> <span class="nf">yaps_to_project_info</span><span class="p">(</span><span class="n">yaps</span><span class="p">):</span> <div class="viewcode-block" id="yaps_to_build"><a class="viewcode-back" href="../../../pylorax.api.html#pylorax.api.projects.yaps_to_build">[docs]</a><span class="k">def</span> <span class="nf">yaps_to_build</span><span class="p">(</span><span class="n">yaps</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;Extract the details from a YumAvailablePackageSqlite object</span> <span class="sd">&quot;&quot;&quot;Extract the build details from a hawkey.Package object</span>
<span class="sd"> :param yaps: Yum object with package details</span> <span class="sd"> :param yaps: Yum object with package details</span>
<span class="sd"> :type yaps: YumAvailablePackageSqlite</span> <span class="sd"> :type yaps: YumAvailablePackageSqlite</span>
<span class="sd"> :returns: A dict with the project details, as well as epoch, release, arch, build_time, changelog, ...</span> <span class="sd"> :returns: A dict with the build details, epoch, release, arch, build_time, changelog, ...</span>
<span class="sd"> :rtype: dict</span> <span class="sd"> :rtype: dict</span>
<span class="sd"> metadata entries are hard-coded to {}</span> <span class="sd"> metadata entries are hard-coded to {}</span>
<span class="sd"> Note that this only returns the build dict, it does not include the name, description, etc.</span>
<span class="sd"> &quot;&quot;&quot;</span> <span class="sd"> &quot;&quot;&quot;</span>
<span class="n">build</span> <span class="o">=</span> <span class="p">{</span><span class="s">&quot;epoch&quot;</span><span class="p">:</span> <span class="nb">int</span><span class="p">(</span><span class="n">yaps</span><span class="o">.</span><span class="n">epoch</span><span class="p">),</span> <span class="k">return</span> <span class="p">{</span><span class="s">&quot;epoch&quot;</span><span class="p">:</span> <span class="nb">int</span><span class="p">(</span><span class="n">yaps</span><span class="o">.</span><span class="n">epoch</span><span class="p">),</span>
<span class="s">&quot;release&quot;</span><span class="p">:</span> <span class="n">yaps</span><span class="o">.</span><span class="n">release</span><span class="p">,</span> <span class="s">&quot;release&quot;</span><span class="p">:</span> <span class="n">yaps</span><span class="o">.</span><span class="n">release</span><span class="p">,</span>
<span class="s">&quot;arch&quot;</span><span class="p">:</span> <span class="n">yaps</span><span class="o">.</span><span class="n">arch</span><span class="p">,</span> <span class="s">&quot;arch&quot;</span><span class="p">:</span> <span class="n">yaps</span><span class="o">.</span><span class="n">arch</span><span class="p">,</span>
<span class="s">&quot;build_time&quot;</span><span class="p">:</span> <span class="n">api_time</span><span class="p">(</span><span class="n">yaps</span><span class="o">.</span><span class="n">buildtime</span><span class="p">),</span> <span class="s">&quot;build_time&quot;</span><span class="p">:</span> <span class="n">api_time</span><span class="p">(</span><span class="n">yaps</span><span class="o">.</span><span class="n">buildtime</span><span class="p">),</span>
@ -152,12 +156,23 @@
<span class="s">&quot;source_ref&quot;</span><span class="p">:</span> <span class="s">&quot;SOURCE_REF&quot;</span><span class="p">,</span> <span class="s">&quot;source_ref&quot;</span><span class="p">:</span> <span class="s">&quot;SOURCE_REF&quot;</span><span class="p">,</span>
<span class="s">&quot;metadata&quot;</span><span class="p">:</span> <span class="p">{}}}</span> <span class="s">&quot;metadata&quot;</span><span class="p">:</span> <span class="p">{}}}</span>
</div>
<div class="viewcode-block" id="yaps_to_project_info"><a class="viewcode-back" href="../../../pylorax.api.html#pylorax.api.projects.yaps_to_project_info">[docs]</a><span class="k">def</span> <span class="nf">yaps_to_project_info</span><span class="p">(</span><span class="n">yaps</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;Extract the details from a YumAvailablePackageSqlite object</span>
<span class="sd"> :param yaps: Yum object with package details</span>
<span class="sd"> :type yaps: YumAvailablePackageSqlite</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="k">return</span> <span class="p">{</span><span class="s">&quot;name&quot;</span><span class="p">:</span> <span class="n">yaps</span><span class="o">.</span><span class="n">name</span><span class="p">,</span> <span class="k">return</span> <span class="p">{</span><span class="s">&quot;name&quot;</span><span class="p">:</span> <span class="n">yaps</span><span class="o">.</span><span class="n">name</span><span class="p">,</span>
<span class="s">&quot;summary&quot;</span><span class="p">:</span> <span class="n">yaps</span><span class="o">.</span><span class="n">summary</span><span class="p">,</span> <span class="s">&quot;summary&quot;</span><span class="p">:</span> <span class="n">yaps</span><span class="o">.</span><span class="n">summary</span><span class="p">,</span>
<span class="s">&quot;description&quot;</span><span class="p">:</span> <span class="n">yaps</span><span class="o">.</span><span class="n">description</span><span class="p">,</span> <span class="s">&quot;description&quot;</span><span class="p">:</span> <span class="n">yaps</span><span class="o">.</span><span class="n">description</span><span class="p">,</span>
<span class="s">&quot;homepage&quot;</span><span class="p">:</span> <span class="n">yaps</span><span class="o">.</span><span class="n">url</span><span class="p">,</span> <span class="s">&quot;homepage&quot;</span><span class="p">:</span> <span class="n">yaps</span><span class="o">.</span><span class="n">url</span><span class="p">,</span>
<span class="s">&quot;upstream_vcs&quot;</span><span class="p">:</span> <span class="s">&quot;UPSTREAM_VCS&quot;</span><span class="p">,</span> <span class="s">&quot;upstream_vcs&quot;</span><span class="p">:</span> <span class="s">&quot;UPSTREAM_VCS&quot;</span><span class="p">,</span>
<span class="s">&quot;builds&quot;</span><span class="p">:</span> <span class="p">[</span><span class="n">build</span><span class="p">]}</span> <span class="s">&quot;builds&quot;</span><span class="p">:</span> <span class="p">[</span><span class="n">yaps_to_build</span><span class="p">(</span><span class="n">yaps</span><span class="p">)]}</span>
</div> </div>
<div class="viewcode-block" id="tm_to_dep"><a class="viewcode-back" href="../../../pylorax.api.html#pylorax.api.projects.tm_to_dep">[docs]</a><span class="k">def</span> <span class="nf">tm_to_dep</span><span class="p">(</span><span class="n">tm</span><span class="p">):</span> <div class="viewcode-block" id="tm_to_dep"><a class="viewcode-back" href="../../../pylorax.api.html#pylorax.api.projects.tm_to_dep">[docs]</a><span class="k">def</span> <span class="nf">tm_to_dep</span><span class="p">(</span><span class="n">tm</span><span class="p">):</span>
@ -175,17 +190,17 @@
<span class="s">&quot;arch&quot;</span><span class="p">:</span> <span class="n">tm</span><span class="o">.</span><span class="n">arch</span><span class="p">}</span> <span class="s">&quot;arch&quot;</span><span class="p">:</span> <span class="n">tm</span><span class="o">.</span><span class="n">arch</span><span class="p">}</span>
</div> </div>
<div class="viewcode-block" id="yaps_to_module"><a class="viewcode-back" href="../../../pylorax.api.html#pylorax.api.projects.yaps_to_module">[docs]</a><span class="k">def</span> <span class="nf">yaps_to_module</span><span class="p">(</span><span class="n">yaps</span><span class="p">):</span> <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 YumAvailablePackageSqlite object</span> <span class="sd">&quot;&quot;&quot;Extract the name from a YumAvailablePackageSqlite object</span>
<span class="sd"> :param yaps: Yum object with package details</span> <span class="sd"> :param proj: Project details</span>
<span class="sd"> :type yaps: YumAvailablePackageSqlite</span> <span class="sd"> :type proj: dict</span>
<span class="sd"> :returns: A dict with name, and group_type</span> <span class="sd"> :returns: A dict with name, and group_type</span>
<span class="sd"> :rtype: dict</span> <span class="sd"> :rtype: dict</span>
<span class="sd"> group_type is hard-coded to &quot;rpm&quot;</span> <span class="sd"> group_type is hard-coded to &quot;rpm&quot;</span>
<span class="sd"> &quot;&quot;&quot;</span> <span class="sd"> &quot;&quot;&quot;</span>
<span class="k">return</span> <span class="p">{</span><span class="s">&quot;name&quot;</span><span class="p">:</span> <span class="n">yaps</span><span class="o">.</span><span class="n">name</span><span class="p">,</span> <span class="k">return</span> <span class="p">{</span><span class="s">&quot;name&quot;</span><span class="p">:</span> <span class="n">proj</span><span class="p">[</span><span class="s">&quot;name&quot;</span><span class="p">],</span>
<span class="s">&quot;group_type&quot;</span><span class="p">:</span> <span class="s">&quot;rpm&quot;</span><span class="p">}</span> <span class="s">&quot;group_type&quot;</span><span class="p">:</span> <span class="s">&quot;rpm&quot;</span><span class="p">}</span>
</div> </div>
@ -220,8 +235,8 @@
<span class="k">raise</span> <span class="n">ProjectsError</span><span class="p">(</span><span class="s">&quot;There was a problem listing projects: </span><span class="si">%s</span><span class="s">&quot;</span> <span class="o">%</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">ProjectsError</span><span class="p">(</span><span class="s">&quot;There was a problem listing projects: </span><span class="si">%s</span><span class="s">&quot;</span> <span class="o">%</span> <span class="nb">str</span><span class="p">(</span><span class="n">e</span><span class="p">))</span>
<span class="k">finally</span><span class="p">:</span> <span class="k">finally</span><span class="p">:</span>
<span class="n">yb</span><span class="o">.</span><span class="n">closeRpmDB</span><span class="p">()</span> <span class="n">yb</span><span class="o">.</span><span class="n">closeRpmDB</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">yaps_to_project</span><span class="p">,</span> <span class="n">ybl</span><span class="o">.</span><span class="n">available</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="s">&quot;name&quot;</span><span class="p">]</span><span class="o">.</span><span class="n">lower</span><span class="p">())</span> <span class="n">projs</span> <span class="o">=</span> <span class="n">_unique_dicts</span><span class="p">(</span><span class="nb">map</span><span class="p">(</span><span class="n">yaps_to_project</span><span class="p">,</span> <span class="n">ybl</span><span class="o">.</span><span class="n">available</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="s">&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="nb">sorted</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="s">&quot;name&quot;</span><span class="p">]</span><span class="o">.</span><span class="n">lower</span><span class="p">())</span>
</div> </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">yb</span><span class="p">,</span> <span class="n">project_names</span><span class="p">):</span> <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">yb</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">&quot;&quot;&quot;Return details about specific projects</span>
@ -239,9 +254,119 @@
<span class="k">raise</span> <span class="n">ProjectsError</span><span class="p">(</span><span class="s">&quot;There was a problem with info for </span><span class="si">%s</span><span class="s">: </span><span class="si">%s</span><span class="s">&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">raise</span> <span class="n">ProjectsError</span><span class="p">(</span><span class="s">&quot;There was a problem with info for </span><span class="si">%s</span><span class="s">: </span><span class="si">%s</span><span class="s">&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">finally</span><span class="p">:</span> <span class="k">finally</span><span class="p">:</span>
<span class="n">yb</span><span class="o">.</span><span class="n">closeRpmDB</span><span class="p">()</span> <span class="n">yb</span><span class="o">.</span><span class="n">closeRpmDB</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">yaps_to_project_info</span><span class="p">,</span> <span class="n">ybl</span><span class="o">.</span><span class="n">available</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="s">&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="n">_unique_projs</span><span class="p">(</span><span class="n">ybl</span><span class="o">.</span><span class="n">available</span><span class="p">)</span>
</div> </div>
<span class="k">def</span> <span class="nf">_unique_projs</span><span class="p">(</span><span class="n">projs</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;Return a sorted list of projects with builds combined into one project entry</span>
<span class="sd"> :param yaps: Yum object with package details</span>
<span class="sd"> :type yaps: YumAvailablePackageSqlite</span>
<span class="sd"> :returns: List of project info dicts with yaps_to_project as well as epoch, version, release, etc.</span>
<span class="sd"> :rtype: list of dicts</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="c"># iterate over ybl.available</span>
<span class="c"># - if ybl.name isn&#39;t in the results yet, add yaps_to_project_info in sorted position</span>
<span class="c"># - if ybl.name is already in results, get its builds. If the build for the project is different</span>
<span class="c"># in any way (version, arch, etc.) add it to the entry&#39;s builds list. If it is the same,</span>
<span class="c"># skip it.</span>
<span class="n">results</span> <span class="o">=</span> <span class="p">[]</span>
<span class="n">results_names</span> <span class="o">=</span> <span class="p">{}</span>
<span class="k">for</span> <span class="n">p</span> <span class="ow">in</span> <span class="n">projs</span><span class="p">:</span>
<span class="k">if</span> <span class="n">p</span><span class="o">.</span><span class="n">name</span><span class="o">.</span><span class="n">lower</span><span class="p">()</span> <span class="ow">not</span> <span class="ow">in</span> <span class="n">results_names</span><span class="p">:</span>
<span class="n">idx</span> <span class="o">=</span> <span class="n">insort_left</span><span class="p">(</span><span class="n">results</span><span class="p">,</span> <span class="n">yaps_to_project_info</span><span class="p">(</span><span class="n">p</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="s">&quot;name&quot;</span><span class="p">]</span><span class="o">.</span><span class="n">lower</span><span class="p">())</span>
<span class="n">results_names</span><span class="p">[</span><span class="n">p</span><span class="o">.</span><span class="n">name</span><span class="o">.</span><span class="n">lower</span><span class="p">()]</span> <span class="o">=</span> <span class="n">idx</span>
<span class="k">else</span><span class="p">:</span>
<span class="n">build</span> <span class="o">=</span> <span class="n">yaps_to_build</span><span class="p">(</span><span class="n">p</span><span class="p">)</span>
<span class="k">if</span> <span class="n">build</span> <span class="ow">not</span> <span class="ow">in</span> <span class="n">results</span><span class="p">[</span><span class="n">results_names</span><span class="p">[</span><span class="n">p</span><span class="o">.</span><span class="n">name</span><span class="o">.</span><span class="n">lower</span><span class="p">()]][</span><span class="s">&quot;builds&quot;</span><span class="p">]:</span>
<span class="n">results</span><span class="p">[</span><span class="n">results_names</span><span class="p">[</span><span class="n">p</span><span class="o">.</span><span class="n">name</span><span class="o">.</span><span class="n">lower</span><span class="p">()]][</span><span class="s">&quot;builds&quot;</span><span class="p">]</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">build</span><span class="p">)</span>
<span class="k">return</span> <span class="n">results</span>
<div class="viewcode-block" id="filterVersionGlob"><a class="viewcode-back" href="../../../pylorax.api.html#pylorax.api.projects.filterVersionGlob">[docs]</a><span class="k">def</span> <span class="nf">filterVersionGlob</span><span class="p">(</span><span class="n">pkgs</span><span class="p">,</span> <span class="n">version</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;Filter a list of yum package objects with a version glob</span>
<span class="sd"> :param pkgs: list of yum package objects</span>
<span class="sd"> :type pkgs: list</span>
<span class="sd"> :param version: version matching glob</span>
<span class="sd"> :type version: str</span>
<span class="sd"> pkgs should be a list of all the versions of the *same* package.</span>
<span class="sd"> Return the latest package that matches the &#39;version&#39; glob.</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="c"># Pick the version(s) matching the version glob</span>
<span class="n">matches</span> <span class="o">=</span> <span class="p">[</span><span class="n">po</span> <span class="k">for</span> <span class="n">po</span> <span class="ow">in</span> <span class="n">pkgs</span> <span class="k">if</span> <span class="n">fnmatch</span><span class="o">.</span><span class="n">fnmatchcase</span><span class="p">(</span><span class="n">po</span><span class="o">.</span><span class="n">version</span><span class="p">,</span> <span class="n">version</span><span class="p">)]</span>
<span class="k">if</span> <span class="ow">not</span> <span class="n">matches</span><span class="p">:</span>
<span class="k">raise</span> <span class="ne">RuntimeError</span><span class="p">(</span><span class="s">&quot;No package version matching </span><span class="si">%s</span><span class="s">&quot;</span> <span class="o">%</span> <span class="n">version</span><span class="p">)</span>
<span class="c"># yum implements __cmd__ using verCMP so this will return the highest matching version</span>
<span class="k">return</span> <span class="nb">max</span><span class="p">(</span><span class="n">matches</span><span class="p">)</span>
</div>
<span class="k">def</span> <span class="nf">_findPackageGlob</span><span class="p">(</span><span class="n">yb</span><span class="p">,</span> <span class="n">pkg_name</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;Find the package(s) that match a name glob</span>
<span class="sd"> :param yb: yum base object</span>
<span class="sd"> :type yb: YumBase</span>
<span class="sd"> :param pkg_name: Name or fileglob of the name to find</span>
<span class="sd"> :type pkg_name: str</span>
<span class="sd"> :returns: list of yum package objects or empty list</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="p">(</span><span class="n">exact</span><span class="p">,</span> <span class="n">globbed</span><span class="p">,</span> <span class="n">_unmatched</span><span class="p">)</span> <span class="o">=</span> <span class="n">yb</span><span class="o">.</span><span class="n">pkgSack</span><span class="o">.</span><span class="n">matchPackageNames</span><span class="p">([</span><span class="n">pkg_name</span><span class="p">])</span>
<span class="n">pkgs</span> <span class="o">=</span> <span class="n">exact</span> <span class="o">+</span> <span class="n">globbed</span>
<span class="k">if</span> <span class="n">pkgs</span><span class="p">:</span>
<span class="k">return</span> <span class="n">pkgs</span>
<span class="c"># Nothing matched, check rpmdb</span>
<span class="n">pkgs</span> <span class="o">=</span> <span class="n">yb</span><span class="o">.</span><span class="n">rpmdb</span><span class="o">.</span><span class="n">returnPackages</span><span class="p">(</span><span class="n">patterns</span><span class="o">=</span><span class="p">[</span><span class="n">pkg_name</span><span class="p">],</span> <span class="n">ignore_case</span><span class="o">=</span><span class="bp">False</span><span class="p">)</span>
<span class="k">if</span> <span class="n">pkgs</span><span class="p">:</span>
<span class="k">return</span> <span class="n">pkgs</span>
<span class="c"># Nothing matched, find a matching dep</span>
<span class="k">return</span> <span class="n">yb</span><span class="o">.</span><span class="n">returnPackagesByDep</span><span class="p">(</span><span class="n">pkg_name</span><span class="p">)</span>
<span class="k">def</span> <span class="nf">_depsolve</span><span class="p">(</span><span class="n">yb</span><span class="p">,</span> <span class="n">projects</span><span class="p">,</span> <span class="n">groups</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;Find the dependencies for a list of projects and groups</span>
<span class="sd"> :param yb: yum base object</span>
<span class="sd"> :type yb: YumBase</span>
<span class="sd"> :param projects: The projects and version globs to find the dependencies for</span>
<span class="sd"> :type projects: List of tuples</span>
<span class="sd"> :param groups: The groups to include in dependency solving</span>
<span class="sd"> :type groups: List of str</span>
<span class="sd"> :returns: A list of errors that were encountered while depsolving the packages</span>
<span class="sd"> :rtype: list of strings</span>
<span class="sd"> :raises: ProjectsError if there was a problem installing something</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="c"># This resets the transaction</span>
<span class="n">yb</span><span class="o">.</span><span class="n">closeRpmDB</span><span class="p">()</span>
<span class="n">install_errors</span> <span class="o">=</span> <span class="p">[]</span>
<span class="k">for</span> <span class="n">name</span> <span class="ow">in</span> <span class="n">groups</span><span class="p">:</span>
<span class="n">yb</span><span class="o">.</span><span class="n">selectGroup</span><span class="p">(</span><span class="n">name</span><span class="p">,</span> <span class="p">[</span><span class="s">&quot;mandatory&quot;</span><span class="p">,</span> <span class="s">&quot;default&quot;</span><span class="p">])</span>
<span class="k">for</span> <span class="n">name</span><span class="p">,</span> <span class="n">version</span> <span class="ow">in</span> <span class="n">projects</span><span class="p">:</span>
<span class="k">if</span> <span class="ow">not</span> <span class="n">version</span><span class="p">:</span>
<span class="n">version</span> <span class="o">=</span> <span class="s">&quot;*&quot;</span>
<span class="n">pattern</span> <span class="o">=</span> <span class="s">&quot;</span><span class="si">%s</span><span class="s"> </span><span class="si">%s</span><span class="s">&quot;</span> <span class="o">%</span> <span class="p">(</span><span class="n">name</span><span class="p">,</span> <span class="n">version</span><span class="p">)</span>
<span class="c"># yum.install&#39;s pattern matches the whole nevra, which can result in -* matching</span>
<span class="c"># unexpected packages. So we need to implement our own version globbing.</span>
<span class="c"># First get a list of packages, then filter that by the version</span>
<span class="n">pkgs</span> <span class="o">=</span> <span class="n">_findPackageGlob</span><span class="p">(</span><span class="n">yb</span><span class="p">,</span> <span class="n">name</span><span class="p">)</span>
<span class="k">if</span> <span class="ow">not</span> <span class="n">pkgs</span><span class="p">:</span>
<span class="n">install_errors</span><span class="o">.</span><span class="n">append</span><span class="p">((</span><span class="n">name</span><span class="p">,</span> <span class="s">&quot;No package name matching </span><span class="si">%s</span><span class="s">&quot;</span> <span class="o">%</span> <span class="n">name</span><span class="p">))</span>
<span class="k">continue</span>
<span class="k">try</span><span class="p">:</span>
<span class="n">po</span> <span class="o">=</span> <span class="n">filterVersionGlob</span><span class="p">(</span><span class="n">pkgs</span><span class="p">,</span> <span class="n">version</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="s">&quot;Chose </span><span class="si">%s</span><span class="s"> as best match for </span><span class="si">%s</span><span class="s">&quot;</span><span class="p">,</span> <span class="n">po</span><span class="o">.</span><span class="n">nevra</span><span class="p">,</span> <span class="n">pattern</span><span class="p">)</span>
<span class="n">yb</span><span class="o">.</span><span class="n">install</span><span class="p">(</span><span class="n">po</span><span class="o">=</span><span class="n">po</span><span class="p">)</span>
<span class="k">except</span> <span class="p">(</span><span class="n">YumBaseError</span><span class="p">,</span> <span class="ne">RuntimeError</span><span class="p">)</span> <span class="k">as</span> <span class="n">e</span><span class="p">:</span>
<span class="n">install_errors</span><span class="o">.</span><span class="n">append</span><span class="p">((</span><span class="n">pattern</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">return</span> <span class="n">install_errors</span>
<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">yb</span><span class="p">,</span> <span class="n">projects</span><span class="p">,</span> <span class="n">groups</span><span class="p">):</span> <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">yb</span><span class="p">,</span> <span class="n">projects</span><span class="p">,</span> <span class="n">groups</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;Return the dependencies for a list of projects</span> <span class="sd">&quot;&quot;&quot;Return the dependencies for a list of projects</span>
@ -256,20 +381,7 @@
<span class="sd"> :raises: ProjectsError if there was a problem installing something</span> <span class="sd"> :raises: ProjectsError if there was a problem installing something</span>
<span class="sd"> &quot;&quot;&quot;</span> <span class="sd"> &quot;&quot;&quot;</span>
<span class="k">try</span><span class="p">:</span> <span class="k">try</span><span class="p">:</span>
<span class="c"># This resets the transaction</span> <span class="n">install_errors</span> <span class="o">=</span> <span class="n">_depsolve</span><span class="p">(</span><span class="n">yb</span><span class="p">,</span> <span class="n">projects</span><span class="p">,</span> <span class="n">groups</span><span class="p">)</span>
<span class="n">yb</span><span class="o">.</span><span class="n">closeRpmDB</span><span class="p">()</span>
<span class="n">install_errors</span> <span class="o">=</span> <span class="p">[]</span>
<span class="k">for</span> <span class="n">name</span> <span class="ow">in</span> <span class="n">groups</span><span class="p">:</span>
<span class="n">yb</span><span class="o">.</span><span class="n">selectGroup</span><span class="p">(</span><span class="n">name</span><span class="p">,</span> <span class="p">[</span><span class="s">&quot;mandatory&quot;</span><span class="p">,</span> <span class="s">&quot;default&quot;</span><span class="p">])</span>
<span class="k">for</span> <span class="n">name</span><span class="p">,</span> <span class="n">version</span> <span class="ow">in</span> <span class="n">projects</span><span class="p">:</span>
<span class="k">if</span> <span class="ow">not</span> <span class="n">version</span><span class="p">:</span>
<span class="n">version</span> <span class="o">=</span> <span class="s">&quot;*&quot;</span>
<span class="n">pattern</span> <span class="o">=</span> <span class="s">&quot;</span><span class="si">%s</span><span class="s">-</span><span class="si">%s</span><span class="s">&quot;</span> <span class="o">%</span> <span class="p">(</span><span class="n">name</span><span class="p">,</span> <span class="n">version</span><span class="p">)</span>
<span class="k">try</span><span class="p">:</span>
<span class="n">yb</span><span class="o">.</span><span class="n">install</span><span class="p">(</span><span class="n">pattern</span><span class="o">=</span><span class="n">pattern</span><span class="p">)</span>
<span class="k">except</span> <span class="n">YumBaseError</span> <span class="k">as</span> <span class="n">e</span><span class="p">:</span>
<span class="n">install_errors</span><span class="o">.</span><span class="n">append</span><span class="p">((</span><span class="n">pattern</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="c"># Were there problems installing these packages?</span> <span class="c"># Were there problems installing these packages?</span>
<span class="k">if</span> <span class="n">install_errors</span><span class="p">:</span> <span class="k">if</span> <span class="n">install_errors</span><span class="p">:</span>
@ -293,18 +405,26 @@
<span class="sd"> :type packages: list of TransactionMember objects</span> <span class="sd"> :type packages: list of TransactionMember objects</span>
<span class="sd"> :param block_size: The block size to use for rounding up file sizes.</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"> :type block_size: int</span>
<span class="sd"> :returns: The estimated size of installed packages</span> <span class="sd"> :returns: Tuple of the the estimated size needed, and the size anaconda will calculate</span>
<span class="sd"> :rtype: int</span> <span class="sd"> :rtype: tuple(int, int)</span>
<span class="sd"> Estimating actual requirements is difficult without the actual file sizes, which</span> <span class="sd"> Estimating actual requirements is difficult without the actual file sizes, which</span>
<span class="sd"> yum doesn&#39;t provide access to. So use the file count and block size to estimate</span> <span class="sd"> yum 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"> a minimum size for each package.</span>
<span class="sd"> Anaconda only takes into account the installedsize of each package. It then fudges</span>
<span class="sd"> this by 35% to make sure there is enough space.</span>
<span class="sd"> &quot;&quot;&quot;</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="n">installed_size</span> <span class="o">=</span> <span class="mi">0</span>
<span class="n">anaconda_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="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">po</span><span class="o">.</span><span class="n">filelist</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="nb">len</span><span class="p">(</span><span class="n">p</span><span class="o">.</span><span class="n">po</span><span class="o">.</span><span class="n">filelist</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">po</span><span class="o">.</span><span class="n">installedsize</span> <span class="n">installed_size</span> <span class="o">+=</span> <span class="n">p</span><span class="o">.</span><span class="n">po</span><span class="o">.</span><span class="n">installedsize</span>
<span class="k">return</span> <span class="n">installed_size</span> <span class="c"># anaconda only takes into account installedsize</span>
<span class="n">anaconda_size</span> <span class="o">+=</span> <span class="n">p</span><span class="o">.</span><span class="n">po</span><span class="o">.</span><span class="n">installedsize</span>
<span class="c"># also count the RPM package size (yum cache)</span>
<span class="n">installed_size</span> <span class="o">+=</span> <span class="p">((</span><span class="n">p</span><span class="o">.</span><span class="n">po</span><span class="o">.</span><span class="n">size</span> <span class="o">/</span> <span class="n">block_size</span><span class="p">)</span> <span class="o">+</span> <span class="mi">1</span><span class="p">)</span> <span class="o">*</span> <span class="n">block_size</span>
<span class="k">return</span> <span class="p">(</span><span class="n">installed_size</span><span class="p">,</span> <span class="n">anaconda_size</span><span class="p">)</span>
</div> </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">yb</span><span class="p">,</span> <span class="n">projects</span><span class="p">,</span> <span class="n">groups</span><span class="p">,</span> <span class="n">with_core</span><span class="o">=</span><span class="bp">True</span><span class="p">):</span> <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">yb</span><span class="p">,</span> <span class="n">projects</span><span class="p">,</span> <span class="n">groups</span><span class="p">,</span> <span class="n">with_core</span><span class="o">=</span><span class="bp">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">&quot;&quot;&quot;Return the dependencies and installed size for a list of projects</span>
@ -315,25 +435,15 @@
<span class="sd"> :type projects: List of tuples</span> <span class="sd"> :type projects: List of tuples</span>
<span class="sd"> :param groups: The groups to include in dependency solving</span> <span class="sd"> :param groups: The groups to include in dependency solving</span>
<span class="sd"> :type groups: List of str</span> <span class="sd"> :type groups: List of str</span>
<span class="sd"> :returns: installed size and a list of NEVRA&#39;s of the project and its dependencies</span> <span class="sd"> :returns: installed size, size estimated by anaconda, 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"> :rtype: tuple of (int, int, list of dicts)</span>
<span class="sd"> :raises: ProjectsError if there was a problem installing something</span> <span class="sd"> :raises: ProjectsError if there was a problem installing something</span>
<span class="sd"> The anaconda_size only includes the installed package size, not file block or cache estimation like</span>
<span class="sd"> installed_size includes.</span>
<span class="sd"> &quot;&quot;&quot;</span> <span class="sd"> &quot;&quot;&quot;</span>
<span class="k">try</span><span class="p">:</span> <span class="k">try</span><span class="p">:</span>
<span class="c"># This resets the transaction</span> <span class="n">install_errors</span> <span class="o">=</span> <span class="n">_depsolve</span><span class="p">(</span><span class="n">yb</span><span class="p">,</span> <span class="n">projects</span><span class="p">,</span> <span class="n">groups</span><span class="p">)</span>
<span class="n">yb</span><span class="o">.</span><span class="n">closeRpmDB</span><span class="p">()</span>
<span class="n">install_errors</span> <span class="o">=</span> <span class="p">[]</span>
<span class="k">for</span> <span class="n">name</span> <span class="ow">in</span> <span class="n">groups</span><span class="p">:</span>
<span class="n">yb</span><span class="o">.</span><span class="n">selectGroup</span><span class="p">(</span><span class="n">name</span><span class="p">,</span> <span class="p">[</span><span class="s">&quot;mandatory&quot;</span><span class="p">,</span> <span class="s">&quot;default&quot;</span><span class="p">])</span>
<span class="k">for</span> <span class="n">name</span><span class="p">,</span> <span class="n">version</span> <span class="ow">in</span> <span class="n">projects</span><span class="p">:</span>
<span class="k">if</span> <span class="ow">not</span> <span class="n">version</span><span class="p">:</span>
<span class="n">version</span> <span class="o">=</span> <span class="s">&quot;*&quot;</span>
<span class="n">pattern</span> <span class="o">=</span> <span class="s">&quot;</span><span class="si">%s</span><span class="s">-</span><span class="si">%s</span><span class="s">&quot;</span> <span class="o">%</span> <span class="p">(</span><span class="n">name</span><span class="p">,</span> <span class="n">version</span><span class="p">)</span>
<span class="k">try</span><span class="p">:</span>
<span class="n">yb</span><span class="o">.</span><span class="n">install</span><span class="p">(</span><span class="n">pattern</span><span class="o">=</span><span class="n">pattern</span><span class="p">)</span>
<span class="k">except</span> <span class="n">YumBaseError</span> <span class="k">as</span> <span class="n">e</span><span class="p">:</span>
<span class="n">install_errors</span><span class="o">.</span><span class="n">append</span><span class="p">((</span><span class="n">pattern</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="c"># Were there problems installing these packages?</span> <span class="c"># Were there problems installing these packages?</span>
<span class="k">if</span> <span class="n">install_errors</span><span class="p">:</span> <span class="k">if</span> <span class="n">install_errors</span><span class="p">:</span>
@ -345,13 +455,13 @@
<span class="k">if</span> <span class="n">rc</span> <span class="ow">not</span> <span class="ow">in</span> <span class="p">[</span><span class="mi">0</span><span class="p">,</span> <span class="mi">1</span><span class="p">,</span> <span class="mi">2</span><span class="p">]:</span> <span class="k">if</span> <span class="n">rc</span> <span class="ow">not</span> <span class="ow">in</span> <span class="p">[</span><span class="mi">0</span><span class="p">,</span> <span class="mi">1</span><span class="p">,</span> <span class="mi">2</span><span class="p">]:</span>
<span class="k">raise</span> <span class="n">ProjectsError</span><span class="p">(</span><span class="s">&quot;There was a problem depsolving </span><span class="si">%s</span><span class="s">: </span><span class="si">%s</span><span class="s">&quot;</span> <span class="o">%</span> <span class="p">(</span><span class="n">projects</span><span class="p">,</span> <span class="n">msg</span><span class="p">))</span> <span class="k">raise</span> <span class="n">ProjectsError</span><span class="p">(</span><span class="s">&quot;There was a problem depsolving </span><span class="si">%s</span><span class="s">: </span><span class="si">%s</span><span class="s">&quot;</span> <span class="o">%</span> <span class="p">(</span><span class="n">projects</span><span class="p">,</span> <span class="n">msg</span><span class="p">))</span>
<span class="n">yb</span><span class="o">.</span><span class="n">tsInfo</span><span class="o">.</span><span class="n">makelists</span><span class="p">()</span> <span class="n">yb</span><span class="o">.</span><span class="n">tsInfo</span><span class="o">.</span><span class="n">makelists</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">yb</span><span class="o">.</span><span class="n">tsInfo</span><span class="o">.</span><span class="n">installed</span> <span class="o">+</span> <span class="n">yb</span><span class="o">.</span><span class="n">tsInfo</span><span class="o">.</span><span class="n">depinstalled</span><span class="p">)</span> <span class="p">(</span><span class="n">installed_size</span><span class="p">,</span> <span class="n">anaconda_size</span><span class="p">)</span> <span class="o">=</span> <span class="n">estimate_size</span><span class="p">(</span><span class="n">yb</span><span class="o">.</span><span class="n">tsInfo</span><span class="o">.</span><span class="n">installed</span> <span class="o">+</span> <span class="n">yb</span><span class="o">.</span><span class="n">tsInfo</span><span class="o">.</span><span class="n">depinstalled</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">tm_to_dep</span><span class="p">,</span> <span class="n">yb</span><span class="o">.</span><span class="n">tsInfo</span><span class="o">.</span><span class="n">installed</span> <span class="o">+</span> <span class="n">yb</span><span class="o">.</span><span class="n">tsInfo</span><span class="o">.</span><span class="n">depinstalled</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="s">&quot;name&quot;</span><span class="p">]</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="nb">sorted</span><span class="p">(</span><span class="nb">map</span><span class="p">(</span><span class="n">tm_to_dep</span><span class="p">,</span> <span class="n">yb</span><span class="o">.</span><span class="n">tsInfo</span><span class="o">.</span><span class="n">installed</span> <span class="o">+</span> <span class="n">yb</span><span class="o">.</span><span class="n">tsInfo</span><span class="o">.</span><span class="n">depinstalled</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="s">&quot;name&quot;</span><span class="p">]</span><span class="o">.</span><span class="n">lower</span><span class="p">())</span>
<span class="k">except</span> <span class="n">YumBaseError</span> <span class="k">as</span> <span class="n">e</span><span class="p">:</span> <span class="k">except</span> <span class="n">YumBaseError</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="s">&quot;There was a problem depsolving </span><span class="si">%s</span><span class="s">: </span><span class="si">%s</span><span class="s">&quot;</span> <span class="o">%</span> <span class="p">(</span><span class="n">projects</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">ProjectsError</span><span class="p">(</span><span class="s">&quot;There was a problem depsolving </span><span class="si">%s</span><span class="s">: </span><span class="si">%s</span><span class="s">&quot;</span> <span class="o">%</span> <span class="p">(</span><span class="n">projects</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">finally</span><span class="p">:</span> <span class="k">finally</span><span class="p">:</span>
<span class="n">yb</span><span class="o">.</span><span class="n">closeRpmDB</span><span class="p">()</span> <span class="n">yb</span><span class="o">.</span><span class="n">closeRpmDB</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> <span class="k">return</span> <span class="p">(</span><span class="n">installed_size</span><span class="p">,</span> <span class="n">anaconda_size</span><span class="p">,</span> <span class="n">deps</span><span class="p">)</span>
</div> </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">yb</span><span class="p">,</span> <span class="n">module_names</span><span class="p">):</span> <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">yb</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">&quot;&quot;&quot;Return a list of modules</span>
@ -368,15 +478,30 @@
<span class="sd"> Modules don&#39;t exist in RHEL7 so this only returns projects</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"> and sets the type to &quot;rpm&quot;</span>
<span class="sd"> &quot;&quot;&quot;</span> <span class="sd"> &quot;&quot;&quot;</span>
<span class="k">try</span><span class="p">:</span> <span class="n">projs</span> <span class="o">=</span> <span class="n">_unique_dicts</span><span class="p">(</span><span class="n">projects_info</span><span class="p">(</span><span class="n">yb</span><span class="p">,</span> <span class="n">module_names</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="s">&quot;name&quot;</span><span class="p">]</span><span class="o">.</span><span class="n">lower</span><span class="p">())</span>
<span class="n">ybl</span> <span class="o">=</span> <span class="n">yb</span><span class="o">.</span><span class="n">doPackageLists</span><span class="p">(</span><span class="n">pkgnarrow</span><span class="o">=</span><span class="s">&quot;available&quot;</span><span class="p">,</span> <span class="n">patterns</span><span class="o">=</span><span class="n">module_names</span><span class="p">,</span> <span class="n">showdups</span><span class="o">=</span><span class="bp">False</span><span class="p">)</span> <span class="k">return</span> <span class="nb">list</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="k">except</span> <span class="n">YumBaseError</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="s">&quot;There was a problem listing modules: </span><span class="si">%s</span><span class="s">&quot;</span> <span class="o">%</span> <span class="nb">str</span><span class="p">(</span><span class="n">e</span><span class="p">))</span>
<span class="k">finally</span><span class="p">:</span>
<span class="n">yb</span><span class="o">.</span><span class="n">closeRpmDB</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">yaps_to_module</span><span class="p">,</span> <span class="n">ybl</span><span class="o">.</span><span class="n">available</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="s">&quot;name&quot;</span><span class="p">]</span><span class="o">.</span><span class="n">lower</span><span class="p">())</span>
</div> </div>
<span class="k">def</span> <span class="nf">_unique_dicts</span><span class="p">(</span><span class="n">lst</span><span class="p">,</span> <span class="n">key</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;Return a new list of dicts, only including one match of key(d)</span>
<span class="sd"> :param lst: list of dicts</span>
<span class="sd"> :type lst: list</span>
<span class="sd"> :param key: key function to match lst entries</span>
<span class="sd"> :type key: function</span>
<span class="sd"> :returns: list of the unique lst entries</span>
<span class="sd"> :rtype: list</span>
<span class="sd"> Uses key(d) to test for duplicates in the returned list, creating a</span>
<span class="sd"> list of unique return values.</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="n">result</span> <span class="o">=</span> <span class="p">[]</span>
<span class="n">result_keys</span> <span class="o">=</span> <span class="p">[]</span>
<span class="k">for</span> <span class="n">d</span> <span class="ow">in</span> <span class="n">lst</span><span class="p">:</span>
<span class="k">if</span> <span class="n">key</span><span class="p">(</span><span class="n">d</span><span class="p">)</span> <span class="ow">not</span> <span class="ow">in</span> <span class="n">result_keys</span><span class="p">:</span>
<span class="n">result</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">result_keys</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">key</span><span class="p">(</span><span class="n">d</span><span class="p">))</span>
<span class="k">return</span> <span class="n">result</span>
<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">yb</span><span class="p">,</span> <span class="n">module_names</span><span class="p">):</span> <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">yb</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">&quot;&quot;&quot;Return details about a module, including dependencies</span>
@ -648,7 +773,7 @@
<li class="right" > <li class="right" >
<a href="../../../py-modindex.html" title="Python Module Index" <a href="../../../py-modindex.html" title="Python Module Index"
>modules</a> |</li> >modules</a> |</li>
<li><a href="../../../index.html">Lorax 19.7.22 documentation</a> &raquo;</li> <li><a href="../../../index.html">Lorax 19.7.43 documentation</a> &raquo;</li>
<li><a href="../../index.html" >Module code</a> &raquo;</li> <li><a href="../../index.html" >Module code</a> &raquo;</li>
<li><a href="../../pylorax.html" >pylorax</a> &raquo;</li> <li><a href="../../pylorax.html" >pylorax</a> &raquo;</li>
<li><a href="../api.html" >pylorax.api</a> &raquo;</li> <li><a href="../api.html" >pylorax.api</a> &raquo;</li>

View File

@ -8,7 +8,7 @@
<head> <head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>pylorax.api.queue &mdash; Lorax 19.7.22 documentation</title> <title>pylorax.api.queue &mdash; Lorax 19.7.43 documentation</title>
<link rel="stylesheet" href="../../../_static/default.css" type="text/css" /> <link rel="stylesheet" href="../../../_static/default.css" type="text/css" />
<link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" /> <link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" />
@ -16,7 +16,7 @@
<script type="text/javascript"> <script type="text/javascript">
var DOCUMENTATION_OPTIONS = { var DOCUMENTATION_OPTIONS = {
URL_ROOT: '../../../', URL_ROOT: '../../../',
VERSION: '19.7.22', VERSION: '19.7.43',
COLLAPSE_INDEX: false, COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html', FILE_SUFFIX: '.html',
HAS_SOURCE: true HAS_SOURCE: true
@ -25,7 +25,7 @@
<script type="text/javascript" src="../../../_static/jquery.js"></script> <script type="text/javascript" src="../../../_static/jquery.js"></script>
<script type="text/javascript" src="../../../_static/underscore.js"></script> <script type="text/javascript" src="../../../_static/underscore.js"></script>
<script type="text/javascript" src="../../../_static/doctools.js"></script> <script type="text/javascript" src="../../../_static/doctools.js"></script>
<link rel="top" title="Lorax 19.7.22 documentation" href="../../../index.html" /> <link rel="top" title="Lorax 19.7.43 documentation" href="../../../index.html" />
<link rel="up" title="pylorax.api" href="../api.html" /> <link rel="up" title="pylorax.api" href="../api.html" />
</head> </head>
<body> <body>
@ -38,7 +38,7 @@
<li class="right" > <li class="right" >
<a href="../../../py-modindex.html" title="Python Module Index" <a href="../../../py-modindex.html" title="Python Module Index"
>modules</a> |</li> >modules</a> |</li>
<li><a href="../../../index.html">Lorax 19.7.22 documentation</a> &raquo;</li> <li><a href="../../../index.html">Lorax 19.7.43 documentation</a> &raquo;</li>
<li><a href="../../index.html" >Module code</a> &raquo;</li> <li><a href="../../index.html" >Module code</a> &raquo;</li>
<li><a href="../../pylorax.html" >pylorax</a> &raquo;</li> <li><a href="../../pylorax.html" >pylorax</a> &raquo;</li>
<li><a href="../api.html" accesskey="U">pylorax.api</a> &raquo;</li> <li><a href="../api.html" accesskey="U">pylorax.api</a> &raquo;</li>
@ -88,6 +88,47 @@
<span class="kn">from</span> <span class="nn">pylorax.creator</span> <span class="kn">import</span> <span class="n">run_creator</span> <span class="kn">from</span> <span class="nn">pylorax.creator</span> <span class="kn">import</span> <span class="n">run_creator</span>
<span class="kn">from</span> <span class="nn">pylorax.sysutils</span> <span class="kn">import</span> <span class="n">joinpaths</span> <span class="kn">from</span> <span class="nn">pylorax.sysutils</span> <span class="kn">import</span> <span class="n">joinpaths</span>
<div class="viewcode-block" id="check_queues"><a class="viewcode-back" href="../../../pylorax.api.html#pylorax.api.queue.check_queues">[docs]</a><span class="k">def</span> <span class="nf">check_queues</span><span class="p">(</span><span class="n">cfg</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;Check to make sure the new and run queue symlinks are correct</span>
<span class="sd"> :param cfg: Configuration settings</span>
<span class="sd"> :type cfg: DataHolder</span>
<span class="sd"> Also check all of the existing results and make sure any with WAITING</span>
<span class="sd"> set in STATUS have a symlink in queue/new/</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="c"># Remove broken symlinks from the new and run queues</span>
<span class="n">queue_symlinks</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">cfg</span><span class="o">.</span><span class="n">composer_dir</span><span class="p">,</span> <span class="s">&quot;queue/new/*&quot;</span><span class="p">))</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">cfg</span><span class="o">.</span><span class="n">composer_dir</span><span class="p">,</span> <span class="s">&quot;queue/run/*&quot;</span><span class="p">))</span>
<span class="k">for</span> <span class="n">link</span> <span class="ow">in</span> <span class="n">queue_symlinks</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">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">link</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="s">&quot;Removing broken symlink </span><span class="si">%s</span><span class="s">&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">unlink</span><span class="p">(</span><span class="n">link</span><span class="p">)</span>
<span class="c"># Write FAILED to the STATUS of any run queue symlinks and remove them</span>
<span class="k">for</span> <span class="n">link</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">composer_dir</span><span class="p">,</span> <span class="s">&quot;queue/run/*&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="s">&quot;Setting build </span><span class="si">%s</span><span class="s"> to FAILED, and removing symlink from queue/run/&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">basename</span><span class="p">(</span><span class="n">link</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">link</span><span class="p">,</span> <span class="s">&quot;STATUS&quot;</span><span class="p">),</span> <span class="s">&quot;w&quot;</span><span class="p">)</span><span class="o">.</span><span class="n">write</span><span class="p">(</span><span class="s">&quot;FAILED</span><span class="se">\n</span><span class="s">&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">link</span><span class="p">)</span>
<span class="c"># Check results STATUS messages</span>
<span class="c"># - If STATUS is missing, set it to FAILED</span>
<span class="c"># - RUNNING should be changed to FAILED</span>
<span class="c"># - WAITING should have a symlink in the new queue</span>
<span class="k">for</span> <span class="n">link</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">composer_dir</span><span class="p">,</span> <span class="s">&quot;results/*&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">joinpaths</span><span class="p">(</span><span class="n">link</span><span class="p">,</span> <span class="s">&quot;STATUS&quot;</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">link</span><span class="p">,</span> <span class="s">&quot;STATUS&quot;</span><span class="p">),</span> <span class="s">&quot;w&quot;</span><span class="p">)</span><span class="o">.</span><span class="n">write</span><span class="p">(</span><span class="s">&quot;FAILED</span><span class="se">\n</span><span class="s">&quot;</span><span class="p">)</span>
<span class="k">continue</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">link</span><span class="p">,</span> <span class="s">&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="k">if</span> <span class="n">status</span> <span class="o">==</span> <span class="s">&quot;RUNNING&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="s">&quot;Setting build </span><span class="si">%s</span><span class="s"> to FAILED&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">basename</span><span class="p">(</span><span class="n">link</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">link</span><span class="p">,</span> <span class="s">&quot;STATUS&quot;</span><span class="p">),</span> <span class="s">&quot;w&quot;</span><span class="p">)</span><span class="o">.</span><span class="n">write</span><span class="p">(</span><span class="s">&quot;FAILED</span><span class="se">\n</span><span class="s">&quot;</span><span class="p">)</span>
<span class="k">elif</span> <span class="n">status</span> <span class="o">==</span> <span class="s">&quot;WAITING&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">islink</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="s">&quot;queue/new/&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">basename</span><span class="p">(</span><span class="n">link</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="s">&quot;Creating missing symlink to new build </span><span class="si">%s</span><span class="s">&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">basename</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">symlink</span><span class="p">(</span><span class="n">link</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="s">&quot;queue/new/&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">basename</span><span class="p">(</span><span class="n">link</span><span class="p">)))</span>
</div>
<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> <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">&quot;&quot;&quot;Start the queue monitor as a mp process</span>
@ -121,7 +162,7 @@
<span class="sd"> compose is finished) the symlink will be moved into ./queue/run/ and a STATUS file</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"> will be created in the results directory.</span>
<span class="sd"> STATUS can contain one of: RUNNING, FINISHED, FAILED</span> <span class="sd"> STATUS can contain one of: WAITING, 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"> 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"> from ./queue/run/ to ./queue/new/ and rerun them.</span>
@ -130,13 +171,7 @@
<span class="sd">&quot;&quot;&quot;Sort the queue entries by their mtime, not their names&quot;&quot;&quot;</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="s">&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="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="s">&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="c"># Move any symlinks in the run queue back to the new queue</span> <span class="n">check_queues</span><span class="p">(</span><span class="n">cfg</span><span class="p">)</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="s">&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="s">&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="s">&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="s">&quot;Moved unfinished compose </span><span class="si">%s</span><span class="s"> 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="bp">True</span><span class="p">:</span> <span class="k">while</span> <span class="bp">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="s">&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="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="s">&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>
@ -259,7 +294,7 @@
<span class="k">else</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="s">&quot;w&quot;</span><span class="p">)</span><span class="o">.</span><span class="n">write</span><span class="p">(</span><span class="s">&quot;TEST IMAGE&quot;</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="s">&quot;w&quot;</span><span class="p">)</span><span class="o">.</span><span class="n">write</span><span class="p">(</span><span class="s">&quot;TEST IMAGE&quot;</span><span class="p">)</span>
<span class="k">else</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="n">run_creator</span><span class="p">(</span><span class="n">install_cfg</span><span class="p">,</span> <span class="n">cancel_func</span><span class="o">=</span><span class="n">cancel_build</span><span class="p">)</span>
<span class="c"># Extract the results of the compose into results_dir and cleanup the compose directory</span> <span class="c"># 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="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>
@ -442,11 +477,16 @@
<span class="sd"> Only call this if the build status is WAITING or RUNNING</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="sd"> &quot;&quot;&quot;</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="s">&quot;composer&quot;</span><span class="p">,</span> <span class="s">&quot;lib_dir&quot;</span><span class="p">),</span> <span class="s">&quot;results&quot;</span><span class="p">,</span> <span class="n">uuid</span><span class="p">,</span> <span class="s">&quot;CANCEL&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">cancel_path</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="s">&quot;Cancel has already been requested for </span><span class="si">%s</span><span class="s">&quot;</span><span class="p">,</span> <span class="n">uuid</span><span class="p">)</span>
<span class="k">return</span> <span class="bp">False</span>
<span class="c"># This status can change (and probably will) while it is in the middle of doing this:</span> <span class="c"># This status can change (and probably will) while it is in the middle of doing this:</span>
<span class="c"># It can move from WAITING -&gt; RUNNING or it can move from RUNNING -&gt; FINISHED|FAILED</span> <span class="c"># It can move from WAITING -&gt; RUNNING or it can move from RUNNING -&gt; FINISHED|FAILED</span>
<span class="c"># If it is in WAITING remove the symlink and then check to make sure it didn&#39;t show up</span> <span class="c"># If it is in WAITING remove the symlink and then check to make sure it didn&#39;t show up</span>
<span class="c"># in RUNNING</span> <span class="c"># in the run queue</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="s">&quot;composer&quot;</span><span class="p">,</span> <span class="s">&quot;lib_dir&quot;</span><span class="p">),</span> <span class="s">&quot;queue&quot;</span><span class="p">)</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="s">&quot;composer&quot;</span><span class="p">,</span> <span class="s">&quot;lib_dir&quot;</span><span class="p">),</span> <span class="s">&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="s">&quot;new&quot;</span><span class="p">,</span> <span class="n">uuid</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="s">&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">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>
@ -457,19 +497,24 @@
<span class="k">pass</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="s">&quot;run&quot;</span><span class="p">,</span> <span class="n">uuid</span><span class="p">)</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="s">&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="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="c"># Make sure the build is still in the waiting state</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="bp">None</span> <span class="ow">or</span> <span class="n">status</span><span class="p">[</span><span class="s">&quot;queue_status&quot;</span><span class="p">]</span> <span class="o">==</span> <span class="s">&quot;WAITING&quot;</span><span class="p">:</span>
<span class="c"># Successfully removed it before the build started</span> <span class="c"># 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="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="c"># Tell the build to stop running</span> <span class="c"># At this point the build has probably started. Write to the CANCEL file.</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="s">&quot;composer&quot;</span><span class="p">,</span> <span class="s">&quot;lib_dir&quot;</span><span class="p">),</span> <span class="s">&quot;results&quot;</span><span class="p">,</span> <span class="n">uuid</span><span class="p">,</span> <span class="s">&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="s">&quot;w&quot;</span><span class="p">)</span><span class="o">.</span><span class="n">write</span><span class="p">(</span><span class="s">&quot;</span><span class="se">\n</span><span class="s">&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="s">&quot;w&quot;</span><span class="p">)</span><span class="o">.</span><span class="n">write</span><span class="p">(</span><span class="s">&quot;</span><span class="se">\n</span><span class="s">&quot;</span><span class="p">)</span>
<span class="c"># Wait for status to move to FAILED</span> <span class="c"># Wait for status to move to FAILED or FINISHED</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="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="bp">True</span><span class="p">:</span> <span class="k">while</span> <span class="bp">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="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="bp">None</span> <span class="ow">or</span> <span class="n">status</span><span class="p">[</span><span class="s">&quot;queue_status&quot;</span><span class="p">]</span> <span class="o">==</span> <span class="s">&quot;FAILED&quot;</span><span class="p">:</span> <span class="k">if</span> <span class="n">status</span> <span class="ow">is</span> <span class="bp">None</span> <span class="ow">or</span> <span class="n">status</span><span class="p">[</span><span class="s">&quot;queue_status&quot;</span><span class="p">]</span> <span class="o">==</span> <span class="s">&quot;FAILED&quot;</span><span class="p">:</span>
<span class="k">break</span> <span class="k">break</span>
<span class="k">elif</span> <span class="n">status</span> <span class="ow">is</span> <span class="ow">not</span> <span class="bp">None</span> <span class="ow">and</span> <span class="n">status</span><span class="p">[</span><span class="s">&quot;queue_status&quot;</span><span class="p">]</span> <span class="o">==</span> <span class="s">&quot;FINISHED&quot;</span><span class="p">:</span>
<span class="c"># The build finished successfully, no point in deleting it now</span>
<span class="k">return</span> <span class="bp">False</span>
<span class="c"># Is this taking too long? Exit anyway and try to cleanup.</span> <span class="c"># 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="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>
@ -710,7 +755,7 @@
<li class="right" > <li class="right" >
<a href="../../../py-modindex.html" title="Python Module Index" <a href="../../../py-modindex.html" title="Python Module Index"
>modules</a> |</li> >modules</a> |</li>
<li><a href="../../../index.html">Lorax 19.7.22 documentation</a> &raquo;</li> <li><a href="../../../index.html">Lorax 19.7.43 documentation</a> &raquo;</li>
<li><a href="../../index.html" >Module code</a> &raquo;</li> <li><a href="../../index.html" >Module code</a> &raquo;</li>
<li><a href="../../pylorax.html" >pylorax</a> &raquo;</li> <li><a href="../../pylorax.html" >pylorax</a> &raquo;</li>
<li><a href="../api.html" >pylorax.api</a> &raquo;</li> <li><a href="../api.html" >pylorax.api</a> &raquo;</li>

View File

@ -8,7 +8,7 @@
<head> <head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>pylorax.api.recipes &mdash; Lorax 19.7.22 documentation</title> <title>pylorax.api.recipes &mdash; Lorax 19.7.43 documentation</title>
<link rel="stylesheet" href="../../../_static/default.css" type="text/css" /> <link rel="stylesheet" href="../../../_static/default.css" type="text/css" />
<link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" /> <link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" />
@ -16,7 +16,7 @@
<script type="text/javascript"> <script type="text/javascript">
var DOCUMENTATION_OPTIONS = { var DOCUMENTATION_OPTIONS = {
URL_ROOT: '../../../', URL_ROOT: '../../../',
VERSION: '19.7.22', VERSION: '19.7.43',
COLLAPSE_INDEX: false, COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html', FILE_SUFFIX: '.html',
HAS_SOURCE: true HAS_SOURCE: true
@ -25,7 +25,7 @@
<script type="text/javascript" src="../../../_static/jquery.js"></script> <script type="text/javascript" src="../../../_static/jquery.js"></script>
<script type="text/javascript" src="../../../_static/underscore.js"></script> <script type="text/javascript" src="../../../_static/underscore.js"></script>
<script type="text/javascript" src="../../../_static/doctools.js"></script> <script type="text/javascript" src="../../../_static/doctools.js"></script>
<link rel="top" title="Lorax 19.7.22 documentation" href="../../../index.html" /> <link rel="top" title="Lorax 19.7.43 documentation" href="../../../index.html" />
<link rel="up" title="pylorax.api" href="../api.html" /> <link rel="up" title="pylorax.api" href="../api.html" />
</head> </head>
<body> <body>
@ -38,7 +38,7 @@
<li class="right" > <li class="right" >
<a href="../../../py-modindex.html" title="Python Module Index" <a href="../../../py-modindex.html" title="Python Module Index"
>modules</a> |</li> >modules</a> |</li>
<li><a href="../../../index.html">Lorax 19.7.22 documentation</a> &raquo;</li> <li><a href="../../../index.html">Lorax 19.7.43 documentation</a> &raquo;</li>
<li><a href="../../index.html" >Module code</a> &raquo;</li> <li><a href="../../index.html" >Module code</a> &raquo;</li>
<li><a href="../../pylorax.html" >pylorax</a> &raquo;</li> <li><a href="../../pylorax.html" >pylorax</a> &raquo;</li>
<li><a href="../api.html" accesskey="U">pylorax.api</a> &raquo;</li> <li><a href="../api.html" accesskey="U">pylorax.api</a> &raquo;</li>
@ -52,7 +52,7 @@
<h1>Source code for pylorax.api.recipes</h1><div class="highlight"><pre> <h1>Source code for pylorax.api.recipes</h1><div class="highlight"><pre>
<span class="c">#</span> <span class="c">#</span>
<span class="c"># Copyright (C) 2017 Red Hat, Inc.</span> <span class="c"># Copyright (C) 2017-2019 Red Hat, Inc.</span>
<span class="c">#</span> <span class="c">#</span>
<span class="c"># This program is free software; you can redistribute it and/or modify</span> <span class="c"># This program is free software; you can redistribute it and/or modify</span>
<span class="c"># it under the terms of the GNU General Public License as published by</span> <span class="c"># it under the terms of the GNU General Public License as published by</span>
@ -287,6 +287,12 @@
<span class="n">description</span> <span class="o">=</span> <span class="n">recipe_dict</span><span class="p">[</span><span class="s">&quot;description&quot;</span><span class="p">]</span> <span class="n">description</span> <span class="o">=</span> <span class="n">recipe_dict</span><span class="p">[</span><span class="s">&quot;description&quot;</span><span class="p">]</span>
<span class="n">version</span> <span class="o">=</span> <span class="n">recipe_dict</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s">&quot;version&quot;</span><span class="p">,</span> <span class="bp">None</span><span class="p">)</span> <span class="n">version</span> <span class="o">=</span> <span class="n">recipe_dict</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s">&quot;version&quot;</span><span class="p">,</span> <span class="bp">None</span><span class="p">)</span>
<span class="n">customizations</span> <span class="o">=</span> <span class="n">recipe_dict</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s">&quot;customizations&quot;</span><span class="p">,</span> <span class="bp">None</span><span class="p">)</span> <span class="n">customizations</span> <span class="o">=</span> <span class="n">recipe_dict</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s">&quot;customizations&quot;</span><span class="p">,</span> <span class="bp">None</span><span class="p">)</span>
<span class="c"># [customizations] was incorrectly documented at first, so we have to support using it</span>
<span class="c"># as [[customizations]] by grabbing the first element.</span>
<span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">customizations</span><span class="p">,</span> <span class="nb">list</span><span class="p">):</span>
<span class="n">customizations</span> <span class="o">=</span> <span class="n">customizations</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span>
<span class="k">except</span> <span class="ne">KeyError</span> <span class="k">as</span> <span class="n">e</span><span class="p">:</span> <span class="k">except</span> <span class="ne">KeyError</span> <span class="k">as</span> <span class="n">e</span><span class="p">:</span>
<span class="k">raise</span> <span class="n">RecipeError</span><span class="p">(</span><span class="s">&quot;There was a problem parsing the recipe: </span><span class="si">%s</span><span class="s">&quot;</span> <span class="o">%</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">RecipeError</span><span class="p">(</span><span class="s">&quot;There was a problem parsing the recipe: </span><span class="si">%s</span><span class="s">&quot;</span> <span class="o">%</span> <span class="nb">str</span><span class="p">(</span><span class="n">e</span><span class="p">))</span>
@ -461,6 +467,9 @@
<span class="sd"> If no commit is passed the master:filename is returned, otherwise it will be</span> <span class="sd"> If no commit is passed the master:filename is returned, otherwise it will be</span>
<span class="sd"> commit:filename</span> <span class="sd"> commit:filename</span>
<span class="sd"> &quot;&quot;&quot;</span> <span class="sd"> &quot;&quot;&quot;</span>
<span class="k">if</span> <span class="ow">not</span> <span class="n">repo_file_exists</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_filename</span><span class="p">(</span><span class="n">recipe_name</span><span class="p">)):</span>
<span class="k">raise</span> <span class="n">RecipeFileError</span><span class="p">(</span><span class="s">&quot;Unknown blueprint&quot;</span><span class="p">)</span>
<span class="p">(</span><span class="n">_</span><span class="p">,</span> <span class="n">recipe_toml</span><span class="p">)</span> <span class="o">=</span> <span class="n">read_commit</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_filename</span><span class="p">(</span><span class="n">recipe_name</span><span class="p">),</span> <span class="n">commit</span><span class="p">)</span> <span class="p">(</span><span class="n">_</span><span class="p">,</span> <span class="n">recipe_toml</span><span class="p">)</span> <span class="o">=</span> <span class="n">read_commit</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_filename</span><span class="p">(</span><span class="n">recipe_name</span><span class="p">),</span> <span class="n">commit</span><span class="p">)</span>
<span class="k">return</span> <span class="n">recipe_from_toml</span><span class="p">(</span><span class="n">recipe_toml</span><span class="p">)</span> <span class="k">return</span> <span class="n">recipe_from_toml</span><span class="p">(</span><span class="n">recipe_toml</span><span class="p">)</span>
</div> </div>
@ -684,6 +693,9 @@
<span class="sd"> Uses tag_file_commit()</span> <span class="sd"> Uses tag_file_commit()</span>
<span class="sd"> &quot;&quot;&quot;</span> <span class="sd"> &quot;&quot;&quot;</span>
<span class="k">if</span> <span class="ow">not</span> <span class="n">repo_file_exists</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_filename</span><span class="p">(</span><span class="n">recipe_name</span><span class="p">)):</span>
<span class="k">raise</span> <span class="n">RecipeFileError</span><span class="p">(</span><span class="s">&quot;Unknown blueprint&quot;</span><span class="p">)</span>
<span class="k">return</span> <span class="n">tag_file_commit</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_filename</span><span class="p">(</span><span class="n">recipe_name</span><span class="p">))</span> <span class="k">return</span> <span class="n">tag_file_commit</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_filename</span><span class="p">(</span><span class="n">recipe_name</span><span class="p">))</span>
</div> </div>
<div class="viewcode-block" id="tag_file_commit"><a class="viewcode-back" href="../../../pylorax.api.html#pylorax.api.recipes.tag_file_commit">[docs]</a><span class="k">def</span> <span class="nf">tag_file_commit</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="p">):</span> <div class="viewcode-block" id="tag_file_commit"><a class="viewcode-back" href="../../../pylorax.api.html#pylorax.api.recipes.tag_file_commit">[docs]</a><span class="k">def</span> <span class="nf">tag_file_commit</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="p">):</span>
@ -893,25 +905,78 @@
<span class="n">diff</span> <span class="o">=</span> <span class="n">Git</span><span class="o">.</span><span class="n">Diff</span><span class="o">.</span><span class="n">new_tree_to_tree</span><span class="p">(</span><span class="n">repo</span><span class="p">,</span> <span class="n">parent</span><span class="o">.</span><span class="n">get_tree</span><span class="p">(),</span> <span class="n">tree</span><span class="p">,</span> <span class="n">diff_opts</span><span class="p">)</span> <span class="n">diff</span> <span class="o">=</span> <span class="n">Git</span><span class="o">.</span><span class="n">Diff</span><span class="o">.</span><span class="n">new_tree_to_tree</span><span class="p">(</span><span class="n">repo</span><span class="p">,</span> <span class="n">parent</span><span class="o">.</span><span class="n">get_tree</span><span class="p">(),</span> <span class="n">tree</span><span class="p">,</span> <span class="n">diff_opts</span><span class="p">)</span>
<span class="k">return</span> <span class="n">diff</span><span class="o">.</span><span class="n">get_num_deltas</span><span class="p">()</span> <span class="o">&gt;</span> <span class="mi">0</span> <span class="k">return</span> <span class="n">diff</span><span class="o">.</span><span class="n">get_num_deltas</span><span class="p">()</span> <span class="o">&gt;</span> <span class="mi">0</span>
</div> </div>
<div class="viewcode-block" id="find_field_value"><a class="viewcode-back" href="../../../pylorax.api.html#pylorax.api.recipes.find_field_value">[docs]</a><span class="k">def</span> <span class="nf">find_field_value</span><span class="p">(</span><span class="n">field</span><span class="p">,</span> <span class="n">value</span><span class="p">,</span> <span class="n">lst</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;Find a field matching value in the list of dicts.</span>
<span class="sd"> :param field: field to search for</span>
<span class="sd"> :type field: str</span>
<span class="sd"> :param value: value to match in the field</span>
<span class="sd"> :type value: str</span>
<span class="sd"> :param lst: List of dict&#39;s with field</span>
<span class="sd"> :type lst: list of dict</span>
<span class="sd"> :returns: First dict with matching field:value, or None</span>
<span class="sd"> :rtype: dict or None</span>
<span class="sd"> Used to return a specific entry from a list that looks like this:</span>
<span class="sd"> [{&quot;name&quot;: &quot;one&quot;, &quot;attr&quot;: &quot;green&quot;}, ...]</span>
<span class="sd"> find_field_value(&quot;name&quot;, &quot;one&quot;, lst) will return the matching dict.</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="k">for</span> <span class="n">d</span> <span class="ow">in</span> <span class="n">lst</span><span class="p">:</span>
<span class="k">if</span> <span class="n">d</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="n">field</span><span class="p">)</span> <span class="ow">and</span> <span class="n">d</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="n">field</span><span class="p">)</span> <span class="o">==</span> <span class="n">value</span><span class="p">:</span>
<span class="k">return</span> <span class="n">d</span>
<span class="k">return</span> <span class="bp">None</span>
</div>
<div class="viewcode-block" id="find_name"><a class="viewcode-back" href="../../../pylorax.api.html#pylorax.api.recipes.find_name">[docs]</a><span class="k">def</span> <span class="nf">find_name</span><span class="p">(</span><span class="n">name</span><span class="p">,</span> <span class="n">lst</span><span class="p">):</span> <div class="viewcode-block" id="find_name"><a class="viewcode-back" href="../../../pylorax.api.html#pylorax.api.recipes.find_name">[docs]</a><span class="k">def</span> <span class="nf">find_name</span><span class="p">(</span><span class="n">name</span><span class="p">,</span> <span class="n">lst</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;Find the dict matching the name in a list and return it.</span> <span class="sd">&quot;&quot;&quot;Find the dict matching the name in a list and return it.</span>
<span class="sd"> :param name: Name to search for</span> <span class="sd"> :param name: Name to search for</span>
<span class="sd"> :type name: str</span> <span class="sd"> :type name: str</span>
<span class="sd"> :param lst: List of dict&#39;s with &quot;name&quot; field</span> <span class="sd"> :param lst: List of dict&#39;s with &quot;name&quot; field</span>
<span class="sd"> :type lst: list of dict</span>
<span class="sd"> :returns: First dict with matching name, or None</span> <span class="sd"> :returns: First dict with matching name, or None</span>
<span class="sd"> :rtype: dict or None</span> <span class="sd"> :rtype: dict or None</span>
<span class="sd"> This is just a wrapper for find_field_value with field set to &quot;name&quot;</span>
<span class="sd"> &quot;&quot;&quot;</span> <span class="sd"> &quot;&quot;&quot;</span>
<span class="k">for</span> <span class="n">e</span> <span class="ow">in</span> <span class="n">lst</span><span class="p">:</span> <span class="k">return</span> <span class="n">find_field_value</span><span class="p">(</span><span class="s">&quot;name&quot;</span><span class="p">,</span> <span class="n">name</span><span class="p">,</span> <span class="n">lst</span><span class="p">)</span>
<span class="k">if</span> <span class="n">e</span><span class="p">[</span><span class="s">&quot;name&quot;</span><span class="p">]</span> <span class="o">==</span> <span class="n">name</span><span class="p">:</span>
<span class="k">return</span> <span class="n">e</span>
<span class="k">return</span> <span class="bp">None</span>
</div> </div>
<div class="viewcode-block" id="diff_items"><a class="viewcode-back" href="../../../pylorax.api.html#pylorax.api.recipes.diff_items">[docs]</a><span class="k">def</span> <span class="nf">diff_items</span><span class="p">(</span><span class="n">title</span><span class="p">,</span> <span class="n">old_items</span><span class="p">,</span> <span class="n">new_items</span><span class="p">):</span> <div class="viewcode-block" id="find_recipe_obj"><a class="viewcode-back" href="../../../pylorax.api.html#pylorax.api.recipes.find_recipe_obj">[docs]</a><span class="k">def</span> <span class="nf">find_recipe_obj</span><span class="p">(</span><span class="n">path</span><span class="p">,</span> <span class="n">recipe</span><span class="p">,</span> <span class="n">default</span><span class="o">=</span><span class="bp">None</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;Find a recipe object</span>
<span class="sd"> :param path: A list of dict field names</span>
<span class="sd"> :type path: list of str</span>
<span class="sd"> :param recipe: The recipe to search</span>
<span class="sd"> :type recipe: Recipe</span>
<span class="sd"> :param default: The value to return if it is not found</span>
<span class="sd"> :type default: Any</span>
<span class="sd"> Return the object found by applying the path to the dicts in the recipe, or</span>
<span class="sd"> return the default if it doesn&#39;t exist.</span>
<span class="sd"> eg. {&quot;customizations&quot;: {&quot;hostname&quot;: &quot;foo&quot;, &quot;users&quot;: [...]}}</span>
<span class="sd"> find_recipe_obj([&quot;customizations&quot;, &quot;hostname&quot;], recipe, &quot;&quot;)</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="n">o</span> <span class="o">=</span> <span class="n">recipe</span>
<span class="k">try</span><span class="p">:</span>
<span class="k">for</span> <span class="n">p</span> <span class="ow">in</span> <span class="n">path</span><span class="p">:</span>
<span class="k">if</span> <span class="ow">not</span> <span class="n">o</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="n">p</span><span class="p">):</span>
<span class="k">return</span> <span class="n">default</span>
<span class="n">o</span> <span class="o">=</span> <span class="n">o</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="n">p</span><span class="p">)</span>
<span class="k">except</span> <span class="ne">AttributeError</span><span class="p">:</span>
<span class="k">return</span> <span class="n">default</span>
<span class="k">return</span> <span class="n">o</span>
</div>
<div class="viewcode-block" id="diff_lists"><a class="viewcode-back" href="../../../pylorax.api.html#pylorax.api.recipes.diff_lists">[docs]</a><span class="k">def</span> <span class="nf">diff_lists</span><span class="p">(</span><span class="n">title</span><span class="p">,</span> <span class="n">field</span><span class="p">,</span> <span class="n">old_items</span><span class="p">,</span> <span class="n">new_items</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;Return the differences between two lists of dicts.</span> <span class="sd">&quot;&quot;&quot;Return the differences between two lists of dicts.</span>
<span class="sd"> :param title: Title of the entry</span> <span class="sd"> :param title: Title of the entry</span>
<span class="sd"> :type title: str</span> <span class="sd"> :type title: str</span>
<span class="sd"> :param field: Field to use as the key for comparisons</span>
<span class="sd"> :type field: str</span>
<span class="sd"> :param old_items: List of item dicts with &quot;name&quot; field</span> <span class="sd"> :param old_items: List of item dicts with &quot;name&quot; field</span>
<span class="sd"> :type old_items: list(dict)</span> <span class="sd"> :type old_items: list(dict)</span>
<span class="sd"> :param new_items: List of item dicts with &quot;name&quot; field</span> <span class="sd"> :param new_items: List of item dicts with &quot;name&quot; field</span>
@ -920,34 +985,79 @@
<span class="sd"> :rtype: list(dict)</span> <span class="sd"> :rtype: list(dict)</span>
<span class="sd"> &quot;&quot;&quot;</span> <span class="sd"> &quot;&quot;&quot;</span>
<span class="n">diffs</span> <span class="o">=</span> <span class="p">[]</span> <span class="n">diffs</span> <span class="o">=</span> <span class="p">[]</span>
<span class="n">old_names</span> <span class="o">=</span> <span class="nb">set</span><span class="p">(</span><span class="n">m</span><span class="p">[</span><span class="s">&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">old_items</span><span class="p">)</span> <span class="n">old_fields</span><span class="o">=</span> <span class="nb">set</span><span class="p">(</span><span class="n">m</span><span class="p">[</span><span class="n">field</span><span class="p">]</span> <span class="k">for</span> <span class="n">m</span> <span class="ow">in</span> <span class="n">old_items</span><span class="p">)</span>
<span class="n">new_names</span> <span class="o">=</span> <span class="nb">set</span><span class="p">(</span><span class="n">m</span><span class="p">[</span><span class="s">&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">new_items</span><span class="p">)</span> <span class="n">new_fields</span><span class="o">=</span> <span class="nb">set</span><span class="p">(</span><span class="n">m</span><span class="p">[</span><span class="n">field</span><span class="p">]</span> <span class="k">for</span> <span class="n">m</span> <span class="ow">in</span> <span class="n">new_items</span><span class="p">)</span>
<span class="n">added_items</span> <span class="o">=</span> <span class="n">new_names</span><span class="o">.</span><span class="n">difference</span><span class="p">(</span><span class="n">old_names</span><span class="p">)</span> <span class="n">added_items</span> <span class="o">=</span> <span class="n">new_fields</span><span class="o">.</span><span class="n">difference</span><span class="p">(</span><span class="n">old_fields</span><span class="p">)</span>
<span class="n">added_items</span> <span class="o">=</span> <span class="nb">sorted</span><span class="p">(</span><span class="n">added_items</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">added_items</span> <span class="o">=</span> <span class="nb">sorted</span><span class="p">(</span><span class="n">added_items</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">removed_items</span> <span class="o">=</span> <span class="n">old_names</span><span class="o">.</span><span class="n">difference</span><span class="p">(</span><span class="n">new_names</span><span class="p">)</span> <span class="n">removed_items</span> <span class="o">=</span> <span class="n">old_fields</span><span class="o">.</span><span class="n">difference</span><span class="p">(</span><span class="n">new_fields</span><span class="p">)</span>
<span class="n">removed_items</span> <span class="o">=</span> <span class="nb">sorted</span><span class="p">(</span><span class="n">removed_items</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">removed_items</span> <span class="o">=</span> <span class="nb">sorted</span><span class="p">(</span><span class="n">removed_items</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">same_items</span> <span class="o">=</span> <span class="n">old_names</span><span class="o">.</span><span class="n">intersection</span><span class="p">(</span><span class="n">new_names</span><span class="p">)</span> <span class="n">same_items</span> <span class="o">=</span> <span class="n">old_fields</span><span class="o">.</span><span class="n">intersection</span><span class="p">(</span><span class="n">new_fields</span><span class="p">)</span>
<span class="n">same_items</span> <span class="o">=</span> <span class="nb">sorted</span><span class="p">(</span><span class="n">same_items</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">same_items</span> <span class="o">=</span> <span class="nb">sorted</span><span class="p">(</span><span class="n">same_items</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="k">for</span> <span class="n">name</span> <span class="ow">in</span> <span class="n">added_items</span><span class="p">:</span> <span class="k">for</span> <span class="n">v</span> <span class="ow">in</span> <span class="n">added_items</span><span class="p">:</span>
<span class="n">diffs</span><span class="o">.</span><span class="n">append</span><span class="p">({</span><span class="s">&quot;old&quot;</span><span class="p">:</span><span class="bp">None</span><span class="p">,</span> <span class="n">diffs</span><span class="o">.</span><span class="n">append</span><span class="p">({</span><span class="s">&quot;old&quot;</span><span class="p">:</span><span class="bp">None</span><span class="p">,</span>
<span class="s">&quot;new&quot;</span><span class="p">:{</span><span class="n">title</span><span class="p">:</span><span class="n">find_name</span><span class="p">(</span><span class="n">name</span><span class="p">,</span> <span class="n">new_items</span><span class="p">)}})</span> <span class="s">&quot;new&quot;</span><span class="p">:{</span><span class="n">title</span><span class="p">:</span><span class="n">find_field_value</span><span class="p">(</span><span class="n">field</span><span class="p">,</span> <span class="n">v</span><span class="p">,</span> <span class="n">new_items</span><span class="p">)}})</span>
<span class="k">for</span> <span class="n">name</span> <span class="ow">in</span> <span class="n">removed_items</span><span class="p">:</span> <span class="k">for</span> <span class="n">v</span> <span class="ow">in</span> <span class="n">removed_items</span><span class="p">:</span>
<span class="n">diffs</span><span class="o">.</span><span class="n">append</span><span class="p">({</span><span class="s">&quot;old&quot;</span><span class="p">:{</span><span class="n">title</span><span class="p">:</span><span class="n">find_name</span><span class="p">(</span><span class="n">name</span><span class="p">,</span> <span class="n">old_items</span><span class="p">)},</span> <span class="n">diffs</span><span class="o">.</span><span class="n">append</span><span class="p">({</span><span class="s">&quot;old&quot;</span><span class="p">:{</span><span class="n">title</span><span class="p">:</span><span class="n">find_field_value</span><span class="p">(</span><span class="n">field</span><span class="p">,</span> <span class="n">v</span><span class="p">,</span> <span class="n">old_items</span><span class="p">)},</span>
<span class="s">&quot;new&quot;</span><span class="p">:</span><span class="bp">None</span><span class="p">})</span> <span class="s">&quot;new&quot;</span><span class="p">:</span><span class="bp">None</span><span class="p">})</span>
<span class="k">for</span> <span class="n">name</span> <span class="ow">in</span> <span class="n">same_items</span><span class="p">:</span> <span class="k">for</span> <span class="n">v</span> <span class="ow">in</span> <span class="n">same_items</span><span class="p">:</span>
<span class="n">old_item</span> <span class="o">=</span> <span class="n">find_name</span><span class="p">(</span><span class="n">name</span><span class="p">,</span> <span class="n">old_items</span><span class="p">)</span> <span class="n">old_item</span> <span class="o">=</span> <span class="n">find_field_value</span><span class="p">(</span><span class="n">field</span><span class="p">,</span> <span class="n">v</span><span class="p">,</span> <span class="n">old_items</span><span class="p">)</span>
<span class="n">new_item</span> <span class="o">=</span> <span class="n">find_name</span><span class="p">(</span><span class="n">name</span><span class="p">,</span> <span class="n">new_items</span><span class="p">)</span> <span class="n">new_item</span> <span class="o">=</span> <span class="n">find_field_value</span><span class="p">(</span><span class="n">field</span><span class="p">,</span> <span class="n">v</span><span class="p">,</span> <span class="n">new_items</span><span class="p">)</span>
<span class="k">if</span> <span class="n">old_item</span> <span class="o">!=</span> <span class="n">new_item</span><span class="p">:</span> <span class="k">if</span> <span class="n">old_item</span> <span class="o">!=</span> <span class="n">new_item</span><span class="p">:</span>
<span class="n">diffs</span><span class="o">.</span><span class="n">append</span><span class="p">({</span><span class="s">&quot;old&quot;</span><span class="p">:{</span><span class="n">title</span><span class="p">:</span><span class="n">old_item</span><span class="p">},</span> <span class="n">diffs</span><span class="o">.</span><span class="n">append</span><span class="p">({</span><span class="s">&quot;old&quot;</span><span class="p">:{</span><span class="n">title</span><span class="p">:</span><span class="n">old_item</span><span class="p">},</span>
<span class="s">&quot;new&quot;</span><span class="p">:{</span><span class="n">title</span><span class="p">:</span><span class="n">new_item</span><span class="p">}})</span> <span class="s">&quot;new&quot;</span><span class="p">:{</span><span class="n">title</span><span class="p">:</span><span class="n">new_item</span><span class="p">}})</span>
<span class="k">return</span> <span class="n">diffs</span> <span class="k">return</span> <span class="n">diffs</span>
</div>
<div class="viewcode-block" id="customizations_diff"><a class="viewcode-back" href="../../../pylorax.api.html#pylorax.api.recipes.customizations_diff">[docs]</a><span class="k">def</span> <span class="nf">customizations_diff</span><span class="p">(</span><span class="n">old_recipe</span><span class="p">,</span> <span class="n">new_recipe</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;Diff the customizations sections from two versions of a recipe</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="n">diffs</span> <span class="o">=</span> <span class="p">[]</span>
<span class="n">old_keys</span> <span class="o">=</span> <span class="nb">set</span><span class="p">(</span><span class="n">old_recipe</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s">&quot;customizations&quot;</span><span class="p">,</span> <span class="p">{})</span><span class="o">.</span><span class="n">keys</span><span class="p">())</span>
<span class="n">new_keys</span> <span class="o">=</span> <span class="nb">set</span><span class="p">(</span><span class="n">new_recipe</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s">&quot;customizations&quot;</span><span class="p">,</span> <span class="p">{})</span><span class="o">.</span><span class="n">keys</span><span class="p">())</span>
<span class="n">added_keys</span> <span class="o">=</span> <span class="n">new_keys</span><span class="o">.</span><span class="n">difference</span><span class="p">(</span><span class="n">old_keys</span><span class="p">)</span>
<span class="n">added_keys</span> <span class="o">=</span> <span class="nb">sorted</span><span class="p">(</span><span class="n">added_keys</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">removed_keys</span> <span class="o">=</span> <span class="n">old_keys</span><span class="o">.</span><span class="n">difference</span><span class="p">(</span><span class="n">new_keys</span><span class="p">)</span>
<span class="n">removed_keys</span> <span class="o">=</span> <span class="nb">sorted</span><span class="p">(</span><span class="n">removed_keys</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">same_keys</span> <span class="o">=</span> <span class="n">old_keys</span><span class="o">.</span><span class="n">intersection</span><span class="p">(</span><span class="n">new_keys</span><span class="p">)</span>
<span class="n">same_keys</span> <span class="o">=</span> <span class="nb">sorted</span><span class="p">(</span><span class="n">same_keys</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="k">for</span> <span class="n">v</span> <span class="ow">in</span> <span class="n">added_keys</span><span class="p">:</span>
<span class="n">diffs</span><span class="o">.</span><span class="n">append</span><span class="p">({</span><span class="s">&quot;old&quot;</span><span class="p">:</span> <span class="bp">None</span><span class="p">,</span>
<span class="s">&quot;new&quot;</span><span class="p">:</span> <span class="p">{</span><span class="s">&quot;Customizations.&quot;</span><span class="o">+</span><span class="n">v</span><span class="p">:</span> <span class="n">new_recipe</span><span class="p">[</span><span class="s">&quot;customizations&quot;</span><span class="p">][</span><span class="n">v</span><span class="p">]}})</span>
<span class="k">for</span> <span class="n">v</span> <span class="ow">in</span> <span class="n">removed_keys</span><span class="p">:</span>
<span class="n">diffs</span><span class="o">.</span><span class="n">append</span><span class="p">({</span><span class="s">&quot;old&quot;</span><span class="p">:</span> <span class="p">{</span><span class="s">&quot;Customizations.&quot;</span><span class="o">+</span><span class="n">v</span><span class="p">:</span> <span class="n">old_recipe</span><span class="p">[</span><span class="s">&quot;customizations&quot;</span><span class="p">][</span><span class="n">v</span><span class="p">]},</span>
<span class="s">&quot;new&quot;</span><span class="p">:</span> <span class="bp">None</span><span class="p">})</span>
<span class="k">for</span> <span class="n">v</span> <span class="ow">in</span> <span class="n">same_keys</span><span class="p">:</span>
<span class="k">if</span> <span class="n">new_recipe</span><span class="p">[</span><span class="s">&quot;customizations&quot;</span><span class="p">][</span><span class="n">v</span><span class="p">]</span> <span class="o">==</span> <span class="n">old_recipe</span><span class="p">[</span><span class="s">&quot;customizations&quot;</span><span class="p">][</span><span class="n">v</span><span class="p">]:</span>
<span class="k">continue</span>
<span class="k">if</span> <span class="nb">type</span><span class="p">(</span><span class="n">new_recipe</span><span class="p">[</span><span class="s">&quot;customizations&quot;</span><span class="p">][</span><span class="n">v</span><span class="p">])</span> <span class="o">==</span> <span class="nb">type</span><span class="p">([]):</span>
<span class="c"># Lists of dicts need to use diff_lists</span>
<span class="c"># sshkey uses &#39;user&#39;, user and group use &#39;name&#39;</span>
<span class="k">if</span> <span class="s">&quot;user&quot;</span> <span class="ow">in</span> <span class="n">new_recipe</span><span class="p">[</span><span class="s">&quot;customizations&quot;</span><span class="p">][</span><span class="n">v</span><span class="p">][</span><span class="mi">0</span><span class="p">]:</span>
<span class="n">field_name</span> <span class="o">=</span> <span class="s">&quot;user&quot;</span>
<span class="k">elif</span> <span class="s">&quot;name&quot;</span> <span class="ow">in</span> <span class="n">new_recipe</span><span class="p">[</span><span class="s">&quot;customizations&quot;</span><span class="p">][</span><span class="n">v</span><span class="p">][</span><span class="mi">0</span><span class="p">]:</span>
<span class="n">field_name</span> <span class="o">=</span> <span class="s">&quot;name&quot;</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="s">&quot;</span><span class="si">%s</span><span class="s"> list has unrecognized key, not &#39;name&#39; or &#39;user&#39;&quot;</span> <span class="o">%</span> <span class="s">&quot;customizations.&quot;</span><span class="o">+</span><span class="n">v</span><span class="p">)</span>
<span class="n">diffs</span><span class="o">.</span><span class="n">extend</span><span class="p">(</span><span class="n">diff_lists</span><span class="p">(</span><span class="s">&quot;Customizations.&quot;</span><span class="o">+</span><span class="n">v</span><span class="p">,</span> <span class="n">field_name</span><span class="p">,</span> <span class="n">old_recipe</span><span class="p">[</span><span class="s">&quot;customizations&quot;</span><span class="p">][</span><span class="n">v</span><span class="p">],</span> <span class="n">new_recipe</span><span class="p">[</span><span class="s">&quot;customizations&quot;</span><span class="p">][</span><span class="n">v</span><span class="p">]))</span>
<span class="k">else</span><span class="p">:</span>
<span class="n">diffs</span><span class="o">.</span><span class="n">append</span><span class="p">({</span><span class="s">&quot;old&quot;</span><span class="p">:</span> <span class="p">{</span><span class="s">&quot;Customizations.&quot;</span><span class="o">+</span><span class="n">v</span><span class="p">:</span> <span class="n">old_recipe</span><span class="p">[</span><span class="s">&quot;customizations&quot;</span><span class="p">][</span><span class="n">v</span><span class="p">]},</span>
<span class="s">&quot;new&quot;</span><span class="p">:</span> <span class="p">{</span><span class="s">&quot;Customizations.&quot;</span><span class="o">+</span><span class="n">v</span><span class="p">:</span> <span class="n">new_recipe</span><span class="p">[</span><span class="s">&quot;customizations&quot;</span><span class="p">][</span><span class="n">v</span><span class="p">]}})</span>
<span class="k">return</span> <span class="n">diffs</span>
</div> </div>
<div class="viewcode-block" id="recipe_diff"><a class="viewcode-back" href="../../../pylorax.api.html#pylorax.api.recipes.recipe_diff">[docs]</a><span class="k">def</span> <span class="nf">recipe_diff</span><span class="p">(</span><span class="n">old_recipe</span><span class="p">,</span> <span class="n">new_recipe</span><span class="p">):</span> <div class="viewcode-block" id="recipe_diff"><a class="viewcode-back" href="../../../pylorax.api.html#pylorax.api.recipes.recipe_diff">[docs]</a><span class="k">def</span> <span class="nf">recipe_diff</span><span class="p">(</span><span class="n">old_recipe</span><span class="p">,</span> <span class="n">new_recipe</span><span class="p">):</span>
@ -968,11 +1078,38 @@
<span class="n">diffs</span><span class="o">.</span><span class="n">append</span><span class="p">({</span><span class="s">&quot;old&quot;</span><span class="p">:{</span><span class="n">element</span><span class="o">.</span><span class="n">title</span><span class="p">():</span><span class="n">old_recipe</span><span class="p">[</span><span class="n">element</span><span class="p">]},</span> <span class="n">diffs</span><span class="o">.</span><span class="n">append</span><span class="p">({</span><span class="s">&quot;old&quot;</span><span class="p">:{</span><span class="n">element</span><span class="o">.</span><span class="n">title</span><span class="p">():</span><span class="n">old_recipe</span><span class="p">[</span><span class="n">element</span><span class="p">]},</span>
<span class="s">&quot;new&quot;</span><span class="p">:{</span><span class="n">element</span><span class="o">.</span><span class="n">title</span><span class="p">():</span><span class="n">new_recipe</span><span class="p">[</span><span class="n">element</span><span class="p">]}})</span> <span class="s">&quot;new&quot;</span><span class="p">:{</span><span class="n">element</span><span class="o">.</span><span class="n">title</span><span class="p">():</span><span class="n">new_recipe</span><span class="p">[</span><span class="n">element</span><span class="p">]}})</span>
<span class="n">diffs</span><span class="o">.</span><span class="n">extend</span><span class="p">(</span><span class="n">diff_items</span><span class="p">(</span><span class="s">&quot;Module&quot;</span><span class="p">,</span> <span class="n">old_recipe</span><span class="p">[</span><span class="s">&quot;modules&quot;</span><span class="p">],</span> <span class="n">new_recipe</span><span class="p">[</span><span class="s">&quot;modules&quot;</span><span class="p">]))</span> <span class="c"># These lists always exist</span>
<span class="n">diffs</span><span class="o">.</span><span class="n">extend</span><span class="p">(</span><span class="n">diff_items</span><span class="p">(</span><span class="s">&quot;Package&quot;</span><span class="p">,</span> <span class="n">old_recipe</span><span class="p">[</span><span class="s">&quot;packages&quot;</span><span class="p">],</span> <span class="n">new_recipe</span><span class="p">[</span><span class="s">&quot;packages&quot;</span><span class="p">]))</span> <span class="n">diffs</span><span class="o">.</span><span class="n">extend</span><span class="p">(</span><span class="n">diff_lists</span><span class="p">(</span><span class="s">&quot;Module&quot;</span><span class="p">,</span> <span class="s">&quot;name&quot;</span><span class="p">,</span> <span class="n">old_recipe</span><span class="p">[</span><span class="s">&quot;modules&quot;</span><span class="p">],</span> <span class="n">new_recipe</span><span class="p">[</span><span class="s">&quot;modules&quot;</span><span class="p">]))</span>
<span class="n">diffs</span><span class="o">.</span><span class="n">extend</span><span class="p">(</span><span class="n">diff_items</span><span class="p">(</span><span class="s">&quot;Group&quot;</span><span class="p">,</span> <span class="n">old_recipe</span><span class="p">[</span><span class="s">&quot;groups&quot;</span><span class="p">],</span> <span class="n">new_recipe</span><span class="p">[</span><span class="s">&quot;groups&quot;</span><span class="p">]))</span> <span class="n">diffs</span><span class="o">.</span><span class="n">extend</span><span class="p">(</span><span class="n">diff_lists</span><span class="p">(</span><span class="s">&quot;Package&quot;</span><span class="p">,</span> <span class="s">&quot;name&quot;</span><span class="p">,</span> <span class="n">old_recipe</span><span class="p">[</span><span class="s">&quot;packages&quot;</span><span class="p">],</span> <span class="n">new_recipe</span><span class="p">[</span><span class="s">&quot;packages&quot;</span><span class="p">]))</span>
<span class="n">diffs</span><span class="o">.</span><span class="n">extend</span><span class="p">(</span><span class="n">diff_lists</span><span class="p">(</span><span class="s">&quot;Group&quot;</span><span class="p">,</span> <span class="s">&quot;name&quot;</span><span class="p">,</span> <span class="n">old_recipe</span><span class="p">[</span><span class="s">&quot;groups&quot;</span><span class="p">],</span> <span class="n">new_recipe</span><span class="p">[</span><span class="s">&quot;groups&quot;</span><span class="p">]))</span>
<span class="k">return</span> <span class="n">diffs</span></div> <span class="c"># The customizations section can contain a number of different types</span>
<span class="n">diffs</span><span class="o">.</span><span class="n">extend</span><span class="p">(</span><span class="n">customizations_diff</span><span class="p">(</span><span class="n">old_recipe</span><span class="p">,</span> <span class="n">new_recipe</span><span class="p">))</span>
<span class="c"># repos contains keys that are lists (eg. [[repos.git]])</span>
<span class="n">diffs</span><span class="o">.</span><span class="n">extend</span><span class="p">(</span><span class="n">diff_lists</span><span class="p">(</span><span class="s">&quot;Repos.git&quot;</span><span class="p">,</span> <span class="s">&quot;rpmname&quot;</span><span class="p">,</span>
<span class="n">find_recipe_obj</span><span class="p">([</span><span class="s">&quot;repos&quot;</span><span class="p">,</span> <span class="s">&quot;git&quot;</span><span class="p">],</span> <span class="n">old_recipe</span><span class="p">,</span> <span class="p">[]),</span>
<span class="n">find_recipe_obj</span><span class="p">([</span><span class="s">&quot;repos&quot;</span><span class="p">,</span> <span class="s">&quot;git&quot;</span><span class="p">],</span> <span class="n">new_recipe</span><span class="p">,</span> <span class="p">[])))</span>
<span class="k">return</span> <span class="n">diffs</span>
</div>
<div class="viewcode-block" id="repo_file_exists"><a class="viewcode-back" href="../../../pylorax.api.html#pylorax.api.recipes.repo_file_exists">[docs]</a><span class="k">def</span> <span class="nf">repo_file_exists</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="p">):</span>
<span class="sd">&quot;&quot;&quot;Return True if the filename exists on the 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"> :param filename: Filename to check</span>
<span class="sd"> :type filename: str</span>
<span class="sd"> :returns: True if the filename exists on the HEAD of the branch, False otherwise.</span>
<span class="sd"> :rtype: bool</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="n">commit</span> <span class="o">=</span> <span class="n">head_commit</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="o">.</span><span class="n">get_id</span><span class="p">()</span><span class="o">.</span><span class="n">to_string</span><span class="p">()</span>
<span class="n">commit_id</span> <span class="o">=</span> <span class="n">Git</span><span class="o">.</span><span class="n">OId</span><span class="o">.</span><span class="n">new_from_string</span><span class="p">(</span><span class="n">commit</span><span class="p">)</span>
<span class="n">commit_obj</span> <span class="o">=</span> <span class="n">repo</span><span class="o">.</span><span class="n">lookup</span><span class="p">(</span><span class="n">commit_id</span><span class="p">,</span> <span class="n">Git</span><span class="o">.</span><span class="n">Commit</span><span class="p">)</span>
<span class="n">tree</span> <span class="o">=</span> <span class="n">commit_obj</span><span class="o">.</span><span class="n">get_tree</span><span class="p">()</span>
<span class="k">return</span> <span class="n">tree</span><span class="o">.</span><span class="n">get_by_name</span><span class="p">(</span><span class="n">filename</span><span class="p">)</span> <span class="ow">is</span> <span class="ow">not</span> <span class="bp">None</span></div>
</pre></div> </pre></div>
</div> </div>
@ -1006,7 +1143,7 @@
<li class="right" > <li class="right" >
<a href="../../../py-modindex.html" title="Python Module Index" <a href="../../../py-modindex.html" title="Python Module Index"
>modules</a> |</li> >modules</a> |</li>
<li><a href="../../../index.html">Lorax 19.7.22 documentation</a> &raquo;</li> <li><a href="../../../index.html">Lorax 19.7.43 documentation</a> &raquo;</li>
<li><a href="../../index.html" >Module code</a> &raquo;</li> <li><a href="../../index.html" >Module code</a> &raquo;</li>
<li><a href="../../pylorax.html" >pylorax</a> &raquo;</li> <li><a href="../../pylorax.html" >pylorax</a> &raquo;</li>
<li><a href="../api.html" >pylorax.api</a> &raquo;</li> <li><a href="../api.html" >pylorax.api</a> &raquo;</li>

View File

@ -8,7 +8,7 @@
<head> <head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>pylorax.api.server &mdash; Lorax 19.7.22 documentation</title> <title>pylorax.api.server &mdash; Lorax 19.7.43 documentation</title>
<link rel="stylesheet" href="../../../_static/default.css" type="text/css" /> <link rel="stylesheet" href="../../../_static/default.css" type="text/css" />
<link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" /> <link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" />
@ -16,7 +16,7 @@
<script type="text/javascript"> <script type="text/javascript">
var DOCUMENTATION_OPTIONS = { var DOCUMENTATION_OPTIONS = {
URL_ROOT: '../../../', URL_ROOT: '../../../',
VERSION: '19.7.22', VERSION: '19.7.43',
COLLAPSE_INDEX: false, COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html', FILE_SUFFIX: '.html',
HAS_SOURCE: true HAS_SOURCE: true
@ -25,7 +25,7 @@
<script type="text/javascript" src="../../../_static/jquery.js"></script> <script type="text/javascript" src="../../../_static/jquery.js"></script>
<script type="text/javascript" src="../../../_static/underscore.js"></script> <script type="text/javascript" src="../../../_static/underscore.js"></script>
<script type="text/javascript" src="../../../_static/doctools.js"></script> <script type="text/javascript" src="../../../_static/doctools.js"></script>
<link rel="top" title="Lorax 19.7.22 documentation" href="../../../index.html" /> <link rel="top" title="Lorax 19.7.43 documentation" href="../../../index.html" />
<link rel="up" title="pylorax.api" href="../api.html" /> <link rel="up" title="pylorax.api" href="../api.html" />
</head> </head>
<body> <body>
@ -38,7 +38,7 @@
<li class="right" > <li class="right" >
<a href="../../../py-modindex.html" title="Python Module Index" <a href="../../../py-modindex.html" title="Python Module Index"
>modules</a> |</li> >modules</a> |</li>
<li><a href="../../../index.html">Lorax 19.7.22 documentation</a> &raquo;</li> <li><a href="../../../index.html">Lorax 19.7.43 documentation</a> &raquo;</li>
<li><a href="../../index.html" >Module code</a> &raquo;</li> <li><a href="../../index.html" >Module code</a> &raquo;</li>
<li><a href="../../pylorax.html" >pylorax</a> &raquo;</li> <li><a href="../../pylorax.html" >pylorax</a> &raquo;</li>
<li><a href="../api.html" accesskey="U">pylorax.api</a> &raquo;</li> <li><a href="../api.html" accesskey="U">pylorax.api</a> &raquo;</li>
@ -81,7 +81,6 @@
<span class="kn">from</span> <span class="nn">pylorax.sysutils</span> <span class="kn">import</span> <span class="n">joinpaths</span> <span class="kn">from</span> <span class="nn">pylorax.sysutils</span> <span class="kn">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="s">&quot;GitLock&quot;</span><span class="p">,</span> <span class="p">[</span><span class="s">&quot;repo&quot;</span><span class="p">,</span> <span class="s">&quot;lock&quot;</span><span class="p">,</span> <span class="s">&quot;dir&quot;</span><span class="p">])</span> <span class="n">GitLock</span> <span class="o">=</span> <span class="n">namedtuple</span><span class="p">(</span><span class="s">&quot;GitLock&quot;</span><span class="p">,</span> <span class="p">[</span><span class="s">&quot;repo&quot;</span><span class="p">,</span> <span class="s">&quot;lock&quot;</span><span class="p">,</span> <span class="s">&quot;dir&quot;</span><span class="p">])</span>
<span class="n">YumLock</span> <span class="o">=</span> <span class="n">namedtuple</span><span class="p">(</span><span class="s">&quot;YumLock&quot;</span><span class="p">,</span> <span class="p">[</span><span class="s">&quot;yb&quot;</span><span class="p">,</span> <span class="s">&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="n">__name__</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="n">__name__</span><span class="p">)</span>
@ -167,7 +166,7 @@
<li class="right" > <li class="right" >
<a href="../../../py-modindex.html" title="Python Module Index" <a href="../../../py-modindex.html" title="Python Module Index"
>modules</a> |</li> >modules</a> |</li>
<li><a href="../../../index.html">Lorax 19.7.22 documentation</a> &raquo;</li> <li><a href="../../../index.html">Lorax 19.7.43 documentation</a> &raquo;</li>
<li><a href="../../index.html" >Module code</a> &raquo;</li> <li><a href="../../index.html" >Module code</a> &raquo;</li>
<li><a href="../../pylorax.html" >pylorax</a> &raquo;</li> <li><a href="../../pylorax.html" >pylorax</a> &raquo;</li>
<li><a href="../api.html" >pylorax.api</a> &raquo;</li> <li><a href="../api.html" >pylorax.api</a> &raquo;</li>

View File

@ -8,7 +8,7 @@
<head> <head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>pylorax.api.timestamp &mdash; Lorax 19.7.22 documentation</title> <title>pylorax.api.timestamp &mdash; Lorax 19.7.43 documentation</title>
<link rel="stylesheet" href="../../../_static/default.css" type="text/css" /> <link rel="stylesheet" href="../../../_static/default.css" type="text/css" />
<link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" /> <link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" />
@ -16,7 +16,7 @@
<script type="text/javascript"> <script type="text/javascript">
var DOCUMENTATION_OPTIONS = { var DOCUMENTATION_OPTIONS = {
URL_ROOT: '../../../', URL_ROOT: '../../../',
VERSION: '19.7.22', VERSION: '19.7.43',
COLLAPSE_INDEX: false, COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html', FILE_SUFFIX: '.html',
HAS_SOURCE: true HAS_SOURCE: true
@ -25,7 +25,7 @@
<script type="text/javascript" src="../../../_static/jquery.js"></script> <script type="text/javascript" src="../../../_static/jquery.js"></script>
<script type="text/javascript" src="../../../_static/underscore.js"></script> <script type="text/javascript" src="../../../_static/underscore.js"></script>
<script type="text/javascript" src="../../../_static/doctools.js"></script> <script type="text/javascript" src="../../../_static/doctools.js"></script>
<link rel="top" title="Lorax 19.7.22 documentation" href="../../../index.html" /> <link rel="top" title="Lorax 19.7.43 documentation" href="../../../index.html" />
<link rel="up" title="pylorax.api" href="../api.html" /> <link rel="up" title="pylorax.api" href="../api.html" />
</head> </head>
<body> <body>
@ -38,7 +38,7 @@
<li class="right" > <li class="right" >
<a href="../../../py-modindex.html" title="Python Module Index" <a href="../../../py-modindex.html" title="Python Module Index"
>modules</a> |</li> >modules</a> |</li>
<li><a href="../../../index.html">Lorax 19.7.22 documentation</a> &raquo;</li> <li><a href="../../../index.html">Lorax 19.7.43 documentation</a> &raquo;</li>
<li><a href="../../index.html" >Module code</a> &raquo;</li> <li><a href="../../index.html" >Module code</a> &raquo;</li>
<li><a href="../../pylorax.html" >pylorax</a> &raquo;</li> <li><a href="../../pylorax.html" >pylorax</a> &raquo;</li>
<li><a href="../api.html" accesskey="U">pylorax.api</a> &raquo;</li> <li><a href="../api.html" accesskey="U">pylorax.api</a> &raquo;</li>
@ -135,7 +135,7 @@
<li class="right" > <li class="right" >
<a href="../../../py-modindex.html" title="Python Module Index" <a href="../../../py-modindex.html" title="Python Module Index"
>modules</a> |</li> >modules</a> |</li>
<li><a href="../../../index.html">Lorax 19.7.22 documentation</a> &raquo;</li> <li><a href="../../../index.html">Lorax 19.7.43 documentation</a> &raquo;</li>
<li><a href="../../index.html" >Module code</a> &raquo;</li> <li><a href="../../index.html" >Module code</a> &raquo;</li>
<li><a href="../../pylorax.html" >pylorax</a> &raquo;</li> <li><a href="../../pylorax.html" >pylorax</a> &raquo;</li>
<li><a href="../api.html" >pylorax.api</a> &raquo;</li> <li><a href="../api.html" >pylorax.api</a> &raquo;</li>

View File

@ -8,7 +8,7 @@
<head> <head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>pylorax.api.v0 &mdash; Lorax 19.7.22 documentation</title> <title>pylorax.api.v0 &mdash; Lorax 19.7.43 documentation</title>
<link rel="stylesheet" href="../../../_static/default.css" type="text/css" /> <link rel="stylesheet" href="../../../_static/default.css" type="text/css" />
<link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" /> <link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" />
@ -16,7 +16,7 @@
<script type="text/javascript"> <script type="text/javascript">
var DOCUMENTATION_OPTIONS = { var DOCUMENTATION_OPTIONS = {
URL_ROOT: '../../../', URL_ROOT: '../../../',
VERSION: '19.7.22', VERSION: '19.7.43',
COLLAPSE_INDEX: false, COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html', FILE_SUFFIX: '.html',
HAS_SOURCE: true HAS_SOURCE: true
@ -25,7 +25,7 @@
<script type="text/javascript" src="../../../_static/jquery.js"></script> <script type="text/javascript" src="../../../_static/jquery.js"></script>
<script type="text/javascript" src="../../../_static/underscore.js"></script> <script type="text/javascript" src="../../../_static/underscore.js"></script>
<script type="text/javascript" src="../../../_static/doctools.js"></script> <script type="text/javascript" src="../../../_static/doctools.js"></script>
<link rel="top" title="Lorax 19.7.22 documentation" href="../../../index.html" /> <link rel="top" title="Lorax 19.7.43 documentation" href="../../../index.html" />
<link rel="up" title="pylorax.api" href="../api.html" /> <link rel="up" title="pylorax.api" href="../api.html" />
</head> </head>
<body> <body>
@ -38,7 +38,7 @@
<li class="right" > <li class="right" >
<a href="../../../py-modindex.html" title="Python Module Index" <a href="../../../py-modindex.html" title="Python Module Index"
>modules</a> |</li> >modules</a> |</li>
<li><a href="../../../index.html">Lorax 19.7.22 documentation</a> &raquo;</li> <li><a href="../../../index.html">Lorax 19.7.43 documentation</a> &raquo;</li>
<li><a href="../../index.html" >Module code</a> &raquo;</li> <li><a href="../../index.html" >Module code</a> &raquo;</li>
<li><a href="../../pylorax.html" >pylorax</a> &raquo;</li> <li><a href="../../pylorax.html" >pylorax</a> &raquo;</li>
<li><a href="../api.html" accesskey="U">pylorax.api</a> &raquo;</li> <li><a href="../api.html" accesskey="U">pylorax.api</a> &raquo;</li>
@ -116,15 +116,23 @@
<span class="sd"> &quot;kubernetes&quot; ],</span> <span class="sd"> &quot;kubernetes&quot; ],</span>
<span class="sd"> &quot;total&quot;: 6 }</span> <span class="sd"> &quot;total&quot;: 6 }</span>
<span class="sd">`/api/v0/blueprints/info/&lt;blueprint_names&gt;`</span> <span class="sd">`/api/v0/blueprints/info/&lt;blueprint_names&gt;[?format=&lt;json|toml&gt;]`</span>
<span class="sd">^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^</span> <span class="sd">^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^</span>
<span class="sd"> Return the JSON representation of the blueprint. This includes 3 top level</span> <span class="sd"> Return the JSON representation of the blueprint. This includes 3 top level</span>
<span class="sd"> objects. `changes` which lists whether or not the workspace is different from</span> <span class="sd"> objects. `changes` which lists whether or not the workspace is different from</span>
<span class="sd"> the most recent commit. `blueprints` which lists the JSON representation of the</span> <span class="sd"> the most recent commit. `blueprints` which lists the JSON representation of the</span>
<span class="sd"> blueprint, and `errors` which will list any errors, like non-existant blueprints.</span> <span class="sd"> blueprint, and `errors` which will list any errors, like non-existant blueprints.</span>
<span class="sd"> Example::</span> <span class="sd"> By default the response is JSON, but if `?format=toml` is included in the URL&#39;s</span>
<span class="sd"> arguments it will return the response as the blueprint&#39;s raw TOML content.</span>
<span class="sd"> *Unless* there is an error which will only return a 400 and a standard error</span>
<span class="sd"> `Status Response`_.</span>
<span class="sd"> If there is an error when JSON is requested the successful blueprints and the</span>
<span class="sd"> errors will both be returned.</span>
<span class="sd"> Example of json response::</span>
<span class="sd"> {</span> <span class="sd"> {</span>
<span class="sd"> &quot;changes&quot;: [</span> <span class="sd"> &quot;changes&quot;: [</span>
@ -246,7 +254,8 @@
<span class="sd"> Delete a blueprint. The blueprint is deleted from the branch, and will no longer</span> <span class="sd"> Delete a blueprint. The blueprint is deleted from the branch, and will no longer</span>
<span class="sd"> be listed by the `list` route. A blueprint can be undeleted using the `undo` route</span> <span class="sd"> be listed by the `list` route. A blueprint can be undeleted using the `undo` route</span>
<span class="sd"> to revert to a previous commit.</span> <span class="sd"> to revert to a previous commit. This will also delete the workspace copy of the</span>
<span class="sd"> blueprint.</span>
<span class="sd"> The response will be a status response with `status` set to true, or an</span> <span class="sd"> The response will be a status response with `status` set to true, or an</span>
<span class="sd"> error response with it set to false and an error message included.</span> <span class="sd"> error response with it set to false and an error message included.</span>
@ -1045,7 +1054,7 @@
<span class="kn">from</span> <span class="nn">pylorax.api.queue</span> <span class="kn">import</span> <span class="n">uuid_tar</span><span class="p">,</span> <span class="n">uuid_image</span><span class="p">,</span> <span class="n">uuid_cancel</span><span class="p">,</span> <span class="n">uuid_log</span> <span class="kn">from</span> <span class="nn">pylorax.api.queue</span> <span class="kn">import</span> <span class="n">uuid_tar</span><span class="p">,</span> <span class="n">uuid_image</span><span class="p">,</span> <span class="n">uuid_cancel</span><span class="p">,</span> <span class="n">uuid_log</span>
<span class="kn">from</span> <span class="nn">pylorax.api.recipes</span> <span class="kn">import</span> <span class="n">RecipeError</span><span class="p">,</span> <span class="n">list_branch_files</span><span class="p">,</span> <span class="n">read_recipe_commit</span><span class="p">,</span> <span class="n">recipe_filename</span><span class="p">,</span> <span class="n">list_commits</span> <span class="kn">from</span> <span class="nn">pylorax.api.recipes</span> <span class="kn">import</span> <span class="n">RecipeError</span><span class="p">,</span> <span class="n">list_branch_files</span><span class="p">,</span> <span class="n">read_recipe_commit</span><span class="p">,</span> <span class="n">recipe_filename</span><span class="p">,</span> <span class="n">list_commits</span>
<span class="kn">from</span> <span class="nn">pylorax.api.recipes</span> <span class="kn">import</span> <span class="n">recipe_from_dict</span><span class="p">,</span> <span class="n">recipe_from_toml</span><span class="p">,</span> <span class="n">commit_recipe</span><span class="p">,</span> <span class="n">delete_recipe</span><span class="p">,</span> <span class="n">revert_recipe</span> <span class="kn">from</span> <span class="nn">pylorax.api.recipes</span> <span class="kn">import</span> <span class="n">recipe_from_dict</span><span class="p">,</span> <span class="n">recipe_from_toml</span><span class="p">,</span> <span class="n">commit_recipe</span><span class="p">,</span> <span class="n">delete_recipe</span><span class="p">,</span> <span class="n">revert_recipe</span>
<span class="kn">from</span> <span class="nn">pylorax.api.recipes</span> <span class="kn">import</span> <span class="n">tag_recipe_commit</span><span class="p">,</span> <span class="n">recipe_diff</span> <span class="kn">from</span> <span class="nn">pylorax.api.recipes</span> <span class="kn">import</span> <span class="n">tag_recipe_commit</span><span class="p">,</span> <span class="n">recipe_diff</span><span class="p">,</span> <span class="n">RecipeFileError</span>
<span class="kn">from</span> <span class="nn">pylorax.api.regexes</span> <span class="kn">import</span> <span class="n">VALID_API_STRING</span> <span class="kn">from</span> <span class="nn">pylorax.api.regexes</span> <span class="kn">import</span> <span class="n">VALID_API_STRING</span>
<span class="kn">from</span> <span class="nn">pylorax.api.workspace</span> <span class="kn">import</span> <span class="n">workspace_read</span><span class="p">,</span> <span class="n">workspace_write</span><span class="p">,</span> <span class="n">workspace_delete</span> <span class="kn">from</span> <span class="nn">pylorax.api.workspace</span> <span class="kn">import</span> <span class="n">workspace_read</span><span class="p">,</span> <span class="n">workspace_write</span><span class="p">,</span> <span class="n">workspace_delete</span>
<span class="kn">from</span> <span class="nn">pylorax.api.yumbase</span> <span class="kn">import</span> <span class="n">update_metadata</span> <span class="kn">from</span> <span class="nn">pylorax.api.yumbase</span> <span class="kn">import</span> <span class="n">update_metadata</span>
@ -1067,12 +1076,21 @@
<span class="k">return</span> <span class="n">iterable</span><span class="p">[</span><span class="n">offset</span><span class="p">:][:</span><span class="n">limit</span><span class="p">]</span> <span class="k">return</span> <span class="n">iterable</span><span class="p">[</span><span class="n">offset</span><span class="p">:][:</span><span class="n">limit</span><span class="p">]</span>
</div> </div>
<div class="viewcode-block" id="blueprint_exists"><a class="viewcode-back" href="../../../pylorax.api.html#pylorax.api.v0.blueprint_exists">[docs]</a><span class="k">def</span> <span class="nf">blueprint_exists</span><span class="p">(</span><span class="n">api</span><span class="p">,</span> <span class="n">branch</span><span class="p">,</span> <span class="n">blueprint_name</span><span class="p">):</span> <div class="viewcode-block" id="blueprint_exists"><a class="viewcode-back" href="../../../pylorax.api.html#pylorax.api.v0.blueprint_exists">[docs]</a><span class="k">def</span> <span class="nf">blueprint_exists</span><span class="p">(</span><span class="n">api</span><span class="p">,</span> <span class="n">branch</span><span class="p">,</span> <span class="n">blueprint_name</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;Return True if the blueprint exists</span>
<span class="sd"> :param api: flask object</span>
<span class="sd"> :type api: Flask</span>
<span class="sd"> :param branch: Branch name</span>
<span class="sd"> :type branch: str</span>
<span class="sd"> :param recipe_name: Recipe name to read</span>
<span class="sd"> :type recipe_name: str</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="k">try</span><span class="p">:</span> <span class="k">try</span><span class="p">:</span>
<span class="k">with</span> <span class="n">api</span><span class="o">.</span><span class="n">config</span><span class="p">[</span><span class="s">&quot;GITLOCK&quot;</span><span class="p">]</span><span class="o">.</span><span class="n">lock</span><span class="p">:</span> <span class="k">with</span> <span class="n">api</span><span class="o">.</span><span class="n">config</span><span class="p">[</span><span class="s">&quot;GITLOCK&quot;</span><span class="p">]</span><span class="o">.</span><span class="n">lock</span><span class="p">:</span>
<span class="n">read_recipe_commit</span><span class="p">(</span><span class="n">api</span><span class="o">.</span><span class="n">config</span><span class="p">[</span><span class="s">&quot;GITLOCK&quot;</span><span class="p">]</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">blueprint_name</span><span class="p">)</span> <span class="n">read_recipe_commit</span><span class="p">(</span><span class="n">api</span><span class="o">.</span><span class="n">config</span><span class="p">[</span><span class="s">&quot;GITLOCK&quot;</span><span class="p">]</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">blueprint_name</span><span class="p">)</span>
<span class="k">return</span> <span class="bp">True</span> <span class="k">return</span> <span class="bp">True</span>
<span class="k">except</span> <span class="n">RecipeError</span><span class="p">:</span> <span class="k">except</span> <span class="p">(</span><span class="n">RecipeError</span><span class="p">,</span> <span class="n">RecipeFileError</span><span class="p">):</span>
<span class="k">return</span> <span class="bp">False</span> <span class="k">return</span> <span class="bp">False</span>
</div> </div>
<div class="viewcode-block" id="v0_api"><a class="viewcode-back" href="../../../pylorax.api.html#pylorax.api.v0.v0_api">[docs]</a><span class="k">def</span> <span class="nf">v0_api</span><span class="p">(</span><span class="n">api</span><span class="p">):</span> <div class="viewcode-block" id="v0_api"><a class="viewcode-back" href="../../../pylorax.api.html#pylorax.api.v0.v0_api">[docs]</a><span class="k">def</span> <span class="nf">v0_api</span><span class="p">(</span><span class="n">api</span><span class="p">):</span>
@ -1131,6 +1149,10 @@
<span class="k">try</span><span class="p">:</span> <span class="k">try</span><span class="p">:</span>
<span class="k">with</span> <span class="n">api</span><span class="o">.</span><span class="n">config</span><span class="p">[</span><span class="s">&quot;GITLOCK&quot;</span><span class="p">]</span><span class="o">.</span><span class="n">lock</span><span class="p">:</span> <span class="k">with</span> <span class="n">api</span><span class="o">.</span><span class="n">config</span><span class="p">[</span><span class="s">&quot;GITLOCK&quot;</span><span class="p">]</span><span class="o">.</span><span class="n">lock</span><span class="p">:</span>
<span class="n">git_blueprint</span> <span class="o">=</span> <span class="n">read_recipe_commit</span><span class="p">(</span><span class="n">api</span><span class="o">.</span><span class="n">config</span><span class="p">[</span><span class="s">&quot;GITLOCK&quot;</span><span class="p">]</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">blueprint_name</span><span class="p">)</span> <span class="n">git_blueprint</span> <span class="o">=</span> <span class="n">read_recipe_commit</span><span class="p">(</span><span class="n">api</span><span class="o">.</span><span class="n">config</span><span class="p">[</span><span class="s">&quot;GITLOCK&quot;</span><span class="p">]</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">blueprint_name</span><span class="p">)</span>
<span class="k">except</span> <span class="n">RecipeFileError</span> <span class="k">as</span> <span class="n">e</span><span class="p">:</span>
<span class="c"># Adding an exception would be redundant, skip it</span>
<span class="n">git_blueprint</span> <span class="o">=</span> <span class="bp">None</span>
<span class="n">log</span><span class="o">.</span><span class="n">error</span><span class="p">(</span><span class="s">&quot;(v0_blueprints_info) </span><span class="si">%s</span><span class="s">&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="ne">Exception</span> <span class="k">as</span> <span class="n">e</span><span class="p">:</span> <span class="k">except</span> <span class="ne">Exception</span> <span class="k">as</span> <span class="n">e</span><span class="p">:</span>
<span class="n">git_blueprint</span> <span class="o">=</span> <span class="bp">None</span> <span class="n">git_blueprint</span> <span class="o">=</span> <span class="bp">None</span>
<span class="n">exceptions</span><span class="o">.</span><span class="n">append</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">exceptions</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="nb">str</span><span class="p">(</span><span class="n">e</span><span class="p">))</span>
@ -1157,6 +1179,10 @@
<span class="n">blueprints</span> <span class="o">=</span> <span class="nb">sorted</span><span class="p">(</span><span class="n">blueprints</span><span class="p">,</span> <span class="n">key</span><span class="o">=</span><span class="k">lambda</span> <span class="n">r</span><span class="p">:</span> <span class="n">r</span><span class="p">[</span><span class="s">&quot;name&quot;</span><span class="p">]</span><span class="o">.</span><span class="n">lower</span><span class="p">())</span> <span class="n">blueprints</span> <span class="o">=</span> <span class="nb">sorted</span><span class="p">(</span><span class="n">blueprints</span><span class="p">,</span> <span class="n">key</span><span class="o">=</span><span class="k">lambda</span> <span class="n">r</span><span class="p">:</span> <span class="n">r</span><span class="p">[</span><span class="s">&quot;name&quot;</span><span class="p">]</span><span class="o">.</span><span class="n">lower</span><span class="p">())</span>
<span class="k">if</span> <span class="n">out_fmt</span> <span class="o">==</span> <span class="s">&quot;toml&quot;</span><span class="p">:</span> <span class="k">if</span> <span class="n">out_fmt</span> <span class="o">==</span> <span class="s">&quot;toml&quot;</span><span class="p">:</span>
<span class="k">if</span> <span class="n">errors</span><span class="p">:</span>
<span class="c"># If there are errors they need to be reported, use JSON and 400 for this</span>
<span class="k">return</span> <span class="n">jsonify</span><span class="p">(</span><span class="n">status</span><span class="o">=</span><span class="bp">False</span><span class="p">,</span> <span class="n">errors</span><span class="o">=</span><span class="n">errors</span><span class="p">),</span> <span class="mi">400</span>
<span class="k">else</span><span class="p">:</span>
<span class="c"># With TOML output we just want to dump the raw blueprint, skipping the rest.</span> <span class="c"># With TOML output we just want to dump the raw blueprint, skipping the rest.</span>
<span class="k">return</span> <span class="s">&quot;</span><span class="se">\n\n</span><span class="s">&quot;</span><span class="o">.</span><span class="n">join</span><span class="p">([</span><span class="n">r</span><span class="o">.</span><span class="n">toml</span><span class="p">()</span> <span class="k">for</span> <span class="n">r</span> <span class="ow">in</span> <span class="n">blueprints</span><span class="p">])</span> <span class="k">return</span> <span class="s">&quot;</span><span class="se">\n\n</span><span class="s">&quot;</span><span class="o">.</span><span class="n">join</span><span class="p">([</span><span class="n">r</span><span class="o">.</span><span class="n">toml</span><span class="p">()</span> <span class="k">for</span> <span class="n">r</span> <span class="ow">in</span> <span class="n">blueprints</span><span class="p">])</span>
<span class="k">else</span><span class="p">:</span> <span class="k">else</span><span class="p">:</span>
@ -1185,20 +1211,19 @@
<span class="n">errors</span> <span class="o">=</span> <span class="p">[]</span> <span class="n">errors</span> <span class="o">=</span> <span class="p">[]</span>
<span class="k">for</span> <span class="n">blueprint_name</span> <span class="ow">in</span> <span class="p">[</span><span class="n">n</span><span class="o">.</span><span class="n">strip</span><span class="p">()</span> <span class="k">for</span> <span class="n">n</span> <span class="ow">in</span> <span class="n">blueprint_names</span><span class="o">.</span><span class="n">split</span><span class="p">(</span><span class="s">&quot;,&quot;</span><span class="p">)]:</span> <span class="k">for</span> <span class="n">blueprint_name</span> <span class="ow">in</span> <span class="p">[</span><span class="n">n</span><span class="o">.</span><span class="n">strip</span><span class="p">()</span> <span class="k">for</span> <span class="n">n</span> <span class="ow">in</span> <span class="n">blueprint_names</span><span class="o">.</span><span class="n">split</span><span class="p">(</span><span class="s">&quot;,&quot;</span><span class="p">)]:</span>
<span class="n">filename</span> <span class="o">=</span> <span class="n">recipe_filename</span><span class="p">(</span><span class="n">blueprint_name</span><span class="p">)</span> <span class="n">filename</span> <span class="o">=</span> <span class="n">recipe_filename</span><span class="p">(</span><span class="n">blueprint_name</span><span class="p">)</span>
<span class="k">if</span> <span class="ow">not</span> <span class="n">blueprint_exists</span><span class="p">(</span><span class="n">api</span><span class="p">,</span> <span class="n">branch</span><span class="p">,</span> <span class="n">blueprint_name</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="s">&quot;id&quot;</span><span class="p">:</span> <span class="n">UNKNOWN_BLUEPRINT</span><span class="p">,</span> <span class="s">&quot;msg&quot;</span><span class="p">:</span> <span class="s">&quot;Unknown blueprint name: </span><span class="si">%s</span><span class="s">&quot;</span> <span class="o">%</span> <span class="n">blueprint_name</span><span class="p">})</span>
<span class="k">continue</span>
<span class="k">try</span><span class="p">:</span> <span class="k">try</span><span class="p">:</span>
<span class="k">with</span> <span class="n">api</span><span class="o">.</span><span class="n">config</span><span class="p">[</span><span class="s">&quot;GITLOCK&quot;</span><span class="p">]</span><span class="o">.</span><span class="n">lock</span><span class="p">:</span> <span class="k">with</span> <span class="n">api</span><span class="o">.</span><span class="n">config</span><span class="p">[</span><span class="s">&quot;GITLOCK&quot;</span><span class="p">]</span><span class="o">.</span><span class="n">lock</span><span class="p">:</span>
<span class="n">commits</span> <span class="o">=</span> <span class="n">list_commits</span><span class="p">(</span><span class="n">api</span><span class="o">.</span><span class="n">config</span><span class="p">[</span><span class="s">&quot;GITLOCK&quot;</span><span class="p">]</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">filename</span><span class="p">)</span> <span class="n">commits</span> <span class="o">=</span> <span class="n">list_commits</span><span class="p">(</span><span class="n">api</span><span class="o">.</span><span class="n">config</span><span class="p">[</span><span class="s">&quot;GITLOCK&quot;</span><span class="p">]</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">filename</span><span class="p">)</span>
<span class="n">limited_commits</span> <span class="o">=</span> <span class="n">take_limits</span><span class="p">(</span><span class="n">list_commits</span><span class="p">(</span><span class="n">api</span><span class="o">.</span><span class="n">config</span><span class="p">[</span><span class="s">&quot;GITLOCK&quot;</span><span class="p">]</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">filename</span><span class="p">),</span> <span class="n">offset</span><span class="p">,</span> <span class="n">limit</span><span class="p">)</span>
<span class="k">except</span> <span class="ne">Exception</span> <span class="k">as</span> <span class="n">e</span><span class="p">:</span> <span class="k">except</span> <span class="ne">Exception</span> <span class="k">as</span> <span class="n">e</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="s">&quot;id&quot;</span><span class="p">:</span> <span class="n">BLUEPRINTS_ERROR</span><span class="p">,</span> <span class="s">&quot;msg&quot;</span><span class="p">:</span> <span class="s">&quot;</span><span class="si">%s</span><span class="s">: </span><span class="si">%s</span><span class="s">&quot;</span> <span class="o">%</span> <span class="p">(</span><span class="n">blueprint_name</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">errors</span><span class="o">.</span><span class="n">append</span><span class="p">({</span><span class="s">&quot;id&quot;</span><span class="p">:</span> <span class="n">BLUEPRINTS_ERROR</span><span class="p">,</span> <span class="s">&quot;msg&quot;</span><span class="p">:</span> <span class="s">&quot;</span><span class="si">%s</span><span class="s">: </span><span class="si">%s</span><span class="s">&quot;</span> <span class="o">%</span> <span class="p">(</span><span class="n">blueprint_name</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">error</span><span class="p">(</span><span class="s">&quot;(v0_blueprints_changes) </span><span class="si">%s</span><span class="s">&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">error</span><span class="p">(</span><span class="s">&quot;(v0_blueprints_changes) </span><span class="si">%s</span><span class="s">&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">else</span><span class="p">:</span> <span class="k">else</span><span class="p">:</span>
<span class="k">if</span> <span class="n">commits</span><span class="p">:</span>
<span class="n">limited_commits</span> <span class="o">=</span> <span class="n">take_limits</span><span class="p">(</span><span class="n">commits</span><span class="p">,</span> <span class="n">offset</span><span class="p">,</span> <span class="n">limit</span><span class="p">)</span>
<span class="n">blueprints</span><span class="o">.</span><span class="n">append</span><span class="p">({</span><span class="s">&quot;name&quot;</span><span class="p">:</span><span class="n">blueprint_name</span><span class="p">,</span> <span class="s">&quot;changes&quot;</span><span class="p">:</span><span class="n">limited_commits</span><span class="p">,</span> <span class="s">&quot;total&quot;</span><span class="p">:</span><span class="nb">len</span><span class="p">(</span><span class="n">commits</span><span class="p">)})</span> <span class="n">blueprints</span><span class="o">.</span><span class="n">append</span><span class="p">({</span><span class="s">&quot;name&quot;</span><span class="p">:</span><span class="n">blueprint_name</span><span class="p">,</span> <span class="s">&quot;changes&quot;</span><span class="p">:</span><span class="n">limited_commits</span><span class="p">,</span> <span class="s">&quot;total&quot;</span><span class="p">:</span><span class="nb">len</span><span class="p">(</span><span class="n">commits</span><span class="p">)})</span>
<span class="k">else</span><span class="p">:</span>
<span class="c"># no commits means there is no blueprint in the branch</span>
<span class="n">errors</span><span class="o">.</span><span class="n">append</span><span class="p">({</span><span class="s">&quot;id&quot;</span><span class="p">:</span> <span class="n">UNKNOWN_BLUEPRINT</span><span class="p">,</span> <span class="s">&quot;msg&quot;</span><span class="p">:</span> <span class="s">&quot;</span><span class="si">%s</span><span class="s">&quot;</span> <span class="o">%</span> <span class="n">blueprint_name</span><span class="p">})</span>
<span class="n">blueprints</span> <span class="o">=</span> <span class="nb">sorted</span><span class="p">(</span><span class="n">blueprints</span><span class="p">,</span> <span class="n">key</span><span class="o">=</span><span class="k">lambda</span> <span class="n">r</span><span class="p">:</span> <span class="n">r</span><span class="p">[</span><span class="s">&quot;name&quot;</span><span class="p">]</span><span class="o">.</span><span class="n">lower</span><span class="p">())</span> <span class="n">blueprints</span> <span class="o">=</span> <span class="nb">sorted</span><span class="p">(</span><span class="n">blueprints</span><span class="p">,</span> <span class="n">key</span><span class="o">=</span><span class="k">lambda</span> <span class="n">r</span><span class="p">:</span> <span class="n">r</span><span class="p">[</span><span class="s">&quot;name&quot;</span><span class="p">]</span><span class="o">.</span><span class="n">lower</span><span class="p">())</span>
@ -1248,6 +1273,7 @@
<span class="k">try</span><span class="p">:</span> <span class="k">try</span><span class="p">:</span>
<span class="k">with</span> <span class="n">api</span><span class="o">.</span><span class="n">config</span><span class="p">[</span><span class="s">&quot;GITLOCK&quot;</span><span class="p">]</span><span class="o">.</span><span class="n">lock</span><span class="p">:</span> <span class="k">with</span> <span class="n">api</span><span class="o">.</span><span class="n">config</span><span class="p">[</span><span class="s">&quot;GITLOCK&quot;</span><span class="p">]</span><span class="o">.</span><span class="n">lock</span><span class="p">:</span>
<span class="n">workspace_delete</span><span class="p">(</span><span class="n">api</span><span class="o">.</span><span class="n">config</span><span class="p">[</span><span class="s">&quot;GITLOCK&quot;</span><span class="p">]</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">blueprint_name</span><span class="p">)</span>
<span class="n">delete_recipe</span><span class="p">(</span><span class="n">api</span><span class="o">.</span><span class="n">config</span><span class="p">[</span><span class="s">&quot;GITLOCK&quot;</span><span class="p">]</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">blueprint_name</span><span class="p">)</span> <span class="n">delete_recipe</span><span class="p">(</span><span class="n">api</span><span class="o">.</span><span class="n">config</span><span class="p">[</span><span class="s">&quot;GITLOCK&quot;</span><span class="p">]</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">blueprint_name</span><span class="p">)</span>
<span class="k">except</span> <span class="ne">Exception</span> <span class="k">as</span> <span class="n">e</span><span class="p">:</span> <span class="k">except</span> <span class="ne">Exception</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="s">&quot;(v0_blueprints_delete) </span><span class="si">%s</span><span class="s">&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">error</span><span class="p">(</span><span class="s">&quot;(v0_blueprints_delete) </span><span class="si">%s</span><span class="s">&quot;</span><span class="p">,</span> <span class="nb">str</span><span class="p">(</span><span class="n">e</span><span class="p">))</span>
@ -1346,6 +1372,9 @@
<span class="k">try</span><span class="p">:</span> <span class="k">try</span><span class="p">:</span>
<span class="k">with</span> <span class="n">api</span><span class="o">.</span><span class="n">config</span><span class="p">[</span><span class="s">&quot;GITLOCK&quot;</span><span class="p">]</span><span class="o">.</span><span class="n">lock</span><span class="p">:</span> <span class="k">with</span> <span class="n">api</span><span class="o">.</span><span class="n">config</span><span class="p">[</span><span class="s">&quot;GITLOCK&quot;</span><span class="p">]</span><span class="o">.</span><span class="n">lock</span><span class="p">:</span>
<span class="n">tag_recipe_commit</span><span class="p">(</span><span class="n">api</span><span class="o">.</span><span class="n">config</span><span class="p">[</span><span class="s">&quot;GITLOCK&quot;</span><span class="p">]</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">blueprint_name</span><span class="p">)</span> <span class="n">tag_recipe_commit</span><span class="p">(</span><span class="n">api</span><span class="o">.</span><span class="n">config</span><span class="p">[</span><span class="s">&quot;GITLOCK&quot;</span><span class="p">]</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">blueprint_name</span><span class="p">)</span>
<span class="k">except</span> <span class="n">RecipeFileError</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="s">&quot;(v0_blueprints_tag) </span><span class="si">%s</span><span class="s">&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">return</span> <span class="n">jsonify</span><span class="p">(</span><span class="n">status</span><span class="o">=</span><span class="bp">False</span><span class="p">,</span> <span class="n">errors</span><span class="o">=</span><span class="p">[{</span><span class="s">&quot;id&quot;</span><span class="p">:</span> <span class="n">UNKNOWN_BLUEPRINT</span><span class="p">,</span> <span class="s">&quot;msg&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="mi">400</span>
<span class="k">except</span> <span class="ne">Exception</span> <span class="k">as</span> <span class="n">e</span><span class="p">:</span> <span class="k">except</span> <span class="ne">Exception</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="s">&quot;(v0_blueprints_tag) </span><span class="si">%s</span><span class="s">&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">error</span><span class="p">(</span><span class="s">&quot;(v0_blueprints_tag) </span><span class="si">%s</span><span class="s">&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">return</span> <span class="n">jsonify</span><span class="p">(</span><span class="n">status</span><span class="o">=</span><span class="bp">False</span><span class="p">,</span> <span class="n">errors</span><span class="o">=</span><span class="p">[{</span><span class="s">&quot;id&quot;</span><span class="p">:</span> <span class="n">BLUEPRINTS_ERROR</span><span class="p">,</span> <span class="s">&quot;msg&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="mi">400</span> <span class="k">return</span> <span class="n">jsonify</span><span class="p">(</span><span class="n">status</span><span class="o">=</span><span class="bp">False</span><span class="p">,</span> <span class="n">errors</span><span class="o">=</span><span class="p">[{</span><span class="s">&quot;id&quot;</span><span class="p">:</span> <span class="n">BLUEPRINTS_ERROR</span><span class="p">,</span> <span class="s">&quot;msg&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="mi">400</span>
@ -1370,6 +1399,9 @@
<span class="k">if</span> <span class="n">VALID_API_STRING</span><span class="o">.</span><span class="n">match</span><span class="p">(</span><span class="n">branch</span><span class="p">)</span> <span class="ow">is</span> <span class="bp">None</span><span class="p">:</span> <span class="k">if</span> <span class="n">VALID_API_STRING</span><span class="o">.</span><span class="n">match</span><span class="p">(</span><span class="n">branch</span><span class="p">)</span> <span class="ow">is</span> <span class="bp">None</span><span class="p">:</span>
<span class="k">return</span> <span class="n">jsonify</span><span class="p">(</span><span class="n">status</span><span class="o">=</span><span class="bp">False</span><span class="p">,</span> <span class="n">errors</span><span class="o">=</span><span class="p">[{</span><span class="s">&quot;id&quot;</span><span class="p">:</span> <span class="n">INVALID_CHARS</span><span class="p">,</span> <span class="s">&quot;msg&quot;</span><span class="p">:</span> <span class="s">&quot;Invalid characters in branch argument&quot;</span><span class="p">}]),</span> <span class="mi">400</span> <span class="k">return</span> <span class="n">jsonify</span><span class="p">(</span><span class="n">status</span><span class="o">=</span><span class="bp">False</span><span class="p">,</span> <span class="n">errors</span><span class="o">=</span><span class="p">[{</span><span class="s">&quot;id&quot;</span><span class="p">:</span> <span class="n">INVALID_CHARS</span><span class="p">,</span> <span class="s">&quot;msg&quot;</span><span class="p">:</span> <span class="s">&quot;Invalid characters in branch argument&quot;</span><span class="p">}]),</span> <span class="mi">400</span>
<span class="k">if</span> <span class="ow">not</span> <span class="n">blueprint_exists</span><span class="p">(</span><span class="n">api</span><span class="p">,</span> <span class="n">branch</span><span class="p">,</span> <span class="n">blueprint_name</span><span class="p">):</span>
<span class="k">return</span> <span class="n">jsonify</span><span class="p">(</span><span class="n">status</span><span class="o">=</span><span class="bp">False</span><span class="p">,</span> <span class="n">errors</span><span class="o">=</span><span class="p">[{</span><span class="s">&quot;id&quot;</span><span class="p">:</span> <span class="n">UNKNOWN_BLUEPRINT</span><span class="p">,</span> <span class="s">&quot;msg&quot;</span><span class="p">:</span> <span class="s">&quot;Unknown blueprint name: </span><span class="si">%s</span><span class="s">&quot;</span> <span class="o">%</span> <span class="n">blueprint_name</span><span class="p">}])</span>
<span class="k">try</span><span class="p">:</span> <span class="k">try</span><span class="p">:</span>
<span class="k">if</span> <span class="n">from_commit</span> <span class="o">==</span> <span class="s">&quot;NEWEST&quot;</span><span class="p">:</span> <span class="k">if</span> <span class="n">from_commit</span> <span class="o">==</span> <span class="s">&quot;NEWEST&quot;</span><span class="p">:</span>
<span class="k">with</span> <span class="n">api</span><span class="o">.</span><span class="n">config</span><span class="p">[</span><span class="s">&quot;GITLOCK&quot;</span><span class="p">]</span><span class="o">.</span><span class="n">lock</span><span class="p">:</span> <span class="k">with</span> <span class="n">api</span><span class="o">.</span><span class="n">config</span><span class="p">[</span><span class="s">&quot;GITLOCK&quot;</span><span class="p">]</span><span class="o">.</span><span class="n">lock</span><span class="p">:</span>
@ -1436,6 +1468,9 @@
<span class="k">try</span><span class="p">:</span> <span class="k">try</span><span class="p">:</span>
<span class="k">with</span> <span class="n">api</span><span class="o">.</span><span class="n">config</span><span class="p">[</span><span class="s">&quot;GITLOCK&quot;</span><span class="p">]</span><span class="o">.</span><span class="n">lock</span><span class="p">:</span> <span class="k">with</span> <span class="n">api</span><span class="o">.</span><span class="n">config</span><span class="p">[</span><span class="s">&quot;GITLOCK&quot;</span><span class="p">]</span><span class="o">.</span><span class="n">lock</span><span class="p">:</span>
<span class="n">blueprint</span> <span class="o">=</span> <span class="n">read_recipe_commit</span><span class="p">(</span><span class="n">api</span><span class="o">.</span><span class="n">config</span><span class="p">[</span><span class="s">&quot;GITLOCK&quot;</span><span class="p">]</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">blueprint_name</span><span class="p">)</span> <span class="n">blueprint</span> <span class="o">=</span> <span class="n">read_recipe_commit</span><span class="p">(</span><span class="n">api</span><span class="o">.</span><span class="n">config</span><span class="p">[</span><span class="s">&quot;GITLOCK&quot;</span><span class="p">]</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">blueprint_name</span><span class="p">)</span>
<span class="k">except</span> <span class="n">RecipeFileError</span> <span class="k">as</span> <span class="n">e</span><span class="p">:</span>
<span class="c"># adding an error here would be redundant, skip it</span>
<span class="n">log</span><span class="o">.</span><span class="n">error</span><span class="p">(</span><span class="s">&quot;(v0_blueprints_freeze) </span><span class="si">%s</span><span class="s">&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="ne">Exception</span> <span class="k">as</span> <span class="n">e</span><span class="p">:</span> <span class="k">except</span> <span class="ne">Exception</span> <span class="k">as</span> <span class="n">e</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="s">&quot;id&quot;</span><span class="p">:</span> <span class="n">BLUEPRINTS_ERROR</span><span class="p">,</span> <span class="s">&quot;msg&quot;</span><span class="p">:</span> <span class="s">&quot;</span><span class="si">%s</span><span class="s">: </span><span class="si">%s</span><span class="s">&quot;</span> <span class="o">%</span> <span class="p">(</span><span class="n">blueprint_name</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">errors</span><span class="o">.</span><span class="n">append</span><span class="p">({</span><span class="s">&quot;id&quot;</span><span class="p">:</span> <span class="n">BLUEPRINTS_ERROR</span><span class="p">,</span> <span class="s">&quot;msg&quot;</span><span class="p">:</span> <span class="s">&quot;</span><span class="si">%s</span><span class="s">: </span><span class="si">%s</span><span class="s">&quot;</span> <span class="o">%</span> <span class="p">(</span><span class="n">blueprint_name</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">error</span><span class="p">(</span><span class="s">&quot;(v0_blueprints_freeze) </span><span class="si">%s</span><span class="s">&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">error</span><span class="p">(</span><span class="s">&quot;(v0_blueprints_freeze) </span><span class="si">%s</span><span class="s">&quot;</span><span class="p">,</span> <span class="nb">str</span><span class="p">(</span><span class="n">e</span><span class="p">))</span>
@ -1496,6 +1531,9 @@
<span class="k">try</span><span class="p">:</span> <span class="k">try</span><span class="p">:</span>
<span class="k">with</span> <span class="n">api</span><span class="o">.</span><span class="n">config</span><span class="p">[</span><span class="s">&quot;GITLOCK&quot;</span><span class="p">]</span><span class="o">.</span><span class="n">lock</span><span class="p">:</span> <span class="k">with</span> <span class="n">api</span><span class="o">.</span><span class="n">config</span><span class="p">[</span><span class="s">&quot;GITLOCK&quot;</span><span class="p">]</span><span class="o">.</span><span class="n">lock</span><span class="p">:</span>
<span class="n">blueprint</span> <span class="o">=</span> <span class="n">read_recipe_commit</span><span class="p">(</span><span class="n">api</span><span class="o">.</span><span class="n">config</span><span class="p">[</span><span class="s">&quot;GITLOCK&quot;</span><span class="p">]</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">blueprint_name</span><span class="p">)</span> <span class="n">blueprint</span> <span class="o">=</span> <span class="n">read_recipe_commit</span><span class="p">(</span><span class="n">api</span><span class="o">.</span><span class="n">config</span><span class="p">[</span><span class="s">&quot;GITLOCK&quot;</span><span class="p">]</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">blueprint_name</span><span class="p">)</span>
<span class="k">except</span> <span class="n">RecipeFileError</span> <span class="k">as</span> <span class="n">e</span><span class="p">:</span>
<span class="c"># adding an error here would be redundant, skip it</span>
<span class="n">log</span><span class="o">.</span><span class="n">error</span><span class="p">(</span><span class="s">&quot;(v0_blueprints_depsolve) </span><span class="si">%s</span><span class="s">&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="ne">Exception</span> <span class="k">as</span> <span class="n">e</span><span class="p">:</span> <span class="k">except</span> <span class="ne">Exception</span> <span class="k">as</span> <span class="n">e</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="s">&quot;id&quot;</span><span class="p">:</span> <span class="n">BLUEPRINTS_ERROR</span><span class="p">,</span> <span class="s">&quot;msg&quot;</span><span class="p">:</span> <span class="s">&quot;</span><span class="si">%s</span><span class="s">: </span><span class="si">%s</span><span class="s">&quot;</span> <span class="o">%</span> <span class="p">(</span><span class="n">blueprint_name</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">errors</span><span class="o">.</span><span class="n">append</span><span class="p">({</span><span class="s">&quot;id&quot;</span><span class="p">:</span> <span class="n">BLUEPRINTS_ERROR</span><span class="p">,</span> <span class="s">&quot;msg&quot;</span><span class="p">:</span> <span class="s">&quot;</span><span class="si">%s</span><span class="s">: </span><span class="si">%s</span><span class="s">&quot;</span> <span class="o">%</span> <span class="p">(</span><span class="n">blueprint_name</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">error</span><span class="p">(</span><span class="s">&quot;(v0_blueprints_depsolve) </span><span class="si">%s</span><span class="s">&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">error</span><span class="p">(</span><span class="s">&quot;(v0_blueprints_depsolve) </span><span class="si">%s</span><span class="s">&quot;</span><span class="p">,</span> <span class="nb">str</span><span class="p">(</span><span class="n">e</span><span class="p">))</span>
@ -1834,6 +1872,9 @@
<span class="k">if</span> <span class="n">VALID_API_STRING</span><span class="o">.</span><span class="n">match</span><span class="p">(</span><span class="n">blueprint_name</span><span class="p">)</span> <span class="ow">is</span> <span class="bp">None</span><span class="p">:</span> <span class="k">if</span> <span class="n">VALID_API_STRING</span><span class="o">.</span><span class="n">match</span><span class="p">(</span><span class="n">blueprint_name</span><span class="p">)</span> <span class="ow">is</span> <span class="bp">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="s">&quot;id&quot;</span><span class="p">:</span> <span class="n">INVALID_CHARS</span><span class="p">,</span> <span class="s">&quot;msg&quot;</span><span class="p">:</span> <span class="s">&quot;Invalid characters in API path&quot;</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="s">&quot;id&quot;</span><span class="p">:</span> <span class="n">INVALID_CHARS</span><span class="p">,</span> <span class="s">&quot;msg&quot;</span><span class="p">:</span> <span class="s">&quot;Invalid characters in API path&quot;</span><span class="p">})</span>
<span class="k">if</span> <span class="ow">not</span> <span class="n">blueprint_exists</span><span class="p">(</span><span class="n">api</span><span class="p">,</span> <span class="n">branch</span><span class="p">,</span> <span class="n">blueprint_name</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="s">&quot;id&quot;</span><span class="p">:</span> <span class="n">UNKNOWN_BLUEPRINT</span><span class="p">,</span> <span class="s">&quot;msg&quot;</span><span class="p">:</span> <span class="s">&quot;Unknown blueprint name: </span><span class="si">%s</span><span class="s">&quot;</span> <span class="o">%</span> <span class="n">blueprint_name</span><span class="p">})</span>
<span class="k">if</span> <span class="n">errors</span><span class="p">:</span> <span class="k">if</span> <span class="n">errors</span><span class="p">:</span>
<span class="k">return</span> <span class="n">jsonify</span><span class="p">(</span><span class="n">status</span><span class="o">=</span><span class="bp">False</span><span class="p">,</span> <span class="n">errors</span><span class="o">=</span><span class="n">errors</span><span class="p">),</span> <span class="mi">400</span> <span class="k">return</span> <span class="n">jsonify</span><span class="p">(</span><span class="n">status</span><span class="o">=</span><span class="bp">False</span><span class="p">,</span> <span class="n">errors</span><span class="o">=</span><span class="n">errors</span><span class="p">),</span> <span class="mi">400</span>
@ -2130,7 +2171,7 @@
<li class="right" > <li class="right" >
<a href="../../../py-modindex.html" title="Python Module Index" <a href="../../../py-modindex.html" title="Python Module Index"
>modules</a> |</li> >modules</a> |</li>
<li><a href="../../../index.html">Lorax 19.7.22 documentation</a> &raquo;</li> <li><a href="../../../index.html">Lorax 19.7.43 documentation</a> &raquo;</li>
<li><a href="../../index.html" >Module code</a> &raquo;</li> <li><a href="../../index.html" >Module code</a> &raquo;</li>
<li><a href="../../pylorax.html" >pylorax</a> &raquo;</li> <li><a href="../../pylorax.html" >pylorax</a> &raquo;</li>
<li><a href="../api.html" >pylorax.api</a> &raquo;</li> <li><a href="../api.html" >pylorax.api</a> &raquo;</li>

View File

@ -8,7 +8,7 @@
<head> <head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>pylorax.api.workspace &mdash; Lorax 19.7.22 documentation</title> <title>pylorax.api.workspace &mdash; Lorax 19.7.43 documentation</title>
<link rel="stylesheet" href="../../../_static/default.css" type="text/css" /> <link rel="stylesheet" href="../../../_static/default.css" type="text/css" />
<link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" /> <link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" />
@ -16,7 +16,7 @@
<script type="text/javascript"> <script type="text/javascript">
var DOCUMENTATION_OPTIONS = { var DOCUMENTATION_OPTIONS = {
URL_ROOT: '../../../', URL_ROOT: '../../../',
VERSION: '19.7.22', VERSION: '19.7.43',
COLLAPSE_INDEX: false, COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html', FILE_SUFFIX: '.html',
HAS_SOURCE: true HAS_SOURCE: true
@ -25,7 +25,7 @@
<script type="text/javascript" src="../../../_static/jquery.js"></script> <script type="text/javascript" src="../../../_static/jquery.js"></script>
<script type="text/javascript" src="../../../_static/underscore.js"></script> <script type="text/javascript" src="../../../_static/underscore.js"></script>
<script type="text/javascript" src="../../../_static/doctools.js"></script> <script type="text/javascript" src="../../../_static/doctools.js"></script>
<link rel="top" title="Lorax 19.7.22 documentation" href="../../../index.html" /> <link rel="top" title="Lorax 19.7.43 documentation" href="../../../index.html" />
<link rel="up" title="pylorax.api" href="../api.html" /> <link rel="up" title="pylorax.api" href="../api.html" />
</head> </head>
<body> <body>
@ -38,7 +38,7 @@
<li class="right" > <li class="right" >
<a href="../../../py-modindex.html" title="Python Module Index" <a href="../../../py-modindex.html" title="Python Module Index"
>modules</a> |</li> >modules</a> |</li>
<li><a href="../../../index.html">Lorax 19.7.22 documentation</a> &raquo;</li> <li><a href="../../../index.html">Lorax 19.7.43 documentation</a> &raquo;</li>
<li><a href="../../index.html" >Module code</a> &raquo;</li> <li><a href="../../index.html" >Module code</a> &raquo;</li>
<li><a href="../../pylorax.html" >pylorax</a> &raquo;</li> <li><a href="../../pylorax.html" >pylorax</a> &raquo;</li>
<li><a href="../api.html" accesskey="U">pylorax.api</a> &raquo;</li> <li><a href="../api.html" accesskey="U">pylorax.api</a> &raquo;</li>
@ -183,7 +183,7 @@
<li class="right" > <li class="right" >
<a href="../../../py-modindex.html" title="Python Module Index" <a href="../../../py-modindex.html" title="Python Module Index"
>modules</a> |</li> >modules</a> |</li>
<li><a href="../../../index.html">Lorax 19.7.22 documentation</a> &raquo;</li> <li><a href="../../../index.html">Lorax 19.7.43 documentation</a> &raquo;</li>
<li><a href="../../index.html" >Module code</a> &raquo;</li> <li><a href="../../index.html" >Module code</a> &raquo;</li>
<li><a href="../../pylorax.html" >pylorax</a> &raquo;</li> <li><a href="../../pylorax.html" >pylorax</a> &raquo;</li>
<li><a href="../api.html" >pylorax.api</a> &raquo;</li> <li><a href="../api.html" >pylorax.api</a> &raquo;</li>

View File

@ -8,7 +8,7 @@
<head> <head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>pylorax.api.yumbase &mdash; Lorax 19.7.22 documentation</title> <title>pylorax.api.yumbase &mdash; Lorax 19.7.43 documentation</title>
<link rel="stylesheet" href="../../../_static/default.css" type="text/css" /> <link rel="stylesheet" href="../../../_static/default.css" type="text/css" />
<link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" /> <link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" />
@ -16,7 +16,7 @@
<script type="text/javascript"> <script type="text/javascript">
var DOCUMENTATION_OPTIONS = { var DOCUMENTATION_OPTIONS = {
URL_ROOT: '../../../', URL_ROOT: '../../../',
VERSION: '19.7.22', VERSION: '19.7.43',
COLLAPSE_INDEX: false, COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html', FILE_SUFFIX: '.html',
HAS_SOURCE: true HAS_SOURCE: true
@ -25,7 +25,7 @@
<script type="text/javascript" src="../../../_static/jquery.js"></script> <script type="text/javascript" src="../../../_static/jquery.js"></script>
<script type="text/javascript" src="../../../_static/underscore.js"></script> <script type="text/javascript" src="../../../_static/underscore.js"></script>
<script type="text/javascript" src="../../../_static/doctools.js"></script> <script type="text/javascript" src="../../../_static/doctools.js"></script>
<link rel="top" title="Lorax 19.7.22 documentation" href="../../../index.html" /> <link rel="top" title="Lorax 19.7.43 documentation" href="../../../index.html" />
<link rel="up" title="pylorax.api" href="../api.html" /> <link rel="up" title="pylorax.api" href="../api.html" />
</head> </head>
<body> <body>
@ -38,7 +38,7 @@
<li class="right" > <li class="right" >
<a href="../../../py-modindex.html" title="Python Module Index" <a href="../../../py-modindex.html" title="Python Module Index"
>modules</a> |</li> >modules</a> |</li>
<li><a href="../../../index.html">Lorax 19.7.22 documentation</a> &raquo;</li> <li><a href="../../../index.html">Lorax 19.7.43 documentation</a> &raquo;</li>
<li><a href="../../index.html" >Module code</a> &raquo;</li> <li><a href="../../index.html" >Module code</a> &raquo;</li>
<li><a href="../../pylorax.html" >pylorax</a> &raquo;</li> <li><a href="../../pylorax.html" >pylorax</a> &raquo;</li>
<li><a href="../api.html" accesskey="U">pylorax.api</a> &raquo;</li> <li><a href="../api.html" accesskey="U">pylorax.api</a> &raquo;</li>
@ -76,6 +76,8 @@
<span class="kn">from</span> <span class="nn">fnmatch</span> <span class="kn">import</span> <span class="n">fnmatchcase</span> <span class="kn">from</span> <span class="nn">fnmatch</span> <span class="kn">import</span> <span class="n">fnmatchcase</span>
<span class="kn">from</span> <span class="nn">glob</span> <span class="kn">import</span> <span class="n">glob</span> <span class="kn">from</span> <span class="nn">glob</span> <span class="kn">import</span> <span class="n">glob</span>
<span class="kn">import</span> <span class="nn">os</span> <span class="kn">import</span> <span class="nn">os</span>
<span class="kn">from</span> <span class="nn">threading</span> <span class="kn">import</span> <span class="n">Lock</span>
<span class="kn">import</span> <span class="nn">time</span>
<span class="kn">import</span> <span class="nn">yum</span> <span class="kn">import</span> <span class="nn">yum</span>
<span class="kn">from</span> <span class="nn">yum.Errors</span> <span class="kn">import</span> <span class="n">YumBaseError</span> <span class="kn">from</span> <span class="nn">yum.Errors</span> <span class="kn">import</span> <span class="n">YumBaseError</span>
@ -84,6 +86,74 @@
<span class="kn">from</span> <span class="nn">pylorax.sysutils</span> <span class="kn">import</span> <span class="n">joinpaths</span> <span class="kn">from</span> <span class="nn">pylorax.sysutils</span> <span class="kn">import</span> <span class="n">joinpaths</span>
<div class="viewcode-block" id="YumLock"><a class="viewcode-back" href="../../../pylorax.api.html#pylorax.api.yumbase.YumLock">[docs]</a><span class="k">class</span> <span class="nc">YumLock</span><span class="p">(</span><span class="nb">object</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;Hold the YumBase object and a Lock to control access to it.</span>
<span class="sd"> self.yb is a property that returns the YumBase object, but it *may* change</span>
<span class="sd"> from one call to the next if the upstream repositories have changed.</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="n">expire_secs</span><span class="o">=</span><span class="mi">6</span><span class="o">*</span><span class="mi">60</span><span class="o">*</span><span class="mi">60</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>
<span class="bp">self</span><span class="o">.</span><span class="n">_lock</span> <span class="o">=</span> <span class="n">Lock</span><span class="p">()</span>
<span class="bp">self</span><span class="o">.</span><span class="n">yb</span> <span class="o">=</span> <span class="n">get_base_object</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">_conf</span><span class="p">)</span>
<span class="bp">self</span><span class="o">.</span><span class="n">_expire_secs</span> <span class="o">=</span> <span class="n">expire_secs</span>
<span class="bp">self</span><span class="o">.</span><span class="n">_expire_time</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="o">+</span> <span class="bp">self</span><span class="o">.</span><span class="n">_expire_secs</span>
<span class="nd">@property</span>
<div class="viewcode-block" id="YumLock.lock"><a class="viewcode-back" href="../../../pylorax.api.html#pylorax.api.yumbase.YumLock.lock">[docs]</a> <span class="k">def</span> <span class="nf">lock</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;Check for repo updates (using expiration time) and return the lock</span>
<span class="sd"> If the repository has been updated, tear down the old YumBase and</span>
<span class="sd"> create a new one. This is the only way to force yum to use the new</span>
<span class="sd"> metadata.</span>
<span class="sd"> &quot;&quot;&quot;</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="bp">self</span><span class="o">.</span><span class="n">_expire_time</span><span class="p">:</span>
<span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">lock_check</span>
<span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">_lock</span>
</div>
<span class="nd">@property</span>
<div class="viewcode-block" id="YumLock.lock_check"><a class="viewcode-back" href="../../../pylorax.api.html#pylorax.api.yumbase.YumLock.lock_check">[docs]</a> <span class="k">def</span> <span class="nf">lock_check</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;Force a check for repo updates and return the lock</span>
<span class="sd"> If the repository has been updated, tear down the old YumBase and</span>
<span class="sd"> create a new one. This is the only way to force yum to use the new</span>
<span class="sd"> metadata.</span>
<span class="sd"> Use this method sparingly, it removes the repodata and downloads a new copy every time.</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="bp">self</span><span class="o">.</span><span class="n">_expire_time</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="o">+</span> <span class="bp">self</span><span class="o">.</span><span class="n">_expire_secs</span>
<span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">_haveReposChanged</span><span class="p">():</span>
<span class="bp">self</span><span class="o">.</span><span class="n">_destroyYb</span><span class="p">()</span>
<span class="bp">self</span><span class="o">.</span><span class="n">yb</span> <span class="o">=</span> <span class="n">get_base_object</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">_conf</span><span class="p">)</span>
<span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">_lock</span>
</div>
<span class="k">def</span> <span class="nf">_destroyYb</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
<span class="c"># Do our best to get yum to let go of all the things...</span>
<span class="bp">self</span><span class="o">.</span><span class="n">yb</span><span class="o">.</span><span class="n">pkgSack</span><span class="o">.</span><span class="n">dropCachedData</span><span class="p">()</span>
<span class="k">for</span> <span class="n">s</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">yb</span><span class="o">.</span><span class="n">pkgSack</span><span class="o">.</span><span class="n">sacks</span><span class="o">.</span><span class="n">values</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">del</span> <span class="n">s</span>
<span class="k">del</span> <span class="bp">self</span><span class="o">.</span><span class="n">yb</span><span class="o">.</span><span class="n">pkgSack</span>
<span class="bp">self</span><span class="o">.</span><span class="n">yb</span><span class="o">.</span><span class="n">closeRpmDB</span><span class="p">()</span>
<span class="k">del</span> <span class="bp">self</span><span class="o">.</span><span class="n">yb</span><span class="o">.</span><span class="n">tsInfo</span>
<span class="k">del</span> <span class="bp">self</span><span class="o">.</span><span class="n">yb</span><span class="o">.</span><span class="n">ts</span>
<span class="bp">self</span><span class="o">.</span><span class="n">yb</span><span class="o">.</span><span class="n">close</span><span class="p">()</span>
<span class="k">del</span> <span class="bp">self</span><span class="o">.</span><span class="n">yb</span>
<span class="k">def</span> <span class="nf">_haveReposChanged</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;Return True if the repo has new metadata&quot;&quot;&quot;</span>
<span class="c"># This is a total kludge, yum doesn&#39;t really expect to deal with things changing while the</span>
<span class="c"># object is is use.</span>
<span class="k">try</span><span class="p">:</span>
<span class="n">before</span> <span class="o">=</span> <span class="p">[(</span><span class="n">r</span><span class="o">.</span><span class="n">id</span><span class="p">,</span> <span class="n">r</span><span class="o">.</span><span class="n">repoXML</span><span class="o">.</span><span class="n">checksums</span><span class="p">[</span><span class="s">&quot;sha256&quot;</span><span class="p">])</span> <span class="k">for</span> <span class="n">r</span> <span class="ow">in</span> <span class="nb">sorted</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">yb</span><span class="o">.</span><span class="n">repos</span><span class="o">.</span><span class="n">listEnabled</span><span class="p">())]</span>
<span class="k">for</span> <span class="n">r</span> <span class="ow">in</span> <span class="nb">sorted</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">yb</span><span class="o">.</span><span class="n">repos</span><span class="o">.</span><span class="n">listEnabled</span><span class="p">()):</span>
<span class="n">r</span><span class="o">.</span><span class="n">metadata_expire</span> <span class="o">=</span> <span class="mi">0</span>
<span class="k">del</span> <span class="n">r</span><span class="o">.</span><span class="n">repoXML</span>
<span class="n">after</span> <span class="o">=</span> <span class="p">[(</span><span class="n">r</span><span class="o">.</span><span class="n">id</span><span class="p">,</span> <span class="n">r</span><span class="o">.</span><span class="n">repoXML</span><span class="o">.</span><span class="n">checksums</span><span class="p">[</span><span class="s">&quot;sha256&quot;</span><span class="p">])</span> <span class="k">for</span> <span class="n">r</span> <span class="ow">in</span> <span class="nb">sorted</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">yb</span><span class="o">.</span><span class="n">repos</span><span class="o">.</span><span class="n">listEnabled</span><span class="p">())]</span>
<span class="k">return</span> <span class="n">before</span> <span class="o">!=</span> <span class="n">after</span>
<span class="k">except</span> <span class="ne">Exception</span><span class="p">:</span>
<span class="k">return</span> <span class="bp">False</span>
</div>
<div class="viewcode-block" id="get_base_object"><a class="viewcode-back" href="../../../pylorax.api.html#pylorax.api.yumbase.get_base_object">[docs]</a><span class="k">def</span> <span class="nf">get_base_object</span><span class="p">(</span><span class="n">conf</span><span class="p">):</span> <div class="viewcode-block" id="get_base_object"><a class="viewcode-back" href="../../../pylorax.api.html#pylorax.api.yumbase.get_base_object">[docs]</a><span class="k">def</span> <span class="nf">get_base_object</span><span class="p">(</span><span class="n">conf</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;Get the Yum object with settings from the config file</span> <span class="sd">&quot;&quot;&quot;Get the Yum object with settings from the config file</span>
@ -156,6 +226,32 @@
<span class="k">if</span> <span class="nb">any</span><span class="p">(</span><span class="nb">map</span><span class="p">(</span><span class="k">lambda</span> <span class="n">pattern</span><span class="p">:</span> <span class="n">fnmatchcase</span><span class="p">(</span><span class="n">name</span><span class="p">,</span> <span class="n">pattern</span><span class="p">),</span> <span class="n">enabled_repos</span><span class="p">)):</span> <span class="c"># pylint: disable=cell-var-from-loop</span> <span class="k">if</span> <span class="nb">any</span><span class="p">(</span><span class="nb">map</span><span class="p">(</span><span class="k">lambda</span> <span class="n">pattern</span><span class="p">:</span> <span class="n">fnmatchcase</span><span class="p">(</span><span class="n">name</span><span class="p">,</span> <span class="n">pattern</span><span class="p">),</span> <span class="n">enabled_repos</span><span class="p">)):</span> <span class="c"># pylint: disable=cell-var-from-loop</span>
<span class="n">yb</span><span class="o">.</span><span class="n">getReposFromConfigFile</span><span class="p">(</span><span class="n">repo_file</span><span class="p">)</span> <span class="n">yb</span><span class="o">.</span><span class="n">getReposFromConfigFile</span><span class="p">(</span><span class="n">repo_file</span><span class="p">)</span>
<span class="c"># Remove any duplicate repo entries. These can cause problems with Anaconda, which will fail</span>
<span class="c"># with space problems.</span>
<span class="n">repos</span> <span class="o">=</span> <span class="nb">list</span><span class="p">(</span><span class="n">r</span><span class="o">.</span><span class="n">id</span> <span class="k">for</span> <span class="n">r</span> <span class="ow">in</span> <span class="n">yb</span><span class="o">.</span><span class="n">repos</span><span class="o">.</span><span class="n">listEnabled</span><span class="p">())</span>
<span class="n">seen</span> <span class="o">=</span> <span class="p">{</span><span class="s">&quot;baseurl&quot;</span><span class="p">:</span> <span class="p">[],</span> <span class="s">&quot;mirrorlist&quot;</span><span class="p">:</span> <span class="p">[],</span> <span class="s">&quot;metalink&quot;</span><span class="p">:</span> <span class="p">[]}</span>
<span class="k">for</span> <span class="n">source_name</span> <span class="ow">in</span> <span class="n">repos</span><span class="p">:</span>
<span class="n">remove</span> <span class="o">=</span> <span class="bp">False</span>
<span class="n">repo</span> <span class="o">=</span> <span class="n">yb</span><span class="o">.</span><span class="n">repos</span><span class="o">.</span><span class="n">getRepo</span><span class="p">(</span><span class="n">source_name</span><span class="p">)</span>
<span class="k">if</span> <span class="n">repo</span><span class="o">.</span><span class="n">baseurl</span><span class="p">:</span>
<span class="k">if</span> <span class="n">repo</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="ow">in</span> <span class="n">seen</span><span class="p">[</span><span class="s">&quot;baseurl&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="s">&quot;Removing duplicate repo: </span><span class="si">%s</span><span class="s"> baseurl=</span><span class="si">%s</span><span class="s">&quot;</span><span class="p">,</span> <span class="n">source_name</span><span class="p">,</span> <span class="n">repo</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="n">remove</span> <span class="o">=</span> <span class="bp">True</span>
<span class="k">else</span><span class="p">:</span>
<span class="n">seen</span><span class="p">[</span><span class="s">&quot;baseurl&quot;</span><span class="p">]</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">repo</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">repo</span><span class="o">.</span><span class="n">mirrorlist</span><span class="p">:</span>
<span class="k">if</span> <span class="n">repo</span><span class="o">.</span><span class="n">mirrorlist</span> <span class="ow">in</span> <span class="n">seen</span><span class="p">[</span><span class="s">&quot;mirrorlist&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="s">&quot;Removing duplicate repo: </span><span class="si">%s</span><span class="s"> mirrorlist=</span><span class="si">%s</span><span class="s">&quot;</span><span class="p">,</span> <span class="n">source_name</span><span class="p">,</span> <span class="n">repo</span><span class="o">.</span><span class="n">mirrorlist</span><span class="p">)</span>
<span class="n">remove</span> <span class="o">=</span> <span class="bp">True</span>
<span class="k">else</span><span class="p">:</span>
<span class="n">seen</span><span class="p">[</span><span class="s">&quot;mirrorlist&quot;</span><span class="p">]</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">repo</span><span class="o">.</span><span class="n">mirrorlist</span><span class="p">)</span>
<span class="k">if</span> <span class="n">remove</span><span class="p">:</span>
<span class="n">yb</span><span class="o">.</span><span class="n">repos</span><span class="o">.</span><span class="n">delete</span><span class="p">(</span><span class="n">source_name</span><span class="p">)</span>
<span class="c"># delete doesn&#39;t remove it from the cache used by listEnabled so we have to force it</span>
<span class="n">yb</span><span class="o">.</span><span class="n">repos</span><span class="o">.</span><span class="n">_cache_enabled_repos</span> <span class="o">=</span> <span class="bp">None</span>
<span class="c"># Update the metadata from the enabled repos to speed up later operations</span> <span class="c"># Update the metadata from the enabled repos to speed up later operations</span>
<span class="n">log</span><span class="o">.</span><span class="n">info</span><span class="p">(</span><span class="s">&quot;Updating yum repository metadata&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="s">&quot;Updating yum repository metadata&quot;</span><span class="p">)</span>
<span class="n">update_metadata</span><span class="p">(</span><span class="n">yb</span><span class="p">)</span> <span class="n">update_metadata</span><span class="p">(</span><span class="n">yb</span><span class="p">)</span>
@ -213,7 +309,7 @@
<li class="right" > <li class="right" >
<a href="../../../py-modindex.html" title="Python Module Index" <a href="../../../py-modindex.html" title="Python Module Index"
>modules</a> |</li> >modules</a> |</li>
<li><a href="../../../index.html">Lorax 19.7.22 documentation</a> &raquo;</li> <li><a href="../../../index.html">Lorax 19.7.43 documentation</a> &raquo;</li>
<li><a href="../../index.html" >Module code</a> &raquo;</li> <li><a href="../../index.html" >Module code</a> &raquo;</li>
<li><a href="../../pylorax.html" >pylorax</a> &raquo;</li> <li><a href="../../pylorax.html" >pylorax</a> &raquo;</li>
<li><a href="../api.html" >pylorax.api</a> &raquo;</li> <li><a href="../api.html" >pylorax.api</a> &raquo;</li>

View File

@ -8,7 +8,7 @@
<head> <head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>pylorax.base &mdash; Lorax 19.7.22 documentation</title> <title>pylorax.base &mdash; Lorax 19.7.43 documentation</title>
<link rel="stylesheet" href="../../_static/default.css" type="text/css" /> <link rel="stylesheet" href="../../_static/default.css" type="text/css" />
<link rel="stylesheet" href="../../_static/pygments.css" type="text/css" /> <link rel="stylesheet" href="../../_static/pygments.css" type="text/css" />
@ -16,7 +16,7 @@
<script type="text/javascript"> <script type="text/javascript">
var DOCUMENTATION_OPTIONS = { var DOCUMENTATION_OPTIONS = {
URL_ROOT: '../../', URL_ROOT: '../../',
VERSION: '19.7.22', VERSION: '19.7.43',
COLLAPSE_INDEX: false, COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html', FILE_SUFFIX: '.html',
HAS_SOURCE: true HAS_SOURCE: true
@ -25,7 +25,7 @@
<script type="text/javascript" src="../../_static/jquery.js"></script> <script type="text/javascript" src="../../_static/jquery.js"></script>
<script type="text/javascript" src="../../_static/underscore.js"></script> <script type="text/javascript" src="../../_static/underscore.js"></script>
<script type="text/javascript" src="../../_static/doctools.js"></script> <script type="text/javascript" src="../../_static/doctools.js"></script>
<link rel="top" title="Lorax 19.7.22 documentation" href="../../index.html" /> <link rel="top" title="Lorax 19.7.43 documentation" href="../../index.html" />
<link rel="up" title="pylorax" href="../pylorax.html" /> <link rel="up" title="pylorax" href="../pylorax.html" />
</head> </head>
<body> <body>
@ -38,7 +38,7 @@
<li class="right" > <li class="right" >
<a href="../../py-modindex.html" title="Python Module Index" <a href="../../py-modindex.html" title="Python Module Index"
>modules</a> |</li> >modules</a> |</li>
<li><a href="../../index.html">Lorax 19.7.22 documentation</a> &raquo;</li> <li><a href="../../index.html">Lorax 19.7.43 documentation</a> &raquo;</li>
<li><a href="../index.html" >Module code</a> &raquo;</li> <li><a href="../index.html" >Module code</a> &raquo;</li>
<li><a href="../pylorax.html" accesskey="U">pylorax</a> &raquo;</li> <li><a href="../pylorax.html" accesskey="U">pylorax</a> &raquo;</li>
</ul> </ul>
@ -150,7 +150,7 @@
<li class="right" > <li class="right" >
<a href="../../py-modindex.html" title="Python Module Index" <a href="../../py-modindex.html" title="Python Module Index"
>modules</a> |</li> >modules</a> |</li>
<li><a href="../../index.html">Lorax 19.7.22 documentation</a> &raquo;</li> <li><a href="../../index.html">Lorax 19.7.43 documentation</a> &raquo;</li>
<li><a href="../index.html" >Module code</a> &raquo;</li> <li><a href="../index.html" >Module code</a> &raquo;</li>
<li><a href="../pylorax.html" >pylorax</a> &raquo;</li> <li><a href="../pylorax.html" >pylorax</a> &raquo;</li>
</ul> </ul>

View File

@ -8,7 +8,7 @@
<head> <head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>pylorax.buildstamp &mdash; Lorax 19.7.22 documentation</title> <title>pylorax.buildstamp &mdash; Lorax 19.7.43 documentation</title>
<link rel="stylesheet" href="../../_static/default.css" type="text/css" /> <link rel="stylesheet" href="../../_static/default.css" type="text/css" />
<link rel="stylesheet" href="../../_static/pygments.css" type="text/css" /> <link rel="stylesheet" href="../../_static/pygments.css" type="text/css" />
@ -16,7 +16,7 @@
<script type="text/javascript"> <script type="text/javascript">
var DOCUMENTATION_OPTIONS = { var DOCUMENTATION_OPTIONS = {
URL_ROOT: '../../', URL_ROOT: '../../',
VERSION: '19.7.22', VERSION: '19.7.43',
COLLAPSE_INDEX: false, COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html', FILE_SUFFIX: '.html',
HAS_SOURCE: true HAS_SOURCE: true
@ -25,7 +25,7 @@
<script type="text/javascript" src="../../_static/jquery.js"></script> <script type="text/javascript" src="../../_static/jquery.js"></script>
<script type="text/javascript" src="../../_static/underscore.js"></script> <script type="text/javascript" src="../../_static/underscore.js"></script>
<script type="text/javascript" src="../../_static/doctools.js"></script> <script type="text/javascript" src="../../_static/doctools.js"></script>
<link rel="top" title="Lorax 19.7.22 documentation" href="../../index.html" /> <link rel="top" title="Lorax 19.7.43 documentation" href="../../index.html" />
<link rel="up" title="pylorax" href="../pylorax.html" /> <link rel="up" title="pylorax" href="../pylorax.html" />
</head> </head>
<body> <body>
@ -38,7 +38,7 @@
<li class="right" > <li class="right" >
<a href="../../py-modindex.html" title="Python Module Index" <a href="../../py-modindex.html" title="Python Module Index"
>modules</a> |</li> >modules</a> |</li>
<li><a href="../../index.html">Lorax 19.7.22 documentation</a> &raquo;</li> <li><a href="../../index.html">Lorax 19.7.43 documentation</a> &raquo;</li>
<li><a href="../index.html" >Module code</a> &raquo;</li> <li><a href="../index.html" >Module code</a> &raquo;</li>
<li><a href="../pylorax.html" accesskey="U">pylorax</a> &raquo;</li> <li><a href="../pylorax.html" accesskey="U">pylorax</a> &raquo;</li>
</ul> </ul>
@ -141,7 +141,7 @@
<li class="right" > <li class="right" >
<a href="../../py-modindex.html" title="Python Module Index" <a href="../../py-modindex.html" title="Python Module Index"
>modules</a> |</li> >modules</a> |</li>
<li><a href="../../index.html">Lorax 19.7.22 documentation</a> &raquo;</li> <li><a href="../../index.html">Lorax 19.7.43 documentation</a> &raquo;</li>
<li><a href="../index.html" >Module code</a> &raquo;</li> <li><a href="../index.html" >Module code</a> &raquo;</li>
<li><a href="../pylorax.html" >pylorax</a> &raquo;</li> <li><a href="../pylorax.html" >pylorax</a> &raquo;</li>
</ul> </ul>

View File

@ -8,7 +8,7 @@
<head> <head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>pylorax.creator &mdash; Lorax 19.7.22 documentation</title> <title>pylorax.creator &mdash; Lorax 19.7.43 documentation</title>
<link rel="stylesheet" href="../../_static/default.css" type="text/css" /> <link rel="stylesheet" href="../../_static/default.css" type="text/css" />
<link rel="stylesheet" href="../../_static/pygments.css" type="text/css" /> <link rel="stylesheet" href="../../_static/pygments.css" type="text/css" />
@ -16,7 +16,7 @@
<script type="text/javascript"> <script type="text/javascript">
var DOCUMENTATION_OPTIONS = { var DOCUMENTATION_OPTIONS = {
URL_ROOT: '../../', URL_ROOT: '../../',
VERSION: '19.7.22', VERSION: '19.7.43',
COLLAPSE_INDEX: false, COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html', FILE_SUFFIX: '.html',
HAS_SOURCE: true HAS_SOURCE: true
@ -25,7 +25,7 @@
<script type="text/javascript" src="../../_static/jquery.js"></script> <script type="text/javascript" src="../../_static/jquery.js"></script>
<script type="text/javascript" src="../../_static/underscore.js"></script> <script type="text/javascript" src="../../_static/underscore.js"></script>
<script type="text/javascript" src="../../_static/doctools.js"></script> <script type="text/javascript" src="../../_static/doctools.js"></script>
<link rel="top" title="Lorax 19.7.22 documentation" href="../../index.html" /> <link rel="top" title="Lorax 19.7.43 documentation" href="../../index.html" />
<link rel="up" title="pylorax" href="../pylorax.html" /> <link rel="up" title="pylorax" href="../pylorax.html" />
</head> </head>
<body> <body>
@ -38,7 +38,7 @@
<li class="right" > <li class="right" >
<a href="../../py-modindex.html" title="Python Module Index" <a href="../../py-modindex.html" title="Python Module Index"
>modules</a> |</li> >modules</a> |</li>
<li><a href="../../index.html">Lorax 19.7.22 documentation</a> &raquo;</li> <li><a href="../../index.html">Lorax 19.7.43 documentation</a> &raquo;</li>
<li><a href="../index.html" >Module code</a> &raquo;</li> <li><a href="../index.html" >Module code</a> &raquo;</li>
<li><a href="../pylorax.html" accesskey="U">pylorax</a> &raquo;</li> <li><a href="../pylorax.html" accesskey="U">pylorax</a> &raquo;</li>
</ul> </ul>
@ -97,7 +97,7 @@
<span class="n">RUNTIME</span> <span class="o">=</span> <span class="s">&quot;images/install.img&quot;</span> <span class="n">RUNTIME</span> <span class="o">=</span> <span class="s">&quot;images/install.img&quot;</span>
<span class="c"># Default parameters for rebuilding initramfs, override with --dracut-args</span> <span class="c"># Default parameters for rebuilding initramfs, override with --dracut-arg</span>
<span class="n">DRACUT_DEFAULT</span> <span class="o">=</span> <span class="p">[</span><span class="s">&quot;--xz&quot;</span><span class="p">,</span> <span class="s">&quot;--add&quot;</span><span class="p">,</span> <span class="s">&quot;livenet dmsquash-live convertfs pollcdrom&quot;</span><span class="p">,</span> <span class="n">DRACUT_DEFAULT</span> <span class="o">=</span> <span class="p">[</span><span class="s">&quot;--xz&quot;</span><span class="p">,</span> <span class="s">&quot;--add&quot;</span><span class="p">,</span> <span class="s">&quot;livenet dmsquash-live convertfs pollcdrom&quot;</span><span class="p">,</span>
<span class="s">&quot;--omit&quot;</span><span class="p">,</span> <span class="s">&quot;plymouth&quot;</span><span class="p">,</span> <span class="s">&quot;--no-hostonly&quot;</span><span class="p">,</span> <span class="s">&quot;--no-early-microcode&quot;</span><span class="p">]</span> <span class="s">&quot;--omit&quot;</span><span class="p">,</span> <span class="s">&quot;plymouth&quot;</span><span class="p">,</span> <span class="s">&quot;--no-hostonly&quot;</span><span class="p">,</span> <span class="s">&quot;--no-early-microcode&quot;</span><span class="p">]</span>
@ -393,7 +393,8 @@
<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">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">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">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="s">&quot;live/&quot;</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="s">&quot;live/&quot;</span><span class="p">),</span>
<span class="n">extra_boot_args</span><span class="o">=</span><span class="n">opts</span><span class="o">.</span><span class="n">extra_boot_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="s">&quot;Rebuilding initrds&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="s">&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="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="n">dracut_args</span> <span class="o">=</span> <span class="n">DRACUT_DEFAULT</span>
@ -457,7 +458,7 @@
<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="s">&quot;runtime&quot;</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="s">&quot;runtime&quot;</span><span class="p">))</span>
</div> </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="n">callback_func</span><span class="o">=</span><span class="bp">None</span><span class="p">):</span> <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="n">cancel_func</span><span class="o">=</span><span class="bp">None</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;</span> <span class="sd">&quot;&quot;&quot;</span>
<span class="sd"> Install to an image</span> <span class="sd"> Install to an image</span>
@ -475,12 +476,12 @@
<span class="k">try</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="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="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">url</span><span class="p">,</span> <span class="n">callback_func</span><span class="o">=</span><span class="n">callback_func</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="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">url</span><span class="p">,</span> <span class="n">cancel_func</span><span class="o">=</span><span class="n">cancel_func</span><span class="p">)</span>
<span class="k">else</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="s">&quot;/virt-install.log&quot;</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="s">&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="s">&quot;install_log = </span><span class="si">%s</span><span class="s">&quot;</span><span class="p">,</span> <span class="n">install_log</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="s">&quot;install_log = </span><span class="si">%s</span><span class="s">&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="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="n">cancel_func</span><span class="o">=</span><span class="n">cancel_func</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="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="s">&quot;Install failed: </span><span class="si">%s</span><span class="s">&quot;</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">error</span><span class="p">(</span><span class="s">&quot;Install failed: </span><span class="si">%s</span><span class="s">&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="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="p">:</span>
@ -541,7 +542,7 @@
<span class="k">return</span> <span class="n">work_dir</span> <span class="k">return</span> <span class="n">work_dir</span>
</div> </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="bp">None</span><span class="p">):</span> <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">cancel_func</span><span class="o">=</span><span class="bp">None</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;Run the image creator process</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"> :param opts: Commandline options to control the process</span>
@ -589,7 +590,10 @@
<span class="c"># Make the image. Output of this is either a partitioned disk image or a fsimage</span> <span class="c"># Make the image. Output of this is either a partitioned disk image or a fsimage</span>
<span class="c"># Can also fail with InstallError</span> <span class="c"># Can also fail with InstallError</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="n">callback_func</span><span class="o">=</span><span class="n">callback_func</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="n">cancel_func</span><span class="o">=</span><span class="n">cancel_func</span><span class="p">)</span>
<span class="k">if</span> <span class="n">cancel_func</span> <span class="ow">and</span> <span class="n">cancel_func</span><span class="p">():</span>
<span class="k">raise</span> <span class="ne">RuntimeError</span><span class="p">(</span><span class="s">&quot;image creation canceled&quot;</span><span class="p">)</span>
<span class="c"># Only create the disk image, return that now</span> <span class="c"># Only create the disk image, return that now</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">if</span> <span class="n">opts</span><span class="o">.</span><span class="n">image_only</span><span class="p">:</span>
@ -604,6 +608,10 @@
<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="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="n">make_squashfs</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">make_squashfs</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="k">if</span> <span class="n">cancel_func</span> <span class="ow">and</span> <span class="n">cancel_func</span><span class="p">():</span>
<span class="k">raise</span> <span class="ne">RuntimeError</span><span class="p">(</span><span class="s">&quot;ISO creation canceled&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="s">&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="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="s">&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="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="k">else</span><span class="p">:</span>
@ -697,7 +705,7 @@
<li class="right" > <li class="right" >
<a href="../../py-modindex.html" title="Python Module Index" <a href="../../py-modindex.html" title="Python Module Index"
>modules</a> |</li> >modules</a> |</li>
<li><a href="../../index.html">Lorax 19.7.22 documentation</a> &raquo;</li> <li><a href="../../index.html">Lorax 19.7.43 documentation</a> &raquo;</li>
<li><a href="../index.html" >Module code</a> &raquo;</li> <li><a href="../index.html" >Module code</a> &raquo;</li>
<li><a href="../pylorax.html" >pylorax</a> &raquo;</li> <li><a href="../pylorax.html" >pylorax</a> &raquo;</li>
</ul> </ul>

View File

@ -8,7 +8,7 @@
<head> <head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>pylorax.decorators &mdash; Lorax 19.7.22 documentation</title> <title>pylorax.decorators &mdash; Lorax 19.7.43 documentation</title>
<link rel="stylesheet" href="../../_static/default.css" type="text/css" /> <link rel="stylesheet" href="../../_static/default.css" type="text/css" />
<link rel="stylesheet" href="../../_static/pygments.css" type="text/css" /> <link rel="stylesheet" href="../../_static/pygments.css" type="text/css" />
@ -16,7 +16,7 @@
<script type="text/javascript"> <script type="text/javascript">
var DOCUMENTATION_OPTIONS = { var DOCUMENTATION_OPTIONS = {
URL_ROOT: '../../', URL_ROOT: '../../',
VERSION: '19.7.22', VERSION: '19.7.43',
COLLAPSE_INDEX: false, COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html', FILE_SUFFIX: '.html',
HAS_SOURCE: true HAS_SOURCE: true
@ -25,7 +25,7 @@
<script type="text/javascript" src="../../_static/jquery.js"></script> <script type="text/javascript" src="../../_static/jquery.js"></script>
<script type="text/javascript" src="../../_static/underscore.js"></script> <script type="text/javascript" src="../../_static/underscore.js"></script>
<script type="text/javascript" src="../../_static/doctools.js"></script> <script type="text/javascript" src="../../_static/doctools.js"></script>
<link rel="top" title="Lorax 19.7.22 documentation" href="../../index.html" /> <link rel="top" title="Lorax 19.7.43 documentation" href="../../index.html" />
<link rel="up" title="pylorax" href="../pylorax.html" /> <link rel="up" title="pylorax" href="../pylorax.html" />
</head> </head>
<body> <body>
@ -38,7 +38,7 @@
<li class="right" > <li class="right" >
<a href="../../py-modindex.html" title="Python Module Index" <a href="../../py-modindex.html" title="Python Module Index"
>modules</a> |</li> >modules</a> |</li>
<li><a href="../../index.html">Lorax 19.7.22 documentation</a> &raquo;</li> <li><a href="../../index.html">Lorax 19.7.43 documentation</a> &raquo;</li>
<li><a href="../index.html" >Module code</a> &raquo;</li> <li><a href="../index.html" >Module code</a> &raquo;</li>
<li><a href="../pylorax.html" accesskey="U">pylorax</a> &raquo;</li> <li><a href="../pylorax.html" accesskey="U">pylorax</a> &raquo;</li>
</ul> </ul>
@ -113,7 +113,7 @@
<li class="right" > <li class="right" >
<a href="../../py-modindex.html" title="Python Module Index" <a href="../../py-modindex.html" title="Python Module Index"
>modules</a> |</li> >modules</a> |</li>
<li><a href="../../index.html">Lorax 19.7.22 documentation</a> &raquo;</li> <li><a href="../../index.html">Lorax 19.7.43 documentation</a> &raquo;</li>
<li><a href="../index.html" >Module code</a> &raquo;</li> <li><a href="../index.html" >Module code</a> &raquo;</li>
<li><a href="../pylorax.html" >pylorax</a> &raquo;</li> <li><a href="../pylorax.html" >pylorax</a> &raquo;</li>
</ul> </ul>

View File

@ -8,7 +8,7 @@
<head> <head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>pylorax.discinfo &mdash; Lorax 19.7.22 documentation</title> <title>pylorax.discinfo &mdash; Lorax 19.7.43 documentation</title>
<link rel="stylesheet" href="../../_static/default.css" type="text/css" /> <link rel="stylesheet" href="../../_static/default.css" type="text/css" />
<link rel="stylesheet" href="../../_static/pygments.css" type="text/css" /> <link rel="stylesheet" href="../../_static/pygments.css" type="text/css" />
@ -16,7 +16,7 @@
<script type="text/javascript"> <script type="text/javascript">
var DOCUMENTATION_OPTIONS = { var DOCUMENTATION_OPTIONS = {
URL_ROOT: '../../', URL_ROOT: '../../',
VERSION: '19.7.22', VERSION: '19.7.43',
COLLAPSE_INDEX: false, COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html', FILE_SUFFIX: '.html',
HAS_SOURCE: true HAS_SOURCE: true
@ -25,7 +25,7 @@
<script type="text/javascript" src="../../_static/jquery.js"></script> <script type="text/javascript" src="../../_static/jquery.js"></script>
<script type="text/javascript" src="../../_static/underscore.js"></script> <script type="text/javascript" src="../../_static/underscore.js"></script>
<script type="text/javascript" src="../../_static/doctools.js"></script> <script type="text/javascript" src="../../_static/doctools.js"></script>
<link rel="top" title="Lorax 19.7.22 documentation" href="../../index.html" /> <link rel="top" title="Lorax 19.7.43 documentation" href="../../index.html" />
<link rel="up" title="pylorax" href="../pylorax.html" /> <link rel="up" title="pylorax" href="../pylorax.html" />
</head> </head>
<body> <body>
@ -38,7 +38,7 @@
<li class="right" > <li class="right" >
<a href="../../py-modindex.html" title="Python Module Index" <a href="../../py-modindex.html" title="Python Module Index"
>modules</a> |</li> >modules</a> |</li>
<li><a href="../../index.html">Lorax 19.7.22 documentation</a> &raquo;</li> <li><a href="../../index.html">Lorax 19.7.43 documentation</a> &raquo;</li>
<li><a href="../index.html" >Module code</a> &raquo;</li> <li><a href="../index.html" >Module code</a> &raquo;</li>
<li><a href="../pylorax.html" accesskey="U">pylorax</a> &raquo;</li> <li><a href="../pylorax.html" accesskey="U">pylorax</a> &raquo;</li>
</ul> </ul>
@ -122,7 +122,7 @@
<li class="right" > <li class="right" >
<a href="../../py-modindex.html" title="Python Module Index" <a href="../../py-modindex.html" title="Python Module Index"
>modules</a> |</li> >modules</a> |</li>
<li><a href="../../index.html">Lorax 19.7.22 documentation</a> &raquo;</li> <li><a href="../../index.html">Lorax 19.7.43 documentation</a> &raquo;</li>
<li><a href="../index.html" >Module code</a> &raquo;</li> <li><a href="../index.html" >Module code</a> &raquo;</li>
<li><a href="../pylorax.html" >pylorax</a> &raquo;</li> <li><a href="../pylorax.html" >pylorax</a> &raquo;</li>
</ul> </ul>

View File

@ -8,7 +8,7 @@
<head> <head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>pylorax.executils &mdash; Lorax 19.7.22 documentation</title> <title>pylorax.executils &mdash; Lorax 19.7.43 documentation</title>
<link rel="stylesheet" href="../../_static/default.css" type="text/css" /> <link rel="stylesheet" href="../../_static/default.css" type="text/css" />
<link rel="stylesheet" href="../../_static/pygments.css" type="text/css" /> <link rel="stylesheet" href="../../_static/pygments.css" type="text/css" />
@ -16,7 +16,7 @@
<script type="text/javascript"> <script type="text/javascript">
var DOCUMENTATION_OPTIONS = { var DOCUMENTATION_OPTIONS = {
URL_ROOT: '../../', URL_ROOT: '../../',
VERSION: '19.7.22', VERSION: '19.7.43',
COLLAPSE_INDEX: false, COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html', FILE_SUFFIX: '.html',
HAS_SOURCE: true HAS_SOURCE: true
@ -25,7 +25,7 @@
<script type="text/javascript" src="../../_static/jquery.js"></script> <script type="text/javascript" src="../../_static/jquery.js"></script>
<script type="text/javascript" src="../../_static/underscore.js"></script> <script type="text/javascript" src="../../_static/underscore.js"></script>
<script type="text/javascript" src="../../_static/doctools.js"></script> <script type="text/javascript" src="../../_static/doctools.js"></script>
<link rel="top" title="Lorax 19.7.22 documentation" href="../../index.html" /> <link rel="top" title="Lorax 19.7.43 documentation" href="../../index.html" />
<link rel="up" title="pylorax" href="../pylorax.html" /> <link rel="up" title="pylorax" href="../pylorax.html" />
</head> </head>
<body> <body>
@ -38,7 +38,7 @@
<li class="right" > <li class="right" >
<a href="../../py-modindex.html" title="Python Module Index" <a href="../../py-modindex.html" title="Python Module Index"
>modules</a> |</li> >modules</a> |</li>
<li><a href="../../index.html">Lorax 19.7.22 documentation</a> &raquo;</li> <li><a href="../../index.html">Lorax 19.7.43 documentation</a> &raquo;</li>
<li><a href="../index.html" >Module code</a> &raquo;</li> <li><a href="../index.html" >Module code</a> &raquo;</li>
<li><a href="../pylorax.html" accesskey="U">pylorax</a> &raquo;</li> <li><a href="../pylorax.html" accesskey="U">pylorax</a> &raquo;</li>
</ul> </ul>
@ -508,7 +508,7 @@
<li class="right" > <li class="right" >
<a href="../../py-modindex.html" title="Python Module Index" <a href="../../py-modindex.html" title="Python Module Index"
>modules</a> |</li> >modules</a> |</li>
<li><a href="../../index.html">Lorax 19.7.22 documentation</a> &raquo;</li> <li><a href="../../index.html">Lorax 19.7.43 documentation</a> &raquo;</li>
<li><a href="../index.html" >Module code</a> &raquo;</li> <li><a href="../index.html" >Module code</a> &raquo;</li>
<li><a href="../pylorax.html" >pylorax</a> &raquo;</li> <li><a href="../pylorax.html" >pylorax</a> &raquo;</li>
</ul> </ul>

View File

@ -8,7 +8,7 @@
<head> <head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>pylorax.imgutils &mdash; Lorax 19.7.22 documentation</title> <title>pylorax.imgutils &mdash; Lorax 19.7.43 documentation</title>
<link rel="stylesheet" href="../../_static/default.css" type="text/css" /> <link rel="stylesheet" href="../../_static/default.css" type="text/css" />
<link rel="stylesheet" href="../../_static/pygments.css" type="text/css" /> <link rel="stylesheet" href="../../_static/pygments.css" type="text/css" />
@ -16,7 +16,7 @@
<script type="text/javascript"> <script type="text/javascript">
var DOCUMENTATION_OPTIONS = { var DOCUMENTATION_OPTIONS = {
URL_ROOT: '../../', URL_ROOT: '../../',
VERSION: '19.7.22', VERSION: '19.7.43',
COLLAPSE_INDEX: false, COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html', FILE_SUFFIX: '.html',
HAS_SOURCE: true HAS_SOURCE: true
@ -25,7 +25,7 @@
<script type="text/javascript" src="../../_static/jquery.js"></script> <script type="text/javascript" src="../../_static/jquery.js"></script>
<script type="text/javascript" src="../../_static/underscore.js"></script> <script type="text/javascript" src="../../_static/underscore.js"></script>
<script type="text/javascript" src="../../_static/doctools.js"></script> <script type="text/javascript" src="../../_static/doctools.js"></script>
<link rel="top" title="Lorax 19.7.22 documentation" href="../../index.html" /> <link rel="top" title="Lorax 19.7.43 documentation" href="../../index.html" />
<link rel="up" title="pylorax" href="../pylorax.html" /> <link rel="up" title="pylorax" href="../pylorax.html" />
</head> </head>
<body> <body>
@ -38,7 +38,7 @@
<li class="right" > <li class="right" >
<a href="../../py-modindex.html" title="Python Module Index" <a href="../../py-modindex.html" title="Python Module Index"
>modules</a> |</li> >modules</a> |</li>
<li><a href="../../index.html">Lorax 19.7.22 documentation</a> &raquo;</li> <li><a href="../../index.html">Lorax 19.7.43 documentation</a> &raquo;</li>
<li><a href="../index.html" >Module code</a> &raquo;</li> <li><a href="../index.html" >Module code</a> &raquo;</li>
<li><a href="../pylorax.html" accesskey="U">pylorax</a> &raquo;</li> <li><a href="../pylorax.html" accesskey="U">pylorax</a> &raquo;</li>
</ul> </ul>
@ -241,7 +241,7 @@
<span class="k">except</span> <span class="n">CalledProcessError</span><span class="p">:</span> <span class="k">except</span> <span class="n">CalledProcessError</span><span class="p">:</span>
<span class="c"># Problems running losetup are always errors, raise immediately</span> <span class="c"># Problems running losetup are always errors, raise immediately</span>
<span class="k">raise</span> <span class="k">raise</span>
<span class="k">except</span> <span class="ne">RuntimeError</span> <span class="k">as</span> <span class="n">e</span><span class="p">:</span> <span class="k">except</span> <span class="ne">RuntimeError</span><span class="p">:</span>
<span class="c"># Try to setup the loop device 3 times</span> <span class="c"># Try to setup the loop device 3 times</span>
<span class="k">if</span> <span class="n">retries</span> <span class="o">==</span> <span class="mi">3</span><span class="p">:</span> <span class="k">if</span> <span class="n">retries</span> <span class="o">==</span> <span class="mi">3</span><span class="p">:</span>
<span class="n">logger</span><span class="o">.</span><span class="n">error</span><span class="p">(</span><span class="s">&quot;loop_attach failed, retries exhausted.&quot;</span><span class="p">)</span> <span class="n">logger</span><span class="o">.</span><span class="n">error</span><span class="p">(</span><span class="s">&quot;loop_attach failed, retries exhausted.&quot;</span><span class="p">)</span>
@ -569,7 +569,7 @@
<li class="right" > <li class="right" >
<a href="../../py-modindex.html" title="Python Module Index" <a href="../../py-modindex.html" title="Python Module Index"
>modules</a> |</li> >modules</a> |</li>
<li><a href="../../index.html">Lorax 19.7.22 documentation</a> &raquo;</li> <li><a href="../../index.html">Lorax 19.7.43 documentation</a> &raquo;</li>
<li><a href="../index.html" >Module code</a> &raquo;</li> <li><a href="../index.html" >Module code</a> &raquo;</li>
<li><a href="../pylorax.html" >pylorax</a> &raquo;</li> <li><a href="../pylorax.html" >pylorax</a> &raquo;</li>
</ul> </ul>

View File

@ -8,7 +8,7 @@
<head> <head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>pylorax.installer &mdash; Lorax 19.7.22 documentation</title> <title>pylorax.installer &mdash; Lorax 19.7.43 documentation</title>
<link rel="stylesheet" href="../../_static/default.css" type="text/css" /> <link rel="stylesheet" href="../../_static/default.css" type="text/css" />
<link rel="stylesheet" href="../../_static/pygments.css" type="text/css" /> <link rel="stylesheet" href="../../_static/pygments.css" type="text/css" />
@ -16,7 +16,7 @@
<script type="text/javascript"> <script type="text/javascript">
var DOCUMENTATION_OPTIONS = { var DOCUMENTATION_OPTIONS = {
URL_ROOT: '../../', URL_ROOT: '../../',
VERSION: '19.7.22', VERSION: '19.7.43',
COLLAPSE_INDEX: false, COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html', FILE_SUFFIX: '.html',
HAS_SOURCE: true HAS_SOURCE: true
@ -25,7 +25,7 @@
<script type="text/javascript" src="../../_static/jquery.js"></script> <script type="text/javascript" src="../../_static/jquery.js"></script>
<script type="text/javascript" src="../../_static/underscore.js"></script> <script type="text/javascript" src="../../_static/underscore.js"></script>
<script type="text/javascript" src="../../_static/doctools.js"></script> <script type="text/javascript" src="../../_static/doctools.js"></script>
<link rel="top" title="Lorax 19.7.22 documentation" href="../../index.html" /> <link rel="top" title="Lorax 19.7.43 documentation" href="../../index.html" />
<link rel="up" title="pylorax" href="../pylorax.html" /> <link rel="up" title="pylorax" href="../pylorax.html" />
</head> </head>
<body> <body>
@ -38,7 +38,7 @@
<li class="right" > <li class="right" >
<a href="../../py-modindex.html" title="Python Module Index" <a href="../../py-modindex.html" title="Python Module Index"
>modules</a> |</li> >modules</a> |</li>
<li><a href="../../index.html">Lorax 19.7.22 documentation</a> &raquo;</li> <li><a href="../../index.html">Lorax 19.7.43 documentation</a> &raquo;</li>
<li><a href="../index.html" >Module code</a> &raquo;</li> <li><a href="../index.html" >Module code</a> &raquo;</li>
<li><a href="../pylorax.html" accesskey="U">pylorax</a> &raquo;</li> <li><a href="../pylorax.html" accesskey="U">pylorax</a> &raquo;</li>
</ul> </ul>
@ -70,6 +70,7 @@
<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="s">&quot;pylorax&quot;</span><span class="p">)</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="s">&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">os</span>
<span class="kn">import</span> <span class="nn">glob</span>
<span class="kn">import</span> <span class="nn">shutil</span> <span class="kn">import</span> <span class="nn">shutil</span>
<span class="kn">import</span> <span class="nn">sys</span> <span class="kn">import</span> <span class="nn">sys</span>
<span class="kn">import</span> <span class="nn">subprocess</span> <span class="kn">import</span> <span class="nn">subprocess</span>
@ -168,7 +169,7 @@
<span class="sd"> &quot;&quot;&quot;</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">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">2</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">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">2</span><span class="p">,</span>
<span class="n">kernel_args</span><span class="o">=</span><span class="bp">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">vnc</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span> <span class="n">arch</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span> <span class="n">kernel_args</span><span class="o">=</span><span class="bp">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">vnc</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span> <span class="n">arch</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span>
<span class="n">log_check</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span> <span class="n">virtio_host</span><span class="o">=</span><span class="s">&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">cancel_func</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span> <span class="n">virtio_host</span><span class="o">=</span><span class="s">&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">qcow2</span><span class="o">=</span><span class="bp">False</span><span class="p">,</span> <span class="n">boot_uefi</span><span class="o">=</span><span class="bp">False</span><span class="p">,</span> <span class="n">ovmf_path</span><span class="o">=</span><span class="bp">None</span><span class="p">):</span> <span class="n">qcow2</span><span class="o">=</span><span class="bp">False</span><span class="p">,</span> <span class="n">boot_uefi</span><span class="o">=</span><span class="bp">False</span><span class="p">,</span> <span class="n">ovmf_path</span><span class="o">=</span><span class="bp">None</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;</span> <span class="sd">&quot;&quot;&quot;</span>
<span class="sd"> Start the installation</span> <span class="sd"> Start the installation</span>
@ -263,14 +264,14 @@
<span class="c"># TODO: If vnc has been passed, we should look up the port and print that</span> <span class="c"># TODO: If vnc has been passed, we should look up the port and print that</span>
<span class="c"># for the user at this point</span> <span class="c"># for the user at this point</span>
<span class="k">while</span> <span class="n">dom</span><span class="o">.</span><span class="n">isActive</span><span class="p">()</span> <span class="ow">and</span> <span class="ow">not</span> <span class="n">log_check</span><span class="p">():</span> <span class="k">while</span> <span class="n">dom</span><span class="o">.</span><span class="n">isActive</span><span class="p">()</span> <span class="ow">and</span> <span class="ow">not</span> <span class="p">(</span><span class="n">cancel_func</span> <span class="ow">and</span> <span class="n">cancel_func</span><span class="p">()):</span>
<span class="n">sys</span><span class="o">.</span><span class="n">stdout</span><span class="o">.</span><span class="n">write</span><span class="p">(</span><span class="s">&quot;.&quot;</span><span class="p">)</span> <span class="n">sys</span><span class="o">.</span><span class="n">stdout</span><span class="o">.</span><span class="n">write</span><span class="p">(</span><span class="s">&quot;.&quot;</span><span class="p">)</span>
<span class="n">sys</span><span class="o">.</span><span class="n">stdout</span><span class="o">.</span><span class="n">flush</span><span class="p">()</span> <span class="n">sys</span><span class="o">.</span><span class="n">stdout</span><span class="o">.</span><span class="n">flush</span><span class="p">()</span>
<span class="n">sleep</span><span class="p">(</span><span class="mi">10</span><span class="p">)</span> <span class="n">sleep</span><span class="p">(</span><span class="mi">10</span><span class="p">)</span>
<span class="k">print</span> <span class="k">print</span>
<span class="k">if</span> <span class="n">log_check</span><span class="p">():</span> <span class="k">if</span> <span class="n">cancel_func</span> <span class="ow">and</span> <span class="n">cancel_func</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="s">&quot;Installation error detected. See logfile.&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="s">&quot;Installation error or cancel detected. See logfile.&quot;</span> <span class="p">)</span>
<span class="k">else</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="s">&quot;Install finished. Or at least virt shut down.&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="s">&quot;Install finished. Or at least virt shut down.&quot;</span> <span class="p">)</span>
@ -285,19 +286,12 @@
<span class="c"># Undefine the virt, UEFI installs need to have --nvram passed</span> <span class="c"># Undefine the virt, UEFI installs need to have --nvram passed</span>
<span class="n">subprocess</span><span class="o">.</span><span class="n">call</span><span class="p">([</span><span class="s">&quot;virsh&quot;</span><span class="p">,</span> <span class="s">&quot;undefine&quot;</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">virt_name</span><span class="p">,</span> <span class="s">&quot;--nvram&quot;</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="s">&quot;virsh&quot;</span><span class="p">,</span> <span class="s">&quot;undefine&quot;</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">virt_name</span><span class="p">,</span> <span class="s">&quot;--nvram&quot;</span><span class="p">])</span>
</div></div> </div></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="n">repo_url</span><span class="p">,</span> <span class="n">callback_func</span><span class="o">=</span><span class="bp">None</span><span class="p">):</span> <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="n">repo_url</span><span class="p">,</span> <span class="n">cancel_func</span><span class="o">=</span><span class="bp">None</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;</span> <span class="sd">&quot;&quot;&quot;</span>
<span class="sd"> Use Anaconda to install to a disk image</span> <span class="sd"> Use Anaconda to install to a disk image</span>
<span class="sd"> &quot;&quot;&quot;</span> <span class="sd"> &quot;&quot;&quot;</span>
<span class="kn">import</span> <span class="nn">selinux</span>
<span class="c"># Set selinux to Permissive if it is Enforcing</span>
<span class="n">selinux_enforcing</span> <span class="o">=</span> <span class="bp">False</span>
<span class="k">if</span> <span class="n">selinux</span><span class="o">.</span><span class="n">is_selinux_enabled</span><span class="p">()</span> <span class="ow">and</span> <span class="n">selinux</span><span class="o">.</span><span class="n">security_getenforce</span><span class="p">():</span>
<span class="n">selinux_enforcing</span> <span class="o">=</span> <span class="bp">True</span>
<span class="n">selinux</span><span class="o">.</span><span class="n">security_setenforce</span><span class="p">(</span><span class="mi">0</span><span class="p">)</span>
<span class="c"># Clean up /tmp/ from previous runs to prevent stale info from being used</span> <span class="c"># 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="s">&quot;/tmp/yum.repos.d/&quot;</span><span class="p">,</span> <span class="s">&quot;/tmp/yum.cache/&quot;</span><span class="p">,</span> <span class="s">&quot;/tmp/yum.root/&quot;</span><span class="p">,</span> <span class="s">&quot;/tmp/yum.pluginconf.d/&quot;</span><span class="p">]:</span> <span class="k">for</span> <span class="n">path</span> <span class="ow">in</span> <span class="p">[</span><span class="s">&quot;/tmp/yum.repos.d/&quot;</span><span class="p">,</span> <span class="s">&quot;/tmp/yum.cache/&quot;</span><span class="p">,</span> <span class="s">&quot;/tmp/yum.root/&quot;</span><span class="p">,</span> <span class="s">&quot;/tmp/yum.pluginconf.d/&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="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>
@ -334,10 +328,14 @@
<span class="c"># Create the sparse image</span> <span class="c"># 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">3</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">disk_size</span> <span class="o">*</span> <span class="mi">1024</span><span class="o">**</span><span class="mi">3</span><span class="p">)</span>
<span class="n">cancel_funcs</span> <span class="o">=</span> <span class="p">[]</span>
<span class="k">if</span> <span class="n">cancel_func</span> <span class="ow">is</span> <span class="ow">not</span> <span class="bp">None</span><span class="p">:</span>
<span class="n">cancel_funcs</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">cancel_func</span><span class="p">)</span>
<span class="c"># Make sure anaconda has the right product and release</span> <span class="c"># Make sure anaconda has the right product and release</span>
<span class="n">os</span><span class="o">.</span><span class="n">environ</span><span class="p">[</span><span class="s">&quot;ANACONDA_PRODUCTNAME&quot;</span><span class="p">]</span> <span class="o">=</span> <span class="n">opts</span><span class="o">.</span><span class="n">project</span> <span class="n">os</span><span class="o">.</span><span class="n">environ</span><span class="p">[</span><span class="s">&quot;ANACONDA_PRODUCTNAME&quot;</span><span class="p">]</span> <span class="o">=</span> <span class="n">opts</span><span class="o">.</span><span class="n">project</span>
<span class="n">os</span><span class="o">.</span><span class="n">environ</span><span class="p">[</span><span class="s">&quot;ANACONDA_PRODUCTVERSION&quot;</span><span class="p">]</span> <span class="o">=</span> <span class="n">opts</span><span class="o">.</span><span class="n">releasever</span> <span class="n">os</span><span class="o">.</span><span class="n">environ</span><span class="p">[</span><span class="s">&quot;ANACONDA_PRODUCTVERSION&quot;</span><span class="p">]</span> <span class="o">=</span> <span class="n">opts</span><span class="o">.</span><span class="n">releasever</span>
<span class="n">rc</span> <span class="o">=</span> <span class="n">execWithRedirect</span><span class="p">(</span><span class="s">&quot;anaconda&quot;</span><span class="p">,</span> <span class="n">args</span><span class="p">,</span> <span class="n">callback_func</span><span class="o">=</span><span class="n">callback_func</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="s">&quot;anaconda&quot;</span><span class="p">,</span> <span class="n">args</span><span class="p">,</span> <span class="n">callback_func</span><span class="o">=</span><span class="k">lambda</span> <span class="p">:</span> <span class="nb">any</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">cancel_funcs</span><span class="p">))</span>
<span class="c"># Move the anaconda logs over to a log directory</span> <span class="c"># 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_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>
@ -358,13 +356,13 @@
<span class="k">if</span> <span class="n">disk_img</span><span class="p">:</span> <span class="k">if</span> <span class="n">disk_img</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_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="s">&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="k">if</span> <span class="n">selinux_enforcing</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="s">&quot;Removing device-mapper setup on </span><span class="si">%s</span><span class="s">&quot;</span><span class="p">,</span> <span class="n">dm_name</span><span class="p">)</span>
<span class="n">selinux</span><span class="o">.</span><span class="n">security_setenforce</span><span class="p">(</span><span class="mi">1</span><span class="p">)</span> <span class="k">for</span> <span class="n">d</span> <span class="ow">in</span> <span class="nb">sorted</span><span class="p">(</span><span class="n">glob</span><span class="o">.</span><span class="n">glob</span><span class="p">(</span><span class="s">&quot;/dev/mapper/&quot;</span><span class="o">+</span><span class="n">dm_name</span><span class="o">+</span><span class="s">&quot;*&quot;</span><span class="p">),</span> <span class="n">reverse</span><span class="o">=</span><span class="bp">True</span><span class="p">):</span>
<span class="n">dm_detach</span><span class="p">(</span><span class="n">d</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="s">&quot;Removing loop device for </span><span class="si">%s</span><span class="s">&quot;</span><span class="p">,</span> <span class="n">disk_img</span><span class="p">)</span>
<span class="n">loop_detach</span><span class="p">(</span><span class="s">&quot;/dev/&quot;</span><span class="o">+</span><span class="n">get_loop_name</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="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="s">&quot;novirt_install failed&quot;</span><span class="p">)</span> <span class="k">raise</span> <span class="n">InstallError</span><span class="p">(</span><span class="s">&quot;novirt_install failed&quot;</span><span class="p">)</span>
@ -394,7 +392,7 @@
<span class="n">execWithRedirect</span><span class="p">(</span><span class="s">&quot;mv&quot;</span><span class="p">,</span> <span class="p">[</span><span class="s">&quot;-f&quot;</span><span class="p">,</span> <span class="n">qcow2_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="bp">True</span><span class="p">)</span> <span class="n">execWithRedirect</span><span class="p">(</span><span class="s">&quot;mv&quot;</span><span class="p">,</span> <span class="p">[</span><span class="s">&quot;-f&quot;</span><span class="p">,</span> <span class="n">qcow2_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="bp">True</span><span class="p">)</span>
</div> </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> <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="n">cancel_func</span><span class="o">=</span><span class="bp">None</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;</span> <span class="sd">&quot;&quot;&quot;</span>
<span class="sd"> Use virt-install to install to a disk image</span> <span class="sd"> Use virt-install to install to a disk image</span>
@ -404,6 +402,9 @@
<span class="sd"> &quot;&quot;&quot;</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="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="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">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">cancel_funcs</span> <span class="o">=</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="k">if</span> <span class="n">cancel_func</span> <span class="ow">is</span> <span class="ow">not</span> <span class="bp">None</span><span class="p">:</span>
<span class="n">cancel_funcs</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">cancel_func</span><span class="p">)</span>
<span class="n">kernel_args</span> <span class="o">=</span> <span class="s">&quot;&quot;</span> <span class="n">kernel_args</span> <span class="o">=</span> <span class="s">&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="k">if</span> <span class="n">opts</span><span class="o">.</span><span class="n">kernel_args</span><span class="p">:</span>
@ -427,7 +428,7 @@
<span class="k">try</span><span class="p">:</span> <span class="k">try</span><span class="p">:</span>
<span class="n">virt</span> <span class="o">=</span> <span class="n">VirtualInstall</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">virt</span> <span class="o">=</span> <span class="n">VirtualInstall</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">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">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">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">cancel_func</span> <span class="o">=</span> <span class="k">lambda</span> <span class="p">:</span> <span class="nb">any</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">cancel_funcs</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_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">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">qcow2</span><span class="o">=</span><span class="n">opts</span><span class="o">.</span><span class="n">qcow2</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">qcow2</span><span class="o">=</span><span class="n">opts</span><span class="o">.</span><span class="n">qcow2</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>
@ -443,7 +444,9 @@
<span class="n">iso_mount</span><span class="o">.</span><span class="n">umount</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="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">raise</span> <span class="n">InstallError</span><span class="p">(</span><span class="s">&quot;virt_install failed&quot;</span><span class="p">)</span> <span class="k">raise</span> <span class="n">InstallError</span><span class="p">(</span><span class="s">&quot;virt_install failed. See logfile.&quot;</span><span class="p">)</span>
<span class="k">elif</span> <span class="n">cancel_func</span> <span class="ow">and</span> <span class="n">cancel_func</span><span class="p">():</span>
<span class="k">raise</span> <span class="n">InstallError</span><span class="p">(</span><span class="s">&quot;virt_install canceled by cancel_func&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="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">mkdiskfsimage</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">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">mkdiskfsimage</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">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>
@ -493,7 +496,7 @@
<li class="right" > <li class="right" >
<a href="../../py-modindex.html" title="Python Module Index" <a href="../../py-modindex.html" title="Python Module Index"
>modules</a> |</li> >modules</a> |</li>
<li><a href="../../index.html">Lorax 19.7.22 documentation</a> &raquo;</li> <li><a href="../../index.html">Lorax 19.7.43 documentation</a> &raquo;</li>
<li><a href="../index.html" >Module code</a> &raquo;</li> <li><a href="../index.html" >Module code</a> &raquo;</li>
<li><a href="../pylorax.html" >pylorax</a> &raquo;</li> <li><a href="../pylorax.html" >pylorax</a> &raquo;</li>
</ul> </ul>

View File

@ -8,7 +8,7 @@
<head> <head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>pylorax.logmonitor &mdash; Lorax 19.7.22 documentation</title> <title>pylorax.logmonitor &mdash; Lorax 19.7.43 documentation</title>
<link rel="stylesheet" href="../../_static/default.css" type="text/css" /> <link rel="stylesheet" href="../../_static/default.css" type="text/css" />
<link rel="stylesheet" href="../../_static/pygments.css" type="text/css" /> <link rel="stylesheet" href="../../_static/pygments.css" type="text/css" />
@ -16,7 +16,7 @@
<script type="text/javascript"> <script type="text/javascript">
var DOCUMENTATION_OPTIONS = { var DOCUMENTATION_OPTIONS = {
URL_ROOT: '../../', URL_ROOT: '../../',
VERSION: '19.7.22', VERSION: '19.7.43',
COLLAPSE_INDEX: false, COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html', FILE_SUFFIX: '.html',
HAS_SOURCE: true HAS_SOURCE: true
@ -25,7 +25,7 @@
<script type="text/javascript" src="../../_static/jquery.js"></script> <script type="text/javascript" src="../../_static/jquery.js"></script>
<script type="text/javascript" src="../../_static/underscore.js"></script> <script type="text/javascript" src="../../_static/underscore.js"></script>
<script type="text/javascript" src="../../_static/doctools.js"></script> <script type="text/javascript" src="../../_static/doctools.js"></script>
<link rel="top" title="Lorax 19.7.22 documentation" href="../../index.html" /> <link rel="top" title="Lorax 19.7.43 documentation" href="../../index.html" />
<link rel="up" title="pylorax" href="../pylorax.html" /> <link rel="up" title="pylorax" href="../pylorax.html" />
</head> </head>
<body> <body>
@ -38,7 +38,7 @@
<li class="right" > <li class="right" >
<a href="../../py-modindex.html" title="Python Module Index" <a href="../../py-modindex.html" title="Python Module Index"
>modules</a> |</li> >modules</a> |</li>
<li><a href="../../index.html">Lorax 19.7.22 documentation</a> &raquo;</li> <li><a href="../../index.html">Lorax 19.7.43 documentation</a> &raquo;</li>
<li><a href="../index.html" >Module code</a> &raquo;</li> <li><a href="../index.html" >Module code</a> &raquo;</li>
<li><a href="../pylorax.html" accesskey="U">pylorax</a> &raquo;</li> <li><a href="../pylorax.html" accesskey="U">pylorax</a> &raquo;</li>
</ul> </ul>
@ -206,7 +206,7 @@
<li class="right" > <li class="right" >
<a href="../../py-modindex.html" title="Python Module Index" <a href="../../py-modindex.html" title="Python Module Index"
>modules</a> |</li> >modules</a> |</li>
<li><a href="../../index.html">Lorax 19.7.22 documentation</a> &raquo;</li> <li><a href="../../index.html">Lorax 19.7.43 documentation</a> &raquo;</li>
<li><a href="../index.html" >Module code</a> &raquo;</li> <li><a href="../index.html" >Module code</a> &raquo;</li>
<li><a href="../pylorax.html" >pylorax</a> &raquo;</li> <li><a href="../pylorax.html" >pylorax</a> &raquo;</li>
</ul> </ul>

View File

@ -8,7 +8,7 @@
<head> <head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>pylorax.ltmpl &mdash; Lorax 19.7.22 documentation</title> <title>pylorax.ltmpl &mdash; Lorax 19.7.43 documentation</title>
<link rel="stylesheet" href="../../_static/default.css" type="text/css" /> <link rel="stylesheet" href="../../_static/default.css" type="text/css" />
<link rel="stylesheet" href="../../_static/pygments.css" type="text/css" /> <link rel="stylesheet" href="../../_static/pygments.css" type="text/css" />
@ -16,7 +16,7 @@
<script type="text/javascript"> <script type="text/javascript">
var DOCUMENTATION_OPTIONS = { var DOCUMENTATION_OPTIONS = {
URL_ROOT: '../../', URL_ROOT: '../../',
VERSION: '19.7.22', VERSION: '19.7.43',
COLLAPSE_INDEX: false, COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html', FILE_SUFFIX: '.html',
HAS_SOURCE: true HAS_SOURCE: true
@ -25,7 +25,7 @@
<script type="text/javascript" src="../../_static/jquery.js"></script> <script type="text/javascript" src="../../_static/jquery.js"></script>
<script type="text/javascript" src="../../_static/underscore.js"></script> <script type="text/javascript" src="../../_static/underscore.js"></script>
<script type="text/javascript" src="../../_static/doctools.js"></script> <script type="text/javascript" src="../../_static/doctools.js"></script>
<link rel="top" title="Lorax 19.7.22 documentation" href="../../index.html" /> <link rel="top" title="Lorax 19.7.43 documentation" href="../../index.html" />
<link rel="up" title="pylorax" href="../pylorax.html" /> <link rel="up" title="pylorax" href="../pylorax.html" />
</head> </head>
<body> <body>
@ -38,7 +38,7 @@
<li class="right" > <li class="right" >
<a href="../../py-modindex.html" title="Python Module Index" <a href="../../py-modindex.html" title="Python Module Index"
>modules</a> |</li> >modules</a> |</li>
<li><a href="../../index.html">Lorax 19.7.22 documentation</a> &raquo;</li> <li><a href="../../index.html">Lorax 19.7.43 documentation</a> &raquo;</li>
<li><a href="../index.html" >Module code</a> &raquo;</li> <li><a href="../index.html" >Module code</a> &raquo;</li>
<li><a href="../pylorax.html" accesskey="U">pylorax</a> &raquo;</li> <li><a href="../pylorax.html" accesskey="U">pylorax</a> &raquo;</li>
</ul> </ul>
@ -121,11 +121,17 @@
<span class="c"># mako template now returns unicode strings</span> <span class="c"># mako template now returns unicode strings</span>
<span class="n">lines</span> <span class="o">=</span> <span class="nb">map</span><span class="p">(</span><span class="k">lambda</span> <span class="n">line</span><span class="p">:</span> <span class="n">line</span><span class="o">.</span><span class="n">encode</span><span class="p">(</span><span class="s">&quot;utf8&quot;</span><span class="p">),</span> <span class="n">lines</span><span class="p">)</span> <span class="n">lines</span> <span class="o">=</span> <span class="nb">map</span><span class="p">(</span><span class="k">lambda</span> <span class="n">line</span><span class="p">:</span> <span class="n">line</span><span class="o">.</span><span class="n">encode</span><span class="p">(</span><span class="s">&quot;utf8&quot;</span><span class="p">),</span> <span class="n">lines</span><span class="p">)</span>
<span class="c"># split with shlex and perform brace expansion</span> <span class="c"># split with shlex and perform brace expansion. This can fail, so we unroll the loop</span>
<span class="n">lines</span> <span class="o">=</span> <span class="nb">map</span><span class="p">(</span><span class="n">split_and_expand</span><span class="p">,</span> <span class="n">lines</span><span class="p">)</span> <span class="c"># for better error reporting.</span>
<span class="n">expanded_lines</span> <span class="o">=</span> <span class="p">[]</span>
<span class="bp">self</span><span class="o">.</span><span class="n">lines</span> <span class="o">=</span> <span class="n">lines</span> <span class="k">try</span><span class="p">:</span>
<span class="k">return</span> <span class="n">lines</span> <span class="k">for</span> <span class="n">line</span> <span class="ow">in</span> <span class="n">lines</span><span class="p">:</span>
<span class="n">expanded_lines</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">split_and_expand</span><span class="p">(</span><span class="n">line</span><span class="p">))</span>
<span class="k">except</span> <span class="ne">Exception</span> <span class="k">as</span> <span class="n">e</span><span class="p">:</span>
<span class="n">logger</span><span class="o">.</span><span class="n">error</span><span class="p">(</span><span class="s">&#39;shlex error processing &quot;</span><span class="si">%s</span><span class="s">&quot;: </span><span class="si">%s</span><span class="s">&#39;</span><span class="p">,</span> <span class="n">line</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="bp">self</span><span class="o">.</span><span class="n">lines</span> <span class="o">=</span> <span class="n">expanded_lines</span>
<span class="k">return</span> <span class="n">expanded_lines</span>
</div></div> </div></div>
<div class="viewcode-block" id="split_and_expand"><a class="viewcode-back" href="../../pylorax.html#pylorax.ltmpl.split_and_expand">[docs]</a><span class="k">def</span> <span class="nf">split_and_expand</span><span class="p">(</span><span class="n">line</span><span class="p">):</span> <div class="viewcode-block" id="split_and_expand"><a class="viewcode-back" href="../../pylorax.html#pylorax.ltmpl.split_and_expand">[docs]</a><span class="k">def</span> <span class="nf">split_and_expand</span><span class="p">(</span><span class="n">line</span><span class="p">):</span>
<span class="k">return</span> <span class="p">[</span><span class="n">exp</span> <span class="k">for</span> <span class="n">word</span> <span class="ow">in</span> <span class="n">shlex</span><span class="o">.</span><span class="n">split</span><span class="p">(</span><span class="n">line</span><span class="p">)</span> <span class="k">for</span> <span class="n">exp</span> <span class="ow">in</span> <span class="n">brace_expand</span><span class="p">(</span><span class="n">word</span><span class="p">)]</span> <span class="k">return</span> <span class="p">[</span><span class="n">exp</span> <span class="k">for</span> <span class="n">word</span> <span class="ow">in</span> <span class="n">shlex</span><span class="o">.</span><span class="n">split</span><span class="p">(</span><span class="n">line</span><span class="p">)</span> <span class="k">for</span> <span class="n">exp</span> <span class="ow">in</span> <span class="n">brace_expand</span><span class="p">(</span><span class="n">word</span><span class="p">)]</span>
@ -748,7 +754,7 @@
<li class="right" > <li class="right" >
<a href="../../py-modindex.html" title="Python Module Index" <a href="../../py-modindex.html" title="Python Module Index"
>modules</a> |</li> >modules</a> |</li>
<li><a href="../../index.html">Lorax 19.7.22 documentation</a> &raquo;</li> <li><a href="../../index.html">Lorax 19.7.43 documentation</a> &raquo;</li>
<li><a href="../index.html" >Module code</a> &raquo;</li> <li><a href="../index.html" >Module code</a> &raquo;</li>
<li><a href="../pylorax.html" >pylorax</a> &raquo;</li> <li><a href="../pylorax.html" >pylorax</a> &raquo;</li>
</ul> </ul>

View File

@ -8,7 +8,7 @@
<head> <head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>pylorax.sysutils &mdash; Lorax 19.7.22 documentation</title> <title>pylorax.sysutils &mdash; Lorax 19.7.43 documentation</title>
<link rel="stylesheet" href="../../_static/default.css" type="text/css" /> <link rel="stylesheet" href="../../_static/default.css" type="text/css" />
<link rel="stylesheet" href="../../_static/pygments.css" type="text/css" /> <link rel="stylesheet" href="../../_static/pygments.css" type="text/css" />
@ -16,7 +16,7 @@
<script type="text/javascript"> <script type="text/javascript">
var DOCUMENTATION_OPTIONS = { var DOCUMENTATION_OPTIONS = {
URL_ROOT: '../../', URL_ROOT: '../../',
VERSION: '19.7.22', VERSION: '19.7.43',
COLLAPSE_INDEX: false, COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html', FILE_SUFFIX: '.html',
HAS_SOURCE: true HAS_SOURCE: true
@ -25,7 +25,7 @@
<script type="text/javascript" src="../../_static/jquery.js"></script> <script type="text/javascript" src="../../_static/jquery.js"></script>
<script type="text/javascript" src="../../_static/underscore.js"></script> <script type="text/javascript" src="../../_static/underscore.js"></script>
<script type="text/javascript" src="../../_static/doctools.js"></script> <script type="text/javascript" src="../../_static/doctools.js"></script>
<link rel="top" title="Lorax 19.7.22 documentation" href="../../index.html" /> <link rel="top" title="Lorax 19.7.43 documentation" href="../../index.html" />
<link rel="up" title="pylorax" href="../pylorax.html" /> <link rel="up" title="pylorax" href="../pylorax.html" />
</head> </head>
<body> <body>
@ -38,7 +38,7 @@
<li class="right" > <li class="right" >
<a href="../../py-modindex.html" title="Python Module Index" <a href="../../py-modindex.html" title="Python Module Index"
>modules</a> |</li> >modules</a> |</li>
<li><a href="../../index.html">Lorax 19.7.22 documentation</a> &raquo;</li> <li><a href="../../index.html">Lorax 19.7.43 documentation</a> &raquo;</li>
<li><a href="../index.html" >Module code</a> &raquo;</li> <li><a href="../index.html" >Module code</a> &raquo;</li>
<li><a href="../pylorax.html" accesskey="U">pylorax</a> &raquo;</li> <li><a href="../pylorax.html" accesskey="U">pylorax</a> &raquo;</li>
</ul> </ul>
@ -191,7 +191,7 @@
<li class="right" > <li class="right" >
<a href="../../py-modindex.html" title="Python Module Index" <a href="../../py-modindex.html" title="Python Module Index"
>modules</a> |</li> >modules</a> |</li>
<li><a href="../../index.html">Lorax 19.7.22 documentation</a> &raquo;</li> <li><a href="../../index.html">Lorax 19.7.43 documentation</a> &raquo;</li>
<li><a href="../index.html" >Module code</a> &raquo;</li> <li><a href="../index.html" >Module code</a> &raquo;</li>
<li><a href="../pylorax.html" >pylorax</a> &raquo;</li> <li><a href="../pylorax.html" >pylorax</a> &raquo;</li>
</ul> </ul>

View File

@ -8,7 +8,7 @@
<head> <head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>pylorax.treebuilder &mdash; Lorax 19.7.22 documentation</title> <title>pylorax.treebuilder &mdash; Lorax 19.7.43 documentation</title>
<link rel="stylesheet" href="../../_static/default.css" type="text/css" /> <link rel="stylesheet" href="../../_static/default.css" type="text/css" />
<link rel="stylesheet" href="../../_static/pygments.css" type="text/css" /> <link rel="stylesheet" href="../../_static/pygments.css" type="text/css" />
@ -16,7 +16,7 @@
<script type="text/javascript"> <script type="text/javascript">
var DOCUMENTATION_OPTIONS = { var DOCUMENTATION_OPTIONS = {
URL_ROOT: '../../', URL_ROOT: '../../',
VERSION: '19.7.22', VERSION: '19.7.43',
COLLAPSE_INDEX: false, COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html', FILE_SUFFIX: '.html',
HAS_SOURCE: true HAS_SOURCE: true
@ -25,7 +25,7 @@
<script type="text/javascript" src="../../_static/jquery.js"></script> <script type="text/javascript" src="../../_static/jquery.js"></script>
<script type="text/javascript" src="../../_static/underscore.js"></script> <script type="text/javascript" src="../../_static/underscore.js"></script>
<script type="text/javascript" src="../../_static/doctools.js"></script> <script type="text/javascript" src="../../_static/doctools.js"></script>
<link rel="top" title="Lorax 19.7.22 documentation" href="../../index.html" /> <link rel="top" title="Lorax 19.7.43 documentation" href="../../index.html" />
<link rel="up" title="pylorax" href="../pylorax.html" /> <link rel="up" title="pylorax" href="../pylorax.html" />
</head> </head>
<body> <body>
@ -38,7 +38,7 @@
<li class="right" > <li class="right" >
<a href="../../py-modindex.html" title="Python Module Index" <a href="../../py-modindex.html" title="Python Module Index"
>modules</a> |</li> >modules</a> |</li>
<li><a href="../../index.html">Lorax 19.7.22 documentation</a> &raquo;</li> <li><a href="../../index.html">Lorax 19.7.43 documentation</a> &raquo;</li>
<li><a href="../index.html" >Module code</a> &raquo;</li> <li><a href="../index.html" >Module code</a> &raquo;</li>
<li><a href="../pylorax.html" accesskey="U">pylorax</a> &raquo;</li> <li><a href="../pylorax.html" accesskey="U">pylorax</a> &raquo;</li>
</ul> </ul>
@ -225,7 +225,8 @@
<div class="viewcode-block" id="TreeBuilder"><a class="viewcode-back" href="../../pylorax.html#pylorax.treebuilder.TreeBuilder">[docs]</a><span class="k">class</span> <span class="nc">TreeBuilder</span><span class="p">(</span><span class="nb">object</span><span class="p">):</span> <div class="viewcode-block" id="TreeBuilder"><a class="viewcode-back" href="../../pylorax.html#pylorax.treebuilder.TreeBuilder">[docs]</a><span class="k">class</span> <span class="nc">TreeBuilder</span><span class="p">(</span><span class="nb">object</span><span class="p">):</span>
<span class="sd">&#39;&#39;&#39;Builds the arch-specific boot images.</span> <span class="sd">&#39;&#39;&#39;Builds the arch-specific boot images.</span>
<span class="sd"> inroot should be the installtree root (the newly-built runtime dir)&#39;&#39;&#39;</span> <span class="sd"> inroot should be the installtree root (the newly-built runtime dir)&#39;&#39;&#39;</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">product</span><span class="p">,</span> <span class="n">arch</span><span class="p">,</span> <span class="n">inroot</span><span class="p">,</span> <span class="n">outroot</span><span class="p">,</span> <span class="n">runtime</span><span class="p">,</span> <span class="n">isolabel</span><span class="p">,</span> <span class="n">domacboot</span><span class="o">=</span><span class="bp">False</span><span class="p">,</span> <span class="n">doupgrade</span><span class="o">=</span><span class="bp">True</span><span class="p">,</span> <span class="n">templatedir</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span> <span class="n">add_templates</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span> <span class="n">add_template_vars</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span> <span class="n">workdir</span><span class="o">=</span><span class="bp">None</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">product</span><span class="p">,</span> <span class="n">arch</span><span class="p">,</span> <span class="n">inroot</span><span class="p">,</span> <span class="n">outroot</span><span class="p">,</span> <span class="n">runtime</span><span class="p">,</span> <span class="n">isolabel</span><span class="p">,</span> <span class="n">domacboot</span><span class="o">=</span><span class="bp">False</span><span class="p">,</span> <span class="n">doupgrade</span><span class="o">=</span><span class="bp">True</span><span class="p">,</span>
<span class="n">templatedir</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span> <span class="n">add_templates</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span> <span class="n">add_template_vars</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span> <span class="n">workdir</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span> <span class="n">extra_boot_args</span><span class="o">=</span><span class="s">&quot;&quot;</span><span class="p">):</span>
<span class="c"># NOTE: if you pass an arg named &quot;runtime&quot; to a mako template it&#39;ll</span> <span class="c"># NOTE: if you pass an arg named &quot;runtime&quot; to a mako template it&#39;ll</span>
<span class="c"># clobber some mako internal variables - hence &quot;runtime_img&quot;.</span> <span class="c"># clobber some mako internal variables - hence &quot;runtime_img&quot;.</span>
@ -234,7 +235,7 @@
<span class="n">inroot</span><span class="o">=</span><span class="n">inroot</span><span class="p">,</span> <span class="n">outroot</span><span class="o">=</span><span class="n">outroot</span><span class="p">,</span> <span class="n">inroot</span><span class="o">=</span><span class="n">inroot</span><span class="p">,</span> <span class="n">outroot</span><span class="o">=</span><span class="n">outroot</span><span class="p">,</span>
<span class="n">basearch</span><span class="o">=</span><span class="n">arch</span><span class="o">.</span><span class="n">basearch</span><span class="p">,</span> <span class="n">libdir</span><span class="o">=</span><span class="n">arch</span><span class="o">.</span><span class="n">libdir</span><span class="p">,</span> <span class="n">basearch</span><span class="o">=</span><span class="n">arch</span><span class="o">.</span><span class="n">basearch</span><span class="p">,</span> <span class="n">libdir</span><span class="o">=</span><span class="n">arch</span><span class="o">.</span><span class="n">libdir</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">udev</span><span class="o">=</span><span class="n">udev_escape</span><span class="p">,</span> <span class="n">domacboot</span><span class="o">=</span><span class="n">domacboot</span><span class="p">,</span> <span class="n">doupgrade</span><span class="o">=</span><span class="n">doupgrade</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">udev</span><span class="o">=</span><span class="n">udev_escape</span><span class="p">,</span> <span class="n">domacboot</span><span class="o">=</span><span class="n">domacboot</span><span class="p">,</span> <span class="n">doupgrade</span><span class="o">=</span><span class="n">doupgrade</span><span class="p">,</span>
<span class="n">workdir</span><span class="o">=</span><span class="n">workdir</span><span class="p">)</span> <span class="n">workdir</span><span class="o">=</span><span class="n">workdir</span><span class="p">,</span> <span class="n">extra_boot_args</span><span class="o">=</span><span class="n">extra_boot_args</span><span class="p">)</span>
<span class="bp">self</span><span class="o">.</span><span class="n">_runner</span> <span class="o">=</span> <span class="n">LoraxTemplateRunner</span><span class="p">(</span><span class="n">inroot</span><span class="p">,</span> <span class="n">outroot</span><span class="p">,</span> <span class="n">templatedir</span><span class="o">=</span><span class="n">templatedir</span><span class="p">)</span> <span class="bp">self</span><span class="o">.</span><span class="n">_runner</span> <span class="o">=</span> <span class="n">LoraxTemplateRunner</span><span class="p">(</span><span class="n">inroot</span><span class="p">,</span> <span class="n">outroot</span><span class="p">,</span> <span class="n">templatedir</span><span class="o">=</span><span class="n">templatedir</span><span class="p">)</span>
<span class="bp">self</span><span class="o">.</span><span class="n">_runner</span><span class="o">.</span><span class="n">defaults</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">vars</span> <span class="bp">self</span><span class="o">.</span><span class="n">_runner</span><span class="o">.</span><span class="n">defaults</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">vars</span>
<span class="bp">self</span><span class="o">.</span><span class="n">add_templates</span> <span class="o">=</span> <span class="n">add_templates</span> <span class="ow">or</span> <span class="p">[]</span> <span class="bp">self</span><span class="o">.</span><span class="n">add_templates</span> <span class="o">=</span> <span class="n">add_templates</span> <span class="ow">or</span> <span class="p">[]</span>
@ -403,7 +404,7 @@
<li class="right" > <li class="right" >
<a href="../../py-modindex.html" title="Python Module Index" <a href="../../py-modindex.html" title="Python Module Index"
>modules</a> |</li> >modules</a> |</li>
<li><a href="../../index.html">Lorax 19.7.22 documentation</a> &raquo;</li> <li><a href="../../index.html">Lorax 19.7.43 documentation</a> &raquo;</li>
<li><a href="../index.html" >Module code</a> &raquo;</li> <li><a href="../index.html" >Module code</a> &raquo;</li>
<li><a href="../pylorax.html" >pylorax</a> &raquo;</li> <li><a href="../pylorax.html" >pylorax</a> &raquo;</li>
</ul> </ul>

View File

@ -8,7 +8,7 @@
<head> <head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>pylorax.treeinfo &mdash; Lorax 19.7.22 documentation</title> <title>pylorax.treeinfo &mdash; Lorax 19.7.43 documentation</title>
<link rel="stylesheet" href="../../_static/default.css" type="text/css" /> <link rel="stylesheet" href="../../_static/default.css" type="text/css" />
<link rel="stylesheet" href="../../_static/pygments.css" type="text/css" /> <link rel="stylesheet" href="../../_static/pygments.css" type="text/css" />
@ -16,7 +16,7 @@
<script type="text/javascript"> <script type="text/javascript">
var DOCUMENTATION_OPTIONS = { var DOCUMENTATION_OPTIONS = {
URL_ROOT: '../../', URL_ROOT: '../../',
VERSION: '19.7.22', VERSION: '19.7.43',
COLLAPSE_INDEX: false, COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html', FILE_SUFFIX: '.html',
HAS_SOURCE: true HAS_SOURCE: true
@ -25,7 +25,7 @@
<script type="text/javascript" src="../../_static/jquery.js"></script> <script type="text/javascript" src="../../_static/jquery.js"></script>
<script type="text/javascript" src="../../_static/underscore.js"></script> <script type="text/javascript" src="../../_static/underscore.js"></script>
<script type="text/javascript" src="../../_static/doctools.js"></script> <script type="text/javascript" src="../../_static/doctools.js"></script>
<link rel="top" title="Lorax 19.7.22 documentation" href="../../index.html" /> <link rel="top" title="Lorax 19.7.43 documentation" href="../../index.html" />
<link rel="up" title="pylorax" href="../pylorax.html" /> <link rel="up" title="pylorax" href="../pylorax.html" />
</head> </head>
<body> <body>
@ -38,7 +38,7 @@
<li class="right" > <li class="right" >
<a href="../../py-modindex.html" title="Python Module Index" <a href="../../py-modindex.html" title="Python Module Index"
>modules</a> |</li> >modules</a> |</li>
<li><a href="../../index.html">Lorax 19.7.22 documentation</a> &raquo;</li> <li><a href="../../index.html">Lorax 19.7.43 documentation</a> &raquo;</li>
<li><a href="../index.html" >Module code</a> &raquo;</li> <li><a href="../index.html" >Module code</a> &raquo;</li>
<li><a href="../pylorax.html" accesskey="U">pylorax</a> &raquo;</li> <li><a href="../pylorax.html" accesskey="U">pylorax</a> &raquo;</li>
</ul> </ul>
@ -140,7 +140,7 @@
<li class="right" > <li class="right" >
<a href="../../py-modindex.html" title="Python Module Index" <a href="../../py-modindex.html" title="Python Module Index"
>modules</a> |</li> >modules</a> |</li>
<li><a href="../../index.html">Lorax 19.7.22 documentation</a> &raquo;</li> <li><a href="../../index.html">Lorax 19.7.43 documentation</a> &raquo;</li>
<li><a href="../index.html" >Module code</a> &raquo;</li> <li><a href="../index.html" >Module code</a> &raquo;</li>
<li><a href="../pylorax.html" >pylorax</a> &raquo;</li> <li><a href="../pylorax.html" >pylorax</a> &raquo;</li>
</ul> </ul>

View File

@ -8,7 +8,7 @@
<head> <head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>pylorax.yumhelper &mdash; Lorax 19.7.22 documentation</title> <title>pylorax.yumhelper &mdash; Lorax 19.7.43 documentation</title>
<link rel="stylesheet" href="../../_static/default.css" type="text/css" /> <link rel="stylesheet" href="../../_static/default.css" type="text/css" />
<link rel="stylesheet" href="../../_static/pygments.css" type="text/css" /> <link rel="stylesheet" href="../../_static/pygments.css" type="text/css" />
@ -16,7 +16,7 @@
<script type="text/javascript"> <script type="text/javascript">
var DOCUMENTATION_OPTIONS = { var DOCUMENTATION_OPTIONS = {
URL_ROOT: '../../', URL_ROOT: '../../',
VERSION: '19.7.22', VERSION: '19.7.43',
COLLAPSE_INDEX: false, COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html', FILE_SUFFIX: '.html',
HAS_SOURCE: true HAS_SOURCE: true
@ -25,7 +25,7 @@
<script type="text/javascript" src="../../_static/jquery.js"></script> <script type="text/javascript" src="../../_static/jquery.js"></script>
<script type="text/javascript" src="../../_static/underscore.js"></script> <script type="text/javascript" src="../../_static/underscore.js"></script>
<script type="text/javascript" src="../../_static/doctools.js"></script> <script type="text/javascript" src="../../_static/doctools.js"></script>
<link rel="top" title="Lorax 19.7.22 documentation" href="../../index.html" /> <link rel="top" title="Lorax 19.7.43 documentation" href="../../index.html" />
<link rel="up" title="pylorax" href="../pylorax.html" /> <link rel="up" title="pylorax" href="../pylorax.html" />
</head> </head>
<body> <body>
@ -38,7 +38,7 @@
<li class="right" > <li class="right" >
<a href="../../py-modindex.html" title="Python Module Index" <a href="../../py-modindex.html" title="Python Module Index"
>modules</a> |</li> >modules</a> |</li>
<li><a href="../../index.html">Lorax 19.7.22 documentation</a> &raquo;</li> <li><a href="../../index.html">Lorax 19.7.43 documentation</a> &raquo;</li>
<li><a href="../index.html" >Module code</a> &raquo;</li> <li><a href="../index.html" >Module code</a> &raquo;</li>
<li><a href="../pylorax.html" accesskey="U">pylorax</a> &raquo;</li> <li><a href="../pylorax.html" accesskey="U">pylorax</a> &raquo;</li>
</ul> </ul>
@ -208,7 +208,7 @@
<li class="right" > <li class="right" >
<a href="../../py-modindex.html" title="Python Module Index" <a href="../../py-modindex.html" title="Python Module Index"
>modules</a> |</li> >modules</a> |</li>
<li><a href="../../index.html">Lorax 19.7.22 documentation</a> &raquo;</li> <li><a href="../../index.html">Lorax 19.7.43 documentation</a> &raquo;</li>
<li><a href="../index.html" >Module code</a> &raquo;</li> <li><a href="../index.html" >Module code</a> &raquo;</li>
<li><a href="../pylorax.html" >pylorax</a> &raquo;</li> <li><a href="../pylorax.html" >pylorax</a> &raquo;</li>
</ul> </ul>

View File

@ -40,8 +40,8 @@ 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. 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``. The available types of images is displayed by ``composer-cli compose types``.
Currently this consists of: ext4-filesystem, live-iso, partitioned-disk, qcow2, Currently this consists of: ami, ext4-filesystem, live-iso, openstack,
tar partitioned-disk, qcow2, tar, vhd, vmdk
Monitor the build status Monitor the build status
------------------------ ------------------------

View File

@ -25,6 +25,11 @@ Important Things To Note
for information on how to enable it. Otherwise you will see image creation fail to for information on how to enable it. Otherwise you will see image creation fail to
depsolve even if the blueprint itself is correct. depsolve even if the blueprint itself is correct.
* All image types lock the root account, except for live-iso. You will need to either
use one of the `Customizations`_ methods for setting a ssh key/password, install a
package that creates a user, or use something like `cloud-init` to setup access at
boot time.
Installation Installation
------------ ------------
@ -167,11 +172,25 @@ for selecting optional packages.
Customizations Customizations
~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~
The ``[[customizations]]`` section can be used to configure the hostname of the final image. eg.:: The ``[customizations]`` section can be used to configure the hostname of the final image. eg.::
[[customizations]] [customizations]
hostname = "baseimage" hostname = "baseimage"
This is optional and may be left out to use the defaults.
[customizations.kernel]
***********************
This allows you to append arguments to the bootloader's kernel commandline. This will not have any
effect on ``tar`` or ``ext4-filesystem`` images since they do not include a bootloader.
For example::
[customizations.kernel]
append = "nosmt=force"
[[customizations.sshkey]] [[customizations.sshkey]]
************************* *************************
@ -216,6 +235,96 @@ Add a group to the image. ``name`` is required and ``gid`` is optional::
gid = 1130 gid = 1130
[customizations.timezone]
*************************
Customizing the timezone and the NTP servers to use for the system::
[customizations.timezone]
timezone = "US/Eastern"
ntpservers = ["0.north-america.pool.ntp.org", "1.north-america.pool.ntp.org"]
The values supported by ``timezone`` can be listed by running ``timedatectl list-timezones``.
If no timezone is setup the system will default to using `UTC`. The ntp servers are also
optional and will default to using the distribution defaults which are fine for most uses.
In some image types there are already NTP servers setup, eg. Google cloud image, and they
cannot be overridden because they are required to boot in the selected environment. But the
timezone will be updated to the one selected in the blueprint.
[customizations.locale]
***********************
Customize the locale settings for the system::
[customizations.locale]
languages = ["en_US.UTF-8"]
keyboard = "us"
The values supported by ``languages`` can be listed by running ``localectl list-locales`` from
the command line.
The values supported by ``keyboard`` can be listed by running ``localectl list-keymaps`` from
the command line.
Multiple languages can be added. The first one becomes the
primary, and the others are added as secondary. One or the other of ``languages``
or ``keyboard`` must be included (or both) in the section.
[customizations.firewall]
*************************
By default the firewall blocks all access except for services that enable their ports explicitly,
like ``sshd``. This command can be used to open other ports or services. Ports are configured using
the port:protocol format::
[customizations.firewall]
ports = ["22:tcp", "80:tcp", "imap:tcp", "53:tcp", "53:udp"]
Numeric ports, or their names from ``/etc/services`` can be used in the ``ports`` enabled/disabled lists.
The blueprint settings extend any existing settings in the image templates, so if ``sshd`` is
already enabled it will extend the list of ports with the ones listed by the blueprint.
If the distribution uses ``firewalld`` you can specify services listed by ``firewall-cmd --get-services``
in a ``customizations.firewall.services`` section::
[customizations.firewall.services]
enabled = ["ftp", "ntp", "dhcp"]
disabled = ["telnet"]
Remember that the ``firewall.services`` are different from the names in ``/etc/services``.
Both are optional, if they are not used leave them out or set them to an empty list ``[]``. If you
only want the default firewall setup this section can be omitted from the blueprint.
NOTE: The ``Google`` and ``OpenStack`` templates explicitly disable the firewall for their environment.
This cannot be overridden by the blueprint.
[customizations.services]
*************************
This section can be used to control which services are enabled at boot time.
Some image types already have services enabled or disabled in order for the
image to work correctly, and cannot be overridden. eg. ``ami`` requires
``sshd``, ``chronyd``, and ``cloud-init``. Without them the image will not
boot. Blueprint services are added to, not replacing, the list already in the
templates, if any.
[customizations.services]
enabled = ["sshd", "cockpit", "httpd.service"]
disabled = ["postfix", "telnetd"]
.. note::
The service names are systemd service units. You can only specify the unit
name, eg. ``httpd``, or the full service name, eg. ``httpd.service`` -- but
not other systemd unit files. Note that this is different from newer
releases where you can specify any systemd unit file.
Adding Output Types Adding Output Types
------------------- -------------------

View File

@ -9,6 +9,14 @@ api Package
:undoc-members: :undoc-members:
:show-inheritance: :show-inheritance:
:mod:`bisect` Module
--------------------
.. automodule:: pylorax.api.bisect
:members:
:undoc-members:
:show-inheritance:
:mod:`checkparams` Module :mod:`checkparams` Module
------------------------- -------------------------

View File

@ -8,7 +8,7 @@
<head> <head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>composer-cli &mdash; Lorax 19.7.22 documentation</title> <title>composer-cli &mdash; Lorax 19.7.43 documentation</title>
<link rel="stylesheet" href="_static/default.css" type="text/css" /> <link rel="stylesheet" href="_static/default.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" /> <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
@ -16,7 +16,7 @@
<script type="text/javascript"> <script type="text/javascript">
var DOCUMENTATION_OPTIONS = { var DOCUMENTATION_OPTIONS = {
URL_ROOT: '', URL_ROOT: '',
VERSION: '19.7.22', VERSION: '19.7.43',
COLLAPSE_INDEX: false, COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html', FILE_SUFFIX: '.html',
HAS_SOURCE: true HAS_SOURCE: true
@ -25,7 +25,7 @@
<script type="text/javascript" src="_static/jquery.js"></script> <script type="text/javascript" src="_static/jquery.js"></script>
<script type="text/javascript" src="_static/underscore.js"></script> <script type="text/javascript" src="_static/underscore.js"></script>
<script type="text/javascript" src="_static/doctools.js"></script> <script type="text/javascript" src="_static/doctools.js"></script>
<link rel="top" title="Lorax 19.7.22 documentation" href="index.html" /> <link rel="top" title="Lorax 19.7.43 documentation" href="index.html" />
<link rel="next" title="Product and Updates Images" href="product-images.html" /> <link rel="next" title="Product and Updates Images" href="product-images.html" />
<link rel="prev" title="lorax-composer" href="lorax-composer.html" /> <link rel="prev" title="lorax-composer" href="lorax-composer.html" />
</head> </head>
@ -45,7 +45,7 @@
<li class="right" > <li class="right" >
<a href="lorax-composer.html" title="lorax-composer" <a href="lorax-composer.html" title="lorax-composer"
accesskey="P">previous</a> |</li> accesskey="P">previous</a> |</li>
<li><a href="index.html">Lorax 19.7.22 documentation</a> &raquo;</li> <li><a href="index.html">Lorax 19.7.43 documentation</a> &raquo;</li>
</ul> </ul>
</div> </div>
@ -88,8 +88,8 @@ saved by viewing the changelog - <tt class="docutils literal"><span class="pre">
<span class="pre">compose</span> <span class="pre">start</span> <span class="pre">http-server</span> <span class="pre">qcow2</span></tt>. It will print a UUID that you can use to <span class="pre">compose</span> <span class="pre">start</span> <span class="pre">http-server</span> <span class="pre">qcow2</span></tt>. It will print a UUID that you can use to
keep track of the build. You can also cancel the build if needed.</p> keep track of the build. You can also cancel the build if needed.</p>
<p>The available types of images is displayed by <tt class="docutils literal"><span class="pre">composer-cli</span> <span class="pre">compose</span> <span class="pre">types</span></tt>. <p>The available types of images is displayed by <tt class="docutils literal"><span class="pre">composer-cli</span> <span class="pre">compose</span> <span class="pre">types</span></tt>.
Currently this consists of: ext4-filesystem, live-iso, partitioned-disk, qcow2, Currently this consists of: ami, ext4-filesystem, live-iso, openstack,
tar</p> partitioned-disk, qcow2, tar, vhd, vmdk</p>
</div> </div>
<div class="section" id="monitor-the-build-status"> <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> <h2>Monitor the build status<a class="headerlink" href="#monitor-the-build-status" title="Permalink to this headline"></a></h2>
@ -169,7 +169,7 @@ save the qcow2 image as <tt class="docutils literal"><span class="pre">UUID-disk
<li class="right" > <li class="right" >
<a href="lorax-composer.html" title="lorax-composer" <a href="lorax-composer.html" title="lorax-composer"
>previous</a> |</li> >previous</a> |</li>
<li><a href="index.html">Lorax 19.7.22 documentation</a> &raquo;</li> <li><a href="index.html">Lorax 19.7.43 documentation</a> &raquo;</li>
</ul> </ul>
</div> </div>
<div class="footer"> <div class="footer">

View File

@ -8,7 +8,7 @@
<head> <head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>cli Package &mdash; Lorax 19.7.22 documentation</title> <title>cli Package &mdash; Lorax 19.7.43 documentation</title>
<link rel="stylesheet" href="_static/default.css" type="text/css" /> <link rel="stylesheet" href="_static/default.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" /> <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
@ -16,7 +16,7 @@
<script type="text/javascript"> <script type="text/javascript">
var DOCUMENTATION_OPTIONS = { var DOCUMENTATION_OPTIONS = {
URL_ROOT: '', URL_ROOT: '',
VERSION: '19.7.22', VERSION: '19.7.43',
COLLAPSE_INDEX: false, COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html', FILE_SUFFIX: '.html',
HAS_SOURCE: true HAS_SOURCE: true
@ -25,7 +25,7 @@
<script type="text/javascript" src="_static/jquery.js"></script> <script type="text/javascript" src="_static/jquery.js"></script>
<script type="text/javascript" src="_static/underscore.js"></script> <script type="text/javascript" src="_static/underscore.js"></script>
<script type="text/javascript" src="_static/doctools.js"></script> <script type="text/javascript" src="_static/doctools.js"></script>
<link rel="top" title="Lorax 19.7.22 documentation" href="index.html" /> <link rel="top" title="Lorax 19.7.43 documentation" href="index.html" />
<link rel="up" title="composer Package" href="composer.html" /> <link rel="up" title="composer Package" href="composer.html" />
<link rel="next" title="pylorax Package" href="pylorax.html" /> <link rel="next" title="pylorax Package" href="pylorax.html" />
<link rel="prev" title="composer Package" href="composer.html" /> <link rel="prev" title="composer Package" href="composer.html" />
@ -46,7 +46,7 @@
<li class="right" > <li class="right" >
<a href="composer.html" title="composer Package" <a href="composer.html" title="composer Package"
accesskey="P">previous</a> |</li> accesskey="P">previous</a> |</li>
<li><a href="index.html">Lorax 19.7.22 documentation</a> &raquo;</li> <li><a href="index.html">Lorax 19.7.43 documentation</a> &raquo;</li>
<li><a href="modules.html" >src</a> &raquo;</li> <li><a href="modules.html" >src</a> &raquo;</li>
<li><a href="composer.html" accesskey="U">composer Package</a> &raquo;</li> <li><a href="composer.html" accesskey="U">composer Package</a> &raquo;</li>
</ul> </ul>
@ -398,6 +398,25 @@ blueprints freeze save &lt;blueprint,...&gt; Save the frozen blueprint to a file
<p>blueprints workspace &lt;blueprint&gt; Push the blueprint TOML to the temporary workspace storage.</p> <p>blueprints workspace &lt;blueprint&gt; Push the blueprint TOML to the temporary workspace storage.</p>
</dd></dl> </dd></dl>
<dl class="function">
<dt id="composer.cli.blueprints.dict_names">
<tt class="descclassname">composer.cli.blueprints.</tt><tt class="descname">dict_names</tt><big>(</big><em>lst</em><big>)</big><a class="reference internal" href="_modules/composer/cli/blueprints.html#dict_names"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#composer.cli.blueprints.dict_names" title="Permalink to this definition"></a></dt>
<dd><p>Return comma-separated list of the dict&#8217;s name/user fields</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>d</strong> (<a class="reference external" href="https://docs.python.org/2/library/stdtypes.html#dict" title="(in Python v2.7)"><em>dict</em></a>) &#8211; key/values</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">String of the dict&#8217;s keys and values</td>
</tr>
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body">str</td>
</tr>
</tbody>
</table>
<p>root, norm</p>
</dd></dl>
<dl class="function"> <dl class="function">
<dt id="composer.cli.blueprints.prettyCommitDetails"> <dt id="composer.cli.blueprints.prettyCommitDetails">
<tt class="descclassname">composer.cli.blueprints.</tt><tt class="descname">prettyCommitDetails</tt><big>(</big><em>change</em>, <em>indent=4</em><big>)</big><a class="reference internal" href="_modules/composer/cli/blueprints.html#prettyCommitDetails"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#composer.cli.blueprints.prettyCommitDetails" title="Permalink to this definition"></a></dt> <tt class="descclassname">composer.cli.blueprints.</tt><tt class="descname">prettyCommitDetails</tt><big>(</big><em>change</em>, <em>indent=4</em><big>)</big><a class="reference internal" href="_modules/composer/cli/blueprints.html#prettyCommitDetails"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#composer.cli.blueprints.prettyCommitDetails" title="Permalink to this definition"></a></dt>
@ -417,8 +436,27 @@ blueprints freeze save &lt;blueprint,...&gt; Save the frozen blueprint to a file
</dd></dl> </dd></dl>
<dl class="function"> <dl class="function">
<dt id="composer.cli.blueprints.prettyDiffEntry"> <dt id="composer.cli.blueprints.pretty_dict">
<tt class="descclassname">composer.cli.blueprints.</tt><tt class="descname">prettyDiffEntry</tt><big>(</big><em>diff</em><big>)</big><a class="reference internal" href="_modules/composer/cli/blueprints.html#prettyDiffEntry"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#composer.cli.blueprints.prettyDiffEntry" title="Permalink to this definition"></a></dt> <tt class="descclassname">composer.cli.blueprints.</tt><tt class="descname">pretty_dict</tt><big>(</big><em>d</em><big>)</big><a class="reference internal" href="_modules/composer/cli/blueprints.html#pretty_dict"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#composer.cli.blueprints.pretty_dict" title="Permalink to this definition"></a></dt>
<dd><p>Return the dict as a human readable single line</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>d</strong> (<a class="reference external" href="https://docs.python.org/2/library/stdtypes.html#dict" title="(in Python v2.7)"><em>dict</em></a>) &#8211; key/values</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">String of the dict&#8217;s keys and values</td>
</tr>
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body">str</td>
</tr>
</tbody>
</table>
<p>key=&#8221;str&#8221;, key=&#8221;str1,str2&#8221;, ...</p>
</dd></dl>
<dl class="function">
<dt id="composer.cli.blueprints.pretty_diff_entry">
<tt class="descclassname">composer.cli.blueprints.</tt><tt class="descname">pretty_diff_entry</tt><big>(</big><em>diff</em><big>)</big><a class="reference internal" href="_modules/composer/cli/blueprints.html#pretty_diff_entry"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#composer.cli.blueprints.pretty_diff_entry" title="Permalink to this definition"></a></dt>
<dd><p>Generate nice diff entry string.</p> <dd><p>Generate nice diff entry string.</p>
<table class="docutils field-list" frame="void" rules="none"> <table class="docutils field-list" frame="void" rules="none">
<col class="field-name" /> <col class="field-name" />
@ -1094,7 +1132,7 @@ not to continue processing the results.</p>
<li class="right" > <li class="right" >
<a href="composer.html" title="composer Package" <a href="composer.html" title="composer Package"
>previous</a> |</li> >previous</a> |</li>
<li><a href="index.html">Lorax 19.7.22 documentation</a> &raquo;</li> <li><a href="index.html">Lorax 19.7.43 documentation</a> &raquo;</li>
<li><a href="modules.html" >src</a> &raquo;</li> <li><a href="modules.html" >src</a> &raquo;</li>
<li><a href="composer.html" >composer Package</a> &raquo;</li> <li><a href="composer.html" >composer Package</a> &raquo;</li>
</ul> </ul>

View File

@ -8,7 +8,7 @@
<head> <head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>composer Package &mdash; Lorax 19.7.22 documentation</title> <title>composer Package &mdash; Lorax 19.7.43 documentation</title>
<link rel="stylesheet" href="_static/default.css" type="text/css" /> <link rel="stylesheet" href="_static/default.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" /> <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
@ -16,7 +16,7 @@
<script type="text/javascript"> <script type="text/javascript">
var DOCUMENTATION_OPTIONS = { var DOCUMENTATION_OPTIONS = {
URL_ROOT: '', URL_ROOT: '',
VERSION: '19.7.22', VERSION: '19.7.43',
COLLAPSE_INDEX: false, COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html', FILE_SUFFIX: '.html',
HAS_SOURCE: true HAS_SOURCE: true
@ -25,7 +25,7 @@
<script type="text/javascript" src="_static/jquery.js"></script> <script type="text/javascript" src="_static/jquery.js"></script>
<script type="text/javascript" src="_static/underscore.js"></script> <script type="text/javascript" src="_static/underscore.js"></script>
<script type="text/javascript" src="_static/doctools.js"></script> <script type="text/javascript" src="_static/doctools.js"></script>
<link rel="top" title="Lorax 19.7.22 documentation" href="index.html" /> <link rel="top" title="Lorax 19.7.43 documentation" href="index.html" />
<link rel="up" title="src" href="modules.html" /> <link rel="up" title="src" href="modules.html" />
<link rel="next" title="cli Package" href="composer.cli.html" /> <link rel="next" title="cli Package" href="composer.cli.html" />
<link rel="prev" title="src" href="modules.html" /> <link rel="prev" title="src" href="modules.html" />
@ -46,7 +46,7 @@
<li class="right" > <li class="right" >
<a href="modules.html" title="src" <a href="modules.html" title="src"
accesskey="P">previous</a> |</li> accesskey="P">previous</a> |</li>
<li><a href="index.html">Lorax 19.7.22 documentation</a> &raquo;</li> <li><a href="index.html">Lorax 19.7.43 documentation</a> &raquo;</li>
<li><a href="modules.html" accesskey="U">src</a> &raquo;</li> <li><a href="modules.html" accesskey="U">src</a> &raquo;</li>
</ul> </ul>
</div> </div>
@ -330,7 +330,7 @@ fetch all results for the given request.</p>
<span id="unix-socket-module"></span><h2><tt class="xref py py-mod docutils literal"><span class="pre">unix_socket</span></tt> Module<a class="headerlink" href="#module-composer.unix_socket" title="Permalink to this headline"></a></h2> <span id="unix-socket-module"></span><h2><tt class="xref py py-mod docutils literal"><span class="pre">unix_socket</span></tt> Module<a class="headerlink" href="#module-composer.unix_socket" title="Permalink to this headline"></a></h2>
<dl class="class"> <dl class="class">
<dt id="composer.unix_socket.UnixHTTPConnection"> <dt id="composer.unix_socket.UnixHTTPConnection">
<em class="property">class </em><tt class="descclassname">composer.unix_socket.</tt><tt class="descname">UnixHTTPConnection</tt><big>(</big><em>socket_path</em>, <em>timeout=60</em><big>)</big><a class="reference internal" href="_modules/composer/unix_socket.html#UnixHTTPConnection"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#composer.unix_socket.UnixHTTPConnection" title="Permalink to this definition"></a></dt> <em class="property">class </em><tt class="descclassname">composer.unix_socket.</tt><tt class="descname">UnixHTTPConnection</tt><big>(</big><em>socket_path</em>, <em>timeout=300</em><big>)</big><a class="reference internal" href="_modules/composer/unix_socket.html#UnixHTTPConnection"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#composer.unix_socket.UnixHTTPConnection" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <a class="reference external" href="https://docs.python.org/2/library/httplib.html#httplib.HTTPConnection" title="(in Python v2.7)"><tt class="xref py py-class docutils literal"><span class="pre">httplib.HTTPConnection</span></tt></a>, <a class="reference external" href="https://docs.python.org/2/library/functions.html#object" title="(in Python v2.7)"><tt class="xref py py-class docutils literal"><span class="pre">object</span></tt></a></p> <dd><p>Bases: <a class="reference external" href="https://docs.python.org/2/library/httplib.html#httplib.HTTPConnection" title="(in Python v2.7)"><tt class="xref py py-class docutils literal"><span class="pre">httplib.HTTPConnection</span></tt></a>, <a class="reference external" href="https://docs.python.org/2/library/functions.html#object" title="(in Python v2.7)"><tt class="xref py py-class docutils literal"><span class="pre">object</span></tt></a></p>
<dl class="method"> <dl class="method">
<dt id="composer.unix_socket.UnixHTTPConnection.connect"> <dt id="composer.unix_socket.UnixHTTPConnection.connect">
@ -341,7 +341,7 @@ fetch all results for the given request.</p>
<dl class="class"> <dl class="class">
<dt id="composer.unix_socket.UnixHTTPConnectionPool"> <dt id="composer.unix_socket.UnixHTTPConnectionPool">
<em class="property">class </em><tt class="descclassname">composer.unix_socket.</tt><tt class="descname">UnixHTTPConnectionPool</tt><big>(</big><em>socket_path</em>, <em>timeout=60</em><big>)</big><a class="reference internal" href="_modules/composer/unix_socket.html#UnixHTTPConnectionPool"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#composer.unix_socket.UnixHTTPConnectionPool" title="Permalink to this definition"></a></dt> <em class="property">class </em><tt class="descclassname">composer.unix_socket.</tt><tt class="descname">UnixHTTPConnectionPool</tt><big>(</big><em>socket_path</em>, <em>timeout=300</em><big>)</big><a class="reference internal" href="_modules/composer/unix_socket.html#UnixHTTPConnectionPool"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#composer.unix_socket.UnixHTTPConnectionPool" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <tt class="xref py py-class docutils literal"><span class="pre">urllib3.connectionpool.HTTPConnectionPool</span></tt></p> <dd><p>Bases: <tt class="xref py py-class docutils literal"><span class="pre">urllib3.connectionpool.HTTPConnectionPool</span></tt></p>
</dd></dl> </dd></dl>
@ -429,7 +429,7 @@ fetch all results for the given request.</p>
<li class="right" > <li class="right" >
<a href="modules.html" title="src" <a href="modules.html" title="src"
>previous</a> |</li> >previous</a> |</li>
<li><a href="index.html">Lorax 19.7.22 documentation</a> &raquo;</li> <li><a href="index.html">Lorax 19.7.43 documentation</a> &raquo;</li>
<li><a href="modules.html" >src</a> &raquo;</li> <li><a href="modules.html" >src</a> &raquo;</li>
</ul> </ul>
</div> </div>

View File

@ -10,7 +10,7 @@
<head> <head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Index &mdash; Lorax 19.7.22 documentation</title> <title>Index &mdash; Lorax 19.7.43 documentation</title>
<link rel="stylesheet" href="_static/default.css" type="text/css" /> <link rel="stylesheet" href="_static/default.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" /> <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
@ -18,7 +18,7 @@
<script type="text/javascript"> <script type="text/javascript">
var DOCUMENTATION_OPTIONS = { var DOCUMENTATION_OPTIONS = {
URL_ROOT: '', URL_ROOT: '',
VERSION: '19.7.22', VERSION: '19.7.43',
COLLAPSE_INDEX: false, COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html', FILE_SUFFIX: '.html',
HAS_SOURCE: true HAS_SOURCE: true
@ -27,7 +27,7 @@
<script type="text/javascript" src="_static/jquery.js"></script> <script type="text/javascript" src="_static/jquery.js"></script>
<script type="text/javascript" src="_static/underscore.js"></script> <script type="text/javascript" src="_static/underscore.js"></script>
<script type="text/javascript" src="_static/doctools.js"></script> <script type="text/javascript" src="_static/doctools.js"></script>
<link rel="top" title="Lorax 19.7.22 documentation" href="index.html" /> <link rel="top" title="Lorax 19.7.43 documentation" href="index.html" />
</head> </head>
<body> <body>
<div class="related"> <div class="related">
@ -39,7 +39,7 @@
<li class="right" > <li class="right" >
<a href="py-modindex.html" title="Python Module Index" <a href="py-modindex.html" title="Python Module Index"
>modules</a> |</li> >modules</a> |</li>
<li><a href="index.html">Lorax 19.7.22 documentation</a> &raquo;</li> <li><a href="index.html">Lorax 19.7.43 documentation</a> &raquo;</li>
</ul> </ul>
</div> </div>
@ -200,6 +200,10 @@
</dt> </dt>
<dt><a href="pylorax.api.html#pylorax.api.compose.bootloader_append">bootloader_append() (in module pylorax.api.compose)</a>
</dt>
<dt><a href="pylorax.html#pylorax.ltmpl.brace_expand">brace_expand() (in module pylorax.ltmpl)</a> <dt><a href="pylorax.html#pylorax.ltmpl.brace_expand">brace_expand() (in module pylorax.ltmpl)</a>
</dt> </dt>
@ -226,6 +230,10 @@
<table style="width: 100%" class="indextable genindextable"><tr> <table style="width: 100%" class="indextable genindextable"><tr>
<td style="width: 33%" valign="top"><dl> <td style="width: 33%" valign="top"><dl>
<dt><a href="pylorax.api.html#pylorax.api.queue.check_queues">check_queues() (in module pylorax.api.queue)</a>
</dt>
<dt><a href="pylorax.api.html#pylorax.api.checkparams.checkparams">checkparams() (in module pylorax.api.checkparams)</a> <dt><a href="pylorax.api.html#pylorax.api.checkparams.checkparams">checkparams() (in module pylorax.api.checkparams)</a>
</dt> </dt>
@ -321,8 +329,6 @@
<dt><a href="composer.cli.html#composer.cli.compose.compose_status">compose_status() (in module composer.cli.compose)</a> <dt><a href="composer.cli.html#composer.cli.compose.compose_status">compose_status() (in module composer.cli.compose)</a>
</dt> </dt>
</dl></td>
<td style="width: 33%" valign="top"><dl>
<dt><a href="composer.cli.html#composer.cli.compose.compose_types">compose_types() (in module composer.cli.compose)</a> <dt><a href="composer.cli.html#composer.cli.compose.compose_types">compose_types() (in module composer.cli.compose)</a>
</dt> </dt>
@ -333,6 +339,8 @@
</dt> </dt>
</dl></dd> </dl></dd>
</dl></td>
<td style="width: 33%" valign="top"><dl>
<dt><a href="composer.html#module-composer">composer (module)</a> <dt><a href="composer.html#module-composer">composer (module)</a>
</dt> </dt>
@ -443,6 +451,14 @@
</dt> </dt>
</dl></dd> </dl></dd>
<dt><a href="pylorax.api.html#pylorax.api.recipes.customizations_diff">customizations_diff() (in module pylorax.api.recipes)</a>
</dt>
<dt><a href="pylorax.api.html#pylorax.api.compose.customize_ks_template">customize_ks_template() (in module pylorax.api.compose)</a>
</dt>
</dl></td> </dl></td>
</tr></table> </tr></table>
@ -485,10 +501,14 @@
<dt><a href="pylorax.html#pylorax.installer.VirtualInstall.destroy">destroy() (pylorax.installer.VirtualInstall method)</a> <dt><a href="pylorax.html#pylorax.installer.VirtualInstall.destroy">destroy() (pylorax.installer.VirtualInstall method)</a>
</dt> </dt>
<dt><a href="composer.cli.html#composer.cli.blueprints.dict_names">dict_names() (in module composer.cli.blueprints)</a>
</dt>
</dl></td> </dl></td>
<td style="width: 33%" valign="top"><dl> <td style="width: 33%" valign="top"><dl>
<dt><a href="pylorax.api.html#pylorax.api.recipes.diff_items">diff_items() (in module pylorax.api.recipes)</a> <dt><a href="pylorax.api.html#pylorax.api.recipes.diff_lists">diff_lists() (in module pylorax.api.recipes)</a>
</dt> </dt>
@ -594,10 +614,18 @@
</dt> </dt>
<dt><a href="pylorax.api.html#pylorax.api.projects.filterVersionGlob">filterVersionGlob() (in module pylorax.api.projects)</a>
</dt>
<dt><a href="pylorax.api.html#pylorax.api.recipes.find_commit_tag">find_commit_tag() (in module pylorax.api.recipes)</a> <dt><a href="pylorax.api.html#pylorax.api.recipes.find_commit_tag">find_commit_tag() (in module pylorax.api.recipes)</a>
</dt> </dt>
<dt><a href="pylorax.api.html#pylorax.api.recipes.find_field_value">find_field_value() (in module pylorax.api.recipes)</a>
</dt>
<dt><a href="pylorax.api.html#pylorax.api.recipes.find_name">find_name() (in module pylorax.api.recipes)</a> <dt><a href="pylorax.api.html#pylorax.api.recipes.find_name">find_name() (in module pylorax.api.recipes)</a>
</dt> </dt>
@ -608,6 +636,10 @@
</dl></td> </dl></td>
<td style="width: 33%" valign="top"><dl> <td style="width: 33%" valign="top"><dl>
<dt><a href="pylorax.api.html#pylorax.api.recipes.find_recipe_obj">find_recipe_obj() (in module pylorax.api.recipes)</a>
</dt>
<dt><a href="pylorax.html#pylorax.treebuilder.findkernels">findkernels() (in module pylorax.treebuilder)</a> <dt><a href="pylorax.html#pylorax.treebuilder.findkernels">findkernels() (in module pylorax.treebuilder)</a>
</dt> </dt>
@ -616,6 +648,10 @@
</dt> </dt>
<dt><a href="pylorax.api.html#pylorax.api.compose.firewall_cmd">firewall_cmd() (in module pylorax.api.compose)</a>
</dt>
<dt><a href="pylorax.api.html#pylorax.api.recipes.Recipe.freeze">freeze() (pylorax.api.recipes.Recipe method)</a> <dt><a href="pylorax.api.html#pylorax.api.recipes.Recipe.freeze">freeze() (pylorax.api.recipes.Recipe method)</a>
</dt> </dt>
@ -662,10 +698,18 @@
</dt> </dt>
<dt><a href="pylorax.api.html#pylorax.api.compose.get_default_services">get_default_services() (in module pylorax.api.compose)</a>
</dt>
<dt><a href="composer.html#composer.http_client.get_filename">get_filename() (in module composer.http_client)</a> <dt><a href="composer.html#composer.http_client.get_filename">get_filename() (in module composer.http_client)</a>
</dt> </dt>
<dt><a href="pylorax.api.html#pylorax.api.compose.get_firewall_settings">get_firewall_settings() (in module pylorax.api.compose)</a>
</dt>
<dt><a href="pylorax.api.html#pylorax.api.queue.get_image_name">get_image_name() (in module pylorax.api.queue)</a> <dt><a href="pylorax.api.html#pylorax.api.queue.get_image_name">get_image_name() (in module pylorax.api.queue)</a>
</dt> </dt>
@ -674,13 +718,21 @@
</dt> </dt>
<dt><a href="pylorax.api.html#pylorax.api.compose.get_kernel_append">get_kernel_append() (in module pylorax.api.compose)</a>
</dt>
<dt><a href="pylorax.html#pylorax.creator.KernelInfo.get_kernel_arch">get_kernel_arch() (pylorax.creator.KernelInfo method)</a> <dt><a href="pylorax.html#pylorax.creator.KernelInfo.get_kernel_arch">get_kernel_arch() (pylorax.creator.KernelInfo method)</a>
</dt> </dt>
<dt><a href="pylorax.html#pylorax.creator.KernelInfo.get_kernels">get_kernels() (pylorax.creator.KernelInfo method)</a>
</dt>
</dl></td> </dl></td>
<td style="width: 33%" valign="top"><dl> <td style="width: 33%" valign="top"><dl>
<dt><a href="pylorax.html#pylorax.creator.KernelInfo.get_kernels">get_kernels() (pylorax.creator.KernelInfo method)</a> <dt><a href="pylorax.api.html#pylorax.api.compose.get_keyboard_layout">get_keyboard_layout() (in module pylorax.api.compose)</a>
</dt> </dt>
@ -688,10 +740,18 @@
</dt> </dt>
<dt><a href="pylorax.api.html#pylorax.api.compose.get_languages">get_languages() (in module pylorax.api.compose)</a>
</dt>
<dt><a href="pylorax.html#pylorax.imgutils.get_loop_name">get_loop_name() (in module pylorax.imgutils)</a> <dt><a href="pylorax.html#pylorax.imgutils.get_loop_name">get_loop_name() (in module pylorax.imgutils)</a>
</dt> </dt>
<dt><a href="pylorax.api.html#pylorax.api.compose.get_md_size">get_md_size() (in module pylorax.api.compose)</a>
</dt>
<dt><a href="pylorax.api.html#pylorax.api.projects.get_repo_sources">get_repo_sources() (in module pylorax.api.projects)</a> <dt><a href="pylorax.api.html#pylorax.api.projects.get_repo_sources">get_repo_sources() (in module pylorax.api.projects)</a>
</dt> </dt>
@ -700,10 +760,18 @@
</dt> </dt>
<dt><a href="pylorax.api.html#pylorax.api.compose.get_services">get_services() (in module pylorax.api.compose)</a>
</dt>
<dt><a href="pylorax.api.html#pylorax.api.projects.get_source_ids">get_source_ids() (in module pylorax.api.projects)</a> <dt><a href="pylorax.api.html#pylorax.api.projects.get_source_ids">get_source_ids() (in module pylorax.api.projects)</a>
</dt> </dt>
<dt><a href="pylorax.api.html#pylorax.api.compose.get_timezone_settings">get_timezone_settings() (in module pylorax.api.compose)</a>
</dt>
<dt><a href="composer.html#composer.http_client.get_url_json">get_url_json() (in module composer.http_client)</a> <dt><a href="composer.html#composer.http_client.get_url_json">get_url_json() (in module composer.http_client)</a>
</dt> </dt>
@ -770,6 +838,10 @@
</dt> </dt>
<dt><a href="pylorax.api.html#pylorax.api.bisect.insort_left">insort_left() (in module pylorax.api.bisect)</a>
</dt>
<dt><a href="pylorax.html#pylorax.ltmpl.LoraxTemplateRunner.install">install() (pylorax.ltmpl.LoraxTemplateRunner method)</a> <dt><a href="pylorax.html#pylorax.ltmpl.LoraxTemplateRunner.install">install() (pylorax.ltmpl.LoraxTemplateRunner method)</a>
</dt> </dt>
@ -791,12 +863,12 @@
<dt><a href="pylorax.html#pylorax.ltmpl.LoraxTemplateRunner.installinitrd">installinitrd() (pylorax.ltmpl.LoraxTemplateRunner method)</a> <dt><a href="pylorax.html#pylorax.ltmpl.LoraxTemplateRunner.installinitrd">installinitrd() (pylorax.ltmpl.LoraxTemplateRunner method)</a>
</dt> </dt>
</dl></td>
<td style="width: 33%" valign="top"><dl>
<dt><a href="pylorax.html#pylorax.ltmpl.LoraxTemplateRunner.installkernel">installkernel() (pylorax.ltmpl.LoraxTemplateRunner method)</a> <dt><a href="pylorax.html#pylorax.ltmpl.LoraxTemplateRunner.installkernel">installkernel() (pylorax.ltmpl.LoraxTemplateRunner method)</a>
</dt> </dt>
</dl></td>
<td style="width: 33%" valign="top"><dl>
<dt><a href="pylorax.html#pylorax.ltmpl.LoraxTemplateRunner.installpkg">installpkg() (pylorax.ltmpl.LoraxTemplateRunner method)</a> <dt><a href="pylorax.html#pylorax.ltmpl.LoraxTemplateRunner.installpkg">installpkg() (pylorax.ltmpl.LoraxTemplateRunner method)</a>
</dt> </dt>
@ -845,10 +917,14 @@
<dt><a href="pylorax.html#pylorax.creator.KernelInfo">KernelInfo (class in pylorax.creator)</a> <dt><a href="pylorax.html#pylorax.creator.KernelInfo">KernelInfo (class in pylorax.creator)</a>
</dt> </dt>
<dt><a href="pylorax.html#pylorax.treebuilder.TreeBuilder.kernels">kernels (pylorax.treebuilder.TreeBuilder attribute)</a>
</dt>
</dl></td> </dl></td>
<td style="width: 33%" valign="top"><dl> <td style="width: 33%" valign="top"><dl>
<dt><a href="pylorax.html#pylorax.treebuilder.TreeBuilder.kernels">kernels (pylorax.treebuilder.TreeBuilder attribute)</a> <dt><a href="pylorax.api.html#pylorax.api.compose.keyboard_cmd">keyboard_cmd() (in module pylorax.api.compose)</a>
</dt> </dt>
</dl></td> </dl></td>
@ -858,6 +934,10 @@
<table style="width: 100%" class="indextable genindextable"><tr> <table style="width: 100%" class="indextable genindextable"><tr>
<td style="width: 33%" valign="top"><dl> <td style="width: 33%" valign="top"><dl>
<dt><a href="pylorax.api.html#pylorax.api.compose.lang_cmd">lang_cmd() (in module pylorax.api.compose)</a>
</dt>
<dt><a href="pylorax.html#pylorax.ArchData.lib64_arches">lib64_arches (pylorax.ArchData attribute)</a> <dt><a href="pylorax.html#pylorax.ArchData.lib64_arches">lib64_arches (pylorax.ArchData attribute)</a>
</dt> </dt>
@ -881,6 +961,16 @@
<dt><a href="pylorax.api.html#pylorax.api.server.GitLock.lock">lock (pylorax.api.server.GitLock attribute)</a> <dt><a href="pylorax.api.html#pylorax.api.server.GitLock.lock">lock (pylorax.api.server.GitLock attribute)</a>
</dt> </dt>
<dd><dl>
<dt><a href="pylorax.api.html#pylorax.api.yumbase.YumLock.lock">(pylorax.api.yumbase.YumLock attribute)</a>
</dt>
</dl></dd>
<dt><a href="pylorax.api.html#pylorax.api.yumbase.YumLock.lock_check">lock_check (pylorax.api.yumbase.YumLock attribute)</a>
</dt>
<dt><a href="pylorax.html#pylorax.ltmpl.LoraxTemplateRunner.log">log() (pylorax.ltmpl.LoraxTemplateRunner method)</a> <dt><a href="pylorax.html#pylorax.ltmpl.LoraxTemplateRunner.log">log() (pylorax.ltmpl.LoraxTemplateRunner method)</a>
</dt> </dt>
@ -890,9 +980,15 @@
</dt> </dt>
<dt><a href="pylorax.html#pylorax.log_selinux_state">log_selinux_state() (in module pylorax)</a>
</dt>
<dt><a href="pylorax.html#pylorax.logmonitor.LogMonitor">LogMonitor (class in pylorax.logmonitor)</a> <dt><a href="pylorax.html#pylorax.logmonitor.LogMonitor">LogMonitor (class in pylorax.logmonitor)</a>
</dt> </dt>
</dl></td>
<td style="width: 33%" valign="top"><dl>
<dt><a href="pylorax.html#pylorax.logmonitor.LogRequestHandler">LogRequestHandler (class in pylorax.logmonitor)</a> <dt><a href="pylorax.html#pylorax.logmonitor.LogRequestHandler">LogRequestHandler (class in pylorax.logmonitor)</a>
</dt> </dt>
@ -901,8 +997,6 @@
<dt><a href="pylorax.html#pylorax.logmonitor.LogServer">LogServer (class in pylorax.logmonitor)</a> <dt><a href="pylorax.html#pylorax.logmonitor.LogServer">LogServer (class in pylorax.logmonitor)</a>
</dt> </dt>
</dl></td>
<td style="width: 33%" valign="top"><dl>
<dt><a href="pylorax.html#pylorax.imgutils.loop_attach">loop_attach() (in module pylorax.imgutils)</a> <dt><a href="pylorax.html#pylorax.imgutils.loop_attach">loop_attach() (in module pylorax.imgutils)</a>
</dt> </dt>
@ -1170,11 +1264,19 @@
</dt> </dt>
<dt><a href="composer.cli.html#composer.cli.blueprints.pretty_dict">pretty_dict() (in module composer.cli.blueprints)</a>
</dt>
<dt><a href="composer.cli.html#composer.cli.blueprints.pretty_diff_entry">pretty_diff_entry() (in module composer.cli.blueprints)</a>
</dt>
<dt><a href="composer.cli.html#composer.cli.blueprints.prettyCommitDetails">prettyCommitDetails() (in module composer.cli.blueprints)</a> <dt><a href="composer.cli.html#composer.cli.blueprints.prettyCommitDetails">prettyCommitDetails() (in module composer.cli.blueprints)</a>
</dt> </dt>
<dt><a href="composer.cli.html#composer.cli.blueprints.prettyDiffEntry">prettyDiffEntry() (in module composer.cli.blueprints)</a> <dt><a href="pylorax.api.html#pylorax.api.projects.proj_to_module">proj_to_module() (in module pylorax.api.projects)</a>
</dt> </dt>
@ -1226,16 +1328,20 @@
</dt> </dt>
<dt><a href="pylorax.api.html#module-pylorax.api.checkparams">pylorax.api.checkparams (module)</a> <dt><a href="pylorax.api.html#module-pylorax.api.bisect">pylorax.api.bisect (module)</a>
</dt> </dt>
<dt><a href="pylorax.api.html#module-pylorax.api.compose">pylorax.api.compose (module)</a> <dt><a href="pylorax.api.html#module-pylorax.api.checkparams">pylorax.api.checkparams (module)</a>
</dt> </dt>
</dl></td> </dl></td>
<td style="width: 33%" valign="top"><dl> <td style="width: 33%" valign="top"><dl>
<dt><a href="pylorax.api.html#module-pylorax.api.compose">pylorax.api.compose (module)</a>
</dt>
<dt><a href="pylorax.api.html#module-pylorax.api.config">pylorax.api.config (module)</a> <dt><a href="pylorax.api.html#module-pylorax.api.config">pylorax.api.config (module)</a>
</dt> </dt>
@ -1437,12 +1543,12 @@
</dt> </dt>
</dl></dd> </dl></dd>
</dl></td>
<td style="width: 33%" valign="top"><dl>
<dt><a href="pylorax.html#pylorax.ltmpl.LoraxTemplateRunner.removefrom">removefrom() (pylorax.ltmpl.LoraxTemplateRunner method)</a> <dt><a href="pylorax.html#pylorax.ltmpl.LoraxTemplateRunner.removefrom">removefrom() (pylorax.ltmpl.LoraxTemplateRunner method)</a>
</dt> </dt>
</dl></td>
<td style="width: 33%" valign="top"><dl>
<dt><a href="pylorax.html#pylorax.ltmpl.LoraxTemplateRunner.removekmod">removekmod() (pylorax.ltmpl.LoraxTemplateRunner method)</a> <dt><a href="pylorax.html#pylorax.ltmpl.LoraxTemplateRunner.removekmod">removekmod() (pylorax.ltmpl.LoraxTemplateRunner method)</a>
</dt> </dt>
@ -1466,6 +1572,10 @@
</dt> </dt>
<dt><a href="pylorax.api.html#pylorax.api.recipes.repo_file_exists">repo_file_exists() (in module pylorax.api.recipes)</a>
</dt>
<dt><a href="pylorax.api.html#pylorax.api.compose.repo_to_ks">repo_to_ks() (in module pylorax.api.compose)</a> <dt><a href="pylorax.api.html#pylorax.api.compose.repo_to_ks">repo_to_ks() (in module pylorax.api.compose)</a>
</dt> </dt>
@ -1544,6 +1654,10 @@
</dt> </dt>
<dt><a href="pylorax.api.html#pylorax.api.compose.services_cmd">services_cmd() (in module pylorax.api.compose)</a>
</dt>
<dt><a href="pylorax.html#pylorax.logmonitor.LogRequestHandler.setup">setup() (pylorax.logmonitor.LogRequestHandler method)</a> <dt><a href="pylorax.html#pylorax.logmonitor.LogRequestHandler.setup">setup() (pylorax.logmonitor.LogRequestHandler method)</a>
</dt> </dt>
@ -1571,12 +1685,12 @@
<dt><a href="composer.cli.html#composer.cli.sources.sources_delete">sources_delete() (in module composer.cli.sources)</a> <dt><a href="composer.cli.html#composer.cli.sources.sources_delete">sources_delete() (in module composer.cli.sources)</a>
</dt> </dt>
</dl></td>
<td style="width: 33%" valign="top"><dl>
<dt><a href="composer.cli.html#composer.cli.sources.sources_info">sources_info() (in module composer.cli.sources)</a> <dt><a href="composer.cli.html#composer.cli.sources.sources_info">sources_info() (in module composer.cli.sources)</a>
</dt> </dt>
</dl></td>
<td style="width: 33%" valign="top"><dl>
<dt><a href="composer.cli.html#composer.cli.sources.sources_list">sources_list() (in module composer.cli.sources)</a> <dt><a href="composer.cli.html#composer.cli.sources.sources_list">sources_list() (in module composer.cli.sources)</a>
</dt> </dt>
@ -1640,12 +1754,16 @@
</dt> </dt>
<dt><a href="pylorax.api.html#pylorax.api.projects.tm_to_dep">tm_to_dep() (in module pylorax.api.projects)</a> <dt><a href="pylorax.api.html#pylorax.api.compose.timezone_cmd">timezone_cmd() (in module pylorax.api.compose)</a>
</dt> </dt>
</dl></td> </dl></td>
<td style="width: 33%" valign="top"><dl> <td style="width: 33%" valign="top"><dl>
<dt><a href="pylorax.api.html#pylorax.api.projects.tm_to_dep">tm_to_dep() (in module pylorax.api.projects)</a>
</dt>
<dt><a href="pylorax.api.html#pylorax.api.recipes.Recipe.toml">toml() (pylorax.api.recipes.Recipe method)</a> <dt><a href="pylorax.api.html#pylorax.api.recipes.Recipe.toml">toml() (pylorax.api.recipes.Recipe method)</a>
</dt> </dt>
@ -1802,6 +1920,10 @@
</dt> </dt>
<dt><a href="pylorax.api.html#pylorax.api.compose.write_ks_root">write_ks_root() (in module pylorax.api.compose)</a>
</dt>
<dt><a href="pylorax.api.html#pylorax.api.compose.write_ks_user">write_ks_user() (in module pylorax.api.compose)</a> <dt><a href="pylorax.api.html#pylorax.api.compose.write_ks_user">write_ks_user() (in module pylorax.api.compose)</a>
</dt> </dt>
@ -1824,23 +1946,27 @@
<table style="width: 100%" class="indextable genindextable"><tr> <table style="width: 100%" class="indextable genindextable"><tr>
<td style="width: 33%" valign="top"><dl> <td style="width: 33%" valign="top"><dl>
<dt><a href="pylorax.api.html#pylorax.api.projects.yaps_to_module">yaps_to_module() (in module pylorax.api.projects)</a> <dt><a href="pylorax.api.html#pylorax.api.projects.yaps_to_build">yaps_to_build() (in module pylorax.api.projects)</a>
</dt> </dt>
<dt><a href="pylorax.api.html#pylorax.api.projects.yaps_to_project">yaps_to_project() (in module pylorax.api.projects)</a> <dt><a href="pylorax.api.html#pylorax.api.projects.yaps_to_project">yaps_to_project() (in module pylorax.api.projects)</a>
</dt> </dt>
</dl></td>
<td style="width: 33%" valign="top"><dl>
<dt><a href="pylorax.api.html#pylorax.api.projects.yaps_to_project_info">yaps_to_project_info() (in module pylorax.api.projects)</a> <dt><a href="pylorax.api.html#pylorax.api.projects.yaps_to_project_info">yaps_to_project_info() (in module pylorax.api.projects)</a>
</dt> </dt>
</dl></td>
<td style="width: 33%" valign="top"><dl>
<dt><a href="pylorax.api.html#pylorax.api.projects.yum_repo_to_file_repo">yum_repo_to_file_repo() (in module pylorax.api.projects)</a> <dt><a href="pylorax.api.html#pylorax.api.projects.yum_repo_to_file_repo">yum_repo_to_file_repo() (in module pylorax.api.projects)</a>
</dt> </dt>
<dt><a href="pylorax.api.html#pylorax.api.yumbase.YumLock">YumLock (class in pylorax.api.yumbase)</a>
</dt>
</dl></td> </dl></td>
</tr></table> </tr></table>
@ -1880,7 +2006,7 @@
<li class="right" > <li class="right" >
<a href="py-modindex.html" title="Python Module Index" <a href="py-modindex.html" title="Python Module Index"
>modules</a> |</li> >modules</a> |</li>
<li><a href="index.html">Lorax 19.7.22 documentation</a> &raquo;</li> <li><a href="index.html">Lorax 19.7.43 documentation</a> &raquo;</li>
</ul> </ul>
</div> </div>
<div class="footer"> <div class="footer">

View File

@ -8,7 +8,7 @@
<head> <head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Welcome to Loraxs documentation! &mdash; Lorax 19.7.22 documentation</title> <title>Welcome to Loraxs documentation! &mdash; Lorax 19.7.43 documentation</title>
<link rel="stylesheet" href="_static/default.css" type="text/css" /> <link rel="stylesheet" href="_static/default.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" /> <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
@ -16,7 +16,7 @@
<script type="text/javascript"> <script type="text/javascript">
var DOCUMENTATION_OPTIONS = { var DOCUMENTATION_OPTIONS = {
URL_ROOT: '', URL_ROOT: '',
VERSION: '19.7.22', VERSION: '19.7.43',
COLLAPSE_INDEX: false, COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html', FILE_SUFFIX: '.html',
HAS_SOURCE: true HAS_SOURCE: true
@ -25,7 +25,7 @@
<script type="text/javascript" src="_static/jquery.js"></script> <script type="text/javascript" src="_static/jquery.js"></script>
<script type="text/javascript" src="_static/underscore.js"></script> <script type="text/javascript" src="_static/underscore.js"></script>
<script type="text/javascript" src="_static/doctools.js"></script> <script type="text/javascript" src="_static/doctools.js"></script>
<link rel="top" title="Lorax 19.7.22 documentation" href="#" /> <link rel="top" title="Lorax 19.7.43 documentation" href="#" />
<link rel="next" title="Introduction to Lorax" href="intro.html" /> <link rel="next" title="Introduction to Lorax" href="intro.html" />
</head> </head>
<body> <body>
@ -41,7 +41,7 @@
<li class="right" > <li class="right" >
<a href="intro.html" title="Introduction to Lorax" <a href="intro.html" title="Introduction to Lorax"
accesskey="N">next</a> |</li> accesskey="N">next</a> |</li>
<li><a href="#">Lorax 19.7.22 documentation</a> &raquo;</li> <li><a href="#">Lorax 19.7.43 documentation</a> &raquo;</li>
</ul> </ul>
</div> </div>
@ -126,7 +126,7 @@
<li class="right" > <li class="right" >
<a href="intro.html" title="Introduction to Lorax" <a href="intro.html" title="Introduction to Lorax"
>next</a> |</li> >next</a> |</li>
<li><a href="#">Lorax 19.7.22 documentation</a> &raquo;</li> <li><a href="#">Lorax 19.7.43 documentation</a> &raquo;</li>
</ul> </ul>
</div> </div>
<div class="footer"> <div class="footer">

View File

@ -8,7 +8,7 @@
<head> <head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Introduction to Lorax &mdash; Lorax 19.7.22 documentation</title> <title>Introduction to Lorax &mdash; Lorax 19.7.43 documentation</title>
<link rel="stylesheet" href="_static/default.css" type="text/css" /> <link rel="stylesheet" href="_static/default.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" /> <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
@ -16,7 +16,7 @@
<script type="text/javascript"> <script type="text/javascript">
var DOCUMENTATION_OPTIONS = { var DOCUMENTATION_OPTIONS = {
URL_ROOT: '', URL_ROOT: '',
VERSION: '19.7.22', VERSION: '19.7.43',
COLLAPSE_INDEX: false, COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html', FILE_SUFFIX: '.html',
HAS_SOURCE: true HAS_SOURCE: true
@ -25,7 +25,7 @@
<script type="text/javascript" src="_static/jquery.js"></script> <script type="text/javascript" src="_static/jquery.js"></script>
<script type="text/javascript" src="_static/underscore.js"></script> <script type="text/javascript" src="_static/underscore.js"></script>
<script type="text/javascript" src="_static/doctools.js"></script> <script type="text/javascript" src="_static/doctools.js"></script>
<link rel="top" title="Lorax 19.7.22 documentation" href="index.html" /> <link rel="top" title="Lorax 19.7.43 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" />
</head> </head>
@ -45,7 +45,7 @@
<li class="right" > <li class="right" >
<a href="index.html" title="Welcome to Loraxs documentation!" <a href="index.html" title="Welcome to Loraxs documentation!"
accesskey="P">previous</a> |</li> accesskey="P">previous</a> |</li>
<li><a href="index.html">Lorax 19.7.22 documentation</a> &raquo;</li> <li><a href="index.html">Lorax 19.7.43 documentation</a> &raquo;</li>
</ul> </ul>
</div> </div>
@ -161,7 +161,7 @@ upd-instroot and mk-images* scripts.</p>
<li class="right" > <li class="right" >
<a href="index.html" title="Welcome to Loraxs documentation!" <a href="index.html" title="Welcome to Loraxs documentation!"
>previous</a> |</li> >previous</a> |</li>
<li><a href="index.html">Lorax 19.7.22 documentation</a> &raquo;</li> <li><a href="index.html">Lorax 19.7.43 documentation</a> &raquo;</li>
</ul> </ul>
</div> </div>
<div class="footer"> <div class="footer">

View File

@ -8,7 +8,7 @@
<head> <head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>livemedia-creator &mdash; Lorax 19.7.22 documentation</title> <title>livemedia-creator &mdash; Lorax 19.7.43 documentation</title>
<link rel="stylesheet" href="_static/default.css" type="text/css" /> <link rel="stylesheet" href="_static/default.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" /> <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
@ -16,7 +16,7 @@
<script type="text/javascript"> <script type="text/javascript">
var DOCUMENTATION_OPTIONS = { var DOCUMENTATION_OPTIONS = {
URL_ROOT: '', URL_ROOT: '',
VERSION: '19.7.22', VERSION: '19.7.43',
COLLAPSE_INDEX: false, COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html', FILE_SUFFIX: '.html',
HAS_SOURCE: true HAS_SOURCE: true
@ -25,7 +25,7 @@
<script type="text/javascript" src="_static/jquery.js"></script> <script type="text/javascript" src="_static/jquery.js"></script>
<script type="text/javascript" src="_static/underscore.js"></script> <script type="text/javascript" src="_static/underscore.js"></script>
<script type="text/javascript" src="_static/doctools.js"></script> <script type="text/javascript" src="_static/doctools.js"></script>
<link rel="top" title="Lorax 19.7.22 documentation" href="index.html" /> <link rel="top" title="Lorax 19.7.43 documentation" href="index.html" />
<link rel="next" title="lorax-composer" href="lorax-composer.html" /> <link rel="next" title="lorax-composer" href="lorax-composer.html" />
<link rel="prev" title="Lorax" href="lorax.html" /> <link rel="prev" title="Lorax" href="lorax.html" />
</head> </head>
@ -45,7 +45,7 @@
<li class="right" > <li class="right" >
<a href="lorax.html" title="Lorax" <a href="lorax.html" title="Lorax"
accesskey="P">previous</a> |</li> accesskey="P">previous</a> |</li>
<li><a href="index.html">Lorax 19.7.22 documentation</a> &raquo;</li> <li><a href="index.html">Lorax 19.7.43 documentation</a> &raquo;</li>
</ul> </ul>
</div> </div>
@ -446,7 +446,7 @@ report bugs against the lorax component.</p>
<li class="right" > <li class="right" >
<a href="lorax.html" title="Lorax" <a href="lorax.html" title="Lorax"
>previous</a> |</li> >previous</a> |</li>
<li><a href="index.html">Lorax 19.7.22 documentation</a> &raquo;</li> <li><a href="index.html">Lorax 19.7.43 documentation</a> &raquo;</li>
</ul> </ul>
</div> </div>
<div class="footer"> <div class="footer">

View File

@ -8,7 +8,7 @@
<head> <head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>lorax-composer &mdash; Lorax 19.7.22 documentation</title> <title>lorax-composer &mdash; Lorax 19.7.43 documentation</title>
<link rel="stylesheet" href="_static/default.css" type="text/css" /> <link rel="stylesheet" href="_static/default.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" /> <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
@ -16,7 +16,7 @@
<script type="text/javascript"> <script type="text/javascript">
var DOCUMENTATION_OPTIONS = { var DOCUMENTATION_OPTIONS = {
URL_ROOT: '', URL_ROOT: '',
VERSION: '19.7.22', VERSION: '19.7.43',
COLLAPSE_INDEX: false, COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html', FILE_SUFFIX: '.html',
HAS_SOURCE: true HAS_SOURCE: true
@ -25,7 +25,7 @@
<script type="text/javascript" src="_static/jquery.js"></script> <script type="text/javascript" src="_static/jquery.js"></script>
<script type="text/javascript" src="_static/underscore.js"></script> <script type="text/javascript" src="_static/underscore.js"></script>
<script type="text/javascript" src="_static/doctools.js"></script> <script type="text/javascript" src="_static/doctools.js"></script>
<link rel="top" title="Lorax 19.7.22 documentation" href="index.html" /> <link rel="top" title="Lorax 19.7.43 documentation" href="index.html" />
<link rel="next" title="composer-cli" href="composer-cli.html" /> <link rel="next" title="composer-cli" href="composer-cli.html" />
<link rel="prev" title="livemedia-creator" href="livemedia-creator.html" /> <link rel="prev" title="livemedia-creator" href="livemedia-creator.html" />
</head> </head>
@ -45,7 +45,7 @@
<li class="right" > <li class="right" >
<a href="livemedia-creator.html" title="livemedia-creator" <a href="livemedia-creator.html" title="livemedia-creator"
accesskey="P">previous</a> |</li> accesskey="P">previous</a> |</li>
<li><a href="index.html">Lorax 19.7.22 documentation</a> &raquo;</li> <li><a href="index.html">Lorax 19.7.43 documentation</a> &raquo;</li>
</ul> </ul>
</div> </div>
@ -81,6 +81,10 @@ for image creation to work correctly. You can either edit the setting in the
<a class="reference external" href="https://access.redhat.com/solutions/392003">Red Hat Enterprise Linux 7 documentation</a> <a class="reference external" href="https://access.redhat.com/solutions/392003">Red Hat Enterprise Linux 7 documentation</a>
for information on how to enable it. Otherwise you will see image creation fail to for information on how to enable it. Otherwise you will see image creation fail to
depsolve even if the blueprint itself is correct.</li> depsolve even if the blueprint itself is correct.</li>
<li>All image types lock the root account, except for live-iso. You will need to either
use one of the <a class="reference internal" href="#customizations">Customizations</a> methods for setting a ssh key/password, install a
package that creates a user, or use something like <cite>cloud-init</cite> to setup access at
boot time.</li>
</ul> </ul>
</div> </div>
<div class="section" id="installation"> <div class="section" id="installation">
@ -204,11 +208,22 @@ for selecting optional packages.</p>
</div> </div>
<div class="section" id="customizations"> <div class="section" id="customizations">
<h3>Customizations<a class="headerlink" href="#customizations" title="Permalink to this headline"></a></h3> <h3>Customizations<a class="headerlink" href="#customizations" title="Permalink to this headline"></a></h3>
<p>The <tt class="docutils literal"><span class="pre">[[customizations]]</span></tt> section can be used to configure the hostname of the final image. eg.:</p> <p>The <tt class="docutils literal"><span class="pre">[customizations]</span></tt> section can be used to configure the hostname of the final image. eg.:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="p">[[</span><span class="n">customizations</span><span class="p">]]</span> <div class="highlight-python"><div class="highlight"><pre><span class="p">[</span><span class="n">customizations</span><span class="p">]</span>
<span class="n">hostname</span> <span class="o">=</span> <span class="s">&quot;baseimage&quot;</span> <span class="n">hostname</span> <span class="o">=</span> <span class="s">&quot;baseimage&quot;</span>
</pre></div> </pre></div>
</div> </div>
<p>This is optional and may be left out to use the defaults.</p>
<div class="section" id="customizations-kernel">
<h4>[customizations.kernel]<a class="headerlink" href="#customizations-kernel" title="Permalink to this headline"></a></h4>
<p>This allows you to append arguments to the bootloader&#8217;s kernel commandline. This will not have any
effect on <tt class="docutils literal"><span class="pre">tar</span></tt> or <tt class="docutils literal"><span class="pre">ext4-filesystem</span></tt> images since they do not include a bootloader.</p>
<p>For example:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="p">[</span><span class="n">customizations</span><span class="o">.</span><span class="n">kernel</span><span class="p">]</span>
<span class="n">append</span> <span class="o">=</span> <span class="s">&quot;nosmt=force&quot;</span>
</pre></div>
</div>
</div>
<div class="section" id="customizations-sshkey"> <div class="section" id="customizations-sshkey">
<h4>[[customizations.sshkey]]<a class="headerlink" href="#customizations-sshkey" title="Permalink to this headline"></a></h4> <h4>[[customizations.sshkey]]<a class="headerlink" href="#customizations-sshkey" title="Permalink to this headline"></a></h4>
<p>Set an existing user&#8217;s ssh key in the final image:</p> <p>Set an existing user&#8217;s ssh key in the final image:</p>
@ -247,6 +262,82 @@ an encrypted password. Otherwise it will be treated as a plain text password.</p
</pre></div> </pre></div>
</div> </div>
</div> </div>
<div class="section" id="customizations-timezone">
<h4>[customizations.timezone]<a class="headerlink" href="#customizations-timezone" title="Permalink to this headline"></a></h4>
<p>Customizing the timezone and the NTP servers to use for the system:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="p">[</span><span class="n">customizations</span><span class="o">.</span><span class="n">timezone</span><span class="p">]</span>
<span class="n">timezone</span> <span class="o">=</span> <span class="s">&quot;US/Eastern&quot;</span>
<span class="n">ntpservers</span> <span class="o">=</span> <span class="p">[</span><span class="s">&quot;0.north-america.pool.ntp.org&quot;</span><span class="p">,</span> <span class="s">&quot;1.north-america.pool.ntp.org&quot;</span><span class="p">]</span>
</pre></div>
</div>
<p>The values supported by <tt class="docutils literal"><span class="pre">timezone</span></tt> can be listed by running <tt class="docutils literal"><span class="pre">timedatectl</span> <span class="pre">list-timezones</span></tt>.</p>
<p>If no timezone is setup the system will default to using <cite>UTC</cite>. The ntp servers are also
optional and will default to using the distribution defaults which are fine for most uses.</p>
<p>In some image types there are already NTP servers setup, eg. Google cloud image, and they
cannot be overridden because they are required to boot in the selected environment. But the
timezone will be updated to the one selected in the blueprint.</p>
</div>
<div class="section" id="customizations-locale">
<h4>[customizations.locale]<a class="headerlink" href="#customizations-locale" title="Permalink to this headline"></a></h4>
<p>Customize the locale settings for the system:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="p">[</span><span class="n">customizations</span><span class="o">.</span><span class="n">locale</span><span class="p">]</span>
<span class="n">languages</span> <span class="o">=</span> <span class="p">[</span><span class="s">&quot;en_US.UTF-8&quot;</span><span class="p">]</span>
<span class="n">keyboard</span> <span class="o">=</span> <span class="s">&quot;us&quot;</span>
</pre></div>
</div>
<p>The values supported by <tt class="docutils literal"><span class="pre">languages</span></tt> can be listed by running <tt class="docutils literal"><span class="pre">localectl</span> <span class="pre">list-locales</span></tt> from
the command line.</p>
<p>The values supported by <tt class="docutils literal"><span class="pre">keyboard</span></tt> can be listed by running <tt class="docutils literal"><span class="pre">localectl</span> <span class="pre">list-keymaps</span></tt> from
the command line.</p>
<p>Multiple languages can be added. The first one becomes the
primary, and the others are added as secondary. One or the other of <tt class="docutils literal"><span class="pre">languages</span></tt>
or <tt class="docutils literal"><span class="pre">keyboard</span></tt> must be included (or both) in the section.</p>
</div>
<div class="section" id="customizations-firewall">
<h4>[customizations.firewall]<a class="headerlink" href="#customizations-firewall" title="Permalink to this headline"></a></h4>
<p>By default the firewall blocks all access except for services that enable their ports explicitly,
like <tt class="docutils literal"><span class="pre">sshd</span></tt>. This command can be used to open other ports or services. Ports are configured using
the port:protocol format:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="p">[</span><span class="n">customizations</span><span class="o">.</span><span class="n">firewall</span><span class="p">]</span>
<span class="n">ports</span> <span class="o">=</span> <span class="p">[</span><span class="s">&quot;22:tcp&quot;</span><span class="p">,</span> <span class="s">&quot;80:tcp&quot;</span><span class="p">,</span> <span class="s">&quot;imap:tcp&quot;</span><span class="p">,</span> <span class="s">&quot;53:tcp&quot;</span><span class="p">,</span> <span class="s">&quot;53:udp&quot;</span><span class="p">]</span>
</pre></div>
</div>
<p>Numeric ports, or their names from <tt class="docutils literal"><span class="pre">/etc/services</span></tt> can be used in the <tt class="docutils literal"><span class="pre">ports</span></tt> enabled/disabled lists.</p>
<p>The blueprint settings extend any existing settings in the image templates, so if <tt class="docutils literal"><span class="pre">sshd</span></tt> is
already enabled it will extend the list of ports with the ones listed by the blueprint.</p>
<p>If the distribution uses <tt class="docutils literal"><span class="pre">firewalld</span></tt> you can specify services listed by <tt class="docutils literal"><span class="pre">firewall-cmd</span> <span class="pre">--get-services</span></tt>
in a <tt class="docutils literal"><span class="pre">customizations.firewall.services</span></tt> section:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="p">[</span><span class="n">customizations</span><span class="o">.</span><span class="n">firewall</span><span class="o">.</span><span class="n">services</span><span class="p">]</span>
<span class="n">enabled</span> <span class="o">=</span> <span class="p">[</span><span class="s">&quot;ftp&quot;</span><span class="p">,</span> <span class="s">&quot;ntp&quot;</span><span class="p">,</span> <span class="s">&quot;dhcp&quot;</span><span class="p">]</span>
<span class="n">disabled</span> <span class="o">=</span> <span class="p">[</span><span class="s">&quot;telnet&quot;</span><span class="p">]</span>
</pre></div>
</div>
<p>Remember that the <tt class="docutils literal"><span class="pre">firewall.services</span></tt> are different from the names in <tt class="docutils literal"><span class="pre">/etc/services</span></tt>.</p>
<p>Both are optional, if they are not used leave them out or set them to an empty list <tt class="docutils literal"><span class="pre">[]</span></tt>. If you
only want the default firewall setup this section can be omitted from the blueprint.</p>
<p>NOTE: The <tt class="docutils literal"><span class="pre">Google</span></tt> and <tt class="docutils literal"><span class="pre">OpenStack</span></tt> templates explicitly disable the firewall for their environment.
This cannot be overridden by the blueprint.</p>
</div>
<div class="section" id="customizations-services">
<h4>[customizations.services]<a class="headerlink" href="#customizations-services" title="Permalink to this headline"></a></h4>
<p>This section can be used to control which services are enabled at boot time.
Some image types already have services enabled or disabled in order for the
image to work correctly, and cannot be overridden. eg. <tt class="docutils literal"><span class="pre">ami</span></tt> requires
<tt class="docutils literal"><span class="pre">sshd</span></tt>, <tt class="docutils literal"><span class="pre">chronyd</span></tt>, and <tt class="docutils literal"><span class="pre">cloud-init</span></tt>. Without them the image will not
boot. Blueprint services are added to, not replacing, the list already in the
templates, if any.</p>
<blockquote>
<div>[customizations.services]
enabled = [&#8220;sshd&#8221;, &#8220;cockpit&#8221;, &#8220;httpd.service&#8221;]
disabled = [&#8220;postfix&#8221;, &#8220;telnetd&#8221;]</div></blockquote>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">The service names are systemd service units. You can only specify the unit
name, eg. <tt class="docutils literal"><span class="pre">httpd</span></tt>, or the full service name, eg. <tt class="docutils literal"><span class="pre">httpd.service</span></tt> &#8211; but
not other systemd unit files. Note that this is different from newer
releases where you can specify any systemd unit file.</p>
</div>
</div>
</div> </div>
</div> </div>
<div class="section" id="adding-output-types"> <div class="section" id="adding-output-types">
@ -393,9 +484,14 @@ sources from <tt class="docutils literal"><span class="pre">/etc/yum.repos.d/</s
<li><a class="reference internal" href="#packages-and-modules">[[packages]] and [[modules]]</a></li> <li><a class="reference internal" href="#packages-and-modules">[[packages]] and [[modules]]</a></li>
<li><a class="reference internal" href="#groups">[[groups]]</a></li> <li><a class="reference internal" href="#groups">[[groups]]</a></li>
<li><a class="reference internal" href="#customizations">Customizations</a><ul> <li><a class="reference internal" href="#customizations">Customizations</a><ul>
<li><a class="reference internal" href="#customizations-kernel">[customizations.kernel]</a></li>
<li><a class="reference internal" href="#customizations-sshkey">[[customizations.sshkey]]</a></li> <li><a class="reference internal" href="#customizations-sshkey">[[customizations.sshkey]]</a></li>
<li><a class="reference internal" href="#customizations-user">[[customizations.user]]</a></li> <li><a class="reference internal" href="#customizations-user">[[customizations.user]]</a></li>
<li><a class="reference internal" href="#customizations-group">[[customizations.group]]</a></li> <li><a class="reference internal" href="#customizations-group">[[customizations.group]]</a></li>
<li><a class="reference internal" href="#customizations-timezone">[customizations.timezone]</a></li>
<li><a class="reference internal" href="#customizations-locale">[customizations.locale]</a></li>
<li><a class="reference internal" href="#customizations-firewall">[customizations.firewall]</a></li>
<li><a class="reference internal" href="#customizations-services">[customizations.services]</a></li>
</ul> </ul>
</li> </li>
</ul> </ul>
@ -455,7 +551,7 @@ sources from <tt class="docutils literal"><span class="pre">/etc/yum.repos.d/</s
<li class="right" > <li class="right" >
<a href="livemedia-creator.html" title="livemedia-creator" <a href="livemedia-creator.html" title="livemedia-creator"
>previous</a> |</li> >previous</a> |</li>
<li><a href="index.html">Lorax 19.7.22 documentation</a> &raquo;</li> <li><a href="index.html">Lorax 19.7.43 documentation</a> &raquo;</li>
</ul> </ul>
</div> </div>
<div class="footer"> <div class="footer">

View File

@ -8,7 +8,7 @@
<head> <head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Lorax &mdash; Lorax 19.7.22 documentation</title> <title>Lorax &mdash; Lorax 19.7.43 documentation</title>
<link rel="stylesheet" href="_static/default.css" type="text/css" /> <link rel="stylesheet" href="_static/default.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" /> <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
@ -16,7 +16,7 @@
<script type="text/javascript"> <script type="text/javascript">
var DOCUMENTATION_OPTIONS = { var DOCUMENTATION_OPTIONS = {
URL_ROOT: '', URL_ROOT: '',
VERSION: '19.7.22', VERSION: '19.7.43',
COLLAPSE_INDEX: false, COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html', FILE_SUFFIX: '.html',
HAS_SOURCE: true HAS_SOURCE: true
@ -25,7 +25,7 @@
<script type="text/javascript" src="_static/jquery.js"></script> <script type="text/javascript" src="_static/jquery.js"></script>
<script type="text/javascript" src="_static/underscore.js"></script> <script type="text/javascript" src="_static/underscore.js"></script>
<script type="text/javascript" src="_static/doctools.js"></script> <script type="text/javascript" src="_static/doctools.js"></script>
<link rel="top" title="Lorax 19.7.22 documentation" href="index.html" /> <link rel="top" title="Lorax 19.7.43 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" />
</head> </head>
@ -45,7 +45,7 @@
<li class="right" > <li class="right" >
<a href="intro.html" title="Introduction to Lorax" <a href="intro.html" title="Introduction to Lorax"
accesskey="P">previous</a> |</li> accesskey="P">previous</a> |</li>
<li><a href="index.html">Lorax 19.7.22 documentation</a> &raquo;</li> <li><a href="index.html">Lorax 19.7.43 documentation</a> &raquo;</li>
</ul> </ul>
</div> </div>
@ -254,7 +254,7 @@ into another directory and then select the new template directory by passing
<li class="right" > <li class="right" >
<a href="intro.html" title="Introduction to Lorax" <a href="intro.html" title="Introduction to Lorax"
>previous</a> |</li> >previous</a> |</li>
<li><a href="index.html">Lorax 19.7.22 documentation</a> &raquo;</li> <li><a href="index.html">Lorax 19.7.43 documentation</a> &raquo;</li>
</ul> </ul>
</div> </div>
<div class="footer"> <div class="footer">

View File

@ -8,7 +8,7 @@
<head> <head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>src &mdash; Lorax 19.7.22 documentation</title> <title>src &mdash; Lorax 19.7.43 documentation</title>
<link rel="stylesheet" href="_static/default.css" type="text/css" /> <link rel="stylesheet" href="_static/default.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" /> <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
@ -16,7 +16,7 @@
<script type="text/javascript"> <script type="text/javascript">
var DOCUMENTATION_OPTIONS = { var DOCUMENTATION_OPTIONS = {
URL_ROOT: '', URL_ROOT: '',
VERSION: '19.7.22', VERSION: '19.7.43',
COLLAPSE_INDEX: false, COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html', FILE_SUFFIX: '.html',
HAS_SOURCE: true HAS_SOURCE: true
@ -25,7 +25,7 @@
<script type="text/javascript" src="_static/jquery.js"></script> <script type="text/javascript" src="_static/jquery.js"></script>
<script type="text/javascript" src="_static/underscore.js"></script> <script type="text/javascript" src="_static/underscore.js"></script>
<script type="text/javascript" src="_static/doctools.js"></script> <script type="text/javascript" src="_static/doctools.js"></script>
<link rel="top" title="Lorax 19.7.22 documentation" href="index.html" /> <link rel="top" title="Lorax 19.7.43 documentation" href="index.html" />
<link rel="next" title="composer Package" href="composer.html" /> <link rel="next" title="composer Package" href="composer.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" />
</head> </head>
@ -45,7 +45,7 @@
<li class="right" > <li class="right" >
<a href="product-images.html" title="Product and Updates Images" <a href="product-images.html" title="Product and Updates Images"
accesskey="P">previous</a> |</li> accesskey="P">previous</a> |</li>
<li><a href="index.html">Lorax 19.7.22 documentation</a> &raquo;</li> <li><a href="index.html">Lorax 19.7.43 documentation</a> &raquo;</li>
</ul> </ul>
</div> </div>
@ -99,6 +99,7 @@
<li class="toctree-l2"><a class="reference internal" href="pylorax.html#subpackages">Subpackages</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">api Package</a><ul> <li class="toctree-l3"><a class="reference internal" href="pylorax.api.html">api Package</a><ul>
<li class="toctree-l4"><a class="reference internal" href="pylorax.api.html#id1"><tt class="docutils literal"><span class="pre">api</span></tt> Package</a></li> <li class="toctree-l4"><a class="reference internal" href="pylorax.api.html#id1"><tt class="docutils literal"><span class="pre">api</span></tt> Package</a></li>
<li class="toctree-l4"><a class="reference internal" href="pylorax.api.html#module-pylorax.api.bisect"><tt class="docutils literal"><span class="pre">bisect</span></tt> Module</a></li>
<li class="toctree-l4"><a class="reference internal" href="pylorax.api.html#module-pylorax.api.checkparams"><tt class="docutils literal"><span class="pre">checkparams</span></tt> Module</a></li> <li class="toctree-l4"><a class="reference internal" href="pylorax.api.html#module-pylorax.api.checkparams"><tt class="docutils literal"><span class="pre">checkparams</span></tt> Module</a></li>
<li class="toctree-l4"><a class="reference internal" href="pylorax.api.html#module-pylorax.api.compose"><tt class="docutils literal"><span class="pre">compose</span></tt> Module</a></li> <li class="toctree-l4"><a class="reference internal" href="pylorax.api.html#module-pylorax.api.compose"><tt class="docutils literal"><span class="pre">compose</span></tt> Module</a></li>
<li class="toctree-l4"><a class="reference internal" href="pylorax.api.html#module-pylorax.api.config"><tt class="docutils literal"><span class="pre">config</span></tt> Module</a></li> <li class="toctree-l4"><a class="reference internal" href="pylorax.api.html#module-pylorax.api.config"><tt class="docutils literal"><span class="pre">config</span></tt> Module</a></li>
@ -172,7 +173,7 @@
<li class="right" > <li class="right" >
<a href="product-images.html" title="Product and Updates Images" <a href="product-images.html" title="Product and Updates Images"
>previous</a> |</li> >previous</a> |</li>
<li><a href="index.html">Lorax 19.7.22 documentation</a> &raquo;</li> <li><a href="index.html">Lorax 19.7.43 documentation</a> &raquo;</li>
</ul> </ul>
</div> </div>
<div class="footer"> <div class="footer">

Binary file not shown.

View File

@ -8,7 +8,7 @@
<head> <head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Product and Updates Images &mdash; Lorax 19.7.22 documentation</title> <title>Product and Updates Images &mdash; Lorax 19.7.43 documentation</title>
<link rel="stylesheet" href="_static/default.css" type="text/css" /> <link rel="stylesheet" href="_static/default.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" /> <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
@ -16,7 +16,7 @@
<script type="text/javascript"> <script type="text/javascript">
var DOCUMENTATION_OPTIONS = { var DOCUMENTATION_OPTIONS = {
URL_ROOT: '', URL_ROOT: '',
VERSION: '19.7.22', VERSION: '19.7.43',
COLLAPSE_INDEX: false, COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html', FILE_SUFFIX: '.html',
HAS_SOURCE: true HAS_SOURCE: true
@ -25,7 +25,7 @@
<script type="text/javascript" src="_static/jquery.js"></script> <script type="text/javascript" src="_static/jquery.js"></script>
<script type="text/javascript" src="_static/underscore.js"></script> <script type="text/javascript" src="_static/underscore.js"></script>
<script type="text/javascript" src="_static/doctools.js"></script> <script type="text/javascript" src="_static/doctools.js"></script>
<link rel="top" title="Lorax 19.7.22 documentation" href="index.html" /> <link rel="top" title="Lorax 19.7.43 documentation" href="index.html" />
<link rel="next" title="src" href="modules.html" /> <link rel="next" title="src" href="modules.html" />
<link rel="prev" title="composer-cli" href="composer-cli.html" /> <link rel="prev" title="composer-cli" href="composer-cli.html" />
</head> </head>
@ -45,7 +45,7 @@
<li class="right" > <li class="right" >
<a href="composer-cli.html" title="composer-cli" <a href="composer-cli.html" title="composer-cli"
accesskey="P">previous</a> |</li> accesskey="P">previous</a> |</li>
<li><a href="index.html">Lorax 19.7.22 documentation</a> &raquo;</li> <li><a href="index.html">Lorax 19.7.43 documentation</a> &raquo;</li>
</ul> </ul>
</div> </div>
@ -127,7 +127,7 @@ command or the installpkgs paramater of <a class="reference internal" href="pylo
<li class="right" > <li class="right" >
<a href="composer-cli.html" title="composer-cli" <a href="composer-cli.html" title="composer-cli"
>previous</a> |</li> >previous</a> |</li>
<li><a href="index.html">Lorax 19.7.22 documentation</a> &raquo;</li> <li><a href="index.html">Lorax 19.7.43 documentation</a> &raquo;</li>
</ul> </ul>
</div> </div>
<div class="footer"> <div class="footer">

View File

@ -8,7 +8,7 @@
<head> <head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Python Module Index &mdash; Lorax 19.7.22 documentation</title> <title>Python Module Index &mdash; Lorax 19.7.43 documentation</title>
<link rel="stylesheet" href="_static/default.css" type="text/css" /> <link rel="stylesheet" href="_static/default.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" /> <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
@ -16,7 +16,7 @@
<script type="text/javascript"> <script type="text/javascript">
var DOCUMENTATION_OPTIONS = { var DOCUMENTATION_OPTIONS = {
URL_ROOT: '', URL_ROOT: '',
VERSION: '19.7.22', VERSION: '19.7.43',
COLLAPSE_INDEX: false, COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html', FILE_SUFFIX: '.html',
HAS_SOURCE: true HAS_SOURCE: true
@ -25,7 +25,7 @@
<script type="text/javascript" src="_static/jquery.js"></script> <script type="text/javascript" src="_static/jquery.js"></script>
<script type="text/javascript" src="_static/underscore.js"></script> <script type="text/javascript" src="_static/underscore.js"></script>
<script type="text/javascript" src="_static/doctools.js"></script> <script type="text/javascript" src="_static/doctools.js"></script>
<link rel="top" title="Lorax 19.7.22 documentation" href="index.html" /> <link rel="top" title="Lorax 19.7.43 documentation" href="index.html" />
@ -40,7 +40,7 @@
<li class="right" > <li class="right" >
<a href="#" title="Python Module Index" <a href="#" title="Python Module Index"
>modules</a> |</li> >modules</a> |</li>
<li><a href="index.html">Lorax 19.7.22 documentation</a> &raquo;</li> <li><a href="index.html">Lorax 19.7.43 documentation</a> &raquo;</li>
</ul> </ul>
</div> </div>
@ -136,6 +136,11 @@
<td>&nbsp;&nbsp;&nbsp; <td>&nbsp;&nbsp;&nbsp;
<a href="pylorax.api.html#module-pylorax.api"><tt class="xref">pylorax.api</tt></a></td><td> <a href="pylorax.api.html#module-pylorax.api"><tt class="xref">pylorax.api</tt></a></td><td>
<em></em></td></tr> <em></em></td></tr>
<tr class="cg-2">
<td></td>
<td>&nbsp;&nbsp;&nbsp;
<a href="pylorax.api.html#module-pylorax.api.bisect"><tt class="xref">pylorax.api.bisect</tt></a></td><td>
<em></em></td></tr>
<tr class="cg-2"> <tr class="cg-2">
<td></td> <td></td>
<td>&nbsp;&nbsp;&nbsp; <td>&nbsp;&nbsp;&nbsp;
@ -315,7 +320,7 @@
<li class="right" > <li class="right" >
<a href="#" title="Python Module Index" <a href="#" title="Python Module Index"
>modules</a> |</li> >modules</a> |</li>
<li><a href="index.html">Lorax 19.7.22 documentation</a> &raquo;</li> <li><a href="index.html">Lorax 19.7.43 documentation</a> &raquo;</li>
</ul> </ul>
</div> </div>
<div class="footer"> <div class="footer">

View File

@ -8,7 +8,7 @@
<head> <head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>api Package &mdash; Lorax 19.7.22 documentation</title> <title>api Package &mdash; Lorax 19.7.43 documentation</title>
<link rel="stylesheet" href="_static/default.css" type="text/css" /> <link rel="stylesheet" href="_static/default.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" /> <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
@ -16,7 +16,7 @@
<script type="text/javascript"> <script type="text/javascript">
var DOCUMENTATION_OPTIONS = { var DOCUMENTATION_OPTIONS = {
URL_ROOT: '', URL_ROOT: '',
VERSION: '19.7.22', VERSION: '19.7.43',
COLLAPSE_INDEX: false, COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html', FILE_SUFFIX: '.html',
HAS_SOURCE: true HAS_SOURCE: true
@ -25,7 +25,7 @@
<script type="text/javascript" src="_static/jquery.js"></script> <script type="text/javascript" src="_static/jquery.js"></script>
<script type="text/javascript" src="_static/underscore.js"></script> <script type="text/javascript" src="_static/underscore.js"></script>
<script type="text/javascript" src="_static/doctools.js"></script> <script type="text/javascript" src="_static/doctools.js"></script>
<link rel="top" title="Lorax 19.7.22 documentation" href="index.html" /> <link rel="top" title="Lorax 19.7.43 documentation" href="index.html" />
<link rel="up" title="pylorax Package" href="pylorax.html" /> <link rel="up" title="pylorax Package" href="pylorax.html" />
<link rel="prev" title="pylorax Package" href="pylorax.html" /> <link rel="prev" title="pylorax Package" href="pylorax.html" />
</head> </head>
@ -42,7 +42,7 @@
<li class="right" > <li class="right" >
<a href="pylorax.html" title="pylorax Package" <a href="pylorax.html" title="pylorax Package"
accesskey="P">previous</a> |</li> accesskey="P">previous</a> |</li>
<li><a href="index.html">Lorax 19.7.22 documentation</a> &raquo;</li> <li><a href="index.html">Lorax 19.7.43 documentation</a> &raquo;</li>
<li><a href="modules.html" >src</a> &raquo;</li> <li><a href="modules.html" >src</a> &raquo;</li>
<li><a href="pylorax.html" accesskey="U">pylorax Package</a> &raquo;</li> <li><a href="pylorax.html" accesskey="U">pylorax Package</a> &raquo;</li>
</ul> </ul>
@ -62,6 +62,40 @@
<tt class="descclassname">pylorax.api.</tt><tt class="descname">crossdomain</tt><big>(</big><em>origin</em>, <em>methods=None</em>, <em>headers=None</em>, <em>max_age=21600</em>, <em>attach_to_all=True</em>, <em>automatic_options=True</em><big>)</big><a class="headerlink" href="#pylorax.api.crossdomain" title="Permalink to this definition"></a></dt> <tt class="descclassname">pylorax.api.</tt><tt class="descname">crossdomain</tt><big>(</big><em>origin</em>, <em>methods=None</em>, <em>headers=None</em>, <em>max_age=21600</em>, <em>attach_to_all=True</em>, <em>automatic_options=True</em><big>)</big><a class="headerlink" href="#pylorax.api.crossdomain" title="Permalink to this definition"></a></dt>
<dd></dd></dl> <dd></dd></dl>
</div>
<div class="section" id="module-pylorax.api.bisect">
<span id="bisect-module"></span><h2><a class="reference external" href="https://docs.python.org/2/library/bisect.html#module-bisect" title="(in Python v2.7)"><tt class="xref py py-mod docutils literal"><span class="pre">bisect</span></tt></a> Module<a class="headerlink" href="#module-pylorax.api.bisect" title="Permalink to this headline"></a></h2>
<dl class="function">
<dt id="pylorax.api.bisect.insort_left">
<tt class="descclassname">pylorax.api.bisect.</tt><tt class="descname">insort_left</tt><big>(</big><em>a</em>, <em>x</em>, <em>key=None</em>, <em>lo=0</em>, <em>hi=None</em><big>)</big><a class="reference internal" href="_modules/pylorax/api/bisect.html#insort_left"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.bisect.insort_left" title="Permalink to this definition"></a></dt>
<dd><p>Insert item x in list a, and keep it sorted assuming a is sorted.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>a</strong> (<em>list</em>) &#8211; sorted list</li>
<li><strong>x</strong> (<a class="reference external" href="https://docs.python.org/2/library/functions.html#object" title="(in Python v2.7)"><em>object</em></a>) &#8211; item to insert into the list</li>
<li><strong>key</strong> (<em>function</em>) &#8211; Function to use to compare items in the list</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">index where the item was inserted</p>
</td>
</tr>
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first last">int</p>
</td>
</tr>
</tbody>
</table>
<p>If x is already in a, insert it to the left of the leftmost x.
Optional args lo (default 0) and hi (default len(a)) bound the
slice of a to be searched.</p>
<p>This is a modified version of bisect.insort_left that can use a
function for the compare, and returns the index position where it
was inserted.</p>
</dd></dl>
</div> </div>
<div class="section" id="module-pylorax.api.checkparams"> <div class="section" id="module-pylorax.api.checkparams">
<span id="checkparams-module"></span><h2><tt class="xref py py-mod docutils literal"><span class="pre">checkparams</span></tt> Module<a class="headerlink" href="#module-pylorax.api.checkparams" title="Permalink to this headline"></a></h2> <span id="checkparams-module"></span><h2><tt class="xref py py-mod docutils literal"><span class="pre">checkparams</span></tt> Module<a class="headerlink" href="#module-pylorax.api.checkparams" title="Permalink to this headline"></a></h2>
@ -108,6 +142,26 @@ parameters needed to generate the desired output. Other types should be set to F
</table> </table>
</dd></dl> </dd></dl>
<dl class="function">
<dt id="pylorax.api.compose.bootloader_append">
<tt class="descclassname">pylorax.api.compose.</tt><tt class="descname">bootloader_append</tt><big>(</big><em>line</em>, <em>kernel_append</em><big>)</big><a class="reference internal" href="_modules/pylorax/api/compose.html#bootloader_append"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.compose.bootloader_append" title="Permalink to this definition"></a></dt>
<dd><p>Insert the kernel_append string into the &#8211;append argument</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
<li><strong>line</strong> (<a class="reference external" href="https://docs.python.org/2/library/functions.html#str" title="(in Python v2.7)"><em>str</em></a>) &#8211; The bootloader ... line</li>
<li><strong>kernel_append</strong> (<a class="reference external" href="https://docs.python.org/2/library/functions.html#str" title="(in Python v2.7)"><em>str</em></a>) &#8211; The arguments to append to the &#8211;append section</li>
</ul>
</td>
</tr>
</tbody>
</table>
<p>Using pykickstart to process the line is the best way to make sure it
is parsed correctly, and re-assembled for inclusion into the final kickstart</p>
</dd></dl>
<dl class="function"> <dl class="function">
<dt id="pylorax.api.compose.compose_args"> <dt id="pylorax.api.compose.compose_args">
<tt class="descclassname">pylorax.api.compose.</tt><tt class="descname">compose_args</tt><big>(</big><em>compose_type</em><big>)</big><a class="reference internal" href="_modules/pylorax/api/compose.html#compose_args"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.compose.compose_args" title="Permalink to this definition"></a></dt> <tt class="descclassname">pylorax.api.compose.</tt><tt class="descname">compose_args</tt><big>(</big><em>compose_type</em><big>)</big><a class="reference internal" href="_modules/pylorax/api/compose.html#compose_args"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.compose.compose_args" title="Permalink to this definition"></a></dt>
@ -132,6 +186,225 @@ Other options will be filled in by <cite>make_compose()</cite></p>
<p>The output types come from the kickstart names in /usr/share/lorax/composer/*ks</p> <p>The output types come from the kickstart names in /usr/share/lorax/composer/*ks</p>
</dd></dl> </dd></dl>
<dl class="function">
<dt id="pylorax.api.compose.customize_ks_template">
<tt class="descclassname">pylorax.api.compose.</tt><tt class="descname">customize_ks_template</tt><big>(</big><em>ks_template</em>, <em>recipe</em><big>)</big><a class="reference internal" href="_modules/pylorax/api/compose.html#customize_ks_template"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.compose.customize_ks_template" title="Permalink to this definition"></a></dt>
<dd><p>Customize the kickstart template and return it</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
<li><strong>ks_template</strong> (<a class="reference external" href="https://docs.python.org/2/library/functions.html#str" title="(in Python v2.7)"><em>str</em></a>) &#8211; The kickstart template</li>
<li><strong>recipe</strong> (<em>Recipe object</em>) &#8211; </li>
</ul>
</td>
</tr>
</tbody>
</table>
<p>Apply customizations to existing template commands, or add defaults for ones that are
missing and required.</p>
<p>Apply customizations.kernel.append to the bootloader argument in the template.
Add bootloader line if it is missing.</p>
<p>Add default timezone if needed. It does NOT replace an existing timezone entry</p>
</dd></dl>
<dl class="function">
<dt id="pylorax.api.compose.firewall_cmd">
<tt class="descclassname">pylorax.api.compose.</tt><tt class="descname">firewall_cmd</tt><big>(</big><em>line</em>, <em>settings</em><big>)</big><a class="reference internal" href="_modules/pylorax/api/compose.html#firewall_cmd"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.compose.firewall_cmd" title="Permalink to this definition"></a></dt>
<dd><p>Update the firewall line with the new ports and services</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
<li><strong>line</strong> (<a class="reference external" href="https://docs.python.org/2/library/functions.html#str" title="(in Python v2.7)"><em>str</em></a>) &#8211; The firewall ... line</li>
<li><strong>settings</strong> (<a class="reference external" href="https://docs.python.org/2/library/stdtypes.html#dict" title="(in Python v2.7)"><em>dict</em></a>) &#8211; A dict with the list of services and ports to enable and disable</li>
</ul>
</td>
</tr>
</tbody>
</table>
<p>Using pykickstart to process the line is the best way to make sure it
is parsed correctly, and re-assembled for inclusion into the final kickstart</p>
</dd></dl>
<dl class="function">
<dt id="pylorax.api.compose.get_default_services">
<tt class="descclassname">pylorax.api.compose.</tt><tt class="descname">get_default_services</tt><big>(</big><em>recipe</em><big>)</big><a class="reference internal" href="_modules/pylorax/api/compose.html#get_default_services"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.compose.get_default_services" title="Permalink to this definition"></a></dt>
<dd><p>Get the default string for services, based on recipe
:param recipe: The recipe</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">string with &#8220;services&#8221; or &#8220;&#8221;</td>
</tr>
<tr class="field-even field"><th class="field-name">Return type:</th><td class="field-body">str</td>
</tr>
</tbody>
</table>
<p>When no services have been selected we don&#8217;t need to add anything to the kickstart
so return an empty string. Otherwise return &#8220;services&#8221; which will be updated with
the settings.</p>
</dd></dl>
<dl class="function">
<dt id="pylorax.api.compose.get_firewall_settings">
<tt class="descclassname">pylorax.api.compose.</tt><tt class="descname">get_firewall_settings</tt><big>(</big><em>recipe</em><big>)</big><a class="reference internal" href="_modules/pylorax/api/compose.html#get_firewall_settings"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.compose.get_firewall_settings" title="Permalink to this definition"></a></dt>
<dd><p>Return the customizations.firewall settings</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>recipe</strong> (<em>Recipe object</em>) &#8211; The recipe</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">A dict of settings</td>
</tr>
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body">dict</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="function">
<dt id="pylorax.api.compose.get_kernel_append">
<tt class="descclassname">pylorax.api.compose.</tt><tt class="descname">get_kernel_append</tt><big>(</big><em>recipe</em><big>)</big><a class="reference internal" href="_modules/pylorax/api/compose.html#get_kernel_append"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.compose.get_kernel_append" title="Permalink to this definition"></a></dt>
<dd><p>Return the customizations.kernel append value</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>recipe</strong> (<em>Recipe object</em>) &#8211; </td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">append value or empty string</td>
</tr>
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body">str</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="function">
<dt id="pylorax.api.compose.get_keyboard_layout">
<tt class="descclassname">pylorax.api.compose.</tt><tt class="descname">get_keyboard_layout</tt><big>(</big><em>recipe</em><big>)</big><a class="reference internal" href="_modules/pylorax/api/compose.html#get_keyboard_layout"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.compose.get_keyboard_layout" title="Permalink to this definition"></a></dt>
<dd><p>Return the customizations.locale.keyboard list</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>recipe</strong> (<em>Recipe object</em>) &#8211; The recipe</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">The keyboard layout string</td>
</tr>
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body">str</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="function">
<dt id="pylorax.api.compose.get_languages">
<tt class="descclassname">pylorax.api.compose.</tt><tt class="descname">get_languages</tt><big>(</big><em>recipe</em><big>)</big><a class="reference internal" href="_modules/pylorax/api/compose.html#get_languages"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.compose.get_languages" title="Permalink to this definition"></a></dt>
<dd><p>Return the customizations.locale.languages list</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>recipe</strong> (<em>Recipe object</em>) &#8211; The recipe</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">list of language strings</td>
</tr>
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body">list</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="function">
<dt id="pylorax.api.compose.get_md_size">
<tt class="descclassname">pylorax.api.compose.</tt><tt class="descname">get_md_size</tt><big>(</big><em>yum_path</em><big>)</big><a class="reference internal" href="_modules/pylorax/api/compose.html#get_md_size"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.compose.get_md_size" title="Permalink to this definition"></a></dt>
<dd><p>Estimate the amount of space needed by anaconda</p>
<p>Anaconda doesn&#8217;t download the filelists or &#8216;other&#8217; metadata, which can add
up to a significant difference, so exclude those from the calculation.</p>
</dd></dl>
<dl class="function">
<dt id="pylorax.api.compose.get_services">
<tt class="descclassname">pylorax.api.compose.</tt><tt class="descname">get_services</tt><big>(</big><em>recipe</em><big>)</big><a class="reference internal" href="_modules/pylorax/api/compose.html#get_services"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.compose.get_services" title="Permalink to this definition"></a></dt>
<dd><p>Return the customizations.services settings</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>recipe</strong> (<em>Recipe object</em>) &#8211; The recipe</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">A dict of settings</td>
</tr>
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body">dict</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="function">
<dt id="pylorax.api.compose.get_timezone_settings">
<tt class="descclassname">pylorax.api.compose.</tt><tt class="descname">get_timezone_settings</tt><big>(</big><em>recipe</em><big>)</big><a class="reference internal" href="_modules/pylorax/api/compose.html#get_timezone_settings"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.compose.get_timezone_settings" title="Permalink to this definition"></a></dt>
<dd><p>Return the customizations.timezone dict</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>recipe</strong> (<em>Recipe object</em>) &#8211; </td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">append value or empty string</td>
</tr>
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body">dict</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="function">
<dt id="pylorax.api.compose.keyboard_cmd">
<tt class="descclassname">pylorax.api.compose.</tt><tt class="descname">keyboard_cmd</tt><big>(</big><em>line</em>, <em>layout</em><big>)</big><a class="reference internal" href="_modules/pylorax/api/compose.html#keyboard_cmd"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.compose.keyboard_cmd" title="Permalink to this definition"></a></dt>
<dd><p>Update the keyboard line with the layout</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
<li><strong>line</strong> (<a class="reference external" href="https://docs.python.org/2/library/functions.html#str" title="(in Python v2.7)"><em>str</em></a>) &#8211; The keyboard ... line</li>
<li><strong>settings</strong> (<a class="reference external" href="https://docs.python.org/2/library/functions.html#str" title="(in Python v2.7)"><em>str</em></a>) &#8211; The keyboard layout</li>
</ul>
</td>
</tr>
</tbody>
</table>
<p>Using pykickstart to process the line is the best way to make sure it
is parsed correctly, and re-assembled for inclusion into the final kickstart</p>
</dd></dl>
<dl class="function">
<dt id="pylorax.api.compose.lang_cmd">
<tt class="descclassname">pylorax.api.compose.</tt><tt class="descname">lang_cmd</tt><big>(</big><em>line</em>, <em>languages</em><big>)</big><a class="reference internal" href="_modules/pylorax/api/compose.html#lang_cmd"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.compose.lang_cmd" title="Permalink to this definition"></a></dt>
<dd><p>Update the lang line with the languages</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
<li><strong>line</strong> (<a class="reference external" href="https://docs.python.org/2/library/functions.html#str" title="(in Python v2.7)"><em>str</em></a>) &#8211; The lang ... line</li>
<li><strong>settings</strong> (<em>list</em>) &#8211; The list of languages</li>
</ul>
</td>
</tr>
</tbody>
</table>
<p>Using pykickstart to process the line is the best way to make sure it
is parsed correctly, and re-assembled for inclusion into the final kickstart</p>
</dd></dl>
<dl class="function"> <dl class="function">
<dt id="pylorax.api.compose.move_compose_results"> <dt id="pylorax.api.compose.move_compose_results">
<tt class="descclassname">pylorax.api.compose.</tt><tt class="descname">move_compose_results</tt><big>(</big><em>cfg</em>, <em>results_dir</em><big>)</big><a class="reference internal" href="_modules/pylorax/api/compose.html#move_compose_results"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.compose.move_compose_results" title="Permalink to this definition"></a></dt> <tt class="descclassname">pylorax.api.compose.</tt><tt class="descname">move_compose_results</tt><big>(</big><em>cfg</em>, <em>results_dir</em><big>)</big><a class="reference internal" href="_modules/pylorax/api/compose.html#move_compose_results"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.compose.move_compose_results" title="Permalink to this definition"></a></dt>
@ -157,6 +430,26 @@ Other options will be filled in by <cite>make_compose()</cite></p>
<p>Set url to &#8220;baseurl&#8221; if it is a repo, leave it as &#8220;url&#8221; for the installation url.</p> <p>Set url to &#8220;baseurl&#8221; if it is a repo, leave it as &#8220;url&#8221; for the installation url.</p>
</dd></dl> </dd></dl>
<dl class="function">
<dt id="pylorax.api.compose.services_cmd">
<tt class="descclassname">pylorax.api.compose.</tt><tt class="descname">services_cmd</tt><big>(</big><em>line</em>, <em>settings</em><big>)</big><a class="reference internal" href="_modules/pylorax/api/compose.html#services_cmd"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.compose.services_cmd" title="Permalink to this definition"></a></dt>
<dd><p>Update the services line with additional services to enable/disable</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
<li><strong>line</strong> (<a class="reference external" href="https://docs.python.org/2/library/functions.html#str" title="(in Python v2.7)"><em>str</em></a>) &#8211; The services ... line</li>
<li><strong>settings</strong> (<a class="reference external" href="https://docs.python.org/2/library/stdtypes.html#dict" title="(in Python v2.7)"><em>dict</em></a>) &#8211; A dict with the list of services to enable and disable</li>
</ul>
</td>
</tr>
</tbody>
</table>
<p>Using pykickstart to process the line is the best way to make sure it
is parsed correctly, and re-assembled for inclusion into the final kickstart</p>
</dd></dl>
<dl class="function"> <dl class="function">
<dt id="pylorax.api.compose.start_build"> <dt id="pylorax.api.compose.start_build">
<tt class="descclassname">pylorax.api.compose.</tt><tt class="descname">start_build</tt><big>(</big><em>cfg</em>, <em>yumlock</em>, <em>gitlock</em>, <em>branch</em>, <em>recipe_name</em>, <em>compose_type</em>, <em>test_mode=0</em><big>)</big><a class="reference internal" href="_modules/pylorax/api/compose.html#start_build"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.compose.start_build" title="Permalink to this definition"></a></dt> <tt class="descclassname">pylorax.api.compose.</tt><tt class="descname">start_build</tt><big>(</big><em>cfg</em>, <em>yumlock</em>, <em>gitlock</em>, <em>branch</em>, <em>recipe_name</em>, <em>compose_type</em>, <em>test_mode=0</em><big>)</big><a class="reference internal" href="_modules/pylorax/api/compose.html#start_build"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.compose.start_build" title="Permalink to this definition"></a></dt>
@ -202,6 +495,26 @@ Other options will be filled in by <cite>make_compose()</cite></p>
<p>Return a list of templates and errors encountered or an empty list</p> <p>Return a list of templates and errors encountered or an empty list</p>
</dd></dl> </dd></dl>
<dl class="function">
<dt id="pylorax.api.compose.timezone_cmd">
<tt class="descclassname">pylorax.api.compose.</tt><tt class="descname">timezone_cmd</tt><big>(</big><em>line</em>, <em>settings</em><big>)</big><a class="reference internal" href="_modules/pylorax/api/compose.html#timezone_cmd"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.compose.timezone_cmd" title="Permalink to this definition"></a></dt>
<dd><p>Update the timezone line with the settings</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
<li><strong>line</strong> (<a class="reference external" href="https://docs.python.org/2/library/functions.html#str" title="(in Python v2.7)"><em>str</em></a>) &#8211; The timezone ... line</li>
<li><strong>settings</strong> (<a class="reference external" href="https://docs.python.org/2/library/stdtypes.html#dict" title="(in Python v2.7)"><em>dict</em></a>) &#8211; A dict with timezone and/or ntpservers list</li>
</ul>
</td>
</tr>
</tbody>
</table>
<p>Using pykickstart to process the line is the best way to make sure it
is parsed correctly, and re-assembled for inclusion into the final kickstart</p>
</dd></dl>
<dl class="function"> <dl class="function">
<dt id="pylorax.api.compose.write_ks_group"> <dt id="pylorax.api.compose.write_ks_group">
<tt class="descclassname">pylorax.api.compose.</tt><tt class="descname">write_ks_group</tt><big>(</big><em>f</em>, <em>group</em><big>)</big><a class="reference internal" href="_modules/pylorax/api/compose.html#write_ks_group"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.compose.write_ks_group" title="Permalink to this definition"></a></dt> <tt class="descclassname">pylorax.api.compose.</tt><tt class="descname">write_ks_group</tt><big>(</big><em>f</em>, <em>group</em><big>)</big><a class="reference internal" href="_modules/pylorax/api/compose.html#write_ks_group"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.compose.write_ks_group" title="Permalink to this definition"></a></dt>
@ -221,6 +534,28 @@ Other options will be filled in by <cite>make_compose()</cite></p>
<p>gid is optional</p> <p>gid is optional</p>
</dd></dl> </dd></dl>
<dl class="function">
<dt id="pylorax.api.compose.write_ks_root">
<tt class="descclassname">pylorax.api.compose.</tt><tt class="descname">write_ks_root</tt><big>(</big><em>f</em>, <em>user</em><big>)</big><a class="reference internal" href="_modules/pylorax/api/compose.html#write_ks_root"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.compose.write_ks_root" title="Permalink to this definition"></a></dt>
<dd><p>Write kickstart root password and sshkey entry</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
<li><strong>f</strong> (<em>open file object</em>) &#8211; kickstart file object</li>
<li><strong>user</strong> (<a class="reference external" href="https://docs.python.org/2/library/stdtypes.html#dict" title="(in Python v2.7)"><em>dict</em></a>) &#8211; A blueprint user dictionary</li>
</ul>
</td>
</tr>
</tbody>
</table>
<p>If the entry contains a ssh key, use sshkey to write it
If it contains password, use rootpw to set it</p>
<p>root cannot be used with the user command. So only key and password are supported
for root.</p>
</dd></dl>
<dl class="function"> <dl class="function">
<dt id="pylorax.api.compose.write_ks_user"> <dt id="pylorax.api.compose.write_ks_user">
<tt class="descclassname">pylorax.api.compose.</tt><tt class="descname">write_ks_user</tt><big>(</big><em>f</em>, <em>user</em><big>)</big><a class="reference internal" href="_modules/pylorax/api/compose.html#write_ks_user"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.compose.write_ks_user" title="Permalink to this definition"></a></dt> <tt class="descclassname">pylorax.api.compose.</tt><tt class="descname">write_ks_user</tt><big>(</big><em>f</em>, <em>user</em><big>)</big><a class="reference internal" href="_modules/pylorax/api/compose.html#write_ks_user"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.compose.write_ks_user" title="Permalink to this definition"></a></dt>
@ -433,10 +768,10 @@ source_name isn&#8217;t passed to it.</p>
</ul> </ul>
</td> </td>
</tr> </tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">The estimated size of installed packages</p> <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">Tuple of the the estimated size needed, and the size anaconda will calculate</p>
</td> </td>
</tr> </tr>
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first last">int</p> <tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first last">tuple(int, int)</p>
</td> </td>
</tr> </tr>
</tbody> </tbody>
@ -444,6 +779,28 @@ source_name isn&#8217;t passed to it.</p>
<p>Estimating actual requirements is difficult without the actual file sizes, which <p>Estimating actual requirements is difficult without the actual file sizes, which
yum doesn&#8217;t provide access to. So use the file count and block size to estimate yum doesn&#8217;t provide access to. So use the file count and block size to estimate
a minimum size for each package.</p> a minimum size for each package.</p>
<p>Anaconda only takes into account the installedsize of each package. It then fudges
this by 35% to make sure there is enough space.</p>
</dd></dl>
<dl class="function">
<dt id="pylorax.api.projects.filterVersionGlob">
<tt class="descclassname">pylorax.api.projects.</tt><tt class="descname">filterVersionGlob</tt><big>(</big><em>pkgs</em>, <em>version</em><big>)</big><a class="reference internal" href="_modules/pylorax/api/projects.html#filterVersionGlob"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.projects.filterVersionGlob" title="Permalink to this definition"></a></dt>
<dd><p>Filter a list of yum package objects with a version glob</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
<li><strong>pkgs</strong> (<em>list</em>) &#8211; list of yum package objects</li>
<li><strong>version</strong> (<a class="reference external" href="https://docs.python.org/2/library/functions.html#str" title="(in Python v2.7)"><em>str</em></a>) &#8211; version matching glob</li>
</ul>
</td>
</tr>
</tbody>
</table>
<p>pkgs should be a list of all the versions of the <em>same</em> package.
Return the latest package that matches the &#8216;version&#8217; glob.</p>
</dd></dl> </dd></dl>
<dl class="function"> <dl class="function">
@ -533,6 +890,25 @@ a minimum size for each package.</p>
and sets the type to &#8220;rpm&#8221;</p> and sets the type to &#8220;rpm&#8221;</p>
</dd></dl> </dd></dl>
<dl class="function">
<dt id="pylorax.api.projects.proj_to_module">
<tt class="descclassname">pylorax.api.projects.</tt><tt class="descname">proj_to_module</tt><big>(</big><em>proj</em><big>)</big><a class="reference internal" href="_modules/pylorax/api/projects.html#proj_to_module"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.projects.proj_to_module" title="Permalink to this definition"></a></dt>
<dd><p>Extract the name from a YumAvailablePackageSqlite object</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>proj</strong> (<a class="reference external" href="https://docs.python.org/2/library/stdtypes.html#dict" title="(in Python v2.7)"><em>dict</em></a>) &#8211; Project details</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">A dict with name, and group_type</td>
</tr>
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body">dict</td>
</tr>
</tbody>
</table>
<p>group_type is hard-coded to &#8220;rpm&#8221;</p>
</dd></dl>
<dl class="function"> <dl class="function">
<dt id="pylorax.api.projects.projects_depsolve"> <dt id="pylorax.api.projects.projects_depsolve">
<tt class="descclassname">pylorax.api.projects.</tt><tt class="descname">projects_depsolve</tt><big>(</big><em>yb</em>, <em>projects</em>, <em>groups</em><big>)</big><a class="reference internal" href="_modules/pylorax/api/projects.html#projects_depsolve"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.projects.projects_depsolve" title="Permalink to this definition"></a></dt> <tt class="descclassname">pylorax.api.projects.</tt><tt class="descname">projects_depsolve</tt><big>(</big><em>yb</em>, <em>projects</em>, <em>groups</em><big>)</big><a class="reference internal" href="_modules/pylorax/api/projects.html#projects_depsolve"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.projects.projects_depsolve" title="Permalink to this definition"></a></dt>
@ -576,10 +952,10 @@ and sets the type to &#8220;rpm&#8221;</p>
</ul> </ul>
</td> </td>
</tr> </tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">installed size and a list of NEVRA&#8217;s of the project and its dependencies</p> <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">installed size, size estimated by anaconda, and a list of NEVRA&#8217;s of the project and its dependencies</p>
</td> </td>
</tr> </tr>
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first">tuple of (int, list of dicts)</p> <tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first">tuple of (int, int, list of dicts)</p>
</td> </td>
</tr> </tr>
<tr class="field-even field"><th class="field-name">Raises :</th><td class="field-body"><p class="first last">ProjectsError if there was a problem installing something</p> <tr class="field-even field"><th class="field-name">Raises :</th><td class="field-body"><p class="first last">ProjectsError if there was a problem installing something</p>
@ -587,6 +963,8 @@ and sets the type to &#8220;rpm&#8221;</p>
</tr> </tr>
</tbody> </tbody>
</table> </table>
<p>The anaconda_size only includes the installed package size, not file block or cache estimation like
installed_size includes.</p>
</dd></dl> </dd></dl>
<dl class="function"> <dl class="function">
@ -721,22 +1099,23 @@ after popping off baseurl and mirrorlist.</p>
</dd></dl> </dd></dl>
<dl class="function"> <dl class="function">
<dt id="pylorax.api.projects.yaps_to_module"> <dt id="pylorax.api.projects.yaps_to_build">
<tt class="descclassname">pylorax.api.projects.</tt><tt class="descname">yaps_to_module</tt><big>(</big><em>yaps</em><big>)</big><a class="reference internal" href="_modules/pylorax/api/projects.html#yaps_to_module"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.projects.yaps_to_module" title="Permalink to this definition"></a></dt> <tt class="descclassname">pylorax.api.projects.</tt><tt class="descname">yaps_to_build</tt><big>(</big><em>yaps</em><big>)</big><a class="reference internal" href="_modules/pylorax/api/projects.html#yaps_to_build"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.projects.yaps_to_build" title="Permalink to this definition"></a></dt>
<dd><p>Extract the name from a YumAvailablePackageSqlite object</p> <dd><p>Extract the build details from a hawkey.Package object</p>
<table class="docutils field-list" frame="void" rules="none"> <table class="docutils field-list" frame="void" rules="none">
<col class="field-name" /> <col class="field-name" />
<col class="field-body" /> <col class="field-body" />
<tbody valign="top"> <tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>yaps</strong> (<em>YumAvailablePackageSqlite</em>) &#8211; Yum object with package details</td> <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>yaps</strong> (<em>YumAvailablePackageSqlite</em>) &#8211; Yum object with package details</td>
</tr> </tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">A dict with name, and group_type</td> <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">A dict with the build details, epoch, release, arch, build_time, changelog, ...</td>
</tr> </tr>
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body">dict</td> <tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body">dict</td>
</tr> </tr>
</tbody> </tbody>
</table> </table>
<p>group_type is hard-coded to &#8220;rpm&#8221;</p> <p>metadata entries are hard-coded to {}</p>
<p>Note that this only returns the build dict, it does not include the name, description, etc.</p>
</dd></dl> </dd></dl>
<dl class="function"> <dl class="function">
@ -828,6 +1207,22 @@ system. It does not return the status of builds that have not been finished.
Use queue_status() for those.</p> Use queue_status() for those.</p>
</dd></dl> </dd></dl>
<dl class="function">
<dt id="pylorax.api.queue.check_queues">
<tt class="descclassname">pylorax.api.queue.</tt><tt class="descname">check_queues</tt><big>(</big><em>cfg</em><big>)</big><a class="reference internal" href="_modules/pylorax/api/queue.html#check_queues"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.queue.check_queues" title="Permalink to this definition"></a></dt>
<dd><p>Check to make sure the new and run queue symlinks are correct</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>cfg</strong> (<em>DataHolder</em>) &#8211; Configuration settings</td>
</tr>
</tbody>
</table>
<p>Also check all of the existing results and make sure any with WAITING
set in STATUS have a symlink in queue/new/</p>
</dd></dl>
<dl class="function"> <dl class="function">
<dt id="pylorax.api.queue.compose_detail"> <dt id="pylorax.api.queue.compose_detail">
<tt class="descclassname">pylorax.api.queue.</tt><tt class="descname">compose_detail</tt><big>(</big><em>results_dir</em><big>)</big><a class="reference internal" href="_modules/pylorax/api/queue.html#compose_detail"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.queue.compose_detail" title="Permalink to this definition"></a></dt> <tt class="descclassname">pylorax.api.queue.</tt><tt class="descname">compose_detail</tt><big>(</big><em>results_dir</em><big>)</big><a class="reference internal" href="_modules/pylorax/api/queue.html#compose_detail"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.queue.compose_detail" title="Permalink to this definition"></a></dt>
@ -954,7 +1349,7 @@ a symlink to the uniquely named results directory should be placed in ./queue/ne
<p>When the it is ready to be run (it is checked every 30 seconds or after a previous <p>When the it is ready to be run (it is checked every 30 seconds or after a previous
compose is finished) the symlink will be moved into ./queue/run/ and a STATUS file compose is finished) the symlink will be moved into ./queue/run/ and a STATUS file
will be created in the results directory.</p> will be created in the results directory.</p>
<p>STATUS can contain one of: RUNNING, FINISHED, FAILED</p> <p>STATUS can contain one of: WAITING, RUNNING, FINISHED, FAILED</p>
<p>If the system is restarted while a compose is running it will move any old symlinks <p>If the system is restarted while a compose is running it will move any old symlinks
from ./queue/run/ to ./queue/new/ and rerun them.</p> from ./queue/run/ to ./queue/new/ and rerun them.</p>
</dd></dl> </dd></dl>
@ -1428,6 +1823,12 @@ be tried.</p>
</table> </table>
</dd></dl> </dd></dl>
<dl class="function">
<dt id="pylorax.api.recipes.customizations_diff">
<tt class="descclassname">pylorax.api.recipes.</tt><tt class="descname">customizations_diff</tt><big>(</big><em>old_recipe</em>, <em>new_recipe</em><big>)</big><a class="reference internal" href="_modules/pylorax/api/recipes.html#customizations_diff"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.recipes.customizations_diff" title="Permalink to this definition"></a></dt>
<dd><p>Diff the customizations sections from two versions of a recipe</p>
</dd></dl>
<dl class="function"> <dl class="function">
<dt id="pylorax.api.recipes.delete_file"> <dt id="pylorax.api.recipes.delete_file">
<tt class="descclassname">pylorax.api.recipes.</tt><tt class="descname">delete_file</tt><big>(</big><em>repo</em>, <em>branch</em>, <em>filename</em><big>)</big><a class="reference internal" href="_modules/pylorax/api/recipes.html#delete_file"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.recipes.delete_file" title="Permalink to this definition"></a></dt> <tt class="descclassname">pylorax.api.recipes.</tt><tt class="descname">delete_file</tt><big>(</big><em>repo</em>, <em>branch</em>, <em>filename</em><big>)</big><a class="reference internal" href="_modules/pylorax/api/recipes.html#delete_file"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.recipes.delete_file" title="Permalink to this definition"></a></dt>
@ -1485,8 +1886,8 @@ be tried.</p>
</dd></dl> </dd></dl>
<dl class="function"> <dl class="function">
<dt id="pylorax.api.recipes.diff_items"> <dt id="pylorax.api.recipes.diff_lists">
<tt class="descclassname">pylorax.api.recipes.</tt><tt class="descname">diff_items</tt><big>(</big><em>title</em>, <em>old_items</em>, <em>new_items</em><big>)</big><a class="reference internal" href="_modules/pylorax/api/recipes.html#diff_items"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.recipes.diff_items" title="Permalink to this definition"></a></dt> <tt class="descclassname">pylorax.api.recipes.</tt><tt class="descname">diff_lists</tt><big>(</big><em>title</em>, <em>field</em>, <em>old_items</em>, <em>new_items</em><big>)</big><a class="reference internal" href="_modules/pylorax/api/recipes.html#diff_lists"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.recipes.diff_lists" title="Permalink to this definition"></a></dt>
<dd><p>Return the differences between two lists of dicts.</p> <dd><p>Return the differences between two lists of dicts.</p>
<table class="docutils field-list" frame="void" rules="none"> <table class="docutils field-list" frame="void" rules="none">
<col class="field-name" /> <col class="field-name" />
@ -1494,6 +1895,7 @@ be tried.</p>
<tbody valign="top"> <tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple"> <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>title</strong> (<a class="reference external" href="https://docs.python.org/2/library/functions.html#str" title="(in Python v2.7)"><em>str</em></a>) &#8211; Title of the entry</li> <li><strong>title</strong> (<a class="reference external" href="https://docs.python.org/2/library/functions.html#str" title="(in Python v2.7)"><em>str</em></a>) &#8211; Title of the entry</li>
<li><strong>field</strong> (<a class="reference external" href="https://docs.python.org/2/library/functions.html#str" title="(in Python v2.7)"><em>str</em></a>) &#8211; Field to use as the key for comparisons</li>
<li><strong>old_items</strong> (<em>list(dict)</em>) &#8211; List of item dicts with &#8220;name&#8221; field</li> <li><strong>old_items</strong> (<em>list(dict)</em>) &#8211; List of item dicts with &#8220;name&#8221; field</li>
<li><strong>new_items</strong> (<em>list(dict)</em>) &#8211; List of item dicts with &#8220;name&#8221; field</li> <li><strong>new_items</strong> (<em>list(dict)</em>) &#8211; List of item dicts with &#8220;name&#8221; field</li>
</ul> </ul>
@ -1538,6 +1940,34 @@ be a tag at all.</p>
<p>The tag will look like: &#8216;refs/tags/&lt;branch&gt;/&lt;filename&gt;/r&lt;revision&gt;&#8217;</p> <p>The tag will look like: &#8216;refs/tags/&lt;branch&gt;/&lt;filename&gt;/r&lt;revision&gt;&#8217;</p>
</dd></dl> </dd></dl>
<dl class="function">
<dt id="pylorax.api.recipes.find_field_value">
<tt class="descclassname">pylorax.api.recipes.</tt><tt class="descname">find_field_value</tt><big>(</big><em>field</em>, <em>value</em>, <em>lst</em><big>)</big><a class="reference internal" href="_modules/pylorax/api/recipes.html#find_field_value"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.recipes.find_field_value" title="Permalink to this definition"></a></dt>
<dd><p>Find a field matching value in the list of dicts.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>field</strong> (<a class="reference external" href="https://docs.python.org/2/library/functions.html#str" title="(in Python v2.7)"><em>str</em></a>) &#8211; field to search for</li>
<li><strong>value</strong> (<a class="reference external" href="https://docs.python.org/2/library/functions.html#str" title="(in Python v2.7)"><em>str</em></a>) &#8211; value to match in the field</li>
<li><strong>lst</strong> (<em>list of dict</em>) &#8211; List of dict&#8217;s with field</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">First dict with matching field:value, or None</p>
</td>
</tr>
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first last">dict or None</p>
</td>
</tr>
</tbody>
</table>
<p>Used to return a specific entry from a list that looks like this:</p>
<p>[{&#8220;name&#8221;: &#8220;one&#8221;, &#8220;attr&#8221;: &#8220;green&#8221;}, ...]</p>
<p>find_field_value(&#8220;name&#8221;, &#8220;one&#8221;, lst) will return the matching dict.</p>
</dd></dl>
<dl class="function"> <dl class="function">
<dt id="pylorax.api.recipes.find_name"> <dt id="pylorax.api.recipes.find_name">
<tt class="descclassname">pylorax.api.recipes.</tt><tt class="descname">find_name</tt><big>(</big><em>name</em>, <em>lst</em><big>)</big><a class="reference internal" href="_modules/pylorax/api/recipes.html#find_name"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.recipes.find_name" title="Permalink to this definition"></a></dt> <tt class="descclassname">pylorax.api.recipes.</tt><tt class="descname">find_name</tt><big>(</big><em>name</em>, <em>lst</em><big>)</big><a class="reference internal" href="_modules/pylorax/api/recipes.html#find_name"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.recipes.find_name" title="Permalink to this definition"></a></dt>
@ -1548,7 +1978,7 @@ be a tag at all.</p>
<tbody valign="top"> <tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple"> <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>name</strong> (<a class="reference external" href="https://docs.python.org/2/library/functions.html#str" title="(in Python v2.7)"><em>str</em></a>) &#8211; Name to search for</li> <li><strong>name</strong> (<a class="reference external" href="https://docs.python.org/2/library/functions.html#str" title="(in Python v2.7)"><em>str</em></a>) &#8211; Name to search for</li>
<li><strong>lst</strong> &#8211; List of dict&#8217;s with &#8220;name&#8221; field</li> <li><strong>lst</strong> (<em>list of dict</em>) &#8211; List of dict&#8217;s with &#8220;name&#8221; field</li>
</ul> </ul>
</td> </td>
</tr> </tr>
@ -1560,6 +1990,30 @@ be a tag at all.</p>
</tr> </tr>
</tbody> </tbody>
</table> </table>
<p>This is just a wrapper for find_field_value with field set to &#8220;name&#8221;</p>
</dd></dl>
<dl class="function">
<dt id="pylorax.api.recipes.find_recipe_obj">
<tt class="descclassname">pylorax.api.recipes.</tt><tt class="descname">find_recipe_obj</tt><big>(</big><em>path</em>, <em>recipe</em>, <em>default=None</em><big>)</big><a class="reference internal" href="_modules/pylorax/api/recipes.html#find_recipe_obj"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.recipes.find_recipe_obj" title="Permalink to this definition"></a></dt>
<dd><p>Find a recipe object</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
<li><strong>path</strong> (<em>list of str</em>) &#8211; A list of dict field names</li>
<li><strong>recipe</strong> (<em>Recipe</em>) &#8211; The recipe to search</li>
<li><strong>default</strong> (<em>Any</em>) &#8211; The value to return if it is not found</li>
</ul>
</td>
</tr>
</tbody>
</table>
<p>Return the object found by applying the path to the dicts in the recipe, or
return the default if it doesn&#8217;t exist.</p>
<p>eg. {&#8220;customizations&#8221;: {&#8220;hostname&#8221;: &#8220;foo&#8221;, &#8220;users&#8221;: [...]}}</p>
<p>find_recipe_obj([&#8220;customizations&#8221;, &#8220;hostname&#8221;], recipe, &#8220;&#8221;)</p>
</dd></dl> </dd></dl>
<dl class="function"> <dl class="function">
@ -2036,6 +2490,31 @@ commit:filename</p>
</table> </table>
</dd></dl> </dd></dl>
<dl class="function">
<dt id="pylorax.api.recipes.repo_file_exists">
<tt class="descclassname">pylorax.api.recipes.</tt><tt class="descname">repo_file_exists</tt><big>(</big><em>repo</em>, <em>branch</em>, <em>filename</em><big>)</big><a class="reference internal" href="_modules/pylorax/api/recipes.html#repo_file_exists"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.recipes.repo_file_exists" title="Permalink to this definition"></a></dt>
<dd><p>Return True if the filename exists on the branch</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>repo</strong> (<em>Git.Repository</em>) &#8211; Open repository</li>
<li><strong>branch</strong> (<a class="reference external" href="https://docs.python.org/2/library/functions.html#str" title="(in Python v2.7)"><em>str</em></a>) &#8211; Branch name</li>
<li><strong>filename</strong> (<a class="reference external" href="https://docs.python.org/2/library/functions.html#str" title="(in Python v2.7)"><em>str</em></a>) &#8211; Filename to check</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">True if the filename exists on the HEAD of the branch, False otherwise.</p>
</td>
</tr>
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first last">bool</p>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="function"> <dl class="function">
<dt id="pylorax.api.recipes.revert_file"> <dt id="pylorax.api.recipes.revert_file">
<tt class="descclassname">pylorax.api.recipes.</tt><tt class="descname">revert_file</tt><big>(</big><em>repo</em>, <em>branch</em>, <em>filename</em>, <em>commit</em><big>)</big><a class="reference internal" href="_modules/pylorax/api/recipes.html#revert_file"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.recipes.revert_file" title="Permalink to this definition"></a></dt> <tt class="descclassname">pylorax.api.recipes.</tt><tt class="descname">revert_file</tt><big>(</big><em>repo</em>, <em>branch</em>, <em>filename</em>, <em>commit</em><big>)</big><a class="reference internal" href="_modules/pylorax/api/recipes.html#revert_file"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.recipes.revert_file" title="Permalink to this definition"></a></dt>
@ -2278,14 +2757,20 @@ store the new blueprint on the new branch.</p>
</div> </div>
</div></blockquote> </div></blockquote>
</div> </div>
<div class="section" id="api-v0-blueprints-info-blueprint-names"> <div class="section" id="api-v0-blueprints-info-blueprint-names-format-json-toml">
<h4><cite>/api/v0/blueprints/info/&lt;blueprint_names&gt;</cite><a class="headerlink" href="#api-v0-blueprints-info-blueprint-names" title="Permalink to this headline"></a></h4> <h4><cite>/api/v0/blueprints/info/&lt;blueprint_names&gt;[?format=&lt;json|toml&gt;]</cite><a class="headerlink" href="#api-v0-blueprints-info-blueprint-names-format-json-toml" title="Permalink to this headline"></a></h4>
<blockquote> <blockquote>
<div><p>Return the JSON representation of the blueprint. This includes 3 top level <div><p>Return the JSON representation of the blueprint. This includes 3 top level
objects. <cite>changes</cite> which lists whether or not the workspace is different from objects. <cite>changes</cite> which lists whether or not the workspace is different from
the most recent commit. <cite>blueprints</cite> which lists the JSON representation of the the most recent commit. <cite>blueprints</cite> which lists the JSON representation of the
blueprint, and <cite>errors</cite> which will list any errors, like non-existant blueprints.</p> blueprint, and <cite>errors</cite> which will list any errors, like non-existant blueprints.</p>
<p>Example:</p> <p>By default the response is JSON, but if <cite>?format=toml</cite> is included in the URL&#8217;s
arguments it will return the response as the blueprint&#8217;s raw TOML content.
<em>Unless</em> there is an error which will only return a 400 and a standard error
<a href="#id2"><span class="problematic" id="id3">`Status Response`_</span></a>.</p>
<p>If there is an error when JSON is requested the successful blueprints and the
errors will both be returned.</p>
<p>Example of json response:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="p">{</span> <div class="highlight-python"><div class="highlight"><pre><span class="p">{</span>
<span class="s">&quot;changes&quot;</span><span class="p">:</span> <span class="p">[</span> <span class="s">&quot;changes&quot;</span><span class="p">:</span> <span class="p">[</span>
<span class="p">{</span> <span class="p">{</span>
@ -2409,7 +2894,8 @@ error response with it set to false and an error message included.</p>
<blockquote> <blockquote>
<div><p>Delete a blueprint. The blueprint is deleted from the branch, and will no longer <div><p>Delete a blueprint. The blueprint is deleted from the branch, and will no longer
be listed by the <cite>list</cite> route. A blueprint can be undeleted using the <cite>undo</cite> route be listed by the <cite>list</cite> route. A blueprint can be undeleted using the <cite>undo</cite> route
to revert to a previous commit.</p> to revert to a previous commit. This will also delete the workspace copy of the
blueprint.</p>
<p>The response will be a status response with <cite>status</cite> set to true, or an <p>The response will be a status response with <cite>status</cite> set to true, or an
error response with it set to false and an error message included.</p> error response with it set to false and an error message included.</p>
</div></blockquote> </div></blockquote>
@ -3210,7 +3696,21 @@ a line boundry.</p>
<dl class="function"> <dl class="function">
<dt id="pylorax.api.v0.blueprint_exists"> <dt id="pylorax.api.v0.blueprint_exists">
<tt class="descclassname">pylorax.api.v0.</tt><tt class="descname">blueprint_exists</tt><big>(</big><em>api</em>, <em>branch</em>, <em>blueprint_name</em><big>)</big><a class="reference internal" href="_modules/pylorax/api/v0.html#blueprint_exists"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.v0.blueprint_exists" title="Permalink to this definition"></a></dt> <tt class="descclassname">pylorax.api.v0.</tt><tt class="descname">blueprint_exists</tt><big>(</big><em>api</em>, <em>branch</em>, <em>blueprint_name</em><big>)</big><a class="reference internal" href="_modules/pylorax/api/v0.html#blueprint_exists"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.v0.blueprint_exists" title="Permalink to this definition"></a></dt>
<dd></dd></dl> <dd><p>Return True if the blueprint exists</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
<li><strong>api</strong> (<em>Flask</em>) &#8211; flask object</li>
<li><strong>branch</strong> (<a class="reference external" href="https://docs.python.org/2/library/functions.html#str" title="(in Python v2.7)"><em>str</em></a>) &#8211; Branch name</li>
<li><strong>recipe_name</strong> (<a class="reference external" href="https://docs.python.org/2/library/functions.html#str" title="(in Python v2.7)"><em>str</em></a>) &#8211; Recipe name to read</li>
</ul>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="function"> <dl class="function">
<dt id="pylorax.api.v0.take_limits"> <dt id="pylorax.api.v0.take_limits">
@ -3349,6 +3849,34 @@ a line boundry.</p>
</div> </div>
<div class="section" id="module-pylorax.api.yumbase"> <div class="section" id="module-pylorax.api.yumbase">
<span id="yumbase-module"></span><h2><tt class="xref py py-mod docutils literal"><span class="pre">yumbase</span></tt> Module<a class="headerlink" href="#module-pylorax.api.yumbase" title="Permalink to this headline"></a></h2> <span id="yumbase-module"></span><h2><tt class="xref py py-mod docutils literal"><span class="pre">yumbase</span></tt> Module<a class="headerlink" href="#module-pylorax.api.yumbase" title="Permalink to this headline"></a></h2>
<dl class="class">
<dt id="pylorax.api.yumbase.YumLock">
<em class="property">class </em><tt class="descclassname">pylorax.api.yumbase.</tt><tt class="descname">YumLock</tt><big>(</big><em>conf</em>, <em>expire_secs=21600</em><big>)</big><a class="reference internal" href="_modules/pylorax/api/yumbase.html#YumLock"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.yumbase.YumLock" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <a class="reference external" href="https://docs.python.org/2/library/functions.html#object" title="(in Python v2.7)"><tt class="xref py py-class docutils literal"><span class="pre">object</span></tt></a></p>
<p>Hold the YumBase object and a Lock to control access to it.</p>
<p>self.yb is a property that returns the YumBase object, but it <em>may</em> change
from one call to the next if the upstream repositories have changed.</p>
<dl class="attribute">
<dt id="pylorax.api.yumbase.YumLock.lock">
<tt class="descname">lock</tt><a class="reference internal" href="_modules/pylorax/api/yumbase.html#YumLock.lock"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.yumbase.YumLock.lock" title="Permalink to this definition"></a></dt>
<dd><p>Check for repo updates (using expiration time) and return the lock</p>
<p>If the repository has been updated, tear down the old YumBase and
create a new one. This is the only way to force yum to use the new
metadata.</p>
</dd></dl>
<dl class="attribute">
<dt id="pylorax.api.yumbase.YumLock.lock_check">
<tt class="descname">lock_check</tt><a class="reference internal" href="_modules/pylorax/api/yumbase.html#YumLock.lock_check"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.yumbase.YumLock.lock_check" title="Permalink to this definition"></a></dt>
<dd><p>Force a check for repo updates and return the lock</p>
<p>If the repository has been updated, tear down the old YumBase and
create a new one. This is the only way to force yum to use the new
metadata.</p>
<p>Use this method sparingly, it removes the repodata and downloads a new copy every time.</p>
</dd></dl>
</dd></dl>
<dl class="function"> <dl class="function">
<dt id="pylorax.api.yumbase.get_base_object"> <dt id="pylorax.api.yumbase.get_base_object">
<tt class="descclassname">pylorax.api.yumbase.</tt><tt class="descname">get_base_object</tt><big>(</big><em>conf</em><big>)</big><a class="reference internal" href="_modules/pylorax/api/yumbase.html#get_base_object"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.yumbase.get_base_object" title="Permalink to this definition"></a></dt> <tt class="descclassname">pylorax.api.yumbase.</tt><tt class="descname">get_base_object</tt><big>(</big><em>conf</em><big>)</big><a class="reference internal" href="_modules/pylorax/api/yumbase.html#get_base_object"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.yumbase.get_base_object" title="Permalink to this definition"></a></dt>
@ -3398,6 +3926,7 @@ a line boundry.</p>
<ul> <ul>
<li><a class="reference internal" href="#">api Package</a><ul> <li><a class="reference internal" href="#">api Package</a><ul>
<li><a class="reference internal" href="#id1"><tt class="docutils literal"><span class="pre">api</span></tt> Package</a></li> <li><a class="reference internal" href="#id1"><tt class="docutils literal"><span class="pre">api</span></tt> Package</a></li>
<li><a class="reference internal" href="#module-pylorax.api.bisect"><tt class="docutils literal"><span class="pre">bisect</span></tt> Module</a></li>
<li><a class="reference internal" href="#module-pylorax.api.checkparams"><tt class="docutils literal"><span class="pre">checkparams</span></tt> Module</a></li> <li><a class="reference internal" href="#module-pylorax.api.checkparams"><tt class="docutils literal"><span class="pre">checkparams</span></tt> Module</a></li>
<li><a class="reference internal" href="#module-pylorax.api.compose"><tt class="docutils literal"><span class="pre">compose</span></tt> Module</a><ul> <li><a class="reference internal" href="#module-pylorax.api.compose"><tt class="docutils literal"><span class="pre">compose</span></tt> Module</a><ul>
<li><a class="reference internal" href="#adding-new-output-types">Adding New Output Types</a></li> <li><a class="reference internal" href="#adding-new-output-types">Adding New Output Types</a></li>
@ -3416,7 +3945,7 @@ a line boundry.</p>
<li><a class="reference internal" href="#status-responses">Status Responses</a></li> <li><a class="reference internal" href="#status-responses">Status Responses</a></li>
<li><a class="reference internal" href="#api-routes">API Routes</a><ul> <li><a class="reference internal" href="#api-routes">API Routes</a><ul>
<li><a class="reference internal" href="#api-v0-blueprints-list"><cite>/api/v0/blueprints/list</cite></a></li> <li><a class="reference internal" href="#api-v0-blueprints-list"><cite>/api/v0/blueprints/list</cite></a></li>
<li><a class="reference internal" href="#api-v0-blueprints-info-blueprint-names"><cite>/api/v0/blueprints/info/&lt;blueprint_names&gt;</cite></a></li> <li><a class="reference internal" href="#api-v0-blueprints-info-blueprint-names-format-json-toml"><cite>/api/v0/blueprints/info/&lt;blueprint_names&gt;[?format=&lt;json|toml&gt;]</cite></a></li>
<li><a class="reference internal" href="#api-v0-blueprints-changes-blueprint-names-offset-0-limit-20"><cite>/api/v0/blueprints/changes/&lt;blueprint_names&gt;[?offset=0&amp;limit=20]</cite></a></li> <li><a class="reference internal" href="#api-v0-blueprints-changes-blueprint-names-offset-0-limit-20"><cite>/api/v0/blueprints/changes/&lt;blueprint_names&gt;[?offset=0&amp;limit=20]</cite></a></li>
<li><a class="reference internal" href="#post-api-v0-blueprints-new">POST <cite>/api/v0/blueprints/new</cite></a></li> <li><a class="reference internal" href="#post-api-v0-blueprints-new">POST <cite>/api/v0/blueprints/new</cite></a></li>
<li><a class="reference internal" href="#delete-api-v0-blueprints-delete-blueprint-name">DELETE <cite>/api/v0/blueprints/delete/&lt;blueprint_name&gt;</cite></a></li> <li><a class="reference internal" href="#delete-api-v0-blueprints-delete-blueprint-name">DELETE <cite>/api/v0/blueprints/delete/&lt;blueprint_name&gt;</cite></a></li>
@ -3498,7 +4027,7 @@ a line boundry.</p>
<li class="right" > <li class="right" >
<a href="pylorax.html" title="pylorax Package" <a href="pylorax.html" title="pylorax Package"
>previous</a> |</li> >previous</a> |</li>
<li><a href="index.html">Lorax 19.7.22 documentation</a> &raquo;</li> <li><a href="index.html">Lorax 19.7.43 documentation</a> &raquo;</li>
<li><a href="modules.html" >src</a> &raquo;</li> <li><a href="modules.html" >src</a> &raquo;</li>
<li><a href="pylorax.html" >pylorax Package</a> &raquo;</li> <li><a href="pylorax.html" >pylorax Package</a> &raquo;</li>
</ul> </ul>

View File

@ -8,7 +8,7 @@
<head> <head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>pylorax Package &mdash; Lorax 19.7.22 documentation</title> <title>pylorax Package &mdash; Lorax 19.7.43 documentation</title>
<link rel="stylesheet" href="_static/default.css" type="text/css" /> <link rel="stylesheet" href="_static/default.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" /> <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
@ -16,7 +16,7 @@
<script type="text/javascript"> <script type="text/javascript">
var DOCUMENTATION_OPTIONS = { var DOCUMENTATION_OPTIONS = {
URL_ROOT: '', URL_ROOT: '',
VERSION: '19.7.22', VERSION: '19.7.43',
COLLAPSE_INDEX: false, COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html', FILE_SUFFIX: '.html',
HAS_SOURCE: true HAS_SOURCE: true
@ -25,7 +25,7 @@
<script type="text/javascript" src="_static/jquery.js"></script> <script type="text/javascript" src="_static/jquery.js"></script>
<script type="text/javascript" src="_static/underscore.js"></script> <script type="text/javascript" src="_static/underscore.js"></script>
<script type="text/javascript" src="_static/doctools.js"></script> <script type="text/javascript" src="_static/doctools.js"></script>
<link rel="top" title="Lorax 19.7.22 documentation" href="index.html" /> <link rel="top" title="Lorax 19.7.43 documentation" href="index.html" />
<link rel="up" title="src" href="modules.html" /> <link rel="up" title="src" href="modules.html" />
<link rel="next" title="api Package" href="pylorax.api.html" /> <link rel="next" title="api Package" href="pylorax.api.html" />
<link rel="prev" title="cli Package" href="composer.cli.html" /> <link rel="prev" title="cli Package" href="composer.cli.html" />
@ -46,7 +46,7 @@
<li class="right" > <li class="right" >
<a href="composer.cli.html" title="cli Package" <a href="composer.cli.html" title="cli Package"
accesskey="P">previous</a> |</li> accesskey="P">previous</a> |</li>
<li><a href="index.html">Lorax 19.7.22 documentation</a> &raquo;</li> <li><a href="index.html">Lorax 19.7.43 documentation</a> &raquo;</li>
<li><a href="modules.html" accesskey="U">src</a> &raquo;</li> <li><a href="modules.html" accesskey="U">src</a> &raquo;</li>
</ul> </ul>
</div> </div>
@ -107,6 +107,12 @@
<tt class="descclassname">pylorax.</tt><tt class="descname">get_buildarch</tt><big>(</big><em>ybo</em><big>)</big><a class="reference internal" href="_modules/pylorax.html#get_buildarch"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.get_buildarch" title="Permalink to this definition"></a></dt> <tt class="descclassname">pylorax.</tt><tt class="descname">get_buildarch</tt><big>(</big><em>ybo</em><big>)</big><a class="reference internal" href="_modules/pylorax.html#get_buildarch"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.get_buildarch" title="Permalink to this definition"></a></dt>
<dd></dd></dl> <dd></dd></dl>
<dl class="function">
<dt id="pylorax.log_selinux_state">
<tt class="descclassname">pylorax.</tt><tt class="descname">log_selinux_state</tt><big>(</big><big>)</big><a class="reference internal" href="_modules/pylorax.html#log_selinux_state"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.log_selinux_state" title="Permalink to this definition"></a></dt>
<dd><p>Log the current state of selinux</p>
</dd></dl>
</div> </div>
<div class="section" id="module-pylorax.base"> <div class="section" id="module-pylorax.base">
<span id="base-module"></span><h2><tt class="xref py py-mod docutils literal"><span class="pre">base</span></tt> Module<a class="headerlink" href="#module-pylorax.base" title="Permalink to this headline"></a></h2> <span id="base-module"></span><h2><tt class="xref py py-mod docutils literal"><span class="pre">base</span></tt> Module<a class="headerlink" href="#module-pylorax.base" title="Permalink to this headline"></a></h2>
@ -116,27 +122,27 @@
<dd><p>Bases: <a class="reference external" href="https://docs.python.org/2/library/functions.html#object" title="(in Python v2.7)"><tt class="xref py py-class docutils literal"><span class="pre">object</span></tt></a></p> <dd><p>Bases: <a class="reference external" href="https://docs.python.org/2/library/functions.html#object" title="(in Python v2.7)"><tt class="xref py py-class docutils literal"><span class="pre">object</span></tt></a></p>
<dl class="method"> <dl class="method">
<dt id="pylorax.base.BaseLoraxClass.pcritical"> <dt id="pylorax.base.BaseLoraxClass.pcritical">
<tt class="descname">pcritical</tt><big>(</big><em>msg</em>, <em>fobj=&lt;open file '&lt;stdout&gt;'</em>, <em>mode 'w' at 0x7f838cf59150&gt;</em><big>)</big><a class="reference internal" href="_modules/pylorax/base.html#BaseLoraxClass.pcritical"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.base.BaseLoraxClass.pcritical" title="Permalink to this definition"></a></dt> <tt class="descname">pcritical</tt><big>(</big><em>msg</em>, <em>fobj=&lt;open file '&lt;stdout&gt;'</em>, <em>mode 'w' at 0x7f44874d0150&gt;</em><big>)</big><a class="reference internal" href="_modules/pylorax/base.html#BaseLoraxClass.pcritical"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.base.BaseLoraxClass.pcritical" title="Permalink to this definition"></a></dt>
<dd></dd></dl> <dd></dd></dl>
<dl class="method"> <dl class="method">
<dt id="pylorax.base.BaseLoraxClass.pdebug"> <dt id="pylorax.base.BaseLoraxClass.pdebug">
<tt class="descname">pdebug</tt><big>(</big><em>msg</em>, <em>fobj=&lt;open file '&lt;stdout&gt;'</em>, <em>mode 'w' at 0x7f838cf59150&gt;</em><big>)</big><a class="reference internal" href="_modules/pylorax/base.html#BaseLoraxClass.pdebug"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.base.BaseLoraxClass.pdebug" title="Permalink to this definition"></a></dt> <tt class="descname">pdebug</tt><big>(</big><em>msg</em>, <em>fobj=&lt;open file '&lt;stdout&gt;'</em>, <em>mode 'w' at 0x7f44874d0150&gt;</em><big>)</big><a class="reference internal" href="_modules/pylorax/base.html#BaseLoraxClass.pdebug"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.base.BaseLoraxClass.pdebug" title="Permalink to this definition"></a></dt>
<dd></dd></dl> <dd></dd></dl>
<dl class="method"> <dl class="method">
<dt id="pylorax.base.BaseLoraxClass.perror"> <dt id="pylorax.base.BaseLoraxClass.perror">
<tt class="descname">perror</tt><big>(</big><em>msg</em>, <em>fobj=&lt;open file '&lt;stdout&gt;'</em>, <em>mode 'w' at 0x7f838cf59150&gt;</em><big>)</big><a class="reference internal" href="_modules/pylorax/base.html#BaseLoraxClass.perror"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.base.BaseLoraxClass.perror" title="Permalink to this definition"></a></dt> <tt class="descname">perror</tt><big>(</big><em>msg</em>, <em>fobj=&lt;open file '&lt;stdout&gt;'</em>, <em>mode 'w' at 0x7f44874d0150&gt;</em><big>)</big><a class="reference internal" href="_modules/pylorax/base.html#BaseLoraxClass.perror"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.base.BaseLoraxClass.perror" title="Permalink to this definition"></a></dt>
<dd></dd></dl> <dd></dd></dl>
<dl class="method"> <dl class="method">
<dt id="pylorax.base.BaseLoraxClass.pinfo"> <dt id="pylorax.base.BaseLoraxClass.pinfo">
<tt class="descname">pinfo</tt><big>(</big><em>msg</em>, <em>fobj=&lt;open file '&lt;stdout&gt;'</em>, <em>mode 'w' at 0x7f838cf59150&gt;</em><big>)</big><a class="reference internal" href="_modules/pylorax/base.html#BaseLoraxClass.pinfo"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.base.BaseLoraxClass.pinfo" title="Permalink to this definition"></a></dt> <tt class="descname">pinfo</tt><big>(</big><em>msg</em>, <em>fobj=&lt;open file '&lt;stdout&gt;'</em>, <em>mode 'w' at 0x7f44874d0150&gt;</em><big>)</big><a class="reference internal" href="_modules/pylorax/base.html#BaseLoraxClass.pinfo"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.base.BaseLoraxClass.pinfo" title="Permalink to this definition"></a></dt>
<dd></dd></dl> <dd></dd></dl>
<dl class="method"> <dl class="method">
<dt id="pylorax.base.BaseLoraxClass.pwarning"> <dt id="pylorax.base.BaseLoraxClass.pwarning">
<tt class="descname">pwarning</tt><big>(</big><em>msg</em>, <em>fobj=&lt;open file '&lt;stdout&gt;'</em>, <em>mode 'w' at 0x7f838cf59150&gt;</em><big>)</big><a class="reference internal" href="_modules/pylorax/base.html#BaseLoraxClass.pwarning"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.base.BaseLoraxClass.pwarning" title="Permalink to this definition"></a></dt> <tt class="descname">pwarning</tt><big>(</big><em>msg</em>, <em>fobj=&lt;open file '&lt;stdout&gt;'</em>, <em>mode 'w' at 0x7f44874d0150&gt;</em><big>)</big><a class="reference internal" href="_modules/pylorax/base.html#BaseLoraxClass.pwarning"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.base.BaseLoraxClass.pwarning" title="Permalink to this definition"></a></dt>
<dd></dd></dl> <dd></dd></dl>
</dd></dl> </dd></dl>
@ -275,7 +281,7 @@ releasever Release version, passed to template. Default is 17</p>
<dl class="function"> <dl class="function">
<dt id="pylorax.creator.make_image"> <dt id="pylorax.creator.make_image">
<tt class="descclassname">pylorax.creator.</tt><tt class="descname">make_image</tt><big>(</big><em>opts</em>, <em>ks</em>, <em>callback_func=None</em><big>)</big><a class="reference internal" href="_modules/pylorax/creator.html#make_image"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.creator.make_image" title="Permalink to this definition"></a></dt> <tt class="descclassname">pylorax.creator.</tt><tt class="descname">make_image</tt><big>(</big><em>opts</em>, <em>ks</em>, <em>cancel_func=None</em><big>)</big><a class="reference internal" href="_modules/pylorax/creator.html#make_image"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.creator.make_image" title="Permalink to this definition"></a></dt>
<dd><p>Install to an image</p> <dd><p>Install to an image</p>
<p>Use virt or anaconda to install to an image.</p> <p>Use virt or anaconda to install to an image.</p>
<p>Returns the full path of of the image created.</p> <p>Returns the full path of of the image created.</p>
@ -370,7 +376,7 @@ type img_mount: imgutils.PartitionMount</p>
<dl class="function"> <dl class="function">
<dt id="pylorax.creator.run_creator"> <dt id="pylorax.creator.run_creator">
<tt class="descclassname">pylorax.creator.</tt><tt class="descname">run_creator</tt><big>(</big><em>opts</em>, <em>callback_func=None</em><big>)</big><a class="reference internal" href="_modules/pylorax/creator.html#run_creator"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.creator.run_creator" title="Permalink to this definition"></a></dt> <tt class="descclassname">pylorax.creator.</tt><tt class="descname">run_creator</tt><big>(</big><em>opts</em>, <em>cancel_func=None</em><big>)</big><a class="reference internal" href="_modules/pylorax/creator.html#run_creator"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.creator.run_creator" title="Permalink to this definition"></a></dt>
<dd><p>Run the image creator process</p> <dd><p>Run the image creator process</p>
<table class="docutils field-list" frame="void" rules="none"> <table class="docutils field-list" frame="void" rules="none">
<col class="field-name" /> <col class="field-name" />
@ -775,7 +781,7 @@ initrd.img than the iso has. The iso is still used for stage2.</p>
<dl class="class"> <dl class="class">
<dt id="pylorax.installer.VirtualInstall"> <dt id="pylorax.installer.VirtualInstall">
<em class="property">class </em><tt class="descclassname">pylorax.installer.</tt><tt class="descname">VirtualInstall</tt><big>(</big><em>iso</em>, <em>ks_paths</em>, <em>disk_img</em>, <em>img_size=2</em>, <em>kernel_args=None</em>, <em>memory=1024</em>, <em>vnc=None</em>, <em>arch=None</em>, <em>log_check=None</em>, <em>virtio_host='127.0.0.1'</em>, <em>virtio_port=6080</em>, <em>qcow2=False</em>, <em>boot_uefi=False</em>, <em>ovmf_path=None</em><big>)</big><a class="reference internal" href="_modules/pylorax/installer.html#VirtualInstall"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.installer.VirtualInstall" title="Permalink to this definition"></a></dt> <em class="property">class </em><tt class="descclassname">pylorax.installer.</tt><tt class="descname">VirtualInstall</tt><big>(</big><em>iso</em>, <em>ks_paths</em>, <em>disk_img</em>, <em>img_size=2</em>, <em>kernel_args=None</em>, <em>memory=1024</em>, <em>vnc=None</em>, <em>arch=None</em>, <em>cancel_func=None</em>, <em>virtio_host='127.0.0.1'</em>, <em>virtio_port=6080</em>, <em>qcow2=False</em>, <em>boot_uefi=False</em>, <em>ovmf_path=None</em><big>)</big><a class="reference internal" href="_modules/pylorax/installer.html#VirtualInstall"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.installer.VirtualInstall" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <a class="reference external" href="https://docs.python.org/2/library/functions.html#object" title="(in Python v2.7)"><tt class="xref py py-class docutils literal"><span class="pre">object</span></tt></a></p> <dd><p>Bases: <a class="reference external" href="https://docs.python.org/2/library/functions.html#object" title="(in Python v2.7)"><tt class="xref py py-class docutils literal"><span class="pre">object</span></tt></a></p>
<p>Run virt-install using an iso and kickstart(s)</p> <p>Run virt-install using an iso and kickstart(s)</p>
<dl class="method"> <dl class="method">
@ -789,13 +795,13 @@ initrd.img than the iso has. The iso is still used for stage2.</p>
<dl class="function"> <dl class="function">
<dt id="pylorax.installer.novirt_install"> <dt id="pylorax.installer.novirt_install">
<tt class="descclassname">pylorax.installer.</tt><tt class="descname">novirt_install</tt><big>(</big><em>opts</em>, <em>disk_img</em>, <em>disk_size</em>, <em>repo_url</em>, <em>callback_func=None</em><big>)</big><a class="reference internal" href="_modules/pylorax/installer.html#novirt_install"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.installer.novirt_install" title="Permalink to this definition"></a></dt> <tt class="descclassname">pylorax.installer.</tt><tt class="descname">novirt_install</tt><big>(</big><em>opts</em>, <em>disk_img</em>, <em>disk_size</em>, <em>repo_url</em>, <em>cancel_func=None</em><big>)</big><a class="reference internal" href="_modules/pylorax/installer.html#novirt_install"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.installer.novirt_install" title="Permalink to this definition"></a></dt>
<dd><p>Use Anaconda to install to a disk image</p> <dd><p>Use Anaconda to install to a disk image</p>
</dd></dl> </dd></dl>
<dl class="function"> <dl class="function">
<dt id="pylorax.installer.virt_install"> <dt id="pylorax.installer.virt_install">
<tt class="descclassname">pylorax.installer.</tt><tt class="descname">virt_install</tt><big>(</big><em>opts</em>, <em>install_log</em>, <em>disk_img</em>, <em>disk_size</em><big>)</big><a class="reference internal" href="_modules/pylorax/installer.html#virt_install"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.installer.virt_install" title="Permalink to this definition"></a></dt> <tt class="descclassname">pylorax.installer.</tt><tt class="descname">virt_install</tt><big>(</big><em>opts</em>, <em>install_log</em>, <em>disk_img</em>, <em>disk_size</em>, <em>cancel_func=None</em><big>)</big><a class="reference internal" href="_modules/pylorax/installer.html#virt_install"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.installer.virt_install" title="Permalink to this definition"></a></dt>
<dd><p>Use virt-install to install to a disk image</p> <dd><p>Use virt-install to install to a disk image</p>
<p>install_log is the path to write the log from virt-install <p>install_log is the path to write the log from virt-install
disk_img is the full path to the final disk or filesystem image disk_img is the full path to the final disk or filesystem image
@ -1320,7 +1326,7 @@ Example:</p>
<dl class="class"> <dl class="class">
<dt id="pylorax.treebuilder.TreeBuilder"> <dt id="pylorax.treebuilder.TreeBuilder">
<em class="property">class </em><tt class="descclassname">pylorax.treebuilder.</tt><tt class="descname">TreeBuilder</tt><big>(</big><em>product</em>, <em>arch</em>, <em>inroot</em>, <em>outroot</em>, <em>runtime</em>, <em>isolabel</em>, <em>domacboot=False</em>, <em>doupgrade=True</em>, <em>templatedir=None</em>, <em>add_templates=None</em>, <em>add_template_vars=None</em>, <em>workdir=None</em><big>)</big><a class="reference internal" href="_modules/pylorax/treebuilder.html#TreeBuilder"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.treebuilder.TreeBuilder" title="Permalink to this definition"></a></dt> <em class="property">class </em><tt class="descclassname">pylorax.treebuilder.</tt><tt class="descname">TreeBuilder</tt><big>(</big><em>product</em>, <em>arch</em>, <em>inroot</em>, <em>outroot</em>, <em>runtime</em>, <em>isolabel</em>, <em>domacboot=False</em>, <em>doupgrade=True</em>, <em>templatedir=None</em>, <em>add_templates=None</em>, <em>add_template_vars=None</em>, <em>workdir=None</em>, <em>extra_boot_args=''</em><big>)</big><a class="reference internal" href="_modules/pylorax/treebuilder.html#TreeBuilder"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.treebuilder.TreeBuilder" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <a class="reference external" href="https://docs.python.org/2/library/functions.html#object" title="(in Python v2.7)"><tt class="xref py py-class docutils literal"><span class="pre">object</span></tt></a></p> <dd><p>Bases: <a class="reference external" href="https://docs.python.org/2/library/functions.html#object" title="(in Python v2.7)"><tt class="xref py py-class docutils literal"><span class="pre">object</span></tt></a></p>
<p>Builds the arch-specific boot images. <p>Builds the arch-specific boot images.
inroot should be the installtree root (the newly-built runtime dir)</p> inroot should be the installtree root (the newly-built runtime dir)</p>
@ -1467,6 +1473,7 @@ image is built with the filename &#8220;${prefix}-${kernel.version}.img&#8221;</
<ul> <ul>
<li class="toctree-l1"><a class="reference internal" href="pylorax.api.html">api Package</a><ul> <li class="toctree-l1"><a class="reference internal" href="pylorax.api.html">api Package</a><ul>
<li class="toctree-l2"><a class="reference internal" href="pylorax.api.html#id1"><tt class="docutils literal"><span class="pre">api</span></tt> Package</a></li> <li class="toctree-l2"><a class="reference internal" href="pylorax.api.html#id1"><tt class="docutils literal"><span class="pre">api</span></tt> Package</a></li>
<li class="toctree-l2"><a class="reference internal" href="pylorax.api.html#module-pylorax.api.bisect"><tt class="docutils literal"><span class="pre">bisect</span></tt> Module</a></li>
<li class="toctree-l2"><a class="reference internal" href="pylorax.api.html#module-pylorax.api.checkparams"><tt class="docutils literal"><span class="pre">checkparams</span></tt> Module</a></li> <li class="toctree-l2"><a class="reference internal" href="pylorax.api.html#module-pylorax.api.checkparams"><tt class="docutils literal"><span class="pre">checkparams</span></tt> Module</a></li>
<li class="toctree-l2"><a class="reference internal" href="pylorax.api.html#module-pylorax.api.compose"><tt class="docutils literal"><span class="pre">compose</span></tt> Module</a><ul> <li class="toctree-l2"><a class="reference internal" href="pylorax.api.html#module-pylorax.api.compose"><tt class="docutils literal"><span class="pre">compose</span></tt> Module</a><ul>
<li class="toctree-l3"><a class="reference internal" href="pylorax.api.html#adding-new-output-types">Adding New Output Types</a></li> <li class="toctree-l3"><a class="reference internal" href="pylorax.api.html#adding-new-output-types">Adding New Output Types</a></li>
@ -1485,7 +1492,7 @@ image is built with the filename &#8220;${prefix}-${kernel.version}.img&#8221;</
<li class="toctree-l3"><a class="reference internal" href="pylorax.api.html#status-responses">Status Responses</a></li> <li class="toctree-l3"><a class="reference internal" href="pylorax.api.html#status-responses">Status Responses</a></li>
<li class="toctree-l3"><a class="reference internal" href="pylorax.api.html#api-routes">API Routes</a><ul> <li class="toctree-l3"><a class="reference internal" href="pylorax.api.html#api-routes">API Routes</a><ul>
<li class="toctree-l4"><a class="reference internal" href="pylorax.api.html#api-v0-blueprints-list"><cite>/api/v0/blueprints/list</cite></a></li> <li class="toctree-l4"><a class="reference internal" href="pylorax.api.html#api-v0-blueprints-list"><cite>/api/v0/blueprints/list</cite></a></li>
<li class="toctree-l4"><a class="reference internal" href="pylorax.api.html#api-v0-blueprints-info-blueprint-names"><cite>/api/v0/blueprints/info/&lt;blueprint_names&gt;</cite></a></li> <li class="toctree-l4"><a class="reference internal" href="pylorax.api.html#api-v0-blueprints-info-blueprint-names-format-json-toml"><cite>/api/v0/blueprints/info/&lt;blueprint_names&gt;[?format=&lt;json|toml&gt;]</cite></a></li>
<li class="toctree-l4"><a class="reference internal" href="pylorax.api.html#api-v0-blueprints-changes-blueprint-names-offset-0-limit-20"><cite>/api/v0/blueprints/changes/&lt;blueprint_names&gt;[?offset=0&amp;limit=20]</cite></a></li> <li class="toctree-l4"><a class="reference internal" href="pylorax.api.html#api-v0-blueprints-changes-blueprint-names-offset-0-limit-20"><cite>/api/v0/blueprints/changes/&lt;blueprint_names&gt;[?offset=0&amp;limit=20]</cite></a></li>
<li class="toctree-l4"><a class="reference internal" href="pylorax.api.html#post-api-v0-blueprints-new">POST <cite>/api/v0/blueprints/new</cite></a></li> <li class="toctree-l4"><a class="reference internal" href="pylorax.api.html#post-api-v0-blueprints-new">POST <cite>/api/v0/blueprints/new</cite></a></li>
<li class="toctree-l4"><a class="reference internal" href="pylorax.api.html#delete-api-v0-blueprints-delete-blueprint-name">DELETE <cite>/api/v0/blueprints/delete/&lt;blueprint_name&gt;</cite></a></li> <li class="toctree-l4"><a class="reference internal" href="pylorax.api.html#delete-api-v0-blueprints-delete-blueprint-name">DELETE <cite>/api/v0/blueprints/delete/&lt;blueprint_name&gt;</cite></a></li>
@ -1608,7 +1615,7 @@ image is built with the filename &#8220;${prefix}-${kernel.version}.img&#8221;</
<li class="right" > <li class="right" >
<a href="composer.cli.html" title="cli Package" <a href="composer.cli.html" title="cli Package"
>previous</a> |</li> >previous</a> |</li>
<li><a href="index.html">Lorax 19.7.22 documentation</a> &raquo;</li> <li><a href="index.html">Lorax 19.7.43 documentation</a> &raquo;</li>
<li><a href="modules.html" >src</a> &raquo;</li> <li><a href="modules.html" >src</a> &raquo;</li>
</ul> </ul>
</div> </div>

View File

@ -8,7 +8,7 @@
<head> <head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Search &mdash; Lorax 19.7.22 documentation</title> <title>Search &mdash; Lorax 19.7.43 documentation</title>
<link rel="stylesheet" href="_static/default.css" type="text/css" /> <link rel="stylesheet" href="_static/default.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" /> <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
@ -16,7 +16,7 @@
<script type="text/javascript"> <script type="text/javascript">
var DOCUMENTATION_OPTIONS = { var DOCUMENTATION_OPTIONS = {
URL_ROOT: '', URL_ROOT: '',
VERSION: '19.7.22', VERSION: '19.7.43',
COLLAPSE_INDEX: false, COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html', FILE_SUFFIX: '.html',
HAS_SOURCE: true HAS_SOURCE: true
@ -26,7 +26,7 @@
<script type="text/javascript" src="_static/underscore.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/doctools.js"></script>
<script type="text/javascript" src="_static/searchtools.js"></script> <script type="text/javascript" src="_static/searchtools.js"></script>
<link rel="top" title="Lorax 19.7.22 documentation" href="index.html" /> <link rel="top" title="Lorax 19.7.43 documentation" href="index.html" />
<script type="text/javascript"> <script type="text/javascript">
jQuery(function() { Search.loadIndex("searchindex.js"); }); jQuery(function() { Search.loadIndex("searchindex.js"); });
</script> </script>
@ -43,7 +43,7 @@
<li class="right" > <li class="right" >
<a href="py-modindex.html" title="Python Module Index" <a href="py-modindex.html" title="Python Module Index"
>modules</a> |</li> >modules</a> |</li>
<li><a href="index.html">Lorax 19.7.22 documentation</a> &raquo;</li> <li><a href="index.html">Lorax 19.7.43 documentation</a> &raquo;</li>
</ul> </ul>
</div> </div>
@ -94,7 +94,7 @@
<li class="right" > <li class="right" >
<a href="py-modindex.html" title="Python Module Index" <a href="py-modindex.html" title="Python Module Index"
>modules</a> |</li> >modules</a> |</li>
<li><a href="index.html">Lorax 19.7.22 documentation</a> &raquo;</li> <li><a href="index.html">Lorax 19.7.43 documentation</a> &raquo;</li>
</ul> </ul>
</div> </div>
<div class="footer"> <div class="footer">

File diff suppressed because one or more lines are too long