lorax/docs/html/pylorax.api.html

2815 lines
190 KiB
HTML

<!DOCTYPE html>
<!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]-->
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>pylorax.api package &mdash; Lorax 30.19 documentation</title>
<script type="text/javascript" src="_static/js/modernizr.min.js"></script>
<script type="text/javascript" id="documentation_options" data-url_root="./" src="_static/documentation_options.js"></script>
<script type="text/javascript" src="_static/jquery.js"></script>
<script type="text/javascript" src="_static/underscore.js"></script>
<script type="text/javascript" src="_static/doctools.js"></script>
<script type="text/javascript" src="_static/language_data.js"></script>
<script type="text/javascript" src="_static/js/theme.js"></script>
<link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<link rel="index" title="Index" href="genindex.html" />
<link rel="search" title="Search" href="search.html" />
<link rel="prev" title="pylorax package" href="pylorax.html" />
</head>
<body class="wy-body-for-nav">
<div class="wy-grid-for-nav">
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
<div class="wy-side-scroll">
<div class="wy-side-nav-search" >
<a href="index.html" class="icon icon-home"> Lorax
</a>
<div class="version">
30.19
</div>
<div role="search">
<form id="rtd-search-form" class="wy-form" action="search.html" method="get">
<input type="text" name="q" placeholder="Search docs" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
</div>
<div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="intro.html">Introduction to Lorax</a></li>
<li class="toctree-l1"><a class="reference internal" href="intro.html#before-lorax">Before Lorax</a></li>
<li class="toctree-l1"><a class="reference internal" href="lorax.html">Lorax</a></li>
<li class="toctree-l1"><a class="reference internal" href="livemedia-creator.html">livemedia-creator</a></li>
<li class="toctree-l1"><a class="reference internal" href="lorax-composer.html">lorax-composer</a></li>
<li class="toctree-l1"><a class="reference internal" href="composer-cli.html">composer-cli</a></li>
<li class="toctree-l1"><a class="reference internal" href="product-images.html">Product and Updates Images</a></li>
<li class="toctree-l1 current"><a class="reference internal" href="modules.html">src</a><ul class="current">
<li class="toctree-l2"><a class="reference internal" href="composer.html">composer package</a></li>
<li class="toctree-l2 current"><a class="reference internal" href="pylorax.html">pylorax package</a><ul class="current">
<li class="toctree-l3 current"><a class="reference internal" href="pylorax.html#subpackages">Subpackages</a><ul class="current">
<li class="toctree-l4 current"><a class="current reference internal" href="#">pylorax.api package</a></li>
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="pylorax.html#submodules">Submodules</a></li>
<li class="toctree-l3"><a class="reference internal" href="pylorax.html#module-pylorax.base">pylorax.base module</a></li>
<li class="toctree-l3"><a class="reference internal" href="pylorax.html#module-pylorax.buildstamp">pylorax.buildstamp module</a></li>
<li class="toctree-l3"><a class="reference internal" href="pylorax.html#module-pylorax.cmdline">pylorax.cmdline module</a></li>
<li class="toctree-l3"><a class="reference internal" href="pylorax.html#pylorax-creator-module">pylorax.creator module</a></li>
<li class="toctree-l3"><a class="reference internal" href="pylorax.html#module-pylorax.decorators">pylorax.decorators module</a></li>
<li class="toctree-l3"><a class="reference internal" href="pylorax.html#module-pylorax.discinfo">pylorax.discinfo module</a></li>
<li class="toctree-l3"><a class="reference internal" href="pylorax.html#module-pylorax.dnfbase">pylorax.dnfbase module</a></li>
<li class="toctree-l3"><a class="reference internal" href="pylorax.html#module-pylorax.dnfhelper">pylorax.dnfhelper module</a></li>
<li class="toctree-l3"><a class="reference internal" href="pylorax.html#module-pylorax.executils">pylorax.executils module</a></li>
<li class="toctree-l3"><a class="reference internal" href="pylorax.html#module-pylorax.imgutils">pylorax.imgutils module</a></li>
<li class="toctree-l3"><a class="reference internal" href="pylorax.html#pylorax-installer-module">pylorax.installer module</a></li>
<li class="toctree-l3"><a class="reference internal" href="pylorax.html#module-pylorax.ltmpl">pylorax.ltmpl module</a></li>
<li class="toctree-l3"><a class="reference internal" href="pylorax.html#module-pylorax.monitor">pylorax.monitor module</a></li>
<li class="toctree-l3"><a class="reference internal" href="pylorax.html#pylorax-mount-module">pylorax.mount module</a></li>
<li class="toctree-l3"><a class="reference internal" href="pylorax.html#module-pylorax.output">pylorax.output module</a></li>
<li class="toctree-l3"><a class="reference internal" href="pylorax.html#module-pylorax.sysutils">pylorax.sysutils module</a></li>
<li class="toctree-l3"><a class="reference internal" href="pylorax.html#module-pylorax.treebuilder">pylorax.treebuilder module</a></li>
<li class="toctree-l3"><a class="reference internal" href="pylorax.html#module-pylorax.treeinfo">pylorax.treeinfo module</a></li>
<li class="toctree-l3"><a class="reference internal" href="pylorax.html#module-pylorax">Module contents</a></li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
</div>
</nav>
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
<nav class="wy-nav-top" aria-label="top navigation">
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="index.html">Lorax</a>
</nav>
<div class="wy-nav-content">
<div class="rst-content">
<div role="navigation" aria-label="breadcrumbs navigation">
<ul class="wy-breadcrumbs">
<li><a href="index.html">Docs</a> &raquo;</li>
<li><a href="modules.html">src</a> &raquo;</li>
<li><a href="pylorax.html">pylorax package</a> &raquo;</li>
<li>pylorax.api package</li>
<li class="wy-breadcrumbs-aside">
<a href="_sources/pylorax.api.rst.txt" rel="nofollow"> View page source</a>
</li>
</ul>
<hr/>
</div>
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
<div itemprop="articleBody">
<div class="section" id="pylorax-api-package">
<h1>pylorax.api package<a class="headerlink" href="#pylorax-api-package" title="Permalink to this headline"></a></h1>
<div class="section" id="submodules">
<h2>Submodules<a class="headerlink" href="#submodules" title="Permalink to this headline"></a></h2>
</div>
<div class="section" id="module-pylorax.api.bisect">
<span id="pylorax-api-bisect-module"></span><h2>pylorax.api.bisect 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">
<code class="descclassname">pylorax.api.bisect.</code><code class="descname">insort_left</code><span class="sig-paren">(</span><em>a</em>, <em>x</em>, <em>key=None</em>, <em>lo=0</em>, <em>hi=None</em><span class="sig-paren">)</span><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> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#list" title="(in Python v3.7)"><em>list</em></a>) -- sorted list</li>
<li><strong>x</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#object" title="(in Python v3.7)"><em>object</em></a>) -- item to insert into the list</li>
<li><strong>key</strong> (<em>function</em>) -- 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"><a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.7)">int</a></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 class="section" id="module-pylorax.api.checkparams">
<span id="pylorax-api-checkparams-module"></span><h2>pylorax.api.checkparams module<a class="headerlink" href="#module-pylorax.api.checkparams" title="Permalink to this headline"></a></h2>
<dl class="function">
<dt id="pylorax.api.checkparams.checkparams">
<code class="descclassname">pylorax.api.checkparams.</code><code class="descname">checkparams</code><span class="sig-paren">(</span><em>tuples</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/checkparams.html#checkparams"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.checkparams.checkparams" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</div>
<div class="section" id="module-pylorax.api.cmdline">
<span id="pylorax-api-cmdline-module"></span><h2>pylorax.api.cmdline module<a class="headerlink" href="#module-pylorax.api.cmdline" title="Permalink to this headline"></a></h2>
<dl class="function">
<dt id="pylorax.api.cmdline.lorax_composer_parser">
<code class="descclassname">pylorax.api.cmdline.</code><code class="descname">lorax_composer_parser</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/cmdline.html#lorax_composer_parser"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.cmdline.lorax_composer_parser" title="Permalink to this definition"></a></dt>
<dd><p>Return the ArgumentParser for lorax-composer</p>
</dd></dl>
</div>
<div class="section" id="module-pylorax.api.compose">
<span id="pylorax-api-compose-module"></span><h2>pylorax.api.compose module<a class="headerlink" href="#module-pylorax.api.compose" title="Permalink to this headline"></a></h2>
<p>Setup for composing an image</p>
<div class="section" id="adding-new-output-types">
<h3>Adding New Output Types<a class="headerlink" href="#adding-new-output-types" title="Permalink to this headline"></a></h3>
<p>The new output type must add a kickstart template to ./share/composer/ where the
name of the kickstart (without the trailing .ks) matches the entry in compose_args.</p>
<p>The kickstart should not have any url or repo entries, these will be added at build
time. The %packages section should be the last thing, and while it can contain mandatory
packages required by the output type, it should not have the trailing %end because the
package NEVRAs will be appended to it at build time.</p>
<p>compose_args should have a name matching the kickstart, and it should set the novirt_install
parameters needed to generate the desired output. Other types should be set to False.</p>
<dl class="function">
<dt id="pylorax.api.compose.add_customizations">
<code class="descclassname">pylorax.api.compose.</code><code class="descname">add_customizations</code><span class="sig-paren">(</span><em>f</em>, <em>recipe</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/compose.html#add_customizations"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.compose.add_customizations" title="Permalink to this definition"></a></dt>
<dd><p>Add customizations to the kickstart file</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>f</strong> (<em>open file object</em>) -- kickstart file object</li>
<li><strong>recipe</strong> (<em>Recipe object</em>) -- </li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">None</p>
</td>
</tr>
<tr class="field-odd field"><th class="field-name">Raises:</th><td class="field-body"><p class="first last">RuntimeError if there was a problem writing to the kickstart</p>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="function">
<dt id="pylorax.api.compose.bootloader_append">
<code class="descclassname">pylorax.api.compose.</code><code class="descname">bootloader_append</code><span class="sig-paren">(</span><em>line</em>, <em>kernel_append</em><span class="sig-paren">)</span><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 --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/3/library/stdtypes.html#str" title="(in Python v3.7)"><em>str</em></a>) -- The bootloader ... line</li>
<li><strong>kernel_append</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)"><em>str</em></a>) -- The arguments to append to the --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">
<dt id="pylorax.api.compose.compose_args">
<code class="descclassname">pylorax.api.compose.</code><code class="descname">compose_args</code><span class="sig-paren">(</span><em>compose_type</em><span class="sig-paren">)</span><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>
<dd><p>Returns the settings to pass to novirt_install for the compose type</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>compose_type</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)"><em>str</em></a>) -- The type of compose to create, from <cite>compose_types()</cite></td>
</tr>
</tbody>
</table>
<p>This will return a dict of options that match the ArgumentParser options for livemedia-creator.
These are the ones the define the type of output, it's filename, etc.
Other options will be filled in by <cite>make_compose()</cite></p>
</dd></dl>
<dl class="function">
<dt id="pylorax.api.compose.compose_types">
<code class="descclassname">pylorax.api.compose.</code><code class="descname">compose_types</code><span class="sig-paren">(</span><em>share_dir</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/compose.html#compose_types"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.compose.compose_types" title="Permalink to this definition"></a></dt>
<dd><p>Returns a list of the supported output types</p>
<p>The output types come from the kickstart names in /usr/share/lorax/composer/*ks</p>
</dd></dl>
<dl class="function">
<dt id="pylorax.api.compose.customize_ks_template">
<code class="descclassname">pylorax.api.compose.</code><code class="descname">customize_ks_template</code><span class="sig-paren">(</span><em>ks_template</em>, <em>recipe</em><span class="sig-paren">)</span><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/3/library/stdtypes.html#str" title="(in Python v3.7)"><em>str</em></a>) -- The kickstart template</li>
<li><strong>recipe</strong> (<em>Recipe object</em>) -- </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">
<code class="descclassname">pylorax.api.compose.</code><code class="descname">firewall_cmd</code><span class="sig-paren">(</span><em>line</em>, <em>settings</em><span class="sig-paren">)</span><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/3/library/stdtypes.html#str" title="(in Python v3.7)"><em>str</em></a>) -- The firewall ... line</li>
<li><strong>settings</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#dict" title="(in Python v3.7)"><em>dict</em></a>) -- 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">
<code class="descclassname">pylorax.api.compose.</code><code class="descname">get_default_services</code><span class="sig-paren">(</span><em>recipe</em><span class="sig-paren">)</span><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 &quot;services&quot; or &quot;&quot;</td>
</tr>
<tr class="field-even field"><th class="field-name">Return type:</th><td class="field-body"><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)">str</a></td>
</tr>
</tbody>
</table>
<p>When no services have been selected we don't need to add anything to the kickstart
so return an empty string. Otherwise return &quot;services&quot; which will be updated with
the settings.</p>
</dd></dl>
<dl class="function">
<dt id="pylorax.api.compose.get_extra_pkgs">
<code class="descclassname">pylorax.api.compose.</code><code class="descname">get_extra_pkgs</code><span class="sig-paren">(</span><em>dbo</em>, <em>share_dir</em>, <em>compose_type</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/compose.html#get_extra_pkgs"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.compose.get_extra_pkgs" title="Permalink to this definition"></a></dt>
<dd><p>Return extra packages needed for the output type</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>dbo</strong> (<em>dnf.Base</em>) -- dnf base object</li>
<li><strong>share_dir</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)"><em>str</em></a>) -- Path to the top level share directory</li>
<li><strong>compose_type</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)"><em>str</em></a>) -- The type of output to create from the recipe</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">List of package names (name only, not NEVRA)</p>
</td>
</tr>
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first last"><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#list" title="(in Python v3.7)">list</a></p>
</td>
</tr>
</tbody>
</table>
<p>Currently this is only needed by live-iso, it reads ./live/live-install.tmpl and
processes only the installpkg lines. It lists the packages needed to complete creation of the
iso using the templates such as x86.tmpl</p>
<p>Keep in mind that the live-install.tmpl is shared between livemedia-creator and lorax-composer,
even though the results are applied differently.</p>
</dd></dl>
<dl class="function">
<dt id="pylorax.api.compose.get_firewall_settings">
<code class="descclassname">pylorax.api.compose.</code><code class="descname">get_firewall_settings</code><span class="sig-paren">(</span><em>recipe</em><span class="sig-paren">)</span><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>) -- 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"><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#dict" title="(in Python v3.7)">dict</a></td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="function">
<dt id="pylorax.api.compose.get_kernel_append">
<code class="descclassname">pylorax.api.compose.</code><code class="descname">get_kernel_append</code><span class="sig-paren">(</span><em>recipe</em><span class="sig-paren">)</span><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>) -- </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"><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)">str</a></td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="function">
<dt id="pylorax.api.compose.get_keyboard_layout">
<code class="descclassname">pylorax.api.compose.</code><code class="descname">get_keyboard_layout</code><span class="sig-paren">(</span><em>recipe</em><span class="sig-paren">)</span><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>) -- 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"><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)">str</a></td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="function">
<dt id="pylorax.api.compose.get_languages">
<code class="descclassname">pylorax.api.compose.</code><code class="descname">get_languages</code><span class="sig-paren">(</span><em>recipe</em><span class="sig-paren">)</span><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>) -- 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"><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#list" title="(in Python v3.7)">list</a></td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="function">
<dt id="pylorax.api.compose.get_services">
<code class="descclassname">pylorax.api.compose.</code><code class="descname">get_services</code><span class="sig-paren">(</span><em>recipe</em><span class="sig-paren">)</span><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>) -- 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"><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#dict" title="(in Python v3.7)">dict</a></td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="function">
<dt id="pylorax.api.compose.get_timezone_settings">
<code class="descclassname">pylorax.api.compose.</code><code class="descname">get_timezone_settings</code><span class="sig-paren">(</span><em>recipe</em><span class="sig-paren">)</span><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>) -- </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"><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#dict" title="(in Python v3.7)">dict</a></td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="function">
<dt id="pylorax.api.compose.keyboard_cmd">
<code class="descclassname">pylorax.api.compose.</code><code class="descname">keyboard_cmd</code><span class="sig-paren">(</span><em>line</em>, <em>layout</em><span class="sig-paren">)</span><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/3/library/stdtypes.html#str" title="(in Python v3.7)"><em>str</em></a>) -- The keyboard ... line</li>
<li><strong>settings</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)"><em>str</em></a>) -- 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">
<code class="descclassname">pylorax.api.compose.</code><code class="descname">lang_cmd</code><span class="sig-paren">(</span><em>line</em>, <em>languages</em><span class="sig-paren">)</span><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/3/library/stdtypes.html#str" title="(in Python v3.7)"><em>str</em></a>) -- The lang ... line</li>
<li><strong>settings</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#list" title="(in Python v3.7)"><em>list</em></a>) -- 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">
<dt id="pylorax.api.compose.move_compose_results">
<code class="descclassname">pylorax.api.compose.</code><code class="descname">move_compose_results</code><span class="sig-paren">(</span><em>cfg</em>, <em>results_dir</em><span class="sig-paren">)</span><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>
<dd><p>Move the final image to the results_dir and cleanup the unneeded compose files</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>cfg</strong> (<a class="reference internal" href="pylorax.html#pylorax.base.DataHolder" title="pylorax.base.DataHolder"><em>DataHolder</em></a>) -- Build configuration</li>
<li><strong>results_dir</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)"><em>str</em></a>) -- Directory to put the results into</li>
</ul>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="function">
<dt id="pylorax.api.compose.repo_to_ks">
<code class="descclassname">pylorax.api.compose.</code><code class="descname">repo_to_ks</code><span class="sig-paren">(</span><em>r</em>, <em>url='url'</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/compose.html#repo_to_ks"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.compose.repo_to_ks" title="Permalink to this definition"></a></dt>
<dd><p>Return a kickstart line with the correct args.
:param r: DNF repository information
:type r: dnf.Repo
:param url: &quot;url&quot; or &quot;baseurl&quot; to use for the baseurl parameter
:type url: str
:returns: kickstart command arguments for url/repo command
:rtype: str</p>
<p>Set url to &quot;baseurl&quot; if it is a repo, leave it as &quot;url&quot; for the installation url.</p>
</dd></dl>
<dl class="function">
<dt id="pylorax.api.compose.services_cmd">
<code class="descclassname">pylorax.api.compose.</code><code class="descname">services_cmd</code><span class="sig-paren">(</span><em>line</em>, <em>settings</em><span class="sig-paren">)</span><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/3/library/stdtypes.html#str" title="(in Python v3.7)"><em>str</em></a>) -- The services ... line</li>
<li><strong>settings</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#dict" title="(in Python v3.7)"><em>dict</em></a>) -- 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">
<dt id="pylorax.api.compose.start_build">
<code class="descclassname">pylorax.api.compose.</code><code class="descname">start_build</code><span class="sig-paren">(</span><em>cfg</em>, <em>dnflock</em>, <em>gitlock</em>, <em>branch</em>, <em>recipe_name</em>, <em>compose_type</em>, <em>test_mode=0</em><span class="sig-paren">)</span><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>
<dd><p>Start the build</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>cfg</strong> (<a class="reference internal" href="#pylorax.api.config.ComposerConfig" title="pylorax.api.config.ComposerConfig"><em>ComposerConfig</em></a>) -- Configuration object</li>
<li><strong>dnflock</strong> (<em>YumLock</em>) -- Lock and YumBase for depsolving</li>
<li><strong>recipe</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)"><em>str</em></a>) -- The recipe to build</li>
<li><strong>compose_type</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)"><em>str</em></a>) -- The type of output to create from the recipe</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">Unique ID for the build that can be used to track its status</p>
</td>
</tr>
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first last"><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)">str</a></p>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="function">
<dt id="pylorax.api.compose.test_templates">
<code class="descclassname">pylorax.api.compose.</code><code class="descname">test_templates</code><span class="sig-paren">(</span><em>dbo</em>, <em>share_dir</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/compose.html#test_templates"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.compose.test_templates" title="Permalink to this definition"></a></dt>
<dd><p>Try depsolving each of the the templates and report any errors</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>dbo</strong> (<em>dnf.Base</em>) -- dnf base object</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">List of template types and errors</td>
</tr>
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body">List of errors</td>
</tr>
</tbody>
</table>
<p>Return a list of templates and errors encountered or an empty list</p>
</dd></dl>
<dl class="function">
<dt id="pylorax.api.compose.timezone_cmd">
<code class="descclassname">pylorax.api.compose.</code><code class="descname">timezone_cmd</code><span class="sig-paren">(</span><em>line</em>, <em>settings</em><span class="sig-paren">)</span><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/3/library/stdtypes.html#str" title="(in Python v3.7)"><em>str</em></a>) -- The timezone ... line</li>
<li><strong>settings</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#dict" title="(in Python v3.7)"><em>dict</em></a>) -- 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">
<dt id="pylorax.api.compose.write_ks_group">
<code class="descclassname">pylorax.api.compose.</code><code class="descname">write_ks_group</code><span class="sig-paren">(</span><em>f</em>, <em>group</em><span class="sig-paren">)</span><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>
<dd><p>Write kickstart group 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>) -- kickstart file object</li>
<li><strong>group</strong> -- A blueprint group dictionary</li>
</ul>
</td>
</tr>
</tbody>
</table>
<p>gid is optional</p>
</dd></dl>
<dl class="function">
<dt id="pylorax.api.compose.write_ks_root">
<code class="descclassname">pylorax.api.compose.</code><code class="descname">write_ks_root</code><span class="sig-paren">(</span><em>f</em>, <em>user</em><span class="sig-paren">)</span><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 simple">
<li><strong>f</strong> (<em>open file object</em>) -- kickstart file object</li>
<li><strong>user</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#dict" title="(in Python v3.7)"><em>dict</em></a>) -- A blueprint user dictionary</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">True if it wrote a rootpw command to the kickstart</p>
</td>
</tr>
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first last"><a class="reference external" href="https://docs.python.org/3/library/functions.html#bool" title="(in Python v3.7)">bool</a></p>
</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">
<dt id="pylorax.api.compose.write_ks_user">
<code class="descclassname">pylorax.api.compose.</code><code class="descname">write_ks_user</code><span class="sig-paren">(</span><em>f</em>, <em>user</em><span class="sig-paren">)</span><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>
<dd><p>Write kickstart user 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>) -- kickstart file object</li>
<li><strong>user</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#dict" title="(in Python v3.7)"><em>dict</em></a>) -- A blueprint user dictionary</li>
</ul>
</td>
</tr>
</tbody>
</table>
<p>If the entry contains a ssh key, use sshkey to write it
All of the user fields are optional, except name, write out a kickstart user entry
with whatever options are relevant.</p>
</dd></dl>
</div>
</div>
<div class="section" id="module-pylorax.api.config">
<span id="pylorax-api-config-module"></span><h2>pylorax.api.config module<a class="headerlink" href="#module-pylorax.api.config" title="Permalink to this headline"></a></h2>
<dl class="class">
<dt id="pylorax.api.config.ComposerConfig">
<em class="property">class </em><code class="descclassname">pylorax.api.config.</code><code class="descname">ComposerConfig</code><span class="sig-paren">(</span><em>defaults=None</em>, <em>dict_type=&lt;class 'collections.OrderedDict'&gt;</em>, <em>allow_no_value=False</em>, <em>*</em>, <em>delimiters=('='</em>, <em>':')</em>, <em>comment_prefixes=('#'</em>, <em>';')</em>, <em>inline_comment_prefixes=None</em>, <em>strict=True</em>, <em>empty_lines_in_values=True</em>, <em>default_section='DEFAULT'</em>, <em>interpolation=&lt;object object&gt;</em>, <em>converters=&lt;object object&gt;</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/config.html#ComposerConfig"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.config.ComposerConfig" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <a class="reference external" href="https://docs.python.org/3/library/configparser.html#configparser.ConfigParser" title="(in Python v3.7)"><code class="xref py py-class docutils literal notranslate"><span class="pre">configparser.ConfigParser</span></code></a></p>
<dl class="method">
<dt id="pylorax.api.config.ComposerConfig.get_default">
<code class="descname">get_default</code><span class="sig-paren">(</span><em>section</em>, <em>option</em>, <em>default</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/config.html#ComposerConfig.get_default"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.config.ComposerConfig.get_default" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
<dl class="function">
<dt id="pylorax.api.config.configure">
<code class="descclassname">pylorax.api.config.</code><code class="descname">configure</code><span class="sig-paren">(</span><em>conf_file='/etc/lorax/composer.conf'</em>, <em>root_dir='/'</em>, <em>test_config=False</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/config.html#configure"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.config.configure" title="Permalink to this definition"></a></dt>
<dd><p>lorax-composer configuration</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>conf_file</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)"><em>str</em></a>) -- Path to the config file overriding the default settings</li>
<li><strong>root_dir</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)"><em>str</em></a>) -- Directory to prepend to paths, defaults to /</li>
<li><strong>test_config</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#bool" title="(in Python v3.7)"><em>bool</em></a>) -- Set to True to skip reading conf_file</li>
</ul>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="function">
<dt id="pylorax.api.config.make_dnf_dirs">
<code class="descclassname">pylorax.api.config.</code><code class="descname">make_dnf_dirs</code><span class="sig-paren">(</span><em>conf</em>, <em>uid</em>, <em>gid</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/config.html#make_dnf_dirs"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.config.make_dnf_dirs" title="Permalink to this definition"></a></dt>
<dd><p>Make any missing dnf directories owned by user:group</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>conf</strong> (<a class="reference internal" href="#pylorax.api.config.ComposerConfig" title="pylorax.api.config.ComposerConfig"><em>ComposerConfig</em></a>) -- The configuration to use</li>
<li><strong>uid</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.7)"><em>int</em></a>) -- uid of owner</li>
<li><strong>gid</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.7)"><em>int</em></a>) -- gid of owner</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">list of errors</p>
</td>
</tr>
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first last">list of str</p>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="function">
<dt id="pylorax.api.config.make_owned_dir">
<code class="descclassname">pylorax.api.config.</code><code class="descname">make_owned_dir</code><span class="sig-paren">(</span><em>p_dir</em>, <em>uid</em>, <em>gid</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/config.html#make_owned_dir"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.config.make_owned_dir" title="Permalink to this definition"></a></dt>
<dd><p>Make a directory and its parents, setting owner and group</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>p_dir</strong> (<em>string</em>) -- path to directory to create</li>
<li><strong>uid</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.7)"><em>int</em></a>) -- uid of owner</li>
<li><strong>gid</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.7)"><em>int</em></a>) -- gid of owner</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">list of errors</p>
</td>
</tr>
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first last">list of str</p>
</td>
</tr>
</tbody>
</table>
<p>Check to make sure it does not have o+rw permissions and that it is owned by uid:gid</p>
</dd></dl>
<dl class="function">
<dt id="pylorax.api.config.make_queue_dirs">
<code class="descclassname">pylorax.api.config.</code><code class="descname">make_queue_dirs</code><span class="sig-paren">(</span><em>conf</em>, <em>gid</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/config.html#make_queue_dirs"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.config.make_queue_dirs" title="Permalink to this definition"></a></dt>
<dd><p>Make any missing queue directories</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>conf</strong> (<a class="reference internal" href="#pylorax.api.config.ComposerConfig" title="pylorax.api.config.ComposerConfig"><em>ComposerConfig</em></a>) -- The configuration to use</li>
<li><strong>gid</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.7)"><em>int</em></a>) -- Group ID that has access to the queue directories</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">list of errors</p>
</td>
</tr>
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first last">list of str</p>
</td>
</tr>
</tbody>
</table>
</dd></dl>
</div>
<div class="section" id="module-pylorax.api.crossdomain">
<span id="pylorax-api-crossdomain-module"></span><h2>pylorax.api.crossdomain module<a class="headerlink" href="#module-pylorax.api.crossdomain" title="Permalink to this headline"></a></h2>
<dl class="function">
<dt id="pylorax.api.crossdomain.crossdomain">
<code class="descclassname">pylorax.api.crossdomain.</code><code class="descname">crossdomain</code><span class="sig-paren">(</span><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><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/crossdomain.html#crossdomain"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.crossdomain.crossdomain" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</div>
<div class="section" id="module-pylorax.api.dnfbase">
<span id="pylorax-api-dnfbase-module"></span><h2>pylorax.api.dnfbase module<a class="headerlink" href="#module-pylorax.api.dnfbase" title="Permalink to this headline"></a></h2>
<dl class="class">
<dt id="pylorax.api.dnfbase.DNFLock">
<em class="property">class </em><code class="descclassname">pylorax.api.dnfbase.</code><code class="descname">DNFLock</code><span class="sig-paren">(</span><em>conf</em>, <em>expire_secs=21600</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/dnfbase.html#DNFLock"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.dnfbase.DNFLock" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <a class="reference external" href="https://docs.python.org/3/library/functions.html#object" title="(in Python v3.7)"><code class="xref py py-class docutils literal notranslate"><span class="pre">object</span></code></a></p>
<p>Hold the dnf.Base object and a Lock to control access to it.</p>
<p>self.dbo is a property that returns the dnf.Base 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.dnfbase.DNFLock.lock">
<code class="descname">lock</code><a class="headerlink" href="#pylorax.api.dnfbase.DNFLock.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 dnf.Base and
create a new one. This is the only way to force dnf to use the new
metadata.</p>
</dd></dl>
<dl class="attribute">
<dt id="pylorax.api.dnfbase.DNFLock.lock_check">
<code class="descname">lock_check</code><a class="headerlink" href="#pylorax.api.dnfbase.DNFLock.lock_check" title="Permalink to this definition"></a></dt>
<dd><p>Force a check for repo updates and return the lock</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">
<dt id="pylorax.api.dnfbase.get_base_object">
<code class="descclassname">pylorax.api.dnfbase.</code><code class="descname">get_base_object</code><span class="sig-paren">(</span><em>conf</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/dnfbase.html#get_base_object"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.dnfbase.get_base_object" title="Permalink to this definition"></a></dt>
<dd><p>Get the DNF object with settings from the config file</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>conf</strong> (<em>ComposerParser</em>) -- configuration object</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">A DNF Base object</td>
</tr>
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body">dnf.Base</td>
</tr>
</tbody>
</table>
</dd></dl>
</div>
<div class="section" id="module-pylorax.api.errors">
<span id="pylorax-api-errors-module"></span><h2>pylorax.api.errors module<a class="headerlink" href="#module-pylorax.api.errors" title="Permalink to this headline"></a></h2>
</div>
<div class="section" id="module-pylorax.api.gitrpm">
<span id="pylorax-api-gitrpm-module"></span><h2>pylorax.api.gitrpm module<a class="headerlink" href="#module-pylorax.api.gitrpm" title="Permalink to this headline"></a></h2>
<p>Clone a git repository and package it as an rpm</p>
<p>This module contains functions for cloning a git repo, creating a tar archive of
the selected commit, branch, or tag, and packaging the files into an rpm that will
be installed by anaconda when creating the image.</p>
<dl class="class">
<dt id="pylorax.api.gitrpm.GitArchiveTarball">
<em class="property">class </em><code class="descclassname">pylorax.api.gitrpm.</code><code class="descname">GitArchiveTarball</code><span class="sig-paren">(</span><em>gitRepo</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/gitrpm.html#GitArchiveTarball"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.gitrpm.GitArchiveTarball" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <a class="reference external" href="https://docs.python.org/3/library/functions.html#object" title="(in Python v3.7)"><code class="xref py py-class docutils literal notranslate"><span class="pre">object</span></code></a></p>
<p>Create a git archive of the selected git repo and reference</p>
<dl class="method">
<dt id="pylorax.api.gitrpm.GitArchiveTarball.write_file">
<code class="descname">write_file</code><span class="sig-paren">(</span><em>sourcesDir</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/gitrpm.html#GitArchiveTarball.write_file"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.gitrpm.GitArchiveTarball.write_file" title="Permalink to this definition"></a></dt>
<dd><p>Create the tar archive</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>sourcesDir</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)"><em>str</em></a>) -- Path to use for creating the archive</td>
</tr>
</tbody>
</table>
<p>This clones the git repository and creates a git archive from the specified reference.
The result is in RPMNAME.tar.xz under the sourcesDir</p>
</dd></dl>
</dd></dl>
<dl class="class">
<dt id="pylorax.api.gitrpm.GitRpmBuild">
<em class="property">class </em><code class="descclassname">pylorax.api.gitrpm.</code><code class="descname">GitRpmBuild</code><span class="sig-paren">(</span><em>*args</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/gitrpm.html#GitRpmBuild"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.gitrpm.GitRpmBuild" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">rpmfluff.SimpleRpmBuild</span></code></p>
<p>Build an rpm containing files from a git repository</p>
<dl class="method">
<dt id="pylorax.api.gitrpm.GitRpmBuild.add_git_tarball">
<code class="descname">add_git_tarball</code><span class="sig-paren">(</span><em>gitRepo</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/gitrpm.html#GitRpmBuild.add_git_tarball"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.gitrpm.GitRpmBuild.add_git_tarball" title="Permalink to this definition"></a></dt>
<dd><p>Add a tar archive of a git repository to the rpm</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>gitRepo</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#dict" title="(in Python v3.7)"><em>dict</em></a>) -- A dict with the repository details</td>
</tr>
</tbody>
</table>
<p>This populates the rpm with the URL of the git repository, the summary
describing the repo, the description of the repository and reference used,
and sets up the rpm to install the archive contents into the destination
path.</p>
</dd></dl>
<dl class="method">
<dt id="pylorax.api.gitrpm.GitRpmBuild.check">
<code class="descname">check</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/gitrpm.html#GitRpmBuild.check"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.gitrpm.GitRpmBuild.check" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="method">
<dt id="pylorax.api.gitrpm.GitRpmBuild.clean">
<code class="descname">clean</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/gitrpm.html#GitRpmBuild.clean"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.gitrpm.GitRpmBuild.clean" title="Permalink to this definition"></a></dt>
<dd><p>Remove the base directory from inside the tmpdir</p>
</dd></dl>
<dl class="method">
<dt id="pylorax.api.gitrpm.GitRpmBuild.cleanup_tmpdir">
<code class="descname">cleanup_tmpdir</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/gitrpm.html#GitRpmBuild.cleanup_tmpdir"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.gitrpm.GitRpmBuild.cleanup_tmpdir" title="Permalink to this definition"></a></dt>
<dd><p>Remove the temporary directory and all of its contents</p>
</dd></dl>
<dl class="method">
<dt id="pylorax.api.gitrpm.GitRpmBuild.get_base_dir">
<code class="descname">get_base_dir</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/gitrpm.html#GitRpmBuild.get_base_dir"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.gitrpm.GitRpmBuild.get_base_dir" title="Permalink to this definition"></a></dt>
<dd><p>Place all the files under a temporary directory + rpmbuild/</p>
</dd></dl>
</dd></dl>
<dl class="function">
<dt id="pylorax.api.gitrpm.create_gitrpm_repo">
<code class="descclassname">pylorax.api.gitrpm.</code><code class="descname">create_gitrpm_repo</code><span class="sig-paren">(</span><em>results_dir</em>, <em>recipe</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/gitrpm.html#create_gitrpm_repo"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.gitrpm.create_gitrpm_repo" title="Permalink to this definition"></a></dt>
<dd><p>Create a dnf repository with the rpms from 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">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>results_dir</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)"><em>str</em></a>) -- Path to create the repository under</li>
<li><strong>recipe</strong> (<a class="reference internal" href="#pylorax.api.recipes.Recipe" title="pylorax.api.recipes.Recipe"><em>Recipe</em></a>) -- The recipe to get the repos.git entries from</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">Path to the dnf repository or &quot;&quot;</p>
</td>
</tr>
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first last"><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)">str</a></p>
</td>
</tr>
</tbody>
</table>
<p>This function creates a dnf repository directory at results_dir+&quot;repo/&quot;,
creates rpms for all of the repos.git entries in the recipe, runs createrepo_c
on the dnf repository so that Anaconda can use it, and returns the path to the
repository to the caller.</p>
</dd></dl>
<dl class="function">
<dt id="pylorax.api.gitrpm.get_repo_description">
<code class="descclassname">pylorax.api.gitrpm.</code><code class="descname">get_repo_description</code><span class="sig-paren">(</span><em>gitRepo</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/gitrpm.html#get_repo_description"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.gitrpm.get_repo_description" title="Permalink to this definition"></a></dt>
<dd><p>Return a description including the git repo and reference</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>gitRepo</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#dict" title="(in Python v3.7)"><em>dict</em></a>) -- A dict with the repository details</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">A string with the git repo url and reference</td>
</tr>
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)">str</a></td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="function">
<dt id="pylorax.api.gitrpm.make_git_rpm">
<code class="descclassname">pylorax.api.gitrpm.</code><code class="descname">make_git_rpm</code><span class="sig-paren">(</span><em>gitRepo</em>, <em>dest</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/gitrpm.html#make_git_rpm"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.gitrpm.make_git_rpm" title="Permalink to this definition"></a></dt>
<dd><p>Create an rpm from the specified git repo</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>gitRepo</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#dict" title="(in Python v3.7)"><em>dict</em></a>) -- A dict with the repository details</td>
</tr>
</tbody>
</table>
<p>This will clone the git repository, create an archive of the selected reference,
and build an rpm that will install the files from the repository under the destination
directory. The gitRepo dict should have the following fields:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">rpmname</span><span class="p">:</span> <span class="s2">&quot;server-config&quot;</span>
<span class="n">rpmversion</span><span class="p">:</span> <span class="s2">&quot;1.0&quot;</span>
<span class="n">rpmrelease</span><span class="p">:</span> <span class="s2">&quot;1&quot;</span>
<span class="n">summary</span><span class="p">:</span> <span class="s2">&quot;Setup files for server deployment&quot;</span>
<span class="n">repo</span><span class="p">:</span> <span class="s2">&quot;PATH OF GIT REPO TO CLONE&quot;</span>
<span class="n">ref</span><span class="p">:</span> <span class="s2">&quot;v1.0&quot;</span>
<span class="n">destination</span><span class="p">:</span> <span class="s2">&quot;/opt/server/&quot;</span>
</pre></div>
</div>
<ul class="simple">
<li>rpmname: Name of the rpm to create, also used as the prefix name in the tar archive</li>
<li>rpmversion: Version of the rpm, eg. &quot;1.0.0&quot;</li>
<li>rpmrelease: Release of the rpm, eg. &quot;1&quot;</li>
<li>summary: Summary string for the rpm</li>
<li>repo: URL of the get repo to clone and create the archive from</li>
<li>ref: Git reference to check out. eg. origin/branch-name, git tag, or git commit hash</li>
<li>destination: Path to install the / of the git repo at when installing the rpm</li>
</ul>
</dd></dl>
</div>
<div class="section" id="module-pylorax.api.projects">
<span id="pylorax-api-projects-module"></span><h2>pylorax.api.projects module<a class="headerlink" href="#module-pylorax.api.projects" title="Permalink to this headline"></a></h2>
<dl class="exception">
<dt id="pylorax.api.projects.ProjectsError">
<em class="property">exception </em><code class="descclassname">pylorax.api.projects.</code><code class="descname">ProjectsError</code><a class="reference internal" href="_modules/pylorax/api/projects.html#ProjectsError"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.projects.ProjectsError" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <a class="reference external" href="https://docs.python.org/3/library/exceptions.html#Exception" title="(in Python v3.7)"><code class="xref py py-class docutils literal notranslate"><span class="pre">Exception</span></code></a></p>
</dd></dl>
<dl class="function">
<dt id="pylorax.api.projects.api_changelog">
<code class="descclassname">pylorax.api.projects.</code><code class="descname">api_changelog</code><span class="sig-paren">(</span><em>changelog</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/projects.html#api_changelog"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.projects.api_changelog" title="Permalink to this definition"></a></dt>
<dd><p>Convert the changelog to a string</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>changelog</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#tuple" title="(in Python v3.7)"><em>tuple</em></a>) -- A list of time, author, string tuples.</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">The most recent changelog text or &quot;&quot;</td>
</tr>
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)">str</a></td>
</tr>
</tbody>
</table>
<p>This returns only the most recent changelog entry.</p>
</dd></dl>
<dl class="function">
<dt id="pylorax.api.projects.api_time">
<code class="descclassname">pylorax.api.projects.</code><code class="descname">api_time</code><span class="sig-paren">(</span><em>t</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/projects.html#api_time"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.projects.api_time" title="Permalink to this definition"></a></dt>
<dd><p>Convert time since epoch to a string</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>t</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.7)"><em>int</em></a>) -- Seconds since epoch</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">Time string</td>
</tr>
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)">str</a></td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="function">
<dt id="pylorax.api.projects.delete_repo_source">
<code class="descclassname">pylorax.api.projects.</code><code class="descname">delete_repo_source</code><span class="sig-paren">(</span><em>source_glob</em>, <em>source_name</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/projects.html#delete_repo_source"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.projects.delete_repo_source" title="Permalink to this definition"></a></dt>
<dd><p>Delete a source from a repo file</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>source_glob</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)"><em>str</em></a>) -- A glob of the repo sources to search</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">None</td>
</tr>
<tr class="field-odd field"><th class="field-name">Raises:</th><td class="field-body">ProjectsError if there was a problem</td>
</tr>
</tbody>
</table>
<p>A repo file may have multiple sources in it, delete only the selected source.
If it is the last one in the file, delete the file.</p>
<p>WARNING: This will delete ANY source, the caller needs to ensure that a system
source_name isn't passed to it.</p>
</dd></dl>
<dl class="function">
<dt id="pylorax.api.projects.dep_evra">
<code class="descclassname">pylorax.api.projects.</code><code class="descname">dep_evra</code><span class="sig-paren">(</span><em>dep</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/projects.html#dep_evra"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.projects.dep_evra" title="Permalink to this definition"></a></dt>
<dd><p>Return the epoch:version-release.arch for the dep</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>dep</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#dict" title="(in Python v3.7)"><em>dict</em></a>) -- dependency dict</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">epoch:version-release.arch</td>
</tr>
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)">str</a></td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="function">
<dt id="pylorax.api.projects.dep_nevra">
<code class="descclassname">pylorax.api.projects.</code><code class="descname">dep_nevra</code><span class="sig-paren">(</span><em>dep</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/projects.html#dep_nevra"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.projects.dep_nevra" title="Permalink to this definition"></a></dt>
<dd><p>Return the name-epoch:version-release.arch</p>
</dd></dl>
<dl class="function">
<dt id="pylorax.api.projects.dnf_repo_to_file_repo">
<code class="descclassname">pylorax.api.projects.</code><code class="descname">dnf_repo_to_file_repo</code><span class="sig-paren">(</span><em>repo</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/projects.html#dnf_repo_to_file_repo"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.projects.dnf_repo_to_file_repo" title="Permalink to this definition"></a></dt>
<dd><p>Return a string representation of a DNF Repo object suitable for writing to a .repo file</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>repo</strong> (<em>dnf.RepoDict</em>) -- DNF Repository</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">A string</td>
</tr>
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)">str</a></td>
</tr>
</tbody>
</table>
<p>The DNF Repo.dump() function does not produce a string that can be used as a dnf .repo file,
it ouputs baseurl and gpgkey as python lists which DNF cannot read. So do this manually with
only the attributes we care about.</p>
</dd></dl>
<dl class="function">
<dt id="pylorax.api.projects.estimate_size">
<code class="descclassname">pylorax.api.projects.</code><code class="descname">estimate_size</code><span class="sig-paren">(</span><em>packages</em>, <em>block_size=6144</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/projects.html#estimate_size"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.projects.estimate_size" title="Permalink to this definition"></a></dt>
<dd><p>Estimate the installed size of a package 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"><ul class="first simple">
<li><strong>packages</strong> (<em>list of hawkey.Package objects</em>) -- The packages to be installed</li>
<li><strong>block_size</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.7)"><em>int</em></a>) -- The block size to use for rounding up file sizes.</li>
</ul>
</td>
</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>
</td>
</tr>
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first last"><a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.7)">int</a></p>
</td>
</tr>
</tbody>
</table>
<p>Estimating actual requirements is difficult without the actual file sizes, which
dnf doesn't provide access to. So use the file count and block size to estimate
a minimum size for each package.</p>
</dd></dl>
<dl class="function">
<dt id="pylorax.api.projects.get_repo_sources">
<code class="descclassname">pylorax.api.projects.</code><code class="descname">get_repo_sources</code><span class="sig-paren">(</span><em>source_glob</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/projects.html#get_repo_sources"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.projects.get_repo_sources" title="Permalink to this definition"></a></dt>
<dd><p>Return a list of sources from a directory of yum repositories</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>source_glob</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)"><em>str</em></a>) -- A glob to use to match the source files, including full path</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">A list of the source ids in all of the matching files</td>
</tr>
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body">list of str</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="function">
<dt id="pylorax.api.projects.get_source_ids">
<code class="descclassname">pylorax.api.projects.</code><code class="descname">get_source_ids</code><span class="sig-paren">(</span><em>source_path</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/projects.html#get_source_ids"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.projects.get_source_ids" title="Permalink to this definition"></a></dt>
<dd><p>Return a list of the source ids in a file</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>source_path</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)"><em>str</em></a>) -- Full path and filename of the source (yum repo) file</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">A list of source id strings</td>
</tr>
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body">list of str</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="function">
<dt id="pylorax.api.projects.modules_info">
<code class="descclassname">pylorax.api.projects.</code><code class="descname">modules_info</code><span class="sig-paren">(</span><em>dbo</em>, <em>module_names</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/projects.html#modules_info"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.projects.modules_info" title="Permalink to this definition"></a></dt>
<dd><p>Return details about a module, including dependencies</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>dbo</strong> (<em>dnf.Base</em>) -- dnf base object</li>
<li><strong>module_names</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)"><em>str</em></a>) -- Names of the modules to get info about</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">List of dicts with module details and dependencies.</p>
</td>
</tr>
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first last">list of dicts</p>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="function">
<dt id="pylorax.api.projects.modules_list">
<code class="descclassname">pylorax.api.projects.</code><code class="descname">modules_list</code><span class="sig-paren">(</span><em>dbo</em>, <em>module_names</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/projects.html#modules_list"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.projects.modules_list" title="Permalink to this definition"></a></dt>
<dd><p>Return a list of modules</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>dbo</strong> (<em>dnf.Base</em>) -- dnf base object</li>
<li><strong>offset</strong> -- Number of modules to skip</li>
<li><strong>limit</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.7)"><em>int</em></a>) -- Maximum number of modules to return</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">List of module information and total count</p>
</td>
</tr>
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first last">tuple of a list of dicts and an Int</p>
</td>
</tr>
</tbody>
</table>
<p>Modules don't exist in RHEL7 so this only returns projects
and sets the type to &quot;rpm&quot;</p>
</dd></dl>
<dl class="function">
<dt id="pylorax.api.projects.pkg_to_build">
<code class="descclassname">pylorax.api.projects.</code><code class="descname">pkg_to_build</code><span class="sig-paren">(</span><em>pkg</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/projects.html#pkg_to_build"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.projects.pkg_to_build" title="Permalink to this definition"></a></dt>
<dd><p>Extract the build details from a hawkey.Package 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>pkg</strong> (<em>hawkey.Package</em>) -- hawkey.Package object with package details</td>
</tr>
<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 class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#dict" title="(in Python v3.7)">dict</a></td>
</tr>
</tbody>
</table>
<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>
<dl class="function">
<dt id="pylorax.api.projects.pkg_to_dep">
<code class="descclassname">pylorax.api.projects.</code><code class="descname">pkg_to_dep</code><span class="sig-paren">(</span><em>pkg</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/projects.html#pkg_to_dep"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.projects.pkg_to_dep" title="Permalink to this definition"></a></dt>
<dd><p>Extract the info from a hawkey.Package 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>pkg</strong> (<em>hawkey.Package</em>) -- A hawkey.Package object</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">A dict with name, epoch, version, release, arch</td>
</tr>
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#dict" title="(in Python v3.7)">dict</a></td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="function">
<dt id="pylorax.api.projects.pkg_to_project">
<code class="descclassname">pylorax.api.projects.</code><code class="descname">pkg_to_project</code><span class="sig-paren">(</span><em>pkg</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/projects.html#pkg_to_project"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.projects.pkg_to_project" title="Permalink to this definition"></a></dt>
<dd><p>Extract the details from a hawkey.Package 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>pkgs</strong> (<em>hawkey.Package</em>) -- hawkey.Package object with package details</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">A dict with the name, summary, description, and url.</td>
</tr>
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#dict" title="(in Python v3.7)">dict</a></td>
</tr>
</tbody>
</table>
<p>upstream_vcs is hard-coded to UPSTREAM_VCS</p>
</dd></dl>
<dl class="function">
<dt id="pylorax.api.projects.pkg_to_project_info">
<code class="descclassname">pylorax.api.projects.</code><code class="descname">pkg_to_project_info</code><span class="sig-paren">(</span><em>pkg</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/projects.html#pkg_to_project_info"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.projects.pkg_to_project_info" title="Permalink to this definition"></a></dt>
<dd><p>Extract the details from a hawkey.Package 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>pkg</strong> (<em>hawkey.Package</em>) -- hawkey.Package object with package details</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">A dict with the project details, as well as epoch, release, arch, build_time, changelog, ...</td>
</tr>
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#dict" title="(in Python v3.7)">dict</a></td>
</tr>
</tbody>
</table>
<p>metadata entries are hard-coded to {}</p>
</dd></dl>
<dl class="function">
<dt id="pylorax.api.projects.proj_to_module">
<code class="descclassname">pylorax.api.projects.</code><code class="descname">proj_to_module</code><span class="sig-paren">(</span><em>proj</em><span class="sig-paren">)</span><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 project_info 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>pkg</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#dict" title="(in Python v3.7)"><em>dict</em></a>) -- dict with package 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"><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#dict" title="(in Python v3.7)">dict</a></td>
</tr>
</tbody>
</table>
<p>group_type is hard-coded to &quot;rpm&quot;</p>
</dd></dl>
<dl class="function">
<dt id="pylorax.api.projects.projects_depsolve">
<code class="descclassname">pylorax.api.projects.</code><code class="descname">projects_depsolve</code><span class="sig-paren">(</span><em>dbo</em>, <em>projects</em>, <em>groups</em><span class="sig-paren">)</span><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>
<dd><p>Return the dependencies for a list of projects</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>dbo</strong> (<em>dnf.Base</em>) -- dnf base object</li>
<li><strong>projects</strong> (<em>List of Strings</em>) -- The projects to find the dependencies for</li>
<li><strong>groups</strong> (<em>List of str</em>) -- The groups to include in dependency solving</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">NEVRA's of the project and its dependencies</p>
</td>
</tr>
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first">list of dicts</p>
</td>
</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>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="function">
<dt id="pylorax.api.projects.projects_depsolve_with_size">
<code class="descclassname">pylorax.api.projects.</code><code class="descname">projects_depsolve_with_size</code><span class="sig-paren">(</span><em>dbo</em>, <em>projects</em>, <em>groups</em>, <em>with_core=True</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/projects.html#projects_depsolve_with_size"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.projects.projects_depsolve_with_size" title="Permalink to this definition"></a></dt>
<dd><p>Return the dependencies and installed size for a list of projects</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>dbo</strong> (<em>dnf.Base</em>) -- dnf base object</li>
<li><strong>project_names</strong> (<em>List of Strings</em>) -- The projects to find the dependencies for</li>
<li><strong>groups</strong> (<em>List of str</em>) -- The groups to include in dependency solving</li>
</ul>
</td>
</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's of the project and its dependencies</p>
</td>
</tr>
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first">tuple of (<a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.7)">int</a>, list of dicts)</p>
</td>
</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>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="function">
<dt id="pylorax.api.projects.projects_info">
<code class="descclassname">pylorax.api.projects.</code><code class="descname">projects_info</code><span class="sig-paren">(</span><em>dbo</em>, <em>project_names</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/projects.html#projects_info"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.projects.projects_info" title="Permalink to this definition"></a></dt>
<dd><p>Return details about specific projects</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>dbo</strong> (<em>dnf.Base</em>) -- dnf base object</li>
<li><strong>project_names</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)"><em>str</em></a>) -- List of names of projects to get info about</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">List of project info dicts with pkg_to_project as well as epoch, version, release, etc.</p>
</td>
</tr>
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first last">list of dicts</p>
</td>
</tr>
</tbody>
</table>
<p>If project_names is None it will return the full list of available packages</p>
</dd></dl>
<dl class="function">
<dt id="pylorax.api.projects.projects_list">
<code class="descclassname">pylorax.api.projects.</code><code class="descname">projects_list</code><span class="sig-paren">(</span><em>dbo</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/projects.html#projects_list"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.projects.projects_list" title="Permalink to this definition"></a></dt>
<dd><p>Return a list of projects</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>dbo</strong> (<em>dnf.Base</em>) -- dnf base object</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">List of project info dicts with name, summary, description, homepage, upstream_vcs</td>
</tr>
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body">list of dicts</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="function">
<dt id="pylorax.api.projects.repo_to_source">
<code class="descclassname">pylorax.api.projects.</code><code class="descname">repo_to_source</code><span class="sig-paren">(</span><em>repo</em>, <em>system_source</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/projects.html#repo_to_source"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.projects.repo_to_source" title="Permalink to this definition"></a></dt>
<dd><p>Return a Weldr Source dict created from the DNF Repository</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>dnf.RepoDict</em>) -- DNF Repository</li>
<li><strong>system_source</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#bool" title="(in Python v3.7)"><em>bool</em></a>) -- True if this source is an immutable system source</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">A dict with Weldr Source fields filled in</p>
</td>
</tr>
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first last"><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#dict" title="(in Python v3.7)">dict</a></p>
</td>
</tr>
</tbody>
</table>
<p>Example:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="p">{</span>
<span class="s2">&quot;check_gpg&quot;</span><span class="p">:</span> <span class="n">true</span><span class="p">,</span>
<span class="s2">&quot;check_ssl&quot;</span><span class="p">:</span> <span class="n">true</span><span class="p">,</span>
<span class="s2">&quot;gpgkey_url&quot;</span><span class="p">:</span> <span class="p">[</span>
<span class="s2">&quot;file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-28-x86_64&quot;</span>
<span class="p">],</span>
<span class="s2">&quot;name&quot;</span><span class="p">:</span> <span class="s2">&quot;fedora&quot;</span><span class="p">,</span>
<span class="s2">&quot;proxy&quot;</span><span class="p">:</span> <span class="s2">&quot;http://proxy.brianlane.com:8123&quot;</span><span class="p">,</span>
<span class="s2">&quot;system&quot;</span><span class="p">:</span> <span class="n">true</span>
<span class="s2">&quot;type&quot;</span><span class="p">:</span> <span class="s2">&quot;yum-metalink&quot;</span><span class="p">,</span>
<span class="s2">&quot;url&quot;</span><span class="p">:</span> <span class="s2">&quot;https://mirrors.fedoraproject.org/metalink?repo=fedora-28&amp;arch=x86_64&quot;</span>
<span class="p">}</span>
</pre></div>
</div>
</dd></dl>
<dl class="function">
<dt id="pylorax.api.projects.source_to_repo">
<code class="descclassname">pylorax.api.projects.</code><code class="descname">source_to_repo</code><span class="sig-paren">(</span><em>source</em>, <em>dnf_conf</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/projects.html#source_to_repo"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.projects.source_to_repo" title="Permalink to this definition"></a></dt>
<dd><p>Return a dnf Repo object created from a source 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>source</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#dict" title="(in Python v3.7)"><em>dict</em></a>) -- A Weldr source dict</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">A dnf Repo object</td>
</tr>
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body">dnf.Repo</td>
</tr>
</tbody>
</table>
<p>Example:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="p">{</span>
<span class="s2">&quot;check_gpg&quot;</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span>
<span class="s2">&quot;check_ssl&quot;</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span>
<span class="s2">&quot;gpgkey_urls&quot;</span><span class="p">:</span> <span class="p">[</span>
<span class="s2">&quot;file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-28-x86_64&quot;</span>
<span class="p">],</span>
<span class="s2">&quot;name&quot;</span><span class="p">:</span> <span class="s2">&quot;fedora&quot;</span><span class="p">,</span>
<span class="s2">&quot;proxy&quot;</span><span class="p">:</span> <span class="s2">&quot;http://proxy.brianlane.com:8123&quot;</span><span class="p">,</span>
<span class="s2">&quot;system&quot;</span><span class="p">:</span> <span class="kc">True</span>
<span class="s2">&quot;type&quot;</span><span class="p">:</span> <span class="s2">&quot;yum-metalink&quot;</span><span class="p">,</span>
<span class="s2">&quot;url&quot;</span><span class="p">:</span> <span class="s2">&quot;https://mirrors.fedoraproject.org/metalink?repo=fedora-28&amp;arch=x86_64&quot;</span>
<span class="p">}</span>
</pre></div>
</div>
</dd></dl>
</div>
<div class="section" id="pylorax-api-queue-module">
<h2>pylorax.api.queue module<a class="headerlink" href="#pylorax-api-queue-module" title="Permalink to this headline"></a></h2>
</div>
<div class="section" id="module-pylorax.api.recipes">
<span id="pylorax-api-recipes-module"></span><h2>pylorax.api.recipes module<a class="headerlink" href="#module-pylorax.api.recipes" title="Permalink to this headline"></a></h2>
<dl class="class">
<dt id="pylorax.api.recipes.CommitDetails">
<em class="property">class </em><code class="descclassname">pylorax.api.recipes.</code><code class="descname">CommitDetails</code><span class="sig-paren">(</span><em>commit</em>, <em>timestamp</em>, <em>message</em>, <em>revision=None</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/recipes.html#CommitDetails"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.recipes.CommitDetails" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <a class="reference internal" href="pylorax.html#pylorax.base.DataHolder" title="pylorax.base.DataHolder"><code class="xref py py-class docutils literal notranslate"><span class="pre">pylorax.base.DataHolder</span></code></a></p>
</dd></dl>
<dl class="exception">
<dt id="pylorax.api.recipes.CommitTimeValError">
<em class="property">exception </em><code class="descclassname">pylorax.api.recipes.</code><code class="descname">CommitTimeValError</code><a class="reference internal" href="_modules/pylorax/api/recipes.html#CommitTimeValError"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.recipes.CommitTimeValError" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <a class="reference external" href="https://docs.python.org/3/library/exceptions.html#Exception" title="(in Python v3.7)"><code class="xref py py-class docutils literal notranslate"><span class="pre">Exception</span></code></a></p>
</dd></dl>
<dl class="function">
<dt id="pylorax.api.recipes.NewRecipeGit">
<code class="descclassname">pylorax.api.recipes.</code><code class="descname">NewRecipeGit</code><span class="sig-paren">(</span><em>toml_dict</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/recipes.html#NewRecipeGit"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.recipes.NewRecipeGit" title="Permalink to this definition"></a></dt>
<dd><p>Create a RecipeGit object from fields in a TOML 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"><ul class="first simple">
<li><strong>rpmname</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)"><em>str</em></a>) -- Name of the rpm to create, also used as the prefix name in the tar archive</li>
<li><strong>rpmversion</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)"><em>str</em></a>) -- Version of the rpm, eg. &quot;1.0.0&quot;</li>
<li><strong>rpmrelease</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)"><em>str</em></a>) -- Release of the rpm, eg. &quot;1&quot;</li>
<li><strong>summary</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)"><em>str</em></a>) -- Summary string for the rpm</li>
<li><strong>repo</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)"><em>str</em></a>) -- URL of the get repo to clone and create the archive from</li>
<li><strong>ref</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)"><em>str</em></a>) -- Git reference to check out. eg. origin/branch-name, git tag, or git commit hash</li>
<li><strong>destination</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)"><em>str</em></a>) -- Path to install the / of the git repo at when installing the rpm</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">A populated RecipeGit object</p>
</td>
</tr>
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first last"><a class="reference internal" href="#pylorax.api.recipes.RecipeGit" title="pylorax.api.recipes.RecipeGit">RecipeGit</a></p>
</td>
</tr>
</tbody>
</table>
<p>The TOML should look like this:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="p">[[</span><span class="n">repos</span><span class="o">.</span><span class="n">git</span><span class="p">]]</span>
<span class="n">rpmname</span><span class="o">=</span><span class="s2">&quot;server-config&quot;</span>
<span class="n">rpmversion</span><span class="o">=</span><span class="s2">&quot;1.0&quot;</span>
<span class="n">rpmrelease</span><span class="o">=</span><span class="s2">&quot;1&quot;</span>
<span class="n">summary</span><span class="o">=</span><span class="s2">&quot;Setup files for server deployment&quot;</span>
<span class="n">repo</span><span class="o">=</span><span class="s2">&quot;PATH OF GIT REPO TO CLONE&quot;</span>
<span class="n">ref</span><span class="o">=</span><span class="s2">&quot;v1.0&quot;</span>
<span class="n">destination</span><span class="o">=</span><span class="s2">&quot;/opt/server/&quot;</span>
</pre></div>
</div>
<p>Note that the repo path supports anything that git supports, <a class="reference external" href="file://">file://</a>, <a class="reference external" href="https://">https://</a>, <a class="reference external" href="http://">http://</a></p>
<p>Currently there is no support for authentication</p>
</dd></dl>
<dl class="class">
<dt id="pylorax.api.recipes.Recipe">
<em class="property">class </em><code class="descclassname">pylorax.api.recipes.</code><code class="descname">Recipe</code><span class="sig-paren">(</span><em>name</em>, <em>description</em>, <em>version</em>, <em>modules</em>, <em>packages</em>, <em>groups</em>, <em>customizations=None</em>, <em>gitrepos=None</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/recipes.html#Recipe"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.recipes.Recipe" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#dict" title="(in Python v3.7)"><code class="xref py py-class docutils literal notranslate"><span class="pre">dict</span></code></a></p>
<p>A Recipe of package and modules</p>
<p>This is a subclass of dict that enforces the constructor arguments
and adds a .filename property to return the recipe's filename,
and a .toml() function to return the recipe as a TOML string.</p>
<dl class="method">
<dt id="pylorax.api.recipes.Recipe.bump_version">
<code class="descname">bump_version</code><span class="sig-paren">(</span><em>old_version=None</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/recipes.html#Recipe.bump_version"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.recipes.Recipe.bump_version" title="Permalink to this definition"></a></dt>
<dd><p>semver recipe version number bump</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>old_version</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)"><em>str</em></a>) -- An optional old version number</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">The new version number or None</td>
</tr>
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)">str</a></td>
</tr>
<tr class="field-even field"><th class="field-name">Raises:</th><td class="field-body">ValueError</td>
</tr>
</tbody>
</table>
<p>If neither have a version, 0.0.1 is returned
If there is no old version the new version is checked and returned
If there is no new version, but there is a old one, bump its patch level
If the old and new versions are the same, bump the patch level
If they are different, check and return the new version</p>
</dd></dl>
<dl class="attribute">
<dt id="pylorax.api.recipes.Recipe.filename">
<code class="descname">filename</code><a class="headerlink" href="#pylorax.api.recipes.Recipe.filename" title="Permalink to this definition"></a></dt>
<dd><p>Return the Recipe's filename</p>
<p>Replaces spaces in the name with '-' and appends .toml</p>
</dd></dl>
<dl class="method">
<dt id="pylorax.api.recipes.Recipe.freeze">
<code class="descname">freeze</code><span class="sig-paren">(</span><em>deps</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/recipes.html#Recipe.freeze"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.recipes.Recipe.freeze" title="Permalink to this definition"></a></dt>
<dd><p>Return a new Recipe with full module and package NEVRA</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>deps</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#list" title="(in Python v3.7)"><em>list</em></a><em>(</em>) -- A list of dependency NEVRA to use to fill in the modules and packages</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">A new Recipe object</td>
</tr>
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><a class="reference internal" href="#pylorax.api.recipes.Recipe" title="pylorax.api.recipes.Recipe">Recipe</a></td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="attribute">
<dt id="pylorax.api.recipes.Recipe.group_names">
<code class="descname">group_names</code><a class="headerlink" href="#pylorax.api.recipes.Recipe.group_names" title="Permalink to this definition"></a></dt>
<dd><p>Return the names of the groups. Groups do not have versions.</p>
</dd></dl>
<dl class="attribute">
<dt id="pylorax.api.recipes.Recipe.module_names">
<code class="descname">module_names</code><a class="headerlink" href="#pylorax.api.recipes.Recipe.module_names" title="Permalink to this definition"></a></dt>
<dd><p>Return the names of the modules</p>
</dd></dl>
<dl class="attribute">
<dt id="pylorax.api.recipes.Recipe.module_nver">
<code class="descname">module_nver</code><a class="headerlink" href="#pylorax.api.recipes.Recipe.module_nver" title="Permalink to this definition"></a></dt>
<dd><p>Return the names and version globs of the modules</p>
</dd></dl>
<dl class="attribute">
<dt id="pylorax.api.recipes.Recipe.package_names">
<code class="descname">package_names</code><a class="headerlink" href="#pylorax.api.recipes.Recipe.package_names" title="Permalink to this definition"></a></dt>
<dd><p>Return the names of the packages</p>
</dd></dl>
<dl class="attribute">
<dt id="pylorax.api.recipes.Recipe.package_nver">
<code class="descname">package_nver</code><a class="headerlink" href="#pylorax.api.recipes.Recipe.package_nver" title="Permalink to this definition"></a></dt>
<dd><p>Return the names and version globs of the packages</p>
</dd></dl>
<dl class="method">
<dt id="pylorax.api.recipes.Recipe.toml">
<code class="descname">toml</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/recipes.html#Recipe.toml"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.recipes.Recipe.toml" title="Permalink to this definition"></a></dt>
<dd><p>Return the Recipe in TOML format</p>
</dd></dl>
</dd></dl>
<dl class="exception">
<dt id="pylorax.api.recipes.RecipeError">
<em class="property">exception </em><code class="descclassname">pylorax.api.recipes.</code><code class="descname">RecipeError</code><a class="reference internal" href="_modules/pylorax/api/recipes.html#RecipeError"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.recipes.RecipeError" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <a class="reference external" href="https://docs.python.org/3/library/exceptions.html#Exception" title="(in Python v3.7)"><code class="xref py py-class docutils literal notranslate"><span class="pre">Exception</span></code></a></p>
</dd></dl>
<dl class="exception">
<dt id="pylorax.api.recipes.RecipeFileError">
<em class="property">exception </em><code class="descclassname">pylorax.api.recipes.</code><code class="descname">RecipeFileError</code><a class="reference internal" href="_modules/pylorax/api/recipes.html#RecipeFileError"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.recipes.RecipeFileError" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <a class="reference external" href="https://docs.python.org/3/library/exceptions.html#Exception" title="(in Python v3.7)"><code class="xref py py-class docutils literal notranslate"><span class="pre">Exception</span></code></a></p>
</dd></dl>
<dl class="class">
<dt id="pylorax.api.recipes.RecipeGit">
<em class="property">class </em><code class="descclassname">pylorax.api.recipes.</code><code class="descname">RecipeGit</code><span class="sig-paren">(</span><em>rpmname</em>, <em>rpmversion</em>, <em>rpmrelease</em>, <em>summary</em>, <em>repo</em>, <em>ref</em>, <em>destination</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/recipes.html#RecipeGit"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.recipes.RecipeGit" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#dict" title="(in Python v3.7)"><code class="xref py py-class docutils literal notranslate"><span class="pre">dict</span></code></a></p>
</dd></dl>
<dl class="class">
<dt id="pylorax.api.recipes.RecipeGroup">
<em class="property">class </em><code class="descclassname">pylorax.api.recipes.</code><code class="descname">RecipeGroup</code><span class="sig-paren">(</span><em>name</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/recipes.html#RecipeGroup"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.recipes.RecipeGroup" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#dict" title="(in Python v3.7)"><code class="xref py py-class docutils literal notranslate"><span class="pre">dict</span></code></a></p>
</dd></dl>
<dl class="class">
<dt id="pylorax.api.recipes.RecipeModule">
<em class="property">class </em><code class="descclassname">pylorax.api.recipes.</code><code class="descname">RecipeModule</code><span class="sig-paren">(</span><em>name</em>, <em>version</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/recipes.html#RecipeModule"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.recipes.RecipeModule" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#dict" title="(in Python v3.7)"><code class="xref py py-class docutils literal notranslate"><span class="pre">dict</span></code></a></p>
</dd></dl>
<dl class="class">
<dt id="pylorax.api.recipes.RecipePackage">
<em class="property">class </em><code class="descclassname">pylorax.api.recipes.</code><code class="descname">RecipePackage</code><span class="sig-paren">(</span><em>name</em>, <em>version</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/recipes.html#RecipePackage"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.recipes.RecipePackage" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <a class="reference internal" href="#pylorax.api.recipes.RecipeModule" title="pylorax.api.recipes.RecipeModule"><code class="xref py py-class docutils literal notranslate"><span class="pre">pylorax.api.recipes.RecipeModule</span></code></a></p>
</dd></dl>
<dl class="function">
<dt id="pylorax.api.recipes.commit_recipe">
<code class="descclassname">pylorax.api.recipes.</code><code class="descname">commit_recipe</code><span class="sig-paren">(</span><em>repo</em>, <em>branch</em>, <em>recipe</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/recipes.html#commit_recipe"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.recipes.commit_recipe" title="Permalink to this definition"></a></dt>
<dd><p>Commit a recipe to a 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>) -- Open repository</li>
<li><strong>branch</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)"><em>str</em></a>) -- Branch name</li>
<li><strong>recipe</strong> (<a class="reference internal" href="#pylorax.api.recipes.Recipe" title="pylorax.api.recipes.Recipe"><em>Recipe</em></a>) -- Recipe to commit</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">OId of the new commit</p>
</td>
</tr>
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first">Git.OId</p>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Raises:</th><td class="field-body"><p class="first last">Can raise errors from Ggit</p>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="function">
<dt id="pylorax.api.recipes.commit_recipe_directory">
<code class="descclassname">pylorax.api.recipes.</code><code class="descname">commit_recipe_directory</code><span class="sig-paren">(</span><em>repo</em>, <em>branch</em>, <em>directory</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/recipes.html#commit_recipe_directory"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.recipes.commit_recipe_directory" title="Permalink to this definition"></a></dt>
<dd><p>Commit all *.toml files from a directory, if they aren't already in git.</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>) -- Open repository</li>
<li><strong>branch</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)"><em>str</em></a>) -- Branch name</li>
<li><strong>directory</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)"><em>str</em></a>) -- The directory of *.toml recipes to commit</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">None</p>
</td>
</tr>
<tr class="field-odd field"><th class="field-name">Raises:</th><td class="field-body"><p class="first last">Can raise errors from Ggit or RecipeFileError</p>
</td>
</tr>
</tbody>
</table>
<p>Files with Toml or RecipeFileErrors will be skipped, and the remainder will
be tried.</p>
</dd></dl>
<dl class="function">
<dt id="pylorax.api.recipes.commit_recipe_file">
<code class="descclassname">pylorax.api.recipes.</code><code class="descname">commit_recipe_file</code><span class="sig-paren">(</span><em>repo</em>, <em>branch</em>, <em>filename</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/recipes.html#commit_recipe_file"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.recipes.commit_recipe_file" title="Permalink to this definition"></a></dt>
<dd><p>Commit a recipe file to a 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>) -- Open repository</li>
<li><strong>branch</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)"><em>str</em></a>) -- Branch name</li>
<li><strong>filename</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)"><em>str</em></a>) -- Path to the recipe file to commit</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">OId of the new commit</p>
</td>
</tr>
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first">Git.OId</p>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Raises:</th><td class="field-body"><p class="first last">Can raise errors from Ggit or RecipeFileError</p>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="function">
<dt id="pylorax.api.recipes.delete_file">
<code class="descclassname">pylorax.api.recipes.</code><code class="descname">delete_file</code><span class="sig-paren">(</span><em>repo</em>, <em>branch</em>, <em>filename</em><span class="sig-paren">)</span><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>
<dd><p>Delete a file from a 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>) -- Open repository</li>
<li><strong>branch</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)"><em>str</em></a>) -- Branch name</li>
<li><strong>filename</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)"><em>str</em></a>) -- filename to delete</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">OId of the new commit</p>
</td>
</tr>
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first">Git.OId</p>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Raises:</th><td class="field-body"><p class="first last">Can raise errors from Ggit</p>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="function">
<dt id="pylorax.api.recipes.delete_recipe">
<code class="descclassname">pylorax.api.recipes.</code><code class="descname">delete_recipe</code><span class="sig-paren">(</span><em>repo</em>, <em>branch</em>, <em>recipe_name</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/recipes.html#delete_recipe"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.recipes.delete_recipe" title="Permalink to this definition"></a></dt>
<dd><p>Delete a recipe from a 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>) -- Open repository</li>
<li><strong>branch</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)"><em>str</em></a>) -- Branch name</li>
<li><strong>recipe_name</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)"><em>str</em></a>) -- Recipe name to delete</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">OId of the new commit</p>
</td>
</tr>
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first">Git.OId</p>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Raises:</th><td class="field-body"><p class="first last">Can raise errors from Ggit</p>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="function">
<dt id="pylorax.api.recipes.diff_items">
<code class="descclassname">pylorax.api.recipes.</code><code class="descname">diff_items</code><span class="sig-paren">(</span><em>title</em>, <em>old_items</em>, <em>new_items</em><span class="sig-paren">)</span><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>
<dd><p>Return the differences between two lists 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>title</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)"><em>str</em></a>) -- Title of the entry</li>
<li><strong>old_items</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#list" title="(in Python v3.7)"><em>list</em></a><em>(</em><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#dict" title="(in Python v3.7)"><em>dict</em></a><em>)</em>) -- List of item dicts with &quot;name&quot; field</li>
<li><strong>new_items</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#list" title="(in Python v3.7)"><em>list</em></a><em>(</em><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#dict" title="(in Python v3.7)"><em>dict</em></a><em>)</em>) -- List of item dicts with &quot;name&quot; field</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">List of diff dicts with old/new entries</p>
</td>
</tr>
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first last"><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#list" title="(in Python v3.7)">list</a>(<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#dict" title="(in Python v3.7)">dict</a>)</p>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="function">
<dt id="pylorax.api.recipes.find_commit_tag">
<code class="descclassname">pylorax.api.recipes.</code><code class="descname">find_commit_tag</code><span class="sig-paren">(</span><em>repo</em>, <em>branch</em>, <em>filename</em>, <em>commit_id</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/recipes.html#find_commit_tag"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.recipes.find_commit_tag" title="Permalink to this definition"></a></dt>
<dd><p>Find the tag that matches the commit_id</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>) -- Open repository</li>
<li><strong>branch</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)"><em>str</em></a>) -- Branch name</li>
<li><strong>filename</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)"><em>str</em></a>) -- filename to revert</li>
<li><strong>commit_id</strong> (<em>Git.OId</em>) -- The commit id to check</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">The tag or None if there isn't one</p>
</td>
</tr>
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first last"><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)">str</a> or <a class="reference external" href="https://docs.python.org/3/library/constants.html#None" title="(in Python v3.7)">None</a></p>
</td>
</tr>
</tbody>
</table>
<p>There should be only 1 tag pointing to a commit, but there may not
be a tag at all.</p>
<p>The tag will look like: 'refs/tags/&lt;branch&gt;/&lt;filename&gt;/r&lt;revision&gt;'</p>
</dd></dl>
<dl class="function">
<dt id="pylorax.api.recipes.find_name">
<code class="descclassname">pylorax.api.recipes.</code><code class="descname">find_name</code><span class="sig-paren">(</span><em>name</em>, <em>lst</em><span class="sig-paren">)</span><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>
<dd><p>Find the dict matching the name in a list 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 simple">
<li><strong>name</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)"><em>str</em></a>) -- Name to search for</li>
<li><strong>lst</strong> -- List of dict's with &quot;name&quot; 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 name, 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"><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#dict" title="(in Python v3.7)">dict</a> or <a class="reference external" href="https://docs.python.org/3/library/constants.html#None" title="(in Python v3.7)">None</a></p>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="function">
<dt id="pylorax.api.recipes.get_commit_details">
<code class="descclassname">pylorax.api.recipes.</code><code class="descname">get_commit_details</code><span class="sig-paren">(</span><em>commit</em>, <em>revision=None</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/recipes.html#get_commit_details"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.recipes.get_commit_details" title="Permalink to this definition"></a></dt>
<dd><p>Return the details about a specific commit.</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>commit</strong> (<em>Git.Commit</em>) -- The commit to get details from</li>
<li><strong>revision</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.7)"><em>int</em></a>) -- Optional commit revision</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">Details about the commit</p>
</td>
</tr>
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first"><a class="reference internal" href="#pylorax.api.recipes.CommitDetails" title="pylorax.api.recipes.CommitDetails">CommitDetails</a></p>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Raises:</th><td class="field-body"><p class="first last">CommitTimeValError or Ggit exceptions</p>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="function">
<dt id="pylorax.api.recipes.get_revision_from_tag">
<code class="descclassname">pylorax.api.recipes.</code><code class="descname">get_revision_from_tag</code><span class="sig-paren">(</span><em>tag</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/recipes.html#get_revision_from_tag"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.recipes.get_revision_from_tag" title="Permalink to this definition"></a></dt>
<dd><p>Return the revision number from a tag</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>tag</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)"><em>str</em></a>) -- The tag to exract the revision from</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">The integer revision or None</td>
</tr>
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.7)">int</a> or <a class="reference external" href="https://docs.python.org/3/library/constants.html#None" title="(in Python v3.7)">None</a></td>
</tr>
</tbody>
</table>
<p>The revision is the part after the r in 'branch/filename/rXXX'</p>
</dd></dl>
<dl class="function">
<dt id="pylorax.api.recipes.gfile">
<code class="descclassname">pylorax.api.recipes.</code><code class="descname">gfile</code><span class="sig-paren">(</span><em>path</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/recipes.html#gfile"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.recipes.gfile" title="Permalink to this definition"></a></dt>
<dd><p>Convert a string path to GFile for use with Git</p>
</dd></dl>
<dl class="function">
<dt id="pylorax.api.recipes.head_commit">
<code class="descclassname">pylorax.api.recipes.</code><code class="descname">head_commit</code><span class="sig-paren">(</span><em>repo</em>, <em>branch</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/recipes.html#head_commit"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.recipes.head_commit" title="Permalink to this definition"></a></dt>
<dd><p>Get the branch's HEAD Commit 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 simple">
<li><strong>repo</strong> (<em>Git.Repository</em>) -- Open repository</li>
<li><strong>branch</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)"><em>str</em></a>) -- Branch name</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">Branch's head commit</p>
</td>
</tr>
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first">Git.Commit</p>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Raises:</th><td class="field-body"><p class="first last">Can raise errors from Ggit</p>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="function">
<dt id="pylorax.api.recipes.is_commit_tag">
<code class="descclassname">pylorax.api.recipes.</code><code class="descname">is_commit_tag</code><span class="sig-paren">(</span><em>repo</em>, <em>commit_id</em>, <em>tag</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/recipes.html#is_commit_tag"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.recipes.is_commit_tag" title="Permalink to this definition"></a></dt>
<dd><p>Check to see if a tag points to a specific commit.</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>) -- Open repository</li>
<li><strong>commit_id</strong> (<em>Git.OId</em>) -- The commit id to check</li>
<li><strong>tag</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)"><em>str</em></a>) -- The tag 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 tag points to the commit, 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"><a class="reference external" href="https://docs.python.org/3/library/functions.html#bool" title="(in Python v3.7)">bool</a></p>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="function">
<dt id="pylorax.api.recipes.is_parent_diff">
<code class="descclassname">pylorax.api.recipes.</code><code class="descname">is_parent_diff</code><span class="sig-paren">(</span><em>repo</em>, <em>filename</em>, <em>tree</em>, <em>parent</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/recipes.html#is_parent_diff"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.recipes.is_parent_diff" title="Permalink to this definition"></a></dt>
<dd><p>Check to see if the commit is different from its parents</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>) -- Open repository</li>
<li><strong>filename</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)"><em>str</em></a>) -- filename to revert</li>
<li><strong>tree</strong> (<em>Git.Tree</em>) -- The commit's tree</li>
<li><strong>parent</strong> (<em>Git.Commit</em>) -- The commit's parent commit</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Retuns:</th><td class="field-body"><p class="first">True if filename in the commit is different from its parents</p>
</td>
</tr>
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first last"><a class="reference external" href="https://docs.python.org/3/library/functions.html#bool" title="(in Python v3.7)">bool</a></p>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="function">
<dt id="pylorax.api.recipes.list_branch_files">
<code class="descclassname">pylorax.api.recipes.</code><code class="descname">list_branch_files</code><span class="sig-paren">(</span><em>repo</em>, <em>branch</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/recipes.html#list_branch_files"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.recipes.list_branch_files" title="Permalink to this definition"></a></dt>
<dd><p>Return a sorted list of the files on the branch HEAD</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>) -- Open repository</li>
<li><strong>branch</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)"><em>str</em></a>) -- Branch name</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">A sorted list of the filenames</p>
</td>
</tr>
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first"><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#list" title="(in Python v3.7)">list</a>(<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)">str</a>)</p>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Raises:</th><td class="field-body"><p class="first last">Can raise errors from Ggit</p>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="function">
<dt id="pylorax.api.recipes.list_commit_files">
<code class="descclassname">pylorax.api.recipes.</code><code class="descname">list_commit_files</code><span class="sig-paren">(</span><em>repo</em>, <em>commit</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/recipes.html#list_commit_files"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.recipes.list_commit_files" title="Permalink to this definition"></a></dt>
<dd><p>Return a sorted list of the files on a commit</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>) -- Open repository</li>
<li><strong>commit</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)"><em>str</em></a>) -- The commit hash to list</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">A sorted list of the filenames</p>
</td>
</tr>
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first"><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#list" title="(in Python v3.7)">list</a>(<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)">str</a>)</p>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Raises:</th><td class="field-body"><p class="first last">Can raise errors from Ggit</p>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="function">
<dt id="pylorax.api.recipes.list_commits">
<code class="descclassname">pylorax.api.recipes.</code><code class="descname">list_commits</code><span class="sig-paren">(</span><em>repo</em>, <em>branch</em>, <em>filename</em>, <em>limit=0</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/recipes.html#list_commits"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.recipes.list_commits" title="Permalink to this definition"></a></dt>
<dd><p>List the commit history of a file on a 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>) -- Open repository</li>
<li><strong>branch</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)"><em>str</em></a>) -- Branch name</li>
<li><strong>filename</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)"><em>str</em></a>) -- filename to revert</li>
<li><strong>limit</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.7)"><em>int</em></a>) -- Number of commits to return (0=all)</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">A list of commit details</p>
</td>
</tr>
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first"><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#list" title="(in Python v3.7)">list</a>(<a class="reference internal" href="#pylorax.api.recipes.CommitDetails" title="pylorax.api.recipes.CommitDetails">CommitDetails</a>)</p>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Raises:</th><td class="field-body"><p class="first last">Can raise errors from Ggit</p>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="function">
<dt id="pylorax.api.recipes.open_or_create_repo">
<code class="descclassname">pylorax.api.recipes.</code><code class="descname">open_or_create_repo</code><span class="sig-paren">(</span><em>path</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/recipes.html#open_or_create_repo"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.recipes.open_or_create_repo" title="Permalink to this definition"></a></dt>
<dd><p>Open an existing repo, or create a new one</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>path</strong> (<em>string</em>) -- path to recipe directory</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">A repository object</td>
</tr>
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body">Git.Repository</td>
</tr>
<tr class="field-even field"><th class="field-name">Raises:</th><td class="field-body">Can raise errors from Ggit</td>
</tr>
</tbody>
</table>
<p>A bare git repo will be created in the git directory of the specified path.
If a repo already exists it will be opened and returned instead of
creating a new one.</p>
</dd></dl>
<dl class="function">
<dt id="pylorax.api.recipes.prepare_commit">
<code class="descclassname">pylorax.api.recipes.</code><code class="descname">prepare_commit</code><span class="sig-paren">(</span><em>repo</em>, <em>branch</em>, <em>builder</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/recipes.html#prepare_commit"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.recipes.prepare_commit" title="Permalink to this definition"></a></dt>
<dd><p>Prepare for a commit</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>) -- Open repository</li>
<li><strong>branch</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)"><em>str</em></a>) -- Branch name</li>
<li><strong>builder</strong> (<a class="reference internal" href="pylorax.html#pylorax.treebuilder.TreeBuilder" title="pylorax.treebuilder.TreeBuilder"><em>TreeBuilder</em></a>) -- instance of TreeBuilder</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">(Tree, Sig, Ref)</p>
</td>
</tr>
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first"><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#tuple" title="(in Python v3.7)">tuple</a></p>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Raises:</th><td class="field-body"><p class="first last">Can raise errors from Ggit</p>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="function">
<dt id="pylorax.api.recipes.read_commit">
<code class="descclassname">pylorax.api.recipes.</code><code class="descname">read_commit</code><span class="sig-paren">(</span><em>repo</em>, <em>branch</em>, <em>filename</em>, <em>commit=None</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/recipes.html#read_commit"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.recipes.read_commit" title="Permalink to this definition"></a></dt>
<dd><p>Return the contents of a file on a specific branch or commit.</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>) -- Open repository</li>
<li><strong>branch</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)"><em>str</em></a>) -- Branch name</li>
<li><strong>filename</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)"><em>str</em></a>) -- filename to read</li>
<li><strong>commit</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)"><em>str</em></a>) -- Optional commit hash</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">The commit id, and the contents of the commit</p>
</td>
</tr>
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first"><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#tuple" title="(in Python v3.7)">tuple</a>(<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)">str</a>, <a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)">str</a>)</p>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Raises:</th><td class="field-body"><p class="first last">Can raise errors from Ggit</p>
</td>
</tr>
</tbody>
</table>
<p>If no commit is passed the master:filename is returned, otherwise it will be
commit:filename</p>
</dd></dl>
<dl class="function">
<dt id="pylorax.api.recipes.read_commit_spec">
<code class="descclassname">pylorax.api.recipes.</code><code class="descname">read_commit_spec</code><span class="sig-paren">(</span><em>repo</em>, <em>spec</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/recipes.html#read_commit_spec"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.recipes.read_commit_spec" title="Permalink to this definition"></a></dt>
<dd><p>Return the raw content of the blob specified by the spec</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>) -- Open repository</li>
<li><strong>spec</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)"><em>str</em></a>) -- Git revparse spec</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">Contents of the commit</p>
</td>
</tr>
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first"><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)">str</a></p>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Raises:</th><td class="field-body"><p class="first last">Can raise errors from Ggit</p>
</td>
</tr>
</tbody>
</table>
<p>eg. To read the README file from master the spec is &quot;master:README&quot;</p>
</dd></dl>
<dl class="function">
<dt id="pylorax.api.recipes.read_recipe_and_id">
<code class="descclassname">pylorax.api.recipes.</code><code class="descname">read_recipe_and_id</code><span class="sig-paren">(</span><em>repo</em>, <em>branch</em>, <em>recipe_name</em>, <em>commit=None</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/recipes.html#read_recipe_and_id"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.recipes.read_recipe_and_id" title="Permalink to this definition"></a></dt>
<dd><p>Read a recipe commit and its id from git</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>) -- Open repository</li>
<li><strong>branch</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)"><em>str</em></a>) -- Branch name</li>
<li><strong>recipe_name</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)"><em>str</em></a>) -- Recipe name to read</li>
<li><strong>commit</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)"><em>str</em></a>) -- Optional commit hash</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">The commit id, and a Recipe object</p>
</td>
</tr>
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first"><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#tuple" title="(in Python v3.7)">tuple</a>(<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)">str</a>, <a class="reference internal" href="#pylorax.api.recipes.Recipe" title="pylorax.api.recipes.Recipe">Recipe</a>)</p>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Raises:</th><td class="field-body"><p class="first last">Can raise errors from Ggit</p>
</td>
</tr>
</tbody>
</table>
<p>If no commit is passed the master:filename is returned, otherwise it will be
commit:filename</p>
</dd></dl>
<dl class="function">
<dt id="pylorax.api.recipes.read_recipe_commit">
<code class="descclassname">pylorax.api.recipes.</code><code class="descname">read_recipe_commit</code><span class="sig-paren">(</span><em>repo</em>, <em>branch</em>, <em>recipe_name</em>, <em>commit=None</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/recipes.html#read_recipe_commit"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.recipes.read_recipe_commit" title="Permalink to this definition"></a></dt>
<dd><p>Read a recipe commit from git and return 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 simple">
<li><strong>repo</strong> (<em>Git.Repository</em>) -- Open repository</li>
<li><strong>branch</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)"><em>str</em></a>) -- Branch name</li>
<li><strong>recipe_name</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)"><em>str</em></a>) -- Recipe name to read</li>
<li><strong>commit</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)"><em>str</em></a>) -- Optional commit hash</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">A Recipe object</p>
</td>
</tr>
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first"><a class="reference internal" href="#pylorax.api.recipes.Recipe" title="pylorax.api.recipes.Recipe">Recipe</a></p>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Raises:</th><td class="field-body"><p class="first last">Can raise errors from Ggit</p>
</td>
</tr>
</tbody>
</table>
<p>If no commit is passed the master:filename is returned, otherwise it will be
commit:filename</p>
</dd></dl>
<dl class="function">
<dt id="pylorax.api.recipes.recipe_diff">
<code class="descclassname">pylorax.api.recipes.</code><code class="descname">recipe_diff</code><span class="sig-paren">(</span><em>old_recipe</em>, <em>new_recipe</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/recipes.html#recipe_diff"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.recipes.recipe_diff" title="Permalink to this definition"></a></dt>
<dd><p>Diff two versions of a 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">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>old_recipe</strong> (<a class="reference internal" href="#pylorax.api.recipes.Recipe" title="pylorax.api.recipes.Recipe"><em>Recipe</em></a>) -- The old version of the recipe</li>
<li><strong>new_recipe</strong> (<a class="reference internal" href="#pylorax.api.recipes.Recipe" title="pylorax.api.recipes.Recipe"><em>Recipe</em></a>) -- The new version of the recipe</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">A list of diff dict entries with old/new</p>
</td>
</tr>
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first last"><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#list" title="(in Python v3.7)">list</a>(<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#dict" title="(in Python v3.7)">dict</a>)</p>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="function">
<dt id="pylorax.api.recipes.recipe_filename">
<code class="descclassname">pylorax.api.recipes.</code><code class="descname">recipe_filename</code><span class="sig-paren">(</span><em>name</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/recipes.html#recipe_filename"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.recipes.recipe_filename" title="Permalink to this definition"></a></dt>
<dd><p>Return the toml filename for a recipe</p>
<p>Replaces spaces with '-' and appends '.toml'</p>
</dd></dl>
<dl class="function">
<dt id="pylorax.api.recipes.recipe_from_dict">
<code class="descclassname">pylorax.api.recipes.</code><code class="descname">recipe_from_dict</code><span class="sig-paren">(</span><em>recipe_dict</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/recipes.html#recipe_from_dict"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.recipes.recipe_from_dict" title="Permalink to this definition"></a></dt>
<dd><p>Create a Recipe object from a plain 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_dict</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#dict" title="(in Python v3.7)"><em>dict</em></a>) -- A plain dict of the recipe</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">A Recipe object</td>
</tr>
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><a class="reference internal" href="#pylorax.api.recipes.Recipe" title="pylorax.api.recipes.Recipe">Recipe</a></td>
</tr>
<tr class="field-even field"><th class="field-name">Raises:</th><td class="field-body">RecipeError</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="function">
<dt id="pylorax.api.recipes.recipe_from_file">
<code class="descclassname">pylorax.api.recipes.</code><code class="descname">recipe_from_file</code><span class="sig-paren">(</span><em>recipe_path</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/recipes.html#recipe_from_file"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.recipes.recipe_from_file" title="Permalink to this definition"></a></dt>
<dd><p>Return a recipe file as 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"><strong>recipe_path</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)"><em>str</em></a>) -- Path to the recipe fila</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">A Recipe object</td>
</tr>
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><a class="reference internal" href="#pylorax.api.recipes.Recipe" title="pylorax.api.recipes.Recipe">Recipe</a></td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="function">
<dt id="pylorax.api.recipes.recipe_from_toml">
<code class="descclassname">pylorax.api.recipes.</code><code class="descname">recipe_from_toml</code><span class="sig-paren">(</span><em>recipe_str</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/recipes.html#recipe_from_toml"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.recipes.recipe_from_toml" title="Permalink to this definition"></a></dt>
<dd><p>Create a Recipe object from a toml string.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>recipe_str</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)"><em>str</em></a>) -- The Recipe TOML string</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">A Recipe object</td>
</tr>
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><a class="reference internal" href="#pylorax.api.recipes.Recipe" title="pylorax.api.recipes.Recipe">Recipe</a></td>
</tr>
<tr class="field-even field"><th class="field-name">Raises:</th><td class="field-body">TomlError</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="function">
<dt id="pylorax.api.recipes.repo_file_exists">
<code class="descclassname">pylorax.api.recipes.</code><code class="descname">repo_file_exists</code><span class="sig-paren">(</span><em>repo</em>, <em>branch</em>, <em>filename</em><span class="sig-paren">)</span><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>) -- Open repository</li>
<li><strong>branch</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)"><em>str</em></a>) -- Branch name</li>
<li><strong>filename</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)"><em>str</em></a>) -- 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"><a class="reference external" href="https://docs.python.org/3/library/functions.html#bool" title="(in Python v3.7)">bool</a></p>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="function">
<dt id="pylorax.api.recipes.revert_file">
<code class="descclassname">pylorax.api.recipes.</code><code class="descname">revert_file</code><span class="sig-paren">(</span><em>repo</em>, <em>branch</em>, <em>filename</em>, <em>commit</em><span class="sig-paren">)</span><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>
<dd><p>Revert the contents of a file to that of a previous commit</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>) -- Open repository</li>
<li><strong>branch</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)"><em>str</em></a>) -- Branch name</li>
<li><strong>filename</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)"><em>str</em></a>) -- filename to revert</li>
<li><strong>commit</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)"><em>str</em></a>) -- Commit hash</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">OId of the new commit</p>
</td>
</tr>
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first">Git.OId</p>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Raises:</th><td class="field-body"><p class="first last">Can raise errors from Ggit</p>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="function">
<dt id="pylorax.api.recipes.revert_recipe">
<code class="descclassname">pylorax.api.recipes.</code><code class="descname">revert_recipe</code><span class="sig-paren">(</span><em>repo</em>, <em>branch</em>, <em>recipe_name</em>, <em>commit</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/recipes.html#revert_recipe"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.recipes.revert_recipe" title="Permalink to this definition"></a></dt>
<dd><p>Revert the contents of a recipe to that of a previous commit</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>) -- Open repository</li>
<li><strong>branch</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)"><em>str</em></a>) -- Branch name</li>
<li><strong>recipe_name</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)"><em>str</em></a>) -- Recipe name to revert</li>
<li><strong>commit</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)"><em>str</em></a>) -- Commit hash</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">OId of the new commit</p>
</td>
</tr>
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first">Git.OId</p>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Raises:</th><td class="field-body"><p class="first last">Can raise errors from Ggit</p>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="function">
<dt id="pylorax.api.recipes.tag_file_commit">
<code class="descclassname">pylorax.api.recipes.</code><code class="descname">tag_file_commit</code><span class="sig-paren">(</span><em>repo</em>, <em>branch</em>, <em>filename</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/recipes.html#tag_file_commit"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.recipes.tag_file_commit" title="Permalink to this definition"></a></dt>
<dd><p>Tag a file's most recent commit</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>) -- Open repository</li>
<li><strong>branch</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)"><em>str</em></a>) -- Branch name</li>
<li><strong>filename</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)"><em>str</em></a>) -- Filename to tag</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">Tag id or None if it failed.</p>
</td>
</tr>
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first">Git.OId</p>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Raises:</th><td class="field-body"><p class="first last">Can raise errors from Ggit</p>
</td>
</tr>
</tbody>
</table>
<p>This uses git tags, of the form <cite>refs/tags/&lt;branch&gt;/&lt;filename&gt;/r&lt;revision&gt;</cite>
Only the most recent recipe commit can be tagged to prevent out of order tagging.
Revisions start at 1 and increment for each new commit that is tagged.
If the commit has already been tagged it will return false.</p>
</dd></dl>
<dl class="function">
<dt id="pylorax.api.recipes.tag_recipe_commit">
<code class="descclassname">pylorax.api.recipes.</code><code class="descname">tag_recipe_commit</code><span class="sig-paren">(</span><em>repo</em>, <em>branch</em>, <em>recipe_name</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/recipes.html#tag_recipe_commit"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.recipes.tag_recipe_commit" title="Permalink to this definition"></a></dt>
<dd><p>Tag a file's most recent commit</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>) -- Open repository</li>
<li><strong>branch</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)"><em>str</em></a>) -- Branch name</li>
<li><strong>recipe_name</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)"><em>str</em></a>) -- Recipe name to tag</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">Tag id or None if it failed.</p>
</td>
</tr>
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first">Git.OId</p>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Raises:</th><td class="field-body"><p class="first last">Can raise errors from Ggit</p>
</td>
</tr>
</tbody>
</table>
<p>Uses tag_file_commit()</p>
</dd></dl>
<dl class="function">
<dt id="pylorax.api.recipes.write_commit">
<code class="descclassname">pylorax.api.recipes.</code><code class="descname">write_commit</code><span class="sig-paren">(</span><em>repo</em>, <em>branch</em>, <em>filename</em>, <em>message</em>, <em>content</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/recipes.html#write_commit"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.recipes.write_commit" title="Permalink to this definition"></a></dt>
<dd><p>Make a new commit to a repository's 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>) -- Open repository</li>
<li><strong>branch</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)"><em>str</em></a>) -- Branch name</li>
<li><strong>filename</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)"><em>str</em></a>) -- full path of the file to add</li>
<li><strong>message</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)"><em>str</em></a>) -- The commit message</li>
<li><strong>content</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)"><em>str</em></a>) -- The data to write</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">OId of the new commit</p>
</td>
</tr>
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first">Git.OId</p>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Raises:</th><td class="field-body"><p class="first last">Can raise errors from Ggit</p>
</td>
</tr>
</tbody>
</table>
</dd></dl>
</div>
<div class="section" id="module-pylorax.api.regexes">
<span id="pylorax-api-regexes-module"></span><h2>pylorax.api.regexes module<a class="headerlink" href="#module-pylorax.api.regexes" title="Permalink to this headline"></a></h2>
</div>
<div class="section" id="pylorax-api-server-module">
<h2>pylorax.api.server module<a class="headerlink" href="#pylorax-api-server-module" title="Permalink to this headline"></a></h2>
</div>
<div class="section" id="module-pylorax.api.timestamp">
<span id="pylorax-api-timestamp-module"></span><h2>pylorax.api.timestamp module<a class="headerlink" href="#module-pylorax.api.timestamp" title="Permalink to this headline"></a></h2>
<dl class="function">
<dt id="pylorax.api.timestamp.timestamp_dict">
<code class="descclassname">pylorax.api.timestamp.</code><code class="descname">timestamp_dict</code><span class="sig-paren">(</span><em>destdir</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/timestamp.html#timestamp_dict"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.timestamp.timestamp_dict" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="function">
<dt id="pylorax.api.timestamp.write_timestamp">
<code class="descclassname">pylorax.api.timestamp.</code><code class="descname">write_timestamp</code><span class="sig-paren">(</span><em>destdir</em>, <em>ty</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/timestamp.html#write_timestamp"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.timestamp.write_timestamp" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</div>
<div class="section" id="pylorax-api-v0-module">
<h2>pylorax.api.v0 module<a class="headerlink" href="#pylorax-api-v0-module" title="Permalink to this headline"></a></h2>
</div>
<div class="section" id="module-pylorax.api.workspace">
<span id="pylorax-api-workspace-module"></span><h2>pylorax.api.workspace module<a class="headerlink" href="#module-pylorax.api.workspace" title="Permalink to this headline"></a></h2>
<dl class="function">
<dt id="pylorax.api.workspace.workspace_delete">
<code class="descclassname">pylorax.api.workspace.</code><code class="descname">workspace_delete</code><span class="sig-paren">(</span><em>repo</em>, <em>branch</em>, <em>recipe_name</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/workspace.html#workspace_delete"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.workspace.workspace_delete" title="Permalink to this definition"></a></dt>
<dd><p>Delete the recipe from the workspace</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>) -- Open repository</li>
<li><strong>branch</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)"><em>str</em></a>) -- Branch name</li>
<li><strong>recipe_name</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)"><em>str</em></a>) -- The name of the recipe</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">None</p>
</td>
</tr>
<tr class="field-odd field"><th class="field-name">Raises:</th><td class="field-body"><p class="first last">IO related errors</p>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="function">
<dt id="pylorax.api.workspace.workspace_dir">
<code class="descclassname">pylorax.api.workspace.</code><code class="descname">workspace_dir</code><span class="sig-paren">(</span><em>repo</em>, <em>branch</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/workspace.html#workspace_dir"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.workspace.workspace_dir" title="Permalink to this definition"></a></dt>
<dd><p>Create the workspace's path from a Repository and 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>) -- Open repository</li>
<li><strong>branch</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)"><em>str</em></a>) -- Branch name</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">The path to the branch's workspace directory</p>
</td>
</tr>
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first last"><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)">str</a></p>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="function">
<dt id="pylorax.api.workspace.workspace_read">
<code class="descclassname">pylorax.api.workspace.</code><code class="descname">workspace_read</code><span class="sig-paren">(</span><em>repo</em>, <em>branch</em>, <em>recipe_name</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/workspace.html#workspace_read"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.workspace.workspace_read" title="Permalink to this definition"></a></dt>
<dd><p>Read a Recipe from the branch's workspace</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>) -- Open repository</li>
<li><strong>branch</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)"><em>str</em></a>) -- Branch name</li>
<li><strong>recipe_name</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)"><em>str</em></a>) -- The name of the recipe</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">The workspace copy of the recipe, or None if it doesn't exist</p>
</td>
</tr>
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first"><a class="reference internal" href="#pylorax.api.recipes.Recipe" title="pylorax.api.recipes.Recipe">Recipe</a> or <a class="reference external" href="https://docs.python.org/3/library/constants.html#None" title="(in Python v3.7)">None</a></p>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Raises:</th><td class="field-body"><p class="first last">RecipeFileError</p>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="function">
<dt id="pylorax.api.workspace.workspace_write">
<code class="descclassname">pylorax.api.workspace.</code><code class="descname">workspace_write</code><span class="sig-paren">(</span><em>repo</em>, <em>branch</em>, <em>recipe</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/workspace.html#workspace_write"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.workspace.workspace_write" title="Permalink to this definition"></a></dt>
<dd><p>Write a recipe to the workspace</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>) -- Open repository</li>
<li><strong>branch</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)"><em>str</em></a>) -- Branch name</li>
<li><strong>recipe</strong> (<a class="reference internal" href="#pylorax.api.recipes.Recipe" title="pylorax.api.recipes.Recipe"><em>Recipe</em></a>) -- The recipe to write to the workspace</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">None</p>
</td>
</tr>
<tr class="field-odd field"><th class="field-name">Raises:</th><td class="field-body"><p class="first last">IO related errors</p>
</td>
</tr>
</tbody>
</table>
</dd></dl>
</div>
<div class="section" id="module-pylorax.api">
<span id="module-contents"></span><h2>Module contents<a class="headerlink" href="#module-pylorax.api" title="Permalink to this headline"></a></h2>
<dl class="function">
<dt id="pylorax.api.crossdomain">
<code class="descclassname">pylorax.api.</code><code class="descname">crossdomain</code><span class="sig-paren">(</span><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><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/crossdomain.html#crossdomain"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.crossdomain" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</div>
</div>
</div>
</div>
<footer>
<div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
<a href="pylorax.html" class="btn btn-neutral float-left" title="pylorax package" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left"></span> Previous</a>
</div>
<hr/>
<div role="contentinfo">
<p>
&copy; Copyright 2018, Red Hat, Inc.
</p>
</div>
Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/rtfd/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>.
</footer>
</div>
</div>
</section>
</div>
<script type="text/javascript">
jQuery(function () {
SphinxRtdTheme.Navigation.enable(true);
});
</script>
</body>
</html>