New lorax documentation - 29.20
This commit is contained in:
parent
1006af4232
commit
5cf54c6f29
@ -1,4 +1,4 @@
|
||||
# Sphinx build info version 1
|
||||
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done.
|
||||
config: dbeabcb4b13705612193fe8e75e2231c
|
||||
config: 4e78ac5a44f14c8d1dd639d792f1c73e
|
||||
tags: 645f666f9bcd5a90fca523b33c5a78b7
|
||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -8,7 +8,7 @@
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<title>composer.cli — Lorax 29.14 documentation</title>
|
||||
<title>composer.cli — Lorax 29.20 documentation</title>
|
||||
|
||||
|
||||
|
||||
@ -57,7 +57,7 @@
|
||||
|
||||
|
||||
<div class="version">
|
||||
29.14
|
||||
29.20
|
||||
</div>
|
||||
|
||||
|
||||
@ -243,7 +243,7 @@
|
||||
<script type="text/javascript">
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT:'../../',
|
||||
VERSION:'29.14',
|
||||
VERSION:'29.20',
|
||||
LANGUAGE:'None',
|
||||
COLLAPSE_INDEX:false,
|
||||
FILE_SUFFIX:'.html',
|
||||
|
@ -8,7 +8,7 @@
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<title>composer.cli.blueprints — Lorax 29.14 documentation</title>
|
||||
<title>composer.cli.blueprints — Lorax 29.20 documentation</title>
|
||||
|
||||
|
||||
|
||||
@ -57,7 +57,7 @@
|
||||
|
||||
|
||||
<div class="version">
|
||||
29.14
|
||||
29.20
|
||||
</div>
|
||||
|
||||
|
||||
@ -700,7 +700,7 @@
|
||||
<script type="text/javascript">
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT:'../../../',
|
||||
VERSION:'29.14',
|
||||
VERSION:'29.20',
|
||||
LANGUAGE:'None',
|
||||
COLLAPSE_INDEX:false,
|
||||
FILE_SUFFIX:'.html',
|
||||
|
@ -8,7 +8,7 @@
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<title>composer.cli.cmdline — Lorax 29.14 documentation</title>
|
||||
<title>composer.cli.cmdline — Lorax 29.20 documentation</title>
|
||||
|
||||
|
||||
|
||||
@ -57,7 +57,7 @@
|
||||
|
||||
|
||||
<div class="version">
|
||||
29.14
|
||||
29.20
|
||||
</div>
|
||||
|
||||
|
||||
@ -239,7 +239,7 @@
|
||||
<script type="text/javascript">
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT:'../../../',
|
||||
VERSION:'29.14',
|
||||
VERSION:'29.20',
|
||||
LANGUAGE:'None',
|
||||
COLLAPSE_INDEX:false,
|
||||
FILE_SUFFIX:'.html',
|
||||
|
@ -8,7 +8,7 @@
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<title>composer.cli.compose — Lorax 29.14 documentation</title>
|
||||
<title>composer.cli.compose — Lorax 29.20 documentation</title>
|
||||
|
||||
|
||||
|
||||
@ -57,7 +57,7 @@
|
||||
|
||||
|
||||
<div class="version">
|
||||
29.14
|
||||
29.20
|
||||
</div>
|
||||
|
||||
|
||||
@ -703,7 +703,7 @@
|
||||
<script type="text/javascript">
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT:'../../../',
|
||||
VERSION:'29.14',
|
||||
VERSION:'29.20',
|
||||
LANGUAGE:'None',
|
||||
COLLAPSE_INDEX:false,
|
||||
FILE_SUFFIX:'.html',
|
||||
|
@ -8,7 +8,7 @@
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<title>composer.cli.modules — Lorax 29.14 documentation</title>
|
||||
<title>composer.cli.modules — Lorax 29.20 documentation</title>
|
||||
|
||||
|
||||
|
||||
@ -57,7 +57,7 @@
|
||||
|
||||
|
||||
<div class="version">
|
||||
29.14
|
||||
29.20
|
||||
</div>
|
||||
|
||||
|
||||
@ -237,7 +237,7 @@
|
||||
<script type="text/javascript">
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT:'../../../',
|
||||
VERSION:'29.14',
|
||||
VERSION:'29.20',
|
||||
LANGUAGE:'None',
|
||||
COLLAPSE_INDEX:false,
|
||||
FILE_SUFFIX:'.html',
|
||||
|
@ -8,7 +8,7 @@
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<title>composer.cli.projects — Lorax 29.14 documentation</title>
|
||||
<title>composer.cli.projects — Lorax 29.20 documentation</title>
|
||||
|
||||
|
||||
|
||||
@ -57,7 +57,7 @@
|
||||
|
||||
|
||||
<div class="version">
|
||||
29.14
|
||||
29.20
|
||||
</div>
|
||||
|
||||
|
||||
@ -299,7 +299,7 @@
|
||||
<script type="text/javascript">
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT:'../../../',
|
||||
VERSION:'29.14',
|
||||
VERSION:'29.20',
|
||||
LANGUAGE:'None',
|
||||
COLLAPSE_INDEX:false,
|
||||
FILE_SUFFIX:'.html',
|
||||
|
@ -8,7 +8,7 @@
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<title>composer.cli.sources — Lorax 29.14 documentation</title>
|
||||
<title>composer.cli.sources — Lorax 29.20 documentation</title>
|
||||
|
||||
|
||||
|
||||
@ -57,7 +57,7 @@
|
||||
|
||||
|
||||
<div class="version">
|
||||
29.14
|
||||
29.20
|
||||
</div>
|
||||
|
||||
|
||||
@ -341,7 +341,7 @@
|
||||
<script type="text/javascript">
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT:'../../../',
|
||||
VERSION:'29.14',
|
||||
VERSION:'29.20',
|
||||
LANGUAGE:'None',
|
||||
COLLAPSE_INDEX:false,
|
||||
FILE_SUFFIX:'.html',
|
||||
|
@ -8,7 +8,7 @@
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<title>composer.cli.status — Lorax 29.14 documentation</title>
|
||||
<title>composer.cli.status — Lorax 29.20 documentation</title>
|
||||
|
||||
|
||||
|
||||
@ -57,7 +57,7 @@
|
||||
|
||||
|
||||
<div class="version">
|
||||
29.14
|
||||
29.20
|
||||
</div>
|
||||
|
||||
|
||||
@ -245,7 +245,7 @@
|
||||
<script type="text/javascript">
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT:'../../../',
|
||||
VERSION:'29.14',
|
||||
VERSION:'29.20',
|
||||
LANGUAGE:'None',
|
||||
COLLAPSE_INDEX:false,
|
||||
FILE_SUFFIX:'.html',
|
||||
|
@ -8,7 +8,7 @@
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<title>composer.cli.utilities — Lorax 29.14 documentation</title>
|
||||
<title>composer.cli.utilities — Lorax 29.20 documentation</title>
|
||||
|
||||
|
||||
|
||||
@ -57,7 +57,7 @@
|
||||
|
||||
|
||||
<div class="version">
|
||||
29.14
|
||||
29.20
|
||||
</div>
|
||||
|
||||
|
||||
@ -284,7 +284,7 @@
|
||||
<script type="text/javascript">
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT:'../../../',
|
||||
VERSION:'29.14',
|
||||
VERSION:'29.20',
|
||||
LANGUAGE:'None',
|
||||
COLLAPSE_INDEX:false,
|
||||
FILE_SUFFIX:'.html',
|
||||
|
@ -8,7 +8,7 @@
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<title>composer.http_client — Lorax 29.14 documentation</title>
|
||||
<title>composer.http_client — Lorax 29.20 documentation</title>
|
||||
|
||||
|
||||
|
||||
@ -57,7 +57,7 @@
|
||||
|
||||
|
||||
<div class="version">
|
||||
29.14
|
||||
29.20
|
||||
</div>
|
||||
|
||||
|
||||
@ -447,7 +447,7 @@
|
||||
<script type="text/javascript">
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT:'../../',
|
||||
VERSION:'29.14',
|
||||
VERSION:'29.20',
|
||||
LANGUAGE:'None',
|
||||
COLLAPSE_INDEX:false,
|
||||
FILE_SUFFIX:'.html',
|
||||
|
@ -8,7 +8,7 @@
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<title>composer.unix_socket — Lorax 29.14 documentation</title>
|
||||
<title>composer.unix_socket — Lorax 29.20 documentation</title>
|
||||
|
||||
|
||||
|
||||
@ -57,7 +57,7 @@
|
||||
|
||||
|
||||
<div class="version">
|
||||
29.14
|
||||
29.20
|
||||
</div>
|
||||
|
||||
|
||||
@ -248,7 +248,7 @@
|
||||
<script type="text/javascript">
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT:'../../',
|
||||
VERSION:'29.14',
|
||||
VERSION:'29.20',
|
||||
LANGUAGE:'None',
|
||||
COLLAPSE_INDEX:false,
|
||||
FILE_SUFFIX:'.html',
|
||||
|
@ -8,7 +8,7 @@
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<title>Overview: module code — Lorax 29.14 documentation</title>
|
||||
<title>Overview: module code — Lorax 29.20 documentation</title>
|
||||
|
||||
|
||||
|
||||
@ -57,7 +57,7 @@
|
||||
|
||||
|
||||
<div class="version">
|
||||
29.14
|
||||
29.20
|
||||
</div>
|
||||
|
||||
|
||||
@ -182,6 +182,7 @@
|
||||
<li><a href="pylorax/creator.html">pylorax.creator</a></li>
|
||||
<li><a href="pylorax/decorators.html">pylorax.decorators</a></li>
|
||||
<li><a href="pylorax/discinfo.html">pylorax.discinfo</a></li>
|
||||
<li><a href="pylorax/dnfbase.html">pylorax.dnfbase</a></li>
|
||||
<li><a href="pylorax/dnfhelper.html">pylorax.dnfhelper</a></li>
|
||||
<li><a href="pylorax/executils.html">pylorax.executils</a></li>
|
||||
<li><a href="pylorax/imgutils.html">pylorax.imgutils</a></li>
|
||||
@ -226,7 +227,7 @@
|
||||
<script type="text/javascript">
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT:'../',
|
||||
VERSION:'29.14',
|
||||
VERSION:'29.20',
|
||||
LANGUAGE:'None',
|
||||
COLLAPSE_INDEX:false,
|
||||
FILE_SUFFIX:'.html',
|
||||
|
@ -8,7 +8,7 @@
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<title>pylorax — Lorax 29.14 documentation</title>
|
||||
<title>pylorax — Lorax 29.20 documentation</title>
|
||||
|
||||
|
||||
|
||||
@ -57,7 +57,7 @@
|
||||
|
||||
|
||||
<div class="version">
|
||||
29.14
|
||||
29.20
|
||||
</div>
|
||||
|
||||
|
||||
@ -220,7 +220,7 @@
|
||||
<span class="n">REMOVE_PPC64_MODULES</span> <span class="o">=</span> <span class="s2">"drm plymouth"</span>
|
||||
|
||||
<span class="c1"># Used for DNF conf.module_platform_id</span>
|
||||
<span class="n">DEFAULT_PLATFORM_ID</span> <span class="o">=</span> <span class="s2">"platform:f30"</span>
|
||||
<span class="n">DEFAULT_PLATFORM_ID</span> <span class="o">=</span> <span class="s2">"platform:f29"</span>
|
||||
|
||||
<div class="viewcode-block" id="ArchData"><a class="viewcode-back" href="../pylorax.html#pylorax.ArchData">[docs]</a><span class="k">class</span> <span class="nc">ArchData</span><span class="p">(</span><span class="n">DataHolder</span><span class="p">):</span>
|
||||
<span class="n">lib64_arches</span> <span class="o">=</span> <span class="p">(</span><span class="s2">"x86_64"</span><span class="p">,</span> <span class="s2">"ppc64"</span><span class="p">,</span> <span class="s2">"ppc64le"</span><span class="p">,</span> <span class="s2">"s390x"</span><span class="p">,</span> <span class="s2">"ia64"</span><span class="p">,</span> <span class="s2">"aarch64"</span><span class="p">)</span>
|
||||
@ -645,7 +645,7 @@
|
||||
<script type="text/javascript">
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT:'../',
|
||||
VERSION:'29.14',
|
||||
VERSION:'29.20',
|
||||
LANGUAGE:'None',
|
||||
COLLAPSE_INDEX:false,
|
||||
FILE_SUFFIX:'.html',
|
||||
|
@ -8,7 +8,7 @@
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<title>pylorax.api.checkparams — Lorax 29.14 documentation</title>
|
||||
<title>pylorax.api.checkparams — Lorax 29.20 documentation</title>
|
||||
|
||||
|
||||
|
||||
@ -57,7 +57,7 @@
|
||||
|
||||
|
||||
<div class="version">
|
||||
29.14
|
||||
29.20
|
||||
</div>
|
||||
|
||||
|
||||
@ -233,7 +233,7 @@
|
||||
<script type="text/javascript">
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT:'../../../',
|
||||
VERSION:'29.14',
|
||||
VERSION:'29.20',
|
||||
LANGUAGE:'None',
|
||||
COLLAPSE_INDEX:false,
|
||||
FILE_SUFFIX:'.html',
|
||||
|
@ -8,7 +8,7 @@
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<title>pylorax.api.cmdline — Lorax 29.14 documentation</title>
|
||||
<title>pylorax.api.cmdline — Lorax 29.20 documentation</title>
|
||||
|
||||
|
||||
|
||||
@ -57,7 +57,7 @@
|
||||
|
||||
|
||||
<div class="version">
|
||||
29.14
|
||||
29.20
|
||||
</div>
|
||||
|
||||
|
||||
@ -247,7 +247,7 @@
|
||||
<script type="text/javascript">
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT:'../../../',
|
||||
VERSION:'29.14',
|
||||
VERSION:'29.20',
|
||||
LANGUAGE:'None',
|
||||
COLLAPSE_INDEX:false,
|
||||
FILE_SUFFIX:'.html',
|
||||
|
@ -8,7 +8,7 @@
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<title>pylorax.api.compose — Lorax 29.14 documentation</title>
|
||||
<title>pylorax.api.compose — Lorax 29.20 documentation</title>
|
||||
|
||||
|
||||
|
||||
@ -57,7 +57,7 @@
|
||||
|
||||
|
||||
<div class="version">
|
||||
29.14
|
||||
29.20
|
||||
</div>
|
||||
|
||||
|
||||
@ -270,6 +270,40 @@
|
||||
<span class="k">return</span> <span class="n">cmd</span></div>
|
||||
|
||||
|
||||
<div class="viewcode-block" id="write_ks_root"><a class="viewcode-back" href="../../../pylorax.api.html#pylorax.api.compose.write_ks_root">[docs]</a><span class="k">def</span> <span class="nf">write_ks_root</span><span class="p">(</span><span class="n">f</span><span class="p">,</span> <span class="n">user</span><span class="p">):</span>
|
||||
<span class="sd">""" Write kickstart root password and sshkey entry</span>
|
||||
|
||||
<span class="sd"> :param f: kickstart file object</span>
|
||||
<span class="sd"> :type f: open file object</span>
|
||||
<span class="sd"> :param user: A blueprint user dictionary</span>
|
||||
<span class="sd"> :type user: dict</span>
|
||||
<span class="sd"> :returns: True if it wrote a rootpw command to the kickstart</span>
|
||||
<span class="sd"> :rtype: bool</span>
|
||||
|
||||
<span class="sd"> If the entry contains a ssh key, use sshkey to write it</span>
|
||||
<span class="sd"> If it contains password, use rootpw to set it</span>
|
||||
|
||||
<span class="sd"> root cannot be used with the user command. So only key and password are supported</span>
|
||||
<span class="sd"> for root.</span>
|
||||
<span class="sd"> """</span>
|
||||
<span class="n">wrote_rootpw</span> <span class="o">=</span> <span class="kc">False</span>
|
||||
|
||||
<span class="c1"># ssh key uses the sshkey kickstart command</span>
|
||||
<span class="k">if</span> <span class="s2">"key"</span> <span class="ow">in</span> <span class="n">user</span><span class="p">:</span>
|
||||
<span class="n">f</span><span class="o">.</span><span class="n">write</span><span class="p">(</span><span class="s1">'sshkey --user </span><span class="si">%s</span><span class="s1"> "</span><span class="si">%s</span><span class="s1">"</span><span class="se">\n</span><span class="s1">'</span> <span class="o">%</span> <span class="p">(</span><span class="n">user</span><span class="p">[</span><span class="s2">"name"</span><span class="p">],</span> <span class="n">user</span><span class="p">[</span><span class="s2">"key"</span><span class="p">]))</span>
|
||||
|
||||
<span class="k">if</span> <span class="s2">"password"</span> <span class="ow">in</span> <span class="n">user</span><span class="p">:</span>
|
||||
<span class="k">if</span> <span class="nb">any</span><span class="p">(</span><span class="n">user</span><span class="p">[</span><span class="s2">"password"</span><span class="p">]</span><span class="o">.</span><span class="n">startswith</span><span class="p">(</span><span class="n">prefix</span><span class="p">)</span> <span class="k">for</span> <span class="n">prefix</span> <span class="ow">in</span> <span class="p">[</span><span class="s2">"$2b$"</span><span class="p">,</span> <span class="s2">"$6$"</span><span class="p">,</span> <span class="s2">"$5$"</span><span class="p">]):</span>
|
||||
<span class="n">log</span><span class="o">.</span><span class="n">debug</span><span class="p">(</span><span class="s2">"Detected pre-crypted password"</span><span class="p">)</span>
|
||||
<span class="n">f</span><span class="o">.</span><span class="n">write</span><span class="p">(</span><span class="s1">'rootpw --iscrypted "</span><span class="si">%s</span><span class="s1">"</span><span class="se">\n</span><span class="s1">'</span> <span class="o">%</span> <span class="n">user</span><span class="p">[</span><span class="s2">"password"</span><span class="p">])</span>
|
||||
<span class="n">wrote_rootpw</span> <span class="o">=</span> <span class="kc">True</span>
|
||||
<span class="k">else</span><span class="p">:</span>
|
||||
<span class="n">log</span><span class="o">.</span><span class="n">debug</span><span class="p">(</span><span class="s2">"Detected plaintext password"</span><span class="p">)</span>
|
||||
<span class="n">f</span><span class="o">.</span><span class="n">write</span><span class="p">(</span><span class="s1">'rootpw --plaintext "</span><span class="si">%s</span><span class="s1">"</span><span class="se">\n</span><span class="s1">'</span> <span class="o">%</span> <span class="n">user</span><span class="p">[</span><span class="s2">"password"</span><span class="p">])</span>
|
||||
<span class="n">wrote_rootpw</span> <span class="o">=</span> <span class="kc">True</span>
|
||||
|
||||
<span class="k">return</span> <span class="n">wrote_rootpw</span></div>
|
||||
|
||||
<div class="viewcode-block" id="write_ks_user"><a class="viewcode-back" href="../../../pylorax.api.html#pylorax.api.compose.write_ks_user">[docs]</a><span class="k">def</span> <span class="nf">write_ks_user</span><span class="p">(</span><span class="n">f</span><span class="p">,</span> <span class="n">user</span><span class="p">):</span>
|
||||
<span class="sd">""" Write kickstart user and sshkey entry</span>
|
||||
|
||||
@ -282,9 +316,6 @@
|
||||
<span class="sd"> All of the user fields are optional, except name, write out a kickstart user entry</span>
|
||||
<span class="sd"> with whatever options are relevant.</span>
|
||||
<span class="sd"> """</span>
|
||||
<span class="k">if</span> <span class="s2">"name"</span> <span class="ow">not</span> <span class="ow">in</span> <span class="n">user</span><span class="p">:</span>
|
||||
<span class="k">raise</span> <span class="ne">RuntimeError</span><span class="p">(</span><span class="s2">"user entry requires a name"</span><span class="p">)</span>
|
||||
|
||||
<span class="c1"># ssh key uses the sshkey kickstart command</span>
|
||||
<span class="k">if</span> <span class="s2">"key"</span> <span class="ow">in</span> <span class="n">user</span><span class="p">:</span>
|
||||
<span class="n">f</span><span class="o">.</span><span class="n">write</span><span class="p">(</span><span class="s1">'sshkey --user </span><span class="si">%s</span><span class="s1"> "</span><span class="si">%s</span><span class="s1">"</span><span class="se">\n</span><span class="s1">'</span> <span class="o">%</span> <span class="p">(</span><span class="n">user</span><span class="p">[</span><span class="s2">"name"</span><span class="p">],</span> <span class="n">user</span><span class="p">[</span><span class="s2">"key"</span><span class="p">]))</span>
|
||||
@ -353,6 +384,7 @@
|
||||
<span class="sd"> :raises: RuntimeError if there was a problem writing to the kickstart</span>
|
||||
<span class="sd"> """</span>
|
||||
<span class="k">if</span> <span class="s2">"customizations"</span> <span class="ow">not</span> <span class="ow">in</span> <span class="n">recipe</span><span class="p">:</span>
|
||||
<span class="n">f</span><span class="o">.</span><span class="n">write</span><span class="p">(</span><span class="s1">'rootpw --lock</span><span class="se">\n</span><span class="s1">'</span><span class="p">)</span>
|
||||
<span class="k">return</span>
|
||||
<span class="n">customizations</span> <span class="o">=</span> <span class="n">recipe</span><span class="p">[</span><span class="s2">"customizations"</span><span class="p">]</span>
|
||||
|
||||
@ -370,9 +402,19 @@
|
||||
|
||||
<span class="c1"># Creating a user also creates a group. Make a list of the names for later</span>
|
||||
<span class="n">user_groups</span> <span class="o">=</span> <span class="p">[]</span>
|
||||
<span class="c1"># kickstart requires a rootpw line</span>
|
||||
<span class="n">wrote_rootpw</span> <span class="o">=</span> <span class="kc">False</span>
|
||||
<span class="k">if</span> <span class="s2">"user"</span> <span class="ow">in</span> <span class="n">customizations</span><span class="p">:</span>
|
||||
<span class="c1"># only name is required, everything else is optional</span>
|
||||
<span class="k">for</span> <span class="n">user</span> <span class="ow">in</span> <span class="n">customizations</span><span class="p">[</span><span class="s2">"user"</span><span class="p">]:</span>
|
||||
<span class="k">if</span> <span class="s2">"name"</span> <span class="ow">not</span> <span class="ow">in</span> <span class="n">user</span><span class="p">:</span>
|
||||
<span class="k">raise</span> <span class="ne">RuntimeError</span><span class="p">(</span><span class="s2">"user entry requires a name"</span><span class="p">)</span>
|
||||
|
||||
<span class="c1"># root is special, cannot use normal user command for it</span>
|
||||
<span class="k">if</span> <span class="n">user</span><span class="p">[</span><span class="s2">"name"</span><span class="p">]</span> <span class="o">==</span> <span class="s2">"root"</span><span class="p">:</span>
|
||||
<span class="n">wrote_rootpw</span> <span class="o">=</span> <span class="n">write_ks_root</span><span class="p">(</span><span class="n">f</span><span class="p">,</span> <span class="n">user</span><span class="p">)</span>
|
||||
<span class="k">continue</span>
|
||||
|
||||
<span class="n">write_ks_user</span><span class="p">(</span><span class="n">f</span><span class="p">,</span> <span class="n">user</span><span class="p">)</span>
|
||||
<span class="n">user_groups</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">user</span><span class="p">[</span><span class="s2">"name"</span><span class="p">])</span>
|
||||
|
||||
@ -381,7 +423,11 @@
|
||||
<span class="k">if</span> <span class="n">group</span><span class="p">[</span><span class="s2">"name"</span><span class="p">]</span> <span class="ow">not</span> <span class="ow">in</span> <span class="n">user_groups</span><span class="p">:</span>
|
||||
<span class="n">write_ks_group</span><span class="p">(</span><span class="n">f</span><span class="p">,</span> <span class="n">group</span><span class="p">)</span>
|
||||
<span class="k">else</span><span class="p">:</span>
|
||||
<span class="n">log</span><span class="o">.</span><span class="n">warning</span><span class="p">(</span><span class="s2">"Skipping group </span><span class="si">%s</span><span class="s2">, already created by user"</span><span class="p">,</span> <span class="n">group</span><span class="p">[</span><span class="s2">"name"</span><span class="p">])</span></div>
|
||||
<span class="n">log</span><span class="o">.</span><span class="n">warning</span><span class="p">(</span><span class="s2">"Skipping group </span><span class="si">%s</span><span class="s2">, already created by user"</span><span class="p">,</span> <span class="n">group</span><span class="p">[</span><span class="s2">"name"</span><span class="p">])</span>
|
||||
|
||||
<span class="c1"># Lock the root account if no root user password has been specified</span>
|
||||
<span class="k">if</span> <span class="ow">not</span> <span class="n">wrote_rootpw</span><span class="p">:</span>
|
||||
<span class="n">f</span><span class="o">.</span><span class="n">write</span><span class="p">(</span><span class="s1">'rootpw --lock</span><span class="se">\n</span><span class="s1">'</span><span class="p">)</span></div>
|
||||
|
||||
<div class="viewcode-block" id="start_build"><a class="viewcode-back" href="../../../pylorax.api.html#pylorax.api.compose.start_build">[docs]</a><span class="k">def</span> <span class="nf">start_build</span><span class="p">(</span><span class="n">cfg</span><span class="p">,</span> <span class="n">dnflock</span><span class="p">,</span> <span class="n">gitlock</span><span class="p">,</span> <span class="n">branch</span><span class="p">,</span> <span class="n">recipe_name</span><span class="p">,</span> <span class="n">compose_type</span><span class="p">,</span> <span class="n">test_mode</span><span class="o">=</span><span class="mi">0</span><span class="p">):</span>
|
||||
<span class="sd">""" Start the build</span>
|
||||
@ -414,7 +460,8 @@
|
||||
<span class="n">projects</span> <span class="o">=</span> <span class="nb">sorted</span><span class="p">(</span><span class="nb">set</span><span class="p">(</span><span class="n">module_nver</span><span class="o">+</span><span class="n">package_nver</span><span class="p">),</span> <span class="n">key</span><span class="o">=</span><span class="k">lambda</span> <span class="n">p</span><span class="p">:</span> <span class="n">p</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span><span class="o">.</span><span class="n">lower</span><span class="p">())</span>
|
||||
<span class="n">deps</span> <span class="o">=</span> <span class="p">[]</span>
|
||||
<span class="k">try</span><span class="p">:</span>
|
||||
<span class="k">with</span> <span class="n">dnflock</span><span class="o">.</span><span class="n">lock</span><span class="p">:</span>
|
||||
<span class="c1"># This can possibly update repodata and reset the YumBase object.</span>
|
||||
<span class="k">with</span> <span class="n">dnflock</span><span class="o">.</span><span class="n">lock_check</span><span class="p">:</span>
|
||||
<span class="p">(</span><span class="n">installed_size</span><span class="p">,</span> <span class="n">deps</span><span class="p">)</span> <span class="o">=</span> <span class="n">projects_depsolve_with_size</span><span class="p">(</span><span class="n">dnflock</span><span class="o">.</span><span class="n">dbo</span><span class="p">,</span> <span class="n">projects</span><span class="p">,</span> <span class="n">recipe</span><span class="o">.</span><span class="n">group_names</span><span class="p">,</span> <span class="n">with_core</span><span class="o">=</span><span class="kc">False</span><span class="p">)</span>
|
||||
<span class="k">except</span> <span class="n">ProjectsError</span> <span class="k">as</span> <span class="n">e</span><span class="p">:</span>
|
||||
<span class="n">log</span><span class="o">.</span><span class="n">error</span><span class="p">(</span><span class="s2">"start_build depsolve: </span><span class="si">%s</span><span class="s2">"</span><span class="p">,</span> <span class="nb">str</span><span class="p">(</span><span class="n">e</span><span class="p">))</span>
|
||||
@ -494,7 +541,7 @@
|
||||
<span class="n">f</span><span class="o">.</span><span class="n">write</span><span class="p">(</span><span class="s1">'clearpart --all --initlabel</span><span class="se">\n</span><span class="s1">'</span><span class="p">)</span>
|
||||
|
||||
<span class="c1"># Write the root partition and it's size in MB (rounded up)</span>
|
||||
<span class="n">f</span><span class="o">.</span><span class="n">write</span><span class="p">(</span><span class="s1">'part / --fstype="ext4" --size=</span><span class="si">%d</span><span class="se">\n</span><span class="s1">'</span> <span class="o">%</span> <span class="n">ceil</span><span class="p">(</span><span class="n">installed_size</span> <span class="o">/</span> <span class="mi">1024</span><span class="o">**</span><span class="mi">2</span><span class="p">))</span>
|
||||
<span class="n">f</span><span class="o">.</span><span class="n">write</span><span class="p">(</span><span class="s1">'part / --size=</span><span class="si">%d</span><span class="se">\n</span><span class="s1">'</span> <span class="o">%</span> <span class="n">ceil</span><span class="p">(</span><span class="n">installed_size</span> <span class="o">/</span> <span class="mi">1024</span><span class="o">**</span><span class="mi">2</span><span class="p">))</span>
|
||||
|
||||
<span class="n">f</span><span class="o">.</span><span class="n">write</span><span class="p">(</span><span class="n">ks_template</span><span class="p">)</span>
|
||||
|
||||
@ -672,6 +719,94 @@
|
||||
<span class="s2">"app_template"</span><span class="p">:</span> <span class="kc">None</span><span class="p">,</span>
|
||||
<span class="s2">"app_file"</span><span class="p">:</span> <span class="kc">None</span><span class="p">,</span>
|
||||
<span class="p">},</span>
|
||||
<span class="s2">"ami"</span><span class="p">:</span> <span class="p">{</span><span class="s2">"make_iso"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span>
|
||||
<span class="s2">"make_disk"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span>
|
||||
<span class="s2">"make_fsimage"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span>
|
||||
<span class="s2">"make_appliance"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span>
|
||||
<span class="s2">"make_ami"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span>
|
||||
<span class="s2">"make_tar"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span>
|
||||
<span class="s2">"make_pxe_live"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span>
|
||||
<span class="s2">"make_ostree_live"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span>
|
||||
<span class="s2">"make_oci"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span>
|
||||
<span class="s2">"make_vagrant"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span>
|
||||
<span class="s2">"ostree"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span>
|
||||
<span class="s2">"live_rootfs_keep_size"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span>
|
||||
<span class="s2">"live_rootfs_size"</span><span class="p">:</span> <span class="mi">0</span><span class="p">,</span>
|
||||
<span class="s2">"image_type"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span>
|
||||
<span class="s2">"qemu_args"</span><span class="p">:</span> <span class="p">[],</span>
|
||||
<span class="s2">"image_name"</span><span class="p">:</span> <span class="s2">"disk.ami"</span><span class="p">,</span>
|
||||
<span class="s2">"fs_label"</span><span class="p">:</span> <span class="s2">""</span><span class="p">,</span>
|
||||
<span class="s2">"image_only"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span>
|
||||
<span class="s2">"app_name"</span><span class="p">:</span> <span class="kc">None</span><span class="p">,</span>
|
||||
<span class="s2">"app_template"</span><span class="p">:</span> <span class="kc">None</span><span class="p">,</span>
|
||||
<span class="s2">"app_file"</span><span class="p">:</span> <span class="kc">None</span><span class="p">,</span>
|
||||
<span class="p">},</span>
|
||||
<span class="s2">"vhd"</span><span class="p">:</span> <span class="p">{</span><span class="s2">"make_iso"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span>
|
||||
<span class="s2">"make_disk"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span>
|
||||
<span class="s2">"make_fsimage"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span>
|
||||
<span class="s2">"make_appliance"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span>
|
||||
<span class="s2">"make_ami"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span>
|
||||
<span class="s2">"make_tar"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span>
|
||||
<span class="s2">"make_pxe_live"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span>
|
||||
<span class="s2">"make_ostree_live"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span>
|
||||
<span class="s2">"make_oci"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span>
|
||||
<span class="s2">"make_vagrant"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span>
|
||||
<span class="s2">"ostree"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span>
|
||||
<span class="s2">"live_rootfs_keep_size"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span>
|
||||
<span class="s2">"live_rootfs_size"</span><span class="p">:</span> <span class="mi">0</span><span class="p">,</span>
|
||||
<span class="s2">"image_type"</span><span class="p">:</span> <span class="s2">"vpc"</span><span class="p">,</span>
|
||||
<span class="s2">"qemu_args"</span><span class="p">:</span> <span class="p">[</span><span class="s2">"-o"</span><span class="p">,</span> <span class="s2">"subformat=fixed,force_size"</span><span class="p">],</span>
|
||||
<span class="s2">"image_name"</span><span class="p">:</span> <span class="s2">"disk.vhd"</span><span class="p">,</span>
|
||||
<span class="s2">"fs_label"</span><span class="p">:</span> <span class="s2">""</span><span class="p">,</span>
|
||||
<span class="s2">"image_only"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span>
|
||||
<span class="s2">"app_name"</span><span class="p">:</span> <span class="kc">None</span><span class="p">,</span>
|
||||
<span class="s2">"app_template"</span><span class="p">:</span> <span class="kc">None</span><span class="p">,</span>
|
||||
<span class="s2">"app_file"</span><span class="p">:</span> <span class="kc">None</span><span class="p">,</span>
|
||||
<span class="p">},</span>
|
||||
<span class="s2">"vmdk"</span><span class="p">:</span> <span class="p">{</span><span class="s2">"make_iso"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span>
|
||||
<span class="s2">"make_disk"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span>
|
||||
<span class="s2">"make_fsimage"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span>
|
||||
<span class="s2">"make_appliance"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span>
|
||||
<span class="s2">"make_ami"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span>
|
||||
<span class="s2">"make_tar"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span>
|
||||
<span class="s2">"make_pxe_live"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span>
|
||||
<span class="s2">"make_ostree_live"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span>
|
||||
<span class="s2">"make_oci"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span>
|
||||
<span class="s2">"make_vagrant"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span>
|
||||
<span class="s2">"ostree"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span>
|
||||
<span class="s2">"live_rootfs_keep_size"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span>
|
||||
<span class="s2">"live_rootfs_size"</span><span class="p">:</span> <span class="mi">0</span><span class="p">,</span>
|
||||
<span class="s2">"image_type"</span><span class="p">:</span> <span class="s2">"vmdk"</span><span class="p">,</span>
|
||||
<span class="s2">"qemu_args"</span><span class="p">:</span> <span class="p">[],</span>
|
||||
<span class="s2">"image_name"</span><span class="p">:</span> <span class="s2">"disk.vmdk"</span><span class="p">,</span>
|
||||
<span class="s2">"fs_label"</span><span class="p">:</span> <span class="s2">""</span><span class="p">,</span>
|
||||
<span class="s2">"image_only"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span>
|
||||
<span class="s2">"app_name"</span><span class="p">:</span> <span class="kc">None</span><span class="p">,</span>
|
||||
<span class="s2">"app_template"</span><span class="p">:</span> <span class="kc">None</span><span class="p">,</span>
|
||||
<span class="s2">"app_file"</span><span class="p">:</span> <span class="kc">None</span><span class="p">,</span>
|
||||
<span class="p">},</span>
|
||||
<span class="s2">"openstack"</span><span class="p">:</span> <span class="p">{</span><span class="s2">"make_iso"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span>
|
||||
<span class="s2">"make_disk"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span>
|
||||
<span class="s2">"make_fsimage"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span>
|
||||
<span class="s2">"make_appliance"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span>
|
||||
<span class="s2">"make_ami"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span>
|
||||
<span class="s2">"make_tar"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span>
|
||||
<span class="s2">"make_pxe_live"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span>
|
||||
<span class="s2">"make_ostree_live"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span>
|
||||
<span class="s2">"make_oci"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span>
|
||||
<span class="s2">"make_vagrant"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span>
|
||||
<span class="s2">"ostree"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span>
|
||||
<span class="s2">"live_rootfs_keep_size"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span>
|
||||
<span class="s2">"live_rootfs_size"</span><span class="p">:</span> <span class="mi">0</span><span class="p">,</span>
|
||||
<span class="s2">"image_type"</span><span class="p">:</span> <span class="s2">"qcow2"</span><span class="p">,</span>
|
||||
<span class="s2">"qemu_args"</span><span class="p">:</span> <span class="p">[],</span>
|
||||
<span class="s2">"image_name"</span><span class="p">:</span> <span class="s2">"disk.qcow2"</span><span class="p">,</span>
|
||||
<span class="s2">"fs_label"</span><span class="p">:</span> <span class="s2">""</span><span class="p">,</span>
|
||||
<span class="s2">"image_only"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span>
|
||||
<span class="s2">"app_name"</span><span class="p">:</span> <span class="kc">None</span><span class="p">,</span>
|
||||
<span class="s2">"app_template"</span><span class="p">:</span> <span class="kc">None</span><span class="p">,</span>
|
||||
<span class="s2">"app_file"</span><span class="p">:</span> <span class="kc">None</span><span class="p">,</span>
|
||||
<span class="p">},</span>
|
||||
<span class="p">}</span>
|
||||
<span class="k">return</span> <span class="n">_MAP</span><span class="p">[</span><span class="n">compose_type</span><span class="p">]</span></div>
|
||||
|
||||
@ -731,7 +866,7 @@
|
||||
<script type="text/javascript">
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT:'../../../',
|
||||
VERSION:'29.14',
|
||||
VERSION:'29.20',
|
||||
LANGUAGE:'None',
|
||||
COLLAPSE_INDEX:false,
|
||||
FILE_SUFFIX:'.html',
|
||||
|
@ -8,7 +8,7 @@
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<title>pylorax.api.config — Lorax 29.14 documentation</title>
|
||||
<title>pylorax.api.config — Lorax 29.20 documentation</title>
|
||||
|
||||
|
||||
|
||||
@ -57,7 +57,7 @@
|
||||
|
||||
|
||||
<div class="version">
|
||||
29.14
|
||||
29.20
|
||||
</div>
|
||||
|
||||
|
||||
@ -174,10 +174,11 @@
|
||||
<span class="kn">import</span> <span class="nn">configparser</span>
|
||||
<span class="kn">import</span> <span class="nn">grp</span>
|
||||
<span class="kn">import</span> <span class="nn">os</span>
|
||||
<span class="kn">import</span> <span class="nn">pwd</span>
|
||||
|
||||
<span class="kn">from</span> <span class="nn">pylorax.sysutils</span> <span class="k">import</span> <span class="n">joinpaths</span>
|
||||
|
||||
<div class="viewcode-block" id="ComposerConfig"><a class="viewcode-back" href="../../../pylorax.api.html#pylorax.api.config.ComposerConfig">[docs]</a><span class="k">class</span> <span class="nc">ComposerConfig</span><span class="p">(</span><span class="n">configparser</span><span class="o">.</span><span class="n">SafeConfigParser</span><span class="p">):</span>
|
||||
<div class="viewcode-block" id="ComposerConfig"><a class="viewcode-back" href="../../../pylorax.api.html#pylorax.api.config.ComposerConfig">[docs]</a><span class="k">class</span> <span class="nc">ComposerConfig</span><span class="p">(</span><span class="n">configparser</span><span class="o">.</span><span class="n">ConfigParser</span><span class="p">):</span>
|
||||
<div class="viewcode-block" id="ComposerConfig.get_default"><a class="viewcode-back" href="../../../pylorax.api.html#pylorax.api.config.ComposerConfig.get_default">[docs]</a> <span class="k">def</span> <span class="nf">get_default</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">section</span><span class="p">,</span> <span class="n">option</span><span class="p">,</span> <span class="n">default</span><span class="p">):</span>
|
||||
<span class="k">try</span><span class="p">:</span>
|
||||
<span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="n">section</span><span class="p">,</span> <span class="n">option</span><span class="p">)</span>
|
||||
@ -224,20 +225,57 @@
|
||||
|
||||
<span class="k">return</span> <span class="n">conf</span></div>
|
||||
|
||||
<div class="viewcode-block" id="make_dnf_dirs"><a class="viewcode-back" href="../../../pylorax.api.html#pylorax.api.config.make_dnf_dirs">[docs]</a><span class="k">def</span> <span class="nf">make_dnf_dirs</span><span class="p">(</span><span class="n">conf</span><span class="p">):</span>
|
||||
<span class="sd">"""Make any missing dnf directories</span>
|
||||
<div class="viewcode-block" id="make_owned_dir"><a class="viewcode-back" href="../../../pylorax.api.html#pylorax.api.config.make_owned_dir">[docs]</a><span class="k">def</span> <span class="nf">make_owned_dir</span><span class="p">(</span><span class="n">p_dir</span><span class="p">,</span> <span class="n">uid</span><span class="p">,</span> <span class="n">gid</span><span class="p">):</span>
|
||||
<span class="sd">"""Make a directory and its parents, setting owner and group</span>
|
||||
|
||||
<span class="sd"> :param p_dir: path to directory to create</span>
|
||||
<span class="sd"> :type p_dir: string</span>
|
||||
<span class="sd"> :param uid: uid of owner</span>
|
||||
<span class="sd"> :type uid: int</span>
|
||||
<span class="sd"> :param gid: gid of owner</span>
|
||||
<span class="sd"> :type gid: int</span>
|
||||
<span class="sd"> :returns: list of errors</span>
|
||||
<span class="sd"> :rtype: list of str</span>
|
||||
|
||||
<span class="sd"> Check to make sure it does not have o+rw permissions and that it is owned by uid:gid</span>
|
||||
<span class="sd"> """</span>
|
||||
<span class="n">errors</span> <span class="o">=</span> <span class="p">[]</span>
|
||||
<span class="k">if</span> <span class="ow">not</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">isdir</span><span class="p">(</span><span class="n">p_dir</span><span class="p">):</span>
|
||||
<span class="c1"># Make sure no o+rw permissions are set</span>
|
||||
<span class="n">orig_umask</span> <span class="o">=</span> <span class="n">os</span><span class="o">.</span><span class="n">umask</span><span class="p">(</span><span class="mo">0o006</span><span class="p">)</span>
|
||||
<span class="n">os</span><span class="o">.</span><span class="n">makedirs</span><span class="p">(</span><span class="n">p_dir</span><span class="p">,</span> <span class="mo">0o771</span><span class="p">)</span>
|
||||
<span class="n">os</span><span class="o">.</span><span class="n">chown</span><span class="p">(</span><span class="n">p_dir</span><span class="p">,</span> <span class="n">uid</span><span class="p">,</span> <span class="n">gid</span><span class="p">)</span>
|
||||
<span class="n">os</span><span class="o">.</span><span class="n">umask</span><span class="p">(</span><span class="n">orig_umask</span><span class="p">)</span>
|
||||
<span class="k">else</span><span class="p">:</span>
|
||||
<span class="n">p_stat</span> <span class="o">=</span> <span class="n">os</span><span class="o">.</span><span class="n">stat</span><span class="p">(</span><span class="n">p_dir</span><span class="p">)</span>
|
||||
<span class="k">if</span> <span class="n">p_stat</span><span class="o">.</span><span class="n">st_mode</span> <span class="o">&</span> <span class="mo">0o006</span> <span class="o">!=</span> <span class="mi">0</span><span class="p">:</span>
|
||||
<span class="n">errors</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="s2">"Incorrect permissions on </span><span class="si">%s</span><span class="s2">, no o+rw permissions are allowed."</span> <span class="o">%</span> <span class="n">p_dir</span><span class="p">)</span>
|
||||
|
||||
<span class="k">if</span> <span class="n">p_stat</span><span class="o">.</span><span class="n">st_gid</span> <span class="o">!=</span> <span class="n">gid</span> <span class="ow">or</span> <span class="n">p_stat</span><span class="o">.</span><span class="n">st_uid</span> <span class="o">!=</span> <span class="mi">0</span><span class="p">:</span>
|
||||
<span class="n">gr_name</span> <span class="o">=</span> <span class="n">grp</span><span class="o">.</span><span class="n">getgrgid</span><span class="p">(</span><span class="n">gid</span><span class="p">)</span><span class="o">.</span><span class="n">gr_name</span>
|
||||
<span class="n">u_name</span> <span class="o">=</span> <span class="n">pwd</span><span class="o">.</span><span class="n">getpwuid</span><span class="p">(</span><span class="n">uid</span><span class="p">)</span>
|
||||
<span class="n">errors</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="s2">"</span><span class="si">%s</span><span class="s2"> should be owned by </span><span class="si">%s</span><span class="s2">:</span><span class="si">%s</span><span class="s2">"</span> <span class="o">%</span> <span class="p">(</span><span class="n">p_dir</span><span class="p">,</span> <span class="n">u_name</span><span class="p">,</span> <span class="n">gr_name</span><span class="p">))</span>
|
||||
|
||||
<span class="k">return</span> <span class="n">errors</span></div>
|
||||
|
||||
<div class="viewcode-block" id="make_dnf_dirs"><a class="viewcode-back" href="../../../pylorax.api.html#pylorax.api.config.make_dnf_dirs">[docs]</a><span class="k">def</span> <span class="nf">make_dnf_dirs</span><span class="p">(</span><span class="n">conf</span><span class="p">,</span> <span class="n">uid</span><span class="p">,</span> <span class="n">gid</span><span class="p">):</span>
|
||||
<span class="sd">"""Make any missing dnf directories owned by user:group</span>
|
||||
|
||||
<span class="sd"> :param conf: The configuration to use</span>
|
||||
<span class="sd"> :type conf: ComposerConfig</span>
|
||||
<span class="sd"> :returns: None</span>
|
||||
<span class="sd"> :param uid: uid of owner</span>
|
||||
<span class="sd"> :type uid: int</span>
|
||||
<span class="sd"> :param gid: gid of owner</span>
|
||||
<span class="sd"> :type gid: int</span>
|
||||
<span class="sd"> :returns: list of errors</span>
|
||||
<span class="sd"> :rtype: list of str</span>
|
||||
<span class="sd"> """</span>
|
||||
<span class="n">errors</span> <span class="o">=</span> <span class="p">[]</span>
|
||||
<span class="k">for</span> <span class="n">p</span> <span class="ow">in</span> <span class="p">[</span><span class="s2">"dnf_conf"</span><span class="p">,</span> <span class="s2">"repo_dir"</span><span class="p">,</span> <span class="s2">"cache_dir"</span><span class="p">,</span> <span class="s2">"dnf_root"</span><span class="p">]:</span>
|
||||
<span class="n">p_dir</span> <span class="o">=</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">abspath</span><span class="p">(</span><span class="n">conf</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">"composer"</span><span class="p">,</span> <span class="n">p</span><span class="p">))</span>
|
||||
<span class="k">if</span> <span class="n">p</span> <span class="o">==</span> <span class="s2">"dnf_conf"</span><span class="p">:</span>
|
||||
<span class="n">p_dir</span> <span class="o">=</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">dirname</span><span class="p">(</span><span class="n">p_dir</span><span class="p">)</span>
|
||||
|
||||
<span class="k">if</span> <span class="ow">not</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">isdir</span><span class="p">(</span><span class="n">p_dir</span><span class="p">):</span>
|
||||
<span class="n">os</span><span class="o">.</span><span class="n">makedirs</span><span class="p">(</span><span class="n">p_dir</span><span class="p">)</span></div>
|
||||
<span class="n">errors</span><span class="o">.</span><span class="n">extend</span><span class="p">(</span><span class="n">make_owned_dir</span><span class="p">(</span><span class="n">p_dir</span><span class="p">,</span> <span class="n">uid</span><span class="p">,</span> <span class="n">gid</span><span class="p">))</span></div>
|
||||
|
||||
<div class="viewcode-block" id="make_queue_dirs"><a class="viewcode-back" href="../../../pylorax.api.html#pylorax.api.config.make_queue_dirs">[docs]</a><span class="k">def</span> <span class="nf">make_queue_dirs</span><span class="p">(</span><span class="n">conf</span><span class="p">,</span> <span class="n">gid</span><span class="p">):</span>
|
||||
<span class="sd">"""Make any missing queue directories</span>
|
||||
@ -253,20 +291,7 @@
|
||||
<span class="n">lib_dir</span> <span class="o">=</span> <span class="n">conf</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">"composer"</span><span class="p">,</span> <span class="s2">"lib_dir"</span><span class="p">)</span>
|
||||
<span class="k">for</span> <span class="n">p</span> <span class="ow">in</span> <span class="p">[</span><span class="s2">"queue/run"</span><span class="p">,</span> <span class="s2">"queue/new"</span><span class="p">,</span> <span class="s2">"results"</span><span class="p">]:</span>
|
||||
<span class="n">p_dir</span> <span class="o">=</span> <span class="n">joinpaths</span><span class="p">(</span><span class="n">lib_dir</span><span class="p">,</span> <span class="n">p</span><span class="p">)</span>
|
||||
<span class="k">if</span> <span class="ow">not</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">exists</span><span class="p">(</span><span class="n">p_dir</span><span class="p">):</span>
|
||||
<span class="n">orig_umask</span> <span class="o">=</span> <span class="n">os</span><span class="o">.</span><span class="n">umask</span><span class="p">(</span><span class="mi">0</span><span class="p">)</span>
|
||||
<span class="n">os</span><span class="o">.</span><span class="n">makedirs</span><span class="p">(</span><span class="n">p_dir</span><span class="p">,</span> <span class="mo">0o771</span><span class="p">)</span>
|
||||
<span class="n">os</span><span class="o">.</span><span class="n">chown</span><span class="p">(</span><span class="n">p_dir</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="n">gid</span><span class="p">)</span>
|
||||
<span class="n">os</span><span class="o">.</span><span class="n">umask</span><span class="p">(</span><span class="n">orig_umask</span><span class="p">)</span>
|
||||
<span class="k">else</span><span class="p">:</span>
|
||||
<span class="n">p_stat</span> <span class="o">=</span> <span class="n">os</span><span class="o">.</span><span class="n">stat</span><span class="p">(</span><span class="n">p_dir</span><span class="p">)</span>
|
||||
<span class="k">if</span> <span class="n">p_stat</span><span class="o">.</span><span class="n">st_mode</span> <span class="o">&</span> <span class="mo">0o006</span> <span class="o">!=</span> <span class="mi">0</span><span class="p">:</span>
|
||||
<span class="n">errors</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="s2">"Incorrect permissions on </span><span class="si">%s</span><span class="s2">, no o+rw permissions are allowed."</span> <span class="o">%</span> <span class="n">p_dir</span><span class="p">)</span>
|
||||
|
||||
<span class="k">if</span> <span class="n">p_stat</span><span class="o">.</span><span class="n">st_gid</span> <span class="o">!=</span> <span class="n">gid</span> <span class="ow">or</span> <span class="n">p_stat</span><span class="o">.</span><span class="n">st_uid</span> <span class="o">!=</span> <span class="mi">0</span><span class="p">:</span>
|
||||
<span class="n">gr_name</span> <span class="o">=</span> <span class="n">grp</span><span class="o">.</span><span class="n">getgrgid</span><span class="p">(</span><span class="n">gid</span><span class="p">)</span><span class="o">.</span><span class="n">gr_name</span>
|
||||
<span class="n">errors</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="s2">"</span><span class="si">%s</span><span class="s2"> should be owned by root:</span><span class="si">%s</span><span class="s2">"</span> <span class="o">%</span> <span class="p">(</span><span class="n">p_dir</span><span class="p">,</span> <span class="n">gr_name</span><span class="p">))</span>
|
||||
|
||||
<span class="n">errors</span><span class="o">.</span><span class="n">extend</span><span class="p">(</span><span class="n">make_owned_dir</span><span class="p">(</span><span class="n">p_dir</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="n">gid</span><span class="p">))</span>
|
||||
<span class="k">return</span> <span class="n">errors</span></div>
|
||||
</pre></div>
|
||||
|
||||
@ -302,7 +327,7 @@
|
||||
<script type="text/javascript">
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT:'../../../',
|
||||
VERSION:'29.14',
|
||||
VERSION:'29.20',
|
||||
LANGUAGE:'None',
|
||||
COLLAPSE_INDEX:false,
|
||||
FILE_SUFFIX:'.html',
|
||||
|
@ -8,7 +8,7 @@
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<title>pylorax.api.crossdomain — Lorax 29.14 documentation</title>
|
||||
<title>pylorax.api.crossdomain — Lorax 29.20 documentation</title>
|
||||
|
||||
|
||||
|
||||
@ -57,7 +57,7 @@
|
||||
|
||||
|
||||
<div class="version">
|
||||
29.14
|
||||
29.20
|
||||
</div>
|
||||
|
||||
|
||||
@ -253,7 +253,7 @@
|
||||
<script type="text/javascript">
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT:'../../../',
|
||||
VERSION:'29.14',
|
||||
VERSION:'29.20',
|
||||
LANGUAGE:'None',
|
||||
COLLAPSE_INDEX:false,
|
||||
FILE_SUFFIX:'.html',
|
||||
|
@ -8,7 +8,7 @@
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<title>pylorax.api.dnfbase — Lorax 29.14 documentation</title>
|
||||
<title>pylorax.api.dnfbase — Lorax 29.20 documentation</title>
|
||||
|
||||
|
||||
|
||||
@ -57,7 +57,7 @@
|
||||
|
||||
|
||||
<div class="version">
|
||||
29.14
|
||||
29.20
|
||||
</div>
|
||||
|
||||
|
||||
@ -181,10 +181,47 @@
|
||||
<span class="kn">from</span> <span class="nn">glob</span> <span class="k">import</span> <span class="n">glob</span>
|
||||
<span class="kn">import</span> <span class="nn">os</span>
|
||||
<span class="kn">import</span> <span class="nn">shutil</span>
|
||||
<span class="kn">from</span> <span class="nn">threading</span> <span class="k">import</span> <span class="n">Lock</span>
|
||||
<span class="kn">import</span> <span class="nn">time</span>
|
||||
|
||||
<span class="kn">from</span> <span class="nn">pylorax</span> <span class="k">import</span> <span class="n">DEFAULT_PLATFORM_ID</span>
|
||||
<span class="kn">from</span> <span class="nn">pylorax.sysutils</span> <span class="k">import</span> <span class="n">flatconfig</span>
|
||||
|
||||
<div class="viewcode-block" id="DNFLock"><a class="viewcode-back" href="../../../pylorax.api.html#pylorax.api.dnfbase.DNFLock">[docs]</a><span class="k">class</span> <span class="nc">DNFLock</span><span class="p">(</span><span class="nb">object</span><span class="p">):</span>
|
||||
<span class="sd">"""Hold the dnf.Base object and a Lock to control access to it.</span>
|
||||
|
||||
<span class="sd"> self.dbo is a property that returns the dnf.Base object, but it *may* change</span>
|
||||
<span class="sd"> from one call to the next if the upstream repositories have changed.</span>
|
||||
<span class="sd"> """</span>
|
||||
<span class="k">def</span> <span class="nf">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">conf</span><span class="p">,</span> <span class="n">expire_secs</span><span class="o">=</span><span class="mi">6</span><span class="o">*</span><span class="mi">60</span><span class="o">*</span><span class="mi">60</span><span class="p">):</span>
|
||||
<span class="bp">self</span><span class="o">.</span><span class="n">_conf</span> <span class="o">=</span> <span class="n">conf</span>
|
||||
<span class="bp">self</span><span class="o">.</span><span class="n">_lock</span> <span class="o">=</span> <span class="n">Lock</span><span class="p">()</span>
|
||||
<span class="bp">self</span><span class="o">.</span><span class="n">dbo</span> <span class="o">=</span> <span class="n">get_base_object</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">_conf</span><span class="p">)</span>
|
||||
<span class="bp">self</span><span class="o">.</span><span class="n">_expire_secs</span> <span class="o">=</span> <span class="n">expire_secs</span>
|
||||
<span class="bp">self</span><span class="o">.</span><span class="n">_expire_time</span> <span class="o">=</span> <span class="n">time</span><span class="o">.</span><span class="n">time</span><span class="p">()</span> <span class="o">+</span> <span class="bp">self</span><span class="o">.</span><span class="n">_expire_secs</span>
|
||||
|
||||
<span class="nd">@property</span>
|
||||
<span class="k">def</span> <span class="nf">lock</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
|
||||
<span class="sd">"""Check for repo updates (using expiration time) and return the lock</span>
|
||||
|
||||
<span class="sd"> If the repository has been updated, tear down the old dnf.Base and</span>
|
||||
<span class="sd"> create a new one. This is the only way to force dnf to use the new</span>
|
||||
<span class="sd"> metadata.</span>
|
||||
<span class="sd"> """</span>
|
||||
<span class="k">if</span> <span class="n">time</span><span class="o">.</span><span class="n">time</span><span class="p">()</span> <span class="o">></span> <span class="bp">self</span><span class="o">.</span><span class="n">_expire_time</span><span class="p">:</span>
|
||||
<span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">lock_check</span>
|
||||
<span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">_lock</span>
|
||||
|
||||
<span class="nd">@property</span>
|
||||
<span class="k">def</span> <span class="nf">lock_check</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
|
||||
<span class="sd">"""Force a check for repo updates and return the lock</span>
|
||||
|
||||
<span class="sd"> Use this method sparingly, it removes the repodata and downloads a new copy every time.</span>
|
||||
<span class="sd"> """</span>
|
||||
<span class="bp">self</span><span class="o">.</span><span class="n">_expire_time</span> <span class="o">=</span> <span class="n">time</span><span class="o">.</span><span class="n">time</span><span class="p">()</span> <span class="o">+</span> <span class="bp">self</span><span class="o">.</span><span class="n">_expire_secs</span>
|
||||
<span class="bp">self</span><span class="o">.</span><span class="n">dbo</span><span class="o">.</span><span class="n">update_cache</span><span class="p">()</span>
|
||||
<span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">_lock</span></div>
|
||||
|
||||
<div class="viewcode-block" id="get_base_object"><a class="viewcode-back" href="../../../pylorax.api.html#pylorax.api.dnfbase.get_base_object">[docs]</a><span class="k">def</span> <span class="nf">get_base_object</span><span class="p">(</span><span class="n">conf</span><span class="p">):</span>
|
||||
<span class="sd">"""Get the DNF object with settings from the config file</span>
|
||||
|
||||
@ -213,7 +250,10 @@
|
||||
<span class="n">dbc</span><span class="o">.</span><span class="n">reposdir</span> <span class="o">=</span> <span class="p">[</span><span class="n">repodir</span><span class="p">]</span>
|
||||
<span class="n">dbc</span><span class="o">.</span><span class="n">install_weak_deps</span> <span class="o">=</span> <span class="kc">False</span>
|
||||
<span class="n">dbc</span><span class="o">.</span><span class="n">prepend_installroot</span><span class="p">(</span><span class="s1">'persistdir'</span><span class="p">)</span>
|
||||
<span class="n">dbc</span><span class="o">.</span><span class="n">tsflags</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="s1">'nodocs'</span><span class="p">)</span>
|
||||
<span class="c1"># this is a weird 'AppendOption' thing that, when you set it,</span>
|
||||
<span class="c1"># actually appends. Doing this adds 'nodocs' to the existing list</span>
|
||||
<span class="c1"># of values, over in libdnf, it does not replace the existing values.</span>
|
||||
<span class="n">dbc</span><span class="o">.</span><span class="n">tsflags</span> <span class="o">=</span> <span class="p">[</span><span class="s1">'nodocs'</span><span class="p">]</span>
|
||||
|
||||
<span class="k">if</span> <span class="n">conf</span><span class="o">.</span><span class="n">get_default</span><span class="p">(</span><span class="s2">"dnf"</span><span class="p">,</span> <span class="s2">"proxy"</span><span class="p">,</span> <span class="kc">None</span><span class="p">):</span>
|
||||
<span class="n">dbc</span><span class="o">.</span><span class="n">proxy</span> <span class="o">=</span> <span class="n">conf</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">"dnf"</span><span class="p">,</span> <span class="s2">"proxy"</span><span class="p">)</span>
|
||||
@ -238,6 +278,10 @@
|
||||
<span class="n">log</span><span class="o">.</span><span class="n">info</span><span class="p">(</span><span class="s2">"Using </span><span class="si">%s</span><span class="s2"> for module_platform_id"</span><span class="p">,</span> <span class="n">platform_id</span><span class="p">)</span>
|
||||
<span class="n">dbc</span><span class="o">.</span><span class="n">module_platform_id</span> <span class="o">=</span> <span class="n">platform_id</span>
|
||||
|
||||
<span class="c1"># Make sure metadata is always current</span>
|
||||
<span class="n">dbc</span><span class="o">.</span><span class="n">metadata_expire</span> <span class="o">=</span> <span class="mi">0</span>
|
||||
<span class="n">dbc</span><span class="o">.</span><span class="n">metadata_expire_filter</span> <span class="o">=</span> <span class="s2">"never"</span>
|
||||
|
||||
<span class="c1"># write the dnf configuration file</span>
|
||||
<span class="k">with</span> <span class="nb">open</span><span class="p">(</span><span class="n">dnfconf</span><span class="p">,</span> <span class="s2">"w"</span><span class="p">)</span> <span class="k">as</span> <span class="n">f</span><span class="p">:</span>
|
||||
<span class="n">f</span><span class="o">.</span><span class="n">write</span><span class="p">(</span><span class="n">dbc</span><span class="o">.</span><span class="n">dump</span><span class="p">())</span>
|
||||
@ -254,6 +298,7 @@
|
||||
<span class="k">try</span><span class="p">:</span>
|
||||
<span class="n">dbo</span><span class="o">.</span><span class="n">fill_sack</span><span class="p">(</span><span class="n">load_system_repo</span><span class="o">=</span><span class="kc">False</span><span class="p">)</span>
|
||||
<span class="n">dbo</span><span class="o">.</span><span class="n">read_comps</span><span class="p">()</span>
|
||||
<span class="n">dbo</span><span class="o">.</span><span class="n">update_cache</span><span class="p">()</span>
|
||||
<span class="k">except</span> <span class="n">dnf</span><span class="o">.</span><span class="n">exceptions</span><span class="o">.</span><span class="n">Error</span> <span class="k">as</span> <span class="n">e</span><span class="p">:</span>
|
||||
<span class="n">log</span><span class="o">.</span><span class="n">error</span><span class="p">(</span><span class="s2">"Failed to update metadata: </span><span class="si">%s</span><span class="s2">"</span><span class="p">,</span> <span class="nb">str</span><span class="p">(</span><span class="n">e</span><span class="p">))</span>
|
||||
<span class="k">raise</span> <span class="ne">RuntimeError</span><span class="p">(</span><span class="s2">"Fetching metadata failed: </span><span class="si">%s</span><span class="s2">"</span> <span class="o">%</span> <span class="nb">str</span><span class="p">(</span><span class="n">e</span><span class="p">))</span>
|
||||
@ -293,7 +338,7 @@
|
||||
<script type="text/javascript">
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT:'../../../',
|
||||
VERSION:'29.14',
|
||||
VERSION:'29.20',
|
||||
LANGUAGE:'None',
|
||||
COLLAPSE_INDEX:false,
|
||||
FILE_SUFFIX:'.html',
|
||||
|
@ -8,7 +8,7 @@
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<title>pylorax.api.projects — Lorax 29.14 documentation</title>
|
||||
<title>pylorax.api.projects — Lorax 29.20 documentation</title>
|
||||
|
||||
|
||||
|
||||
@ -57,7 +57,7 @@
|
||||
|
||||
|
||||
<div class="version">
|
||||
29.14
|
||||
29.20
|
||||
</div>
|
||||
|
||||
|
||||
@ -352,7 +352,9 @@
|
||||
<span class="sd"> :rtype: None</span>
|
||||
<span class="sd"> :raises: ProjectsError if there was a problem installing something</span>
|
||||
<span class="sd"> """</span>
|
||||
<span class="c1"># This resets the transaction</span>
|
||||
<span class="c1"># This resets the transaction and updates the cache.</span>
|
||||
<span class="c1"># It is important that the cache always be synchronized because Anaconda will grab its own copy</span>
|
||||
<span class="c1"># and if that is different the NEVRAs will not match and the build will fail.</span>
|
||||
<span class="n">dbo</span><span class="o">.</span><span class="n">reset</span><span class="p">(</span><span class="n">goal</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span>
|
||||
<span class="n">install_errors</span> <span class="o">=</span> <span class="p">[]</span>
|
||||
<span class="k">for</span> <span class="n">name</span> <span class="ow">in</span> <span class="n">groups</span><span class="p">:</span>
|
||||
@ -362,23 +364,25 @@
|
||||
<span class="n">install_errors</span><span class="o">.</span><span class="n">append</span><span class="p">((</span><span class="s2">"Group </span><span class="si">%s</span><span class="s2">"</span> <span class="o">%</span> <span class="p">(</span><span class="n">name</span><span class="p">),</span> <span class="nb">str</span><span class="p">(</span><span class="n">e</span><span class="p">)))</span>
|
||||
|
||||
<span class="k">for</span> <span class="n">name</span><span class="p">,</span> <span class="n">version</span> <span class="ow">in</span> <span class="n">projects</span><span class="p">:</span>
|
||||
<span class="k">try</span><span class="p">:</span>
|
||||
<span class="k">if</span> <span class="ow">not</span> <span class="n">version</span><span class="p">:</span>
|
||||
<span class="n">version</span> <span class="o">=</span> <span class="s2">"*"</span>
|
||||
<span class="n">pkgs</span> <span class="o">=</span> <span class="p">[</span><span class="n">pkg</span> <span class="k">for</span> <span class="n">pkg</span> <span class="ow">in</span> <span class="n">dnf</span><span class="o">.</span><span class="n">subject</span><span class="o">.</span><span class="n">Subject</span><span class="p">(</span><span class="n">name</span><span class="p">)</span><span class="o">.</span><span class="n">get_best_query</span><span class="p">(</span><span class="n">dbo</span><span class="o">.</span><span class="n">sack</span><span class="p">)</span><span class="o">.</span><span class="n">filter</span><span class="p">(</span><span class="n">version__glob</span><span class="o">=</span><span class="n">version</span><span class="p">,</span> <span class="n">latest</span><span class="o">=</span><span class="kc">True</span><span class="p">)]</span>
|
||||
<span class="k">if</span> <span class="ow">not</span> <span class="n">pkgs</span><span class="p">:</span>
|
||||
<span class="n">install_errors</span><span class="o">.</span><span class="n">append</span><span class="p">((</span><span class="s2">"</span><span class="si">%s</span><span class="s2">-</span><span class="si">%s</span><span class="s2">"</span> <span class="o">%</span> <span class="p">(</span><span class="n">name</span><span class="p">,</span> <span class="n">version</span><span class="p">),</span> <span class="s2">"No match"</span><span class="p">))</span>
|
||||
<span class="k">continue</span>
|
||||
<span class="c1"># Find the best package matching the name + version glob</span>
|
||||
<span class="c1"># dnf can return multiple packages if it is in more than 1 repository</span>
|
||||
<span class="n">query</span> <span class="o">=</span> <span class="n">dbo</span><span class="o">.</span><span class="n">sack</span><span class="o">.</span><span class="n">query</span><span class="p">()</span><span class="o">.</span><span class="n">filterm</span><span class="p">(</span><span class="n">provides__glob</span><span class="o">=</span><span class="n">name</span><span class="p">)</span>
|
||||
<span class="k">if</span> <span class="n">version</span><span class="p">:</span>
|
||||
<span class="n">query</span><span class="o">.</span><span class="n">filterm</span><span class="p">(</span><span class="n">version__glob</span><span class="o">=</span><span class="n">version</span><span class="p">)</span>
|
||||
|
||||
<span class="k">for</span> <span class="n">p</span> <span class="ow">in</span> <span class="n">pkgs</span><span class="p">:</span>
|
||||
<span class="n">dbo</span><span class="o">.</span><span class="n">package_install</span><span class="p">(</span><span class="n">p</span><span class="p">)</span>
|
||||
<span class="k">except</span> <span class="n">dnf</span><span class="o">.</span><span class="n">exceptions</span><span class="o">.</span><span class="n">MarkingError</span> <span class="k">as</span> <span class="n">e</span><span class="p">:</span>
|
||||
<span class="n">install_errors</span><span class="o">.</span><span class="n">append</span><span class="p">((</span><span class="s2">"</span><span class="si">%s</span><span class="s2">-</span><span class="si">%s</span><span class="s2">"</span> <span class="o">%</span> <span class="p">(</span><span class="n">name</span><span class="p">,</span> <span class="n">version</span><span class="p">),</span> <span class="nb">str</span><span class="p">(</span><span class="n">e</span><span class="p">)))</span>
|
||||
<span class="n">query</span><span class="o">.</span><span class="n">filterm</span><span class="p">(</span><span class="n">latest</span><span class="o">=</span><span class="mi">1</span><span class="p">)</span>
|
||||
<span class="k">if</span> <span class="ow">not</span> <span class="n">query</span><span class="p">:</span>
|
||||
<span class="n">install_errors</span><span class="o">.</span><span class="n">append</span><span class="p">((</span><span class="s2">"</span><span class="si">%s</span><span class="s2">-</span><span class="si">%s</span><span class="s2">"</span> <span class="o">%</span> <span class="p">(</span><span class="n">name</span><span class="p">,</span> <span class="n">version</span><span class="p">),</span> <span class="s2">"No match"</span><span class="p">))</span>
|
||||
<span class="k">continue</span>
|
||||
<span class="n">sltr</span> <span class="o">=</span> <span class="n">dnf</span><span class="o">.</span><span class="n">selector</span><span class="o">.</span><span class="n">Selector</span><span class="p">(</span><span class="n">dbo</span><span class="o">.</span><span class="n">sack</span><span class="p">)</span><span class="o">.</span><span class="n">set</span><span class="p">(</span><span class="n">pkg</span><span class="o">=</span><span class="n">query</span><span class="p">)</span>
|
||||
|
||||
<span class="c1"># NOTE: dnf says in near future there will be a "goal" attribute of Base class</span>
|
||||
<span class="c1"># so yes, we're using a 'private' attribute here on purpose and with permission.</span>
|
||||
<span class="n">dbo</span><span class="o">.</span><span class="n">_goal</span><span class="o">.</span><span class="n">install</span><span class="p">(</span><span class="n">select</span><span class="o">=</span><span class="n">sltr</span><span class="p">,</span> <span class="n">optional</span><span class="o">=</span><span class="kc">False</span><span class="p">)</span>
|
||||
|
||||
<span class="k">if</span> <span class="n">install_errors</span><span class="p">:</span>
|
||||
<span class="k">raise</span> <span class="n">ProjectsError</span><span class="p">(</span><span class="s2">"The following package(s) had problems: </span><span class="si">%s</span><span class="s2">"</span> <span class="o">%</span> <span class="s2">","</span><span class="o">.</span><span class="n">join</span><span class="p">([</span><span class="s2">"</span><span class="si">%s</span><span class="s2"> (</span><span class="si">%s</span><span class="s2">)"</span> <span class="o">%</span> <span class="p">(</span><span class="n">pattern</span><span class="p">,</span> <span class="n">err</span><span class="p">)</span> <span class="k">for</span> <span class="n">pattern</span><span class="p">,</span> <span class="n">err</span> <span class="ow">in</span> <span class="n">install_errors</span><span class="p">]))</span>
|
||||
|
||||
|
||||
<div class="viewcode-block" id="projects_depsolve"><a class="viewcode-back" href="../../../pylorax.api.html#pylorax.api.projects.projects_depsolve">[docs]</a><span class="k">def</span> <span class="nf">projects_depsolve</span><span class="p">(</span><span class="n">dbo</span><span class="p">,</span> <span class="n">projects</span><span class="p">,</span> <span class="n">groups</span><span class="p">):</span>
|
||||
<span class="sd">"""Return the dependencies for a list of projects</span>
|
||||
|
||||
@ -508,7 +512,7 @@
|
||||
<span class="sd"> it ouputs baseurl and gpgkey as python lists which DNF cannot read. So do this manually with</span>
|
||||
<span class="sd"> only the attributes we care about.</span>
|
||||
<span class="sd"> """</span>
|
||||
<span class="n">repo_str</span> <span class="o">=</span> <span class="s2">"[</span><span class="si">%s</span><span class="s2">]</span><span class="se">\n</span><span class="s2">"</span> <span class="o">%</span> <span class="n">repo</span><span class="o">.</span><span class="n">id</span>
|
||||
<span class="n">repo_str</span> <span class="o">=</span> <span class="s2">"[</span><span class="si">%s</span><span class="s2">]</span><span class="se">\n</span><span class="s2">name = </span><span class="si">%s</span><span class="se">\n</span><span class="s2">"</span> <span class="o">%</span> <span class="p">(</span><span class="n">repo</span><span class="o">.</span><span class="n">id</span><span class="p">,</span> <span class="n">repo</span><span class="o">.</span><span class="n">name</span><span class="p">)</span>
|
||||
<span class="k">if</span> <span class="n">repo</span><span class="o">.</span><span class="n">metalink</span><span class="p">:</span>
|
||||
<span class="n">repo_str</span> <span class="o">+=</span> <span class="s2">"metalink = </span><span class="si">%s</span><span class="se">\n</span><span class="s2">"</span> <span class="o">%</span> <span class="n">repo</span><span class="o">.</span><span class="n">metalink</span>
|
||||
<span class="k">elif</span> <span class="n">repo</span><span class="o">.</span><span class="n">mirrorlist</span><span class="p">:</span>
|
||||
@ -583,7 +587,7 @@
|
||||
<span class="n">source</span><span class="p">[</span><span class="s2">"check_gpg"</span><span class="p">]</span> <span class="o">=</span> <span class="kc">True</span>
|
||||
|
||||
<span class="k">if</span> <span class="n">repo</span><span class="o">.</span><span class="n">gpgkey</span><span class="p">:</span>
|
||||
<span class="n">source</span><span class="p">[</span><span class="s2">"gpgkey_urls"</span><span class="p">]</span> <span class="o">=</span> <span class="n">repo</span><span class="o">.</span><span class="n">gpgkey</span>
|
||||
<span class="n">source</span><span class="p">[</span><span class="s2">"gpgkey_urls"</span><span class="p">]</span> <span class="o">=</span> <span class="nb">list</span><span class="p">(</span><span class="n">repo</span><span class="o">.</span><span class="n">gpgkey</span><span class="p">)</span>
|
||||
|
||||
<span class="k">return</span> <span class="n">source</span></div>
|
||||
|
||||
@ -637,7 +641,7 @@
|
||||
<span class="n">repo</span><span class="o">.</span><span class="n">gpgcheck</span> <span class="o">=</span> <span class="kc">False</span>
|
||||
|
||||
<span class="k">if</span> <span class="s2">"gpgkey_urls"</span> <span class="ow">in</span> <span class="n">source</span><span class="p">:</span>
|
||||
<span class="n">repo</span><span class="o">.</span><span class="n">gpgkey</span> <span class="o">=</span> <span class="s2">","</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="n">source</span><span class="p">[</span><span class="s2">"gpgkey_urls"</span><span class="p">])</span>
|
||||
<span class="n">repo</span><span class="o">.</span><span class="n">gpgkey</span> <span class="o">=</span> <span class="nb">tuple</span><span class="p">(</span><span class="n">source</span><span class="p">[</span><span class="s2">"gpgkey_urls"</span><span class="p">])</span>
|
||||
|
||||
<span class="n">repo</span><span class="o">.</span><span class="n">enable</span><span class="p">()</span>
|
||||
|
||||
@ -738,7 +742,7 @@
|
||||
<script type="text/javascript">
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT:'../../../',
|
||||
VERSION:'29.14',
|
||||
VERSION:'29.20',
|
||||
LANGUAGE:'None',
|
||||
COLLAPSE_INDEX:false,
|
||||
FILE_SUFFIX:'.html',
|
||||
|
@ -8,7 +8,7 @@
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<title>pylorax.api.queue — Lorax 29.14 documentation</title>
|
||||
<title>pylorax.api.queue — Lorax 29.20 documentation</title>
|
||||
|
||||
|
||||
|
||||
@ -57,7 +57,7 @@
|
||||
|
||||
|
||||
<div class="version">
|
||||
29.14
|
||||
29.20
|
||||
</div>
|
||||
|
||||
|
||||
@ -819,7 +819,7 @@
|
||||
<script type="text/javascript">
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT:'../../../',
|
||||
VERSION:'29.14',
|
||||
VERSION:'29.20',
|
||||
LANGUAGE:'None',
|
||||
COLLAPSE_INDEX:false,
|
||||
FILE_SUFFIX:'.html',
|
||||
|
@ -8,7 +8,7 @@
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<title>pylorax.api.recipes — Lorax 29.14 documentation</title>
|
||||
<title>pylorax.api.recipes — Lorax 29.20 documentation</title>
|
||||
|
||||
|
||||
|
||||
@ -57,7 +57,7 @@
|
||||
|
||||
|
||||
<div class="version">
|
||||
29.14
|
||||
29.20
|
||||
</div>
|
||||
|
||||
|
||||
@ -1111,7 +1111,7 @@
|
||||
<script type="text/javascript">
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT:'../../../',
|
||||
VERSION:'29.14',
|
||||
VERSION:'29.20',
|
||||
LANGUAGE:'None',
|
||||
COLLAPSE_INDEX:false,
|
||||
FILE_SUFFIX:'.html',
|
||||
|
@ -8,7 +8,7 @@
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<title>pylorax.api.server — Lorax 29.14 documentation</title>
|
||||
<title>pylorax.api.server — Lorax 29.20 documentation</title>
|
||||
|
||||
|
||||
|
||||
@ -57,7 +57,7 @@
|
||||
|
||||
|
||||
<div class="version">
|
||||
29.14
|
||||
29.20
|
||||
</div>
|
||||
|
||||
|
||||
@ -185,7 +185,6 @@
|
||||
<span class="kn">from</span> <span class="nn">pylorax.sysutils</span> <span class="k">import</span> <span class="n">joinpaths</span>
|
||||
|
||||
<span class="n">GitLock</span> <span class="o">=</span> <span class="n">namedtuple</span><span class="p">(</span><span class="s2">"GitLock"</span><span class="p">,</span> <span class="p">[</span><span class="s2">"repo"</span><span class="p">,</span> <span class="s2">"lock"</span><span class="p">,</span> <span class="s2">"dir"</span><span class="p">])</span>
|
||||
<span class="n">DNFLock</span> <span class="o">=</span> <span class="n">namedtuple</span><span class="p">(</span><span class="s2">"DNFLock"</span><span class="p">,</span> <span class="p">[</span><span class="s2">"dbo"</span><span class="p">,</span> <span class="s2">"lock"</span><span class="p">])</span>
|
||||
|
||||
<span class="n">server</span> <span class="o">=</span> <span class="n">Flask</span><span class="p">(</span><span class="vm">__name__</span><span class="p">)</span>
|
||||
|
||||
@ -272,7 +271,7 @@
|
||||
<script type="text/javascript">
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT:'../../../',
|
||||
VERSION:'29.14',
|
||||
VERSION:'29.20',
|
||||
LANGUAGE:'None',
|
||||
COLLAPSE_INDEX:false,
|
||||
FILE_SUFFIX:'.html',
|
||||
|
@ -8,7 +8,7 @@
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<title>pylorax.api.timestamp — Lorax 29.14 documentation</title>
|
||||
<title>pylorax.api.timestamp — Lorax 29.20 documentation</title>
|
||||
|
||||
|
||||
|
||||
@ -57,7 +57,7 @@
|
||||
|
||||
|
||||
<div class="version">
|
||||
29.14
|
||||
29.20
|
||||
</div>
|
||||
|
||||
|
||||
@ -240,7 +240,7 @@
|
||||
<script type="text/javascript">
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT:'../../../',
|
||||
VERSION:'29.14',
|
||||
VERSION:'29.20',
|
||||
LANGUAGE:'None',
|
||||
COLLAPSE_INDEX:false,
|
||||
FILE_SUFFIX:'.html',
|
||||
|
@ -8,7 +8,7 @@
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<title>pylorax.api.v0 — Lorax 29.14 documentation</title>
|
||||
<title>pylorax.api.v0 — Lorax 29.20 documentation</title>
|
||||
|
||||
|
||||
|
||||
@ -57,7 +57,7 @@
|
||||
|
||||
|
||||
<div class="version">
|
||||
29.14
|
||||
29.20
|
||||
</div>
|
||||
|
||||
|
||||
@ -220,15 +220,23 @@
|
||||
<span class="sd"> "kubernetes" ],</span>
|
||||
<span class="sd"> "total": 6 }</span>
|
||||
|
||||
<span class="sd">`/api/v0/blueprints/info/<blueprint_names>`</span>
|
||||
<span class="sd">^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^</span>
|
||||
<span class="sd">`/api/v0/blueprints/info/<blueprint_names>[?format=<json|toml>]`</span>
|
||||
<span class="sd">^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^</span>
|
||||
|
||||
<span class="sd"> Return the JSON representation of the blueprint. This includes 3 top level</span>
|
||||
<span class="sd"> objects. `changes` which lists whether or not the workspace is different from</span>
|
||||
<span class="sd"> the most recent commit. `blueprints` which lists the JSON representation of the</span>
|
||||
<span class="sd"> blueprint, and `errors` which will list any errors, like non-existant blueprints.</span>
|
||||
|
||||
<span class="sd"> Example::</span>
|
||||
<span class="sd"> By default the response is JSON, but if `?format=toml` is included in the URL's</span>
|
||||
<span class="sd"> arguments it will return the response as the blueprint's raw TOML content.</span>
|
||||
<span class="sd"> *Unless* there is an error which will only return a 400 and a standard error</span>
|
||||
<span class="sd"> `Status Response`_.</span>
|
||||
|
||||
<span class="sd"> If there is an error when JSON is requested the successful blueprints and the</span>
|
||||
<span class="sd"> errors will both be returned.</span>
|
||||
|
||||
<span class="sd"> Example of json response::</span>
|
||||
|
||||
<span class="sd"> {</span>
|
||||
<span class="sd"> "changes": [</span>
|
||||
@ -1260,8 +1268,12 @@
|
||||
<span class="n">blueprints</span> <span class="o">=</span> <span class="nb">sorted</span><span class="p">(</span><span class="n">blueprints</span><span class="p">,</span> <span class="n">key</span><span class="o">=</span><span class="k">lambda</span> <span class="n">r</span><span class="p">:</span> <span class="n">r</span><span class="p">[</span><span class="s2">"name"</span><span class="p">]</span><span class="o">.</span><span class="n">lower</span><span class="p">())</span>
|
||||
|
||||
<span class="k">if</span> <span class="n">out_fmt</span> <span class="o">==</span> <span class="s2">"toml"</span><span class="p">:</span>
|
||||
<span class="c1"># With TOML output we just want to dump the raw blueprint, skipping the rest.</span>
|
||||
<span class="k">return</span> <span class="s2">"</span><span class="se">\n\n</span><span class="s2">"</span><span class="o">.</span><span class="n">join</span><span class="p">([</span><span class="n">r</span><span class="o">.</span><span class="n">toml</span><span class="p">()</span> <span class="k">for</span> <span class="n">r</span> <span class="ow">in</span> <span class="n">blueprints</span><span class="p">])</span>
|
||||
<span class="k">if</span> <span class="n">errors</span><span class="p">:</span>
|
||||
<span class="c1"># If there are errors they need to be reported, use JSON and 400 for this</span>
|
||||
<span class="k">return</span> <span class="n">jsonify</span><span class="p">(</span><span class="n">status</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="n">errors</span><span class="o">=</span><span class="n">errors</span><span class="p">),</span> <span class="mi">400</span>
|
||||
<span class="k">else</span><span class="p">:</span>
|
||||
<span class="c1"># With TOML output we just want to dump the raw blueprint, skipping the rest.</span>
|
||||
<span class="k">return</span> <span class="s2">"</span><span class="se">\n\n</span><span class="s2">"</span><span class="o">.</span><span class="n">join</span><span class="p">([</span><span class="n">r</span><span class="o">.</span><span class="n">toml</span><span class="p">()</span> <span class="k">for</span> <span class="n">r</span> <span class="ow">in</span> <span class="n">blueprints</span><span class="p">])</span>
|
||||
<span class="k">else</span><span class="p">:</span>
|
||||
<span class="k">return</span> <span class="n">jsonify</span><span class="p">(</span><span class="n">changes</span><span class="o">=</span><span class="n">changes</span><span class="p">,</span> <span class="n">blueprints</span><span class="o">=</span><span class="n">blueprints</span><span class="p">,</span> <span class="n">errors</span><span class="o">=</span><span class="n">errors</span><span class="p">)</span>
|
||||
|
||||
@ -2228,7 +2240,7 @@
|
||||
<script type="text/javascript">
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT:'../../../',
|
||||
VERSION:'29.14',
|
||||
VERSION:'29.20',
|
||||
LANGUAGE:'None',
|
||||
COLLAPSE_INDEX:false,
|
||||
FILE_SUFFIX:'.html',
|
||||
|
@ -8,7 +8,7 @@
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<title>pylorax.api.workspace — Lorax 29.14 documentation</title>
|
||||
<title>pylorax.api.workspace — Lorax 29.20 documentation</title>
|
||||
|
||||
|
||||
|
||||
@ -57,7 +57,7 @@
|
||||
|
||||
|
||||
<div class="version">
|
||||
29.14
|
||||
29.20
|
||||
</div>
|
||||
|
||||
|
||||
@ -288,7 +288,7 @@
|
||||
<script type="text/javascript">
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT:'../../../',
|
||||
VERSION:'29.14',
|
||||
VERSION:'29.20',
|
||||
LANGUAGE:'None',
|
||||
COLLAPSE_INDEX:false,
|
||||
FILE_SUFFIX:'.html',
|
||||
|
@ -8,7 +8,7 @@
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<title>pylorax.base — Lorax 29.14 documentation</title>
|
||||
<title>pylorax.base — Lorax 29.20 documentation</title>
|
||||
|
||||
|
||||
|
||||
@ -57,7 +57,7 @@
|
||||
|
||||
|
||||
<div class="version">
|
||||
29.14
|
||||
29.20
|
||||
</div>
|
||||
|
||||
|
||||
@ -256,7 +256,7 @@
|
||||
<script type="text/javascript">
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT:'../../',
|
||||
VERSION:'29.14',
|
||||
VERSION:'29.20',
|
||||
LANGUAGE:'None',
|
||||
COLLAPSE_INDEX:false,
|
||||
FILE_SUFFIX:'.html',
|
||||
|
@ -8,7 +8,7 @@
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<title>pylorax.buildstamp — Lorax 29.14 documentation</title>
|
||||
<title>pylorax.buildstamp — Lorax 29.20 documentation</title>
|
||||
|
||||
|
||||
|
||||
@ -57,7 +57,7 @@
|
||||
|
||||
|
||||
<div class="version">
|
||||
29.14
|
||||
29.20
|
||||
</div>
|
||||
|
||||
|
||||
@ -250,7 +250,7 @@
|
||||
<script type="text/javascript">
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT:'../../',
|
||||
VERSION:'29.14',
|
||||
VERSION:'29.20',
|
||||
LANGUAGE:'None',
|
||||
COLLAPSE_INDEX:false,
|
||||
FILE_SUFFIX:'.html',
|
||||
|
@ -8,7 +8,7 @@
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<title>pylorax.cmdline — Lorax 29.14 documentation</title>
|
||||
<title>pylorax.cmdline — Lorax 29.20 documentation</title>
|
||||
|
||||
|
||||
|
||||
@ -57,7 +57,7 @@
|
||||
|
||||
|
||||
<div class="version">
|
||||
29.14
|
||||
29.20
|
||||
</div>
|
||||
|
||||
|
||||
@ -493,7 +493,7 @@
|
||||
<script type="text/javascript">
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT:'../../',
|
||||
VERSION:'29.14',
|
||||
VERSION:'29.20',
|
||||
LANGUAGE:'None',
|
||||
COLLAPSE_INDEX:false,
|
||||
FILE_SUFFIX:'.html',
|
||||
|
@ -8,7 +8,7 @@
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<title>pylorax.creator — Lorax 29.14 documentation</title>
|
||||
<title>pylorax.creator — Lorax 29.20 documentation</title>
|
||||
|
||||
|
||||
|
||||
@ -57,7 +57,7 @@
|
||||
|
||||
|
||||
<div class="version">
|
||||
29.14
|
||||
29.20
|
||||
</div>
|
||||
|
||||
|
||||
@ -903,7 +903,7 @@
|
||||
<script type="text/javascript">
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT:'../../',
|
||||
VERSION:'29.14',
|
||||
VERSION:'29.20',
|
||||
LANGUAGE:'None',
|
||||
COLLAPSE_INDEX:false,
|
||||
FILE_SUFFIX:'.html',
|
||||
|
@ -8,7 +8,7 @@
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<title>pylorax.decorators — Lorax 29.14 documentation</title>
|
||||
<title>pylorax.decorators — Lorax 29.20 documentation</title>
|
||||
|
||||
|
||||
|
||||
@ -57,7 +57,7 @@
|
||||
|
||||
|
||||
<div class="version">
|
||||
29.14
|
||||
29.20
|
||||
</div>
|
||||
|
||||
|
||||
@ -219,7 +219,7 @@
|
||||
<script type="text/javascript">
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT:'../../',
|
||||
VERSION:'29.14',
|
||||
VERSION:'29.20',
|
||||
LANGUAGE:'None',
|
||||
COLLAPSE_INDEX:false,
|
||||
FILE_SUFFIX:'.html',
|
||||
|
@ -8,7 +8,7 @@
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<title>pylorax.discinfo — Lorax 29.14 documentation</title>
|
||||
<title>pylorax.discinfo — Lorax 29.20 documentation</title>
|
||||
|
||||
|
||||
|
||||
@ -57,7 +57,7 @@
|
||||
|
||||
|
||||
<div class="version">
|
||||
29.14
|
||||
29.20
|
||||
</div>
|
||||
|
||||
|
||||
@ -228,7 +228,7 @@
|
||||
<script type="text/javascript">
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT:'../../',
|
||||
VERSION:'29.14',
|
||||
VERSION:'29.20',
|
||||
LANGUAGE:'None',
|
||||
COLLAPSE_INDEX:false,
|
||||
FILE_SUFFIX:'.html',
|
||||
|
403
docs/html/_modules/pylorax/dnfbase.html
Normal file
403
docs/html/_modules/pylorax/dnfbase.html
Normal file
@ -0,0 +1,403 @@
|
||||
|
||||
|
||||
<!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.dnfbase — Lorax 29.20 documentation</title>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<link rel="stylesheet" href="../../_static/css/theme.css" type="text/css" />
|
||||
<link rel="stylesheet" href="../../_static/pygments.css" type="text/css" />
|
||||
<link rel="index" title="Index" href="../../genindex.html" />
|
||||
<link rel="search" title="Search" href="../../search.html" />
|
||||
|
||||
|
||||
<script src="../../_static/js/modernizr.min.js"></script>
|
||||
|
||||
</head>
|
||||
|
||||
<body class="wy-body-for-nav">
|
||||
|
||||
|
||||
<div class="wy-grid-for-nav">
|
||||
|
||||
|
||||
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
|
||||
<div class="wy-side-scroll">
|
||||
<div class="wy-side-nav-search">
|
||||
|
||||
|
||||
|
||||
<a href="../../index.html" class="icon icon-home"> Lorax
|
||||
|
||||
|
||||
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="version">
|
||||
29.20
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
<div role="search">
|
||||
<form id="rtd-search-form" class="wy-form" action="../../search.html" method="get">
|
||||
<input type="text" name="q" placeholder="Search docs" />
|
||||
<input type="hidden" name="check_keywords" value="yes" />
|
||||
<input type="hidden" name="area" value="default" />
|
||||
</form>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<ul>
|
||||
<li class="toctree-l1"><a class="reference internal" href="../../intro.html">Introduction to Lorax</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="../../intro.html#before-lorax">Before Lorax</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="../../lorax.html">Lorax</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="../../livemedia-creator.html">livemedia-creator</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="../../lorax-composer.html">lorax-composer</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="../../composer-cli.html">composer-cli</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="../../product-images.html">Product and Updates Images</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="../../modules.html">src</a></li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
|
||||
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
|
||||
|
||||
|
||||
<nav class="wy-nav-top" aria-label="top navigation">
|
||||
|
||||
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
|
||||
<a href="../../index.html">Lorax</a>
|
||||
|
||||
</nav>
|
||||
|
||||
|
||||
<div class="wy-nav-content">
|
||||
|
||||
<div class="rst-content">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div role="navigation" aria-label="breadcrumbs navigation">
|
||||
|
||||
<ul class="wy-breadcrumbs">
|
||||
|
||||
<li><a href="../../index.html">Docs</a> »</li>
|
||||
|
||||
<li><a href="../index.html">Module code</a> »</li>
|
||||
|
||||
<li><a href="../pylorax.html">pylorax</a> »</li>
|
||||
|
||||
<li>pylorax.dnfbase</li>
|
||||
|
||||
|
||||
<li class="wy-breadcrumbs-aside">
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
<hr/>
|
||||
</div>
|
||||
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
|
||||
<div itemprop="articleBody">
|
||||
|
||||
<h1>Source code for pylorax.dnfbase</h1><div class="highlight"><pre>
|
||||
<span></span><span class="c1"># Copyright (C) 2018 Red Hat, Inc.</span>
|
||||
<span class="c1">#</span>
|
||||
<span class="c1"># This program is free software; you can redistribute it and/or modify</span>
|
||||
<span class="c1"># it under the terms of the GNU General Public License as published by</span>
|
||||
<span class="c1"># the Free Software Foundation; either version 2 of the License, or</span>
|
||||
<span class="c1"># (at your option) any later version.</span>
|
||||
<span class="c1">#</span>
|
||||
<span class="c1"># This program is distributed in the hope that it will be useful,</span>
|
||||
<span class="c1"># but WITHOUT ANY WARRANTY; without even the implied warranty of</span>
|
||||
<span class="c1"># MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the</span>
|
||||
<span class="c1"># GNU General Public License for more details.</span>
|
||||
<span class="c1">#</span>
|
||||
<span class="c1"># You should have received a copy of the GNU General Public License</span>
|
||||
<span class="c1"># along with this program. If not, see <http://www.gnu.org/licenses/>.</span>
|
||||
<span class="c1">#</span>
|
||||
<span class="kn">import</span> <span class="nn">logging</span>
|
||||
<span class="n">log</span> <span class="o">=</span> <span class="n">logging</span><span class="o">.</span><span class="n">getLogger</span><span class="p">(</span><span class="s2">"pylorax"</span><span class="p">)</span>
|
||||
|
||||
<span class="kn">import</span> <span class="nn">dnf</span>
|
||||
<span class="kn">import</span> <span class="nn">os</span>
|
||||
<span class="kn">import</span> <span class="nn">shutil</span>
|
||||
|
||||
<span class="kn">from</span> <span class="nn">pylorax</span> <span class="k">import</span> <span class="n">DEFAULT_PLATFORM_ID</span>
|
||||
<span class="kn">from</span> <span class="nn">pylorax.sysutils</span> <span class="k">import</span> <span class="n">flatconfig</span>
|
||||
|
||||
<div class="viewcode-block" id="get_dnf_base_object"><a class="viewcode-back" href="../../pylorax.html#pylorax.dnfbase.get_dnf_base_object">[docs]</a><span class="k">def</span> <span class="nf">get_dnf_base_object</span><span class="p">(</span><span class="n">installroot</span><span class="p">,</span> <span class="n">sources</span><span class="p">,</span> <span class="n">mirrorlists</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">repos</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span>
|
||||
<span class="n">enablerepos</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">disablerepos</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span>
|
||||
<span class="n">tempdir</span><span class="o">=</span><span class="s2">"/var/tmp"</span><span class="p">,</span> <span class="n">proxy</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">releasever</span><span class="o">=</span><span class="s2">"29"</span><span class="p">,</span>
|
||||
<span class="n">cachedir</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">logdir</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">sslverify</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="n">dnfplugins</span><span class="o">=</span><span class="kc">None</span><span class="p">):</span>
|
||||
<span class="sd">""" Create a dnf Base object and setup the repositories and installroot</span>
|
||||
|
||||
<span class="sd"> :param string installroot: Full path to the installroot</span>
|
||||
<span class="sd"> :param list sources: List of source repo urls to use for the installation</span>
|
||||
<span class="sd"> :param list enablerepos: List of repo names to enable</span>
|
||||
<span class="sd"> :param list disablerepos: List of repo names to disable</span>
|
||||
<span class="sd"> :param list mirrorlist: List of mirrors to use</span>
|
||||
<span class="sd"> :param string tempdir: Path of temporary directory</span>
|
||||
<span class="sd"> :param string proxy: http proxy to use when fetching packages</span>
|
||||
<span class="sd"> :param string releasever: Release version to pass to dnf</span>
|
||||
<span class="sd"> :param string cachedir: Directory to use for caching packages</span>
|
||||
<span class="sd"> :param bool noverifyssl: Set to True to ignore the CA of ssl certs. eg. use self-signed ssl for https repos.</span>
|
||||
|
||||
<span class="sd"> If tempdir is not set /var/tmp is used.</span>
|
||||
<span class="sd"> If cachedir is None a dnf.cache directory is created inside tmpdir</span>
|
||||
<span class="sd"> """</span>
|
||||
<span class="k">def</span> <span class="nf">sanitize_repo</span><span class="p">(</span><span class="n">repo</span><span class="p">):</span>
|
||||
<span class="sd">"""Convert bare paths to file:/// URIs, and silently reject protocols unhandled by yum"""</span>
|
||||
<span class="k">if</span> <span class="n">repo</span><span class="o">.</span><span class="n">startswith</span><span class="p">(</span><span class="s2">"/"</span><span class="p">):</span>
|
||||
<span class="k">return</span> <span class="s2">"file://</span><span class="si">{0}</span><span class="s2">"</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="n">repo</span><span class="p">)</span>
|
||||
<span class="k">elif</span> <span class="nb">any</span><span class="p">(</span><span class="n">repo</span><span class="o">.</span><span class="n">startswith</span><span class="p">(</span><span class="n">p</span><span class="p">)</span> <span class="k">for</span> <span class="n">p</span> <span class="ow">in</span> <span class="p">(</span><span class="s1">'http://'</span><span class="p">,</span> <span class="s1">'https://'</span><span class="p">,</span> <span class="s1">'ftp://'</span><span class="p">,</span> <span class="s1">'file://'</span><span class="p">)):</span>
|
||||
<span class="k">return</span> <span class="n">repo</span>
|
||||
<span class="k">else</span><span class="p">:</span>
|
||||
<span class="k">return</span> <span class="kc">None</span>
|
||||
|
||||
<span class="n">mirrorlists</span> <span class="o">=</span> <span class="n">mirrorlists</span> <span class="ow">or</span> <span class="p">[]</span>
|
||||
|
||||
<span class="c1"># sanitize the repositories</span>
|
||||
<span class="n">sources</span> <span class="o">=</span> <span class="nb">list</span><span class="p">(</span><span class="n">sanitize_repo</span><span class="p">(</span><span class="n">r</span><span class="p">)</span> <span class="k">for</span> <span class="n">r</span> <span class="ow">in</span> <span class="n">sources</span><span class="p">)</span>
|
||||
<span class="n">mirrorlists</span> <span class="o">=</span> <span class="nb">list</span><span class="p">(</span><span class="n">sanitize_repo</span><span class="p">(</span><span class="n">r</span><span class="p">)</span> <span class="k">for</span> <span class="n">r</span> <span class="ow">in</span> <span class="n">mirrorlists</span><span class="p">)</span>
|
||||
|
||||
<span class="c1"># remove invalid repositories</span>
|
||||
<span class="n">sources</span> <span class="o">=</span> <span class="nb">list</span><span class="p">(</span><span class="n">r</span> <span class="k">for</span> <span class="n">r</span> <span class="ow">in</span> <span class="n">sources</span> <span class="k">if</span> <span class="n">r</span><span class="p">)</span>
|
||||
<span class="n">mirrorlists</span> <span class="o">=</span> <span class="nb">list</span><span class="p">(</span><span class="n">r</span> <span class="k">for</span> <span class="n">r</span> <span class="ow">in</span> <span class="n">mirrorlists</span> <span class="k">if</span> <span class="n">r</span><span class="p">)</span>
|
||||
|
||||
<span class="k">if</span> <span class="ow">not</span> <span class="n">cachedir</span><span class="p">:</span>
|
||||
<span class="n">cachedir</span> <span class="o">=</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="n">tempdir</span><span class="p">,</span> <span class="s2">"dnf.cache"</span><span class="p">)</span>
|
||||
<span class="k">if</span> <span class="ow">not</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">isdir</span><span class="p">(</span><span class="n">cachedir</span><span class="p">):</span>
|
||||
<span class="n">os</span><span class="o">.</span><span class="n">mkdir</span><span class="p">(</span><span class="n">cachedir</span><span class="p">)</span>
|
||||
|
||||
<span class="k">if</span> <span class="ow">not</span> <span class="n">logdir</span><span class="p">:</span>
|
||||
<span class="n">logdir</span> <span class="o">=</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="n">tempdir</span><span class="p">,</span> <span class="s2">"dnf.logs"</span><span class="p">)</span>
|
||||
<span class="k">if</span> <span class="ow">not</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">isdir</span><span class="p">(</span><span class="n">logdir</span><span class="p">):</span>
|
||||
<span class="n">os</span><span class="o">.</span><span class="n">mkdir</span><span class="p">(</span><span class="n">logdir</span><span class="p">)</span>
|
||||
|
||||
<span class="n">dnfbase</span> <span class="o">=</span> <span class="n">dnf</span><span class="o">.</span><span class="n">Base</span><span class="p">()</span>
|
||||
<span class="c1"># Enable DNF pluings</span>
|
||||
<span class="c1"># NOTE: These come from the HOST system's environment</span>
|
||||
<span class="k">if</span> <span class="n">dnfplugins</span><span class="p">:</span>
|
||||
<span class="k">if</span> <span class="n">dnfplugins</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span> <span class="o">==</span> <span class="s2">"*"</span><span class="p">:</span>
|
||||
<span class="c1"># Enable them all</span>
|
||||
<span class="n">dnfbase</span><span class="o">.</span><span class="n">init_plugins</span><span class="p">()</span>
|
||||
<span class="k">else</span><span class="p">:</span>
|
||||
<span class="c1"># Only enable the listed plugins</span>
|
||||
<span class="n">dnfbase</span><span class="o">.</span><span class="n">init_plugins</span><span class="p">(</span><span class="n">disabled_glob</span><span class="o">=</span><span class="p">[</span><span class="s2">"*"</span><span class="p">],</span> <span class="n">enable_plugins</span><span class="o">=</span><span class="n">dnfplugins</span><span class="p">)</span>
|
||||
<span class="n">conf</span> <span class="o">=</span> <span class="n">dnfbase</span><span class="o">.</span><span class="n">conf</span>
|
||||
<span class="n">conf</span><span class="o">.</span><span class="n">logdir</span> <span class="o">=</span> <span class="n">logdir</span>
|
||||
<span class="n">conf</span><span class="o">.</span><span class="n">cachedir</span> <span class="o">=</span> <span class="n">cachedir</span>
|
||||
|
||||
<span class="n">conf</span><span class="o">.</span><span class="n">install_weak_deps</span> <span class="o">=</span> <span class="kc">False</span>
|
||||
<span class="n">conf</span><span class="o">.</span><span class="n">releasever</span> <span class="o">=</span> <span class="n">releasever</span>
|
||||
<span class="n">conf</span><span class="o">.</span><span class="n">installroot</span> <span class="o">=</span> <span class="n">installroot</span>
|
||||
<span class="n">conf</span><span class="o">.</span><span class="n">prepend_installroot</span><span class="p">(</span><span class="s1">'persistdir'</span><span class="p">)</span>
|
||||
<span class="c1"># this is a weird 'AppendOption' thing that, when you set it,</span>
|
||||
<span class="c1"># actually appends. Doing this adds 'nodocs' to the existing list</span>
|
||||
<span class="c1"># of values, over in libdnf, it does not replace the existing values.</span>
|
||||
<span class="n">conf</span><span class="o">.</span><span class="n">tsflags</span> <span class="o">=</span> <span class="p">[</span><span class="s1">'nodocs'</span><span class="p">]</span>
|
||||
|
||||
<span class="k">if</span> <span class="n">proxy</span><span class="p">:</span>
|
||||
<span class="n">conf</span><span class="o">.</span><span class="n">proxy</span> <span class="o">=</span> <span class="n">proxy</span>
|
||||
|
||||
<span class="k">if</span> <span class="n">sslverify</span> <span class="o">==</span> <span class="kc">False</span><span class="p">:</span>
|
||||
<span class="n">conf</span><span class="o">.</span><span class="n">sslverify</span> <span class="o">=</span> <span class="kc">False</span>
|
||||
|
||||
<span class="c1"># DNF 3.2 needs to have module_platform_id set, otherwise depsolve won't work correctly</span>
|
||||
<span class="k">if</span> <span class="ow">not</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">exists</span><span class="p">(</span><span class="s2">"/etc/os-release"</span><span class="p">):</span>
|
||||
<span class="n">log</span><span class="o">.</span><span class="n">warning</span><span class="p">(</span><span class="s2">"/etc/os-release is missing, cannot determine platform id, falling back to </span><span class="si">%s</span><span class="s2">"</span><span class="p">,</span> <span class="n">DEFAULT_PLATFORM_ID</span><span class="p">)</span>
|
||||
<span class="n">platform_id</span> <span class="o">=</span> <span class="n">DEFAULT_PLATFORM_ID</span>
|
||||
<span class="k">else</span><span class="p">:</span>
|
||||
<span class="n">os_release</span> <span class="o">=</span> <span class="n">flatconfig</span><span class="p">(</span><span class="s2">"/etc/os-release"</span><span class="p">)</span>
|
||||
<span class="n">platform_id</span> <span class="o">=</span> <span class="n">os_release</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">"PLATFORM_ID"</span><span class="p">,</span> <span class="n">DEFAULT_PLATFORM_ID</span><span class="p">)</span>
|
||||
<span class="n">log</span><span class="o">.</span><span class="n">info</span><span class="p">(</span><span class="s2">"Using </span><span class="si">%s</span><span class="s2"> for module_platform_id"</span><span class="p">,</span> <span class="n">platform_id</span><span class="p">)</span>
|
||||
<span class="n">conf</span><span class="o">.</span><span class="n">module_platform_id</span> <span class="o">=</span> <span class="n">platform_id</span>
|
||||
|
||||
<span class="c1"># Add .repo files</span>
|
||||
<span class="k">if</span> <span class="n">repos</span><span class="p">:</span>
|
||||
<span class="n">reposdir</span> <span class="o">=</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="n">tempdir</span><span class="p">,</span> <span class="s2">"dnf.repos"</span><span class="p">)</span>
|
||||
<span class="k">if</span> <span class="ow">not</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">isdir</span><span class="p">(</span><span class="n">reposdir</span><span class="p">):</span>
|
||||
<span class="n">os</span><span class="o">.</span><span class="n">mkdir</span><span class="p">(</span><span class="n">reposdir</span><span class="p">)</span>
|
||||
<span class="k">for</span> <span class="n">r</span> <span class="ow">in</span> <span class="n">repos</span><span class="p">:</span>
|
||||
<span class="n">shutil</span><span class="o">.</span><span class="n">copy2</span><span class="p">(</span><span class="n">r</span><span class="p">,</span> <span class="n">reposdir</span><span class="p">)</span>
|
||||
<span class="n">conf</span><span class="o">.</span><span class="n">reposdir</span> <span class="o">=</span> <span class="p">[</span><span class="n">reposdir</span><span class="p">]</span>
|
||||
<span class="n">dnfbase</span><span class="o">.</span><span class="n">read_all_repos</span><span class="p">()</span>
|
||||
|
||||
<span class="c1"># add the sources</span>
|
||||
<span class="k">for</span> <span class="n">i</span><span class="p">,</span> <span class="n">r</span> <span class="ow">in</span> <span class="nb">enumerate</span><span class="p">(</span><span class="n">sources</span><span class="p">):</span>
|
||||
<span class="k">if</span> <span class="s2">"SRPM"</span> <span class="ow">in</span> <span class="n">r</span> <span class="ow">or</span> <span class="s2">"srpm"</span> <span class="ow">in</span> <span class="n">r</span><span class="p">:</span>
|
||||
<span class="n">log</span><span class="o">.</span><span class="n">info</span><span class="p">(</span><span class="s2">"Skipping source repo: </span><span class="si">%s</span><span class="s2">"</span><span class="p">,</span> <span class="n">r</span><span class="p">)</span>
|
||||
<span class="k">continue</span>
|
||||
<span class="n">repo_name</span> <span class="o">=</span> <span class="s2">"lorax-repo-</span><span class="si">%d</span><span class="s2">"</span> <span class="o">%</span> <span class="n">i</span>
|
||||
<span class="n">repo</span> <span class="o">=</span> <span class="n">dnf</span><span class="o">.</span><span class="n">repo</span><span class="o">.</span><span class="n">Repo</span><span class="p">(</span><span class="n">repo_name</span><span class="p">,</span> <span class="n">conf</span><span class="p">)</span>
|
||||
<span class="n">repo</span><span class="o">.</span><span class="n">baseurl</span> <span class="o">=</span> <span class="p">[</span><span class="n">r</span><span class="p">]</span>
|
||||
<span class="k">if</span> <span class="n">proxy</span><span class="p">:</span>
|
||||
<span class="n">repo</span><span class="o">.</span><span class="n">proxy</span> <span class="o">=</span> <span class="n">proxy</span>
|
||||
<span class="n">repo</span><span class="o">.</span><span class="n">enable</span><span class="p">()</span>
|
||||
<span class="n">dnfbase</span><span class="o">.</span><span class="n">repos</span><span class="o">.</span><span class="n">add</span><span class="p">(</span><span class="n">repo</span><span class="p">)</span>
|
||||
<span class="n">log</span><span class="o">.</span><span class="n">info</span><span class="p">(</span><span class="s2">"Added '</span><span class="si">%s</span><span class="s2">': </span><span class="si">%s</span><span class="s2">"</span><span class="p">,</span> <span class="n">repo_name</span><span class="p">,</span> <span class="n">r</span><span class="p">)</span>
|
||||
<span class="n">log</span><span class="o">.</span><span class="n">info</span><span class="p">(</span><span class="s2">"Fetching metadata..."</span><span class="p">)</span>
|
||||
<span class="k">try</span><span class="p">:</span>
|
||||
<span class="n">repo</span><span class="o">.</span><span class="n">load</span><span class="p">()</span>
|
||||
<span class="k">except</span> <span class="n">dnf</span><span class="o">.</span><span class="n">exceptions</span><span class="o">.</span><span class="n">RepoError</span> <span class="k">as</span> <span class="n">e</span><span class="p">:</span>
|
||||
<span class="n">log</span><span class="o">.</span><span class="n">error</span><span class="p">(</span><span class="s2">"Error fetching metadata for </span><span class="si">%s</span><span class="s2">: </span><span class="si">%s</span><span class="s2">"</span><span class="p">,</span> <span class="n">repo_name</span><span class="p">,</span> <span class="n">e</span><span class="p">)</span>
|
||||
<span class="k">return</span> <span class="kc">None</span>
|
||||
|
||||
<span class="c1"># add the mirrorlists</span>
|
||||
<span class="k">for</span> <span class="n">i</span><span class="p">,</span> <span class="n">r</span> <span class="ow">in</span> <span class="nb">enumerate</span><span class="p">(</span><span class="n">mirrorlists</span><span class="p">):</span>
|
||||
<span class="k">if</span> <span class="s2">"SRPM"</span> <span class="ow">in</span> <span class="n">r</span> <span class="ow">or</span> <span class="s2">"srpm"</span> <span class="ow">in</span> <span class="n">r</span><span class="p">:</span>
|
||||
<span class="n">log</span><span class="o">.</span><span class="n">info</span><span class="p">(</span><span class="s2">"Skipping source repo: </span><span class="si">%s</span><span class="s2">"</span><span class="p">,</span> <span class="n">r</span><span class="p">)</span>
|
||||
<span class="k">continue</span>
|
||||
<span class="n">repo_name</span> <span class="o">=</span> <span class="s2">"lorax-mirrorlist-</span><span class="si">%d</span><span class="s2">"</span> <span class="o">%</span> <span class="n">i</span>
|
||||
<span class="n">repo</span> <span class="o">=</span> <span class="n">dnf</span><span class="o">.</span><span class="n">repo</span><span class="o">.</span><span class="n">Repo</span><span class="p">(</span><span class="n">repo_name</span><span class="p">,</span> <span class="n">conf</span><span class="p">)</span>
|
||||
<span class="n">repo</span><span class="o">.</span><span class="n">mirrorlist</span> <span class="o">=</span> <span class="n">r</span>
|
||||
<span class="k">if</span> <span class="n">proxy</span><span class="p">:</span>
|
||||
<span class="n">repo</span><span class="o">.</span><span class="n">proxy</span> <span class="o">=</span> <span class="n">proxy</span>
|
||||
<span class="n">repo</span><span class="o">.</span><span class="n">enable</span><span class="p">()</span>
|
||||
<span class="n">dnfbase</span><span class="o">.</span><span class="n">repos</span><span class="o">.</span><span class="n">add</span><span class="p">(</span><span class="n">repo</span><span class="p">)</span>
|
||||
<span class="n">log</span><span class="o">.</span><span class="n">info</span><span class="p">(</span><span class="s2">"Added '</span><span class="si">%s</span><span class="s2">': </span><span class="si">%s</span><span class="s2">"</span><span class="p">,</span> <span class="n">repo_name</span><span class="p">,</span> <span class="n">r</span><span class="p">)</span>
|
||||
<span class="n">log</span><span class="o">.</span><span class="n">info</span><span class="p">(</span><span class="s2">"Fetching metadata..."</span><span class="p">)</span>
|
||||
<span class="k">try</span><span class="p">:</span>
|
||||
<span class="n">repo</span><span class="o">.</span><span class="n">load</span><span class="p">()</span>
|
||||
<span class="k">except</span> <span class="n">dnf</span><span class="o">.</span><span class="n">exceptions</span><span class="o">.</span><span class="n">RepoError</span> <span class="k">as</span> <span class="n">e</span><span class="p">:</span>
|
||||
<span class="n">log</span><span class="o">.</span><span class="n">error</span><span class="p">(</span><span class="s2">"Error fetching metadata for </span><span class="si">%s</span><span class="s2">: </span><span class="si">%s</span><span class="s2">"</span><span class="p">,</span> <span class="n">repo_name</span><span class="p">,</span> <span class="n">e</span><span class="p">)</span>
|
||||
<span class="k">return</span> <span class="kc">None</span>
|
||||
|
||||
<span class="c1"># Enable repos listed on the cmdline</span>
|
||||
<span class="k">for</span> <span class="n">r</span> <span class="ow">in</span> <span class="n">enablerepos</span><span class="p">:</span>
|
||||
<span class="n">repolist</span> <span class="o">=</span> <span class="n">dnfbase</span><span class="o">.</span><span class="n">repos</span><span class="o">.</span><span class="n">get_matching</span><span class="p">(</span><span class="n">r</span><span class="p">)</span>
|
||||
<span class="k">if</span> <span class="ow">not</span> <span class="n">repolist</span><span class="p">:</span>
|
||||
<span class="n">log</span><span class="o">.</span><span class="n">warning</span><span class="p">(</span><span class="s2">"</span><span class="si">%s</span><span class="s2"> is an unknown repo, not enabling it"</span><span class="p">,</span> <span class="n">r</span><span class="p">)</span>
|
||||
<span class="k">else</span><span class="p">:</span>
|
||||
<span class="n">repolist</span><span class="o">.</span><span class="n">enable</span><span class="p">()</span>
|
||||
<span class="n">log</span><span class="o">.</span><span class="n">info</span><span class="p">(</span><span class="s2">"Enabled repo </span><span class="si">%s</span><span class="s2">"</span><span class="p">,</span> <span class="n">r</span><span class="p">)</span>
|
||||
|
||||
<span class="c1"># Disable repos listed on the cmdline</span>
|
||||
<span class="k">for</span> <span class="n">r</span> <span class="ow">in</span> <span class="n">disablerepos</span><span class="p">:</span>
|
||||
<span class="n">repolist</span> <span class="o">=</span> <span class="n">dnfbase</span><span class="o">.</span><span class="n">repos</span><span class="o">.</span><span class="n">get_matching</span><span class="p">(</span><span class="n">r</span><span class="p">)</span>
|
||||
<span class="k">if</span> <span class="ow">not</span> <span class="n">repolist</span><span class="p">:</span>
|
||||
<span class="n">log</span><span class="o">.</span><span class="n">warning</span><span class="p">(</span><span class="s2">"</span><span class="si">%s</span><span class="s2"> is an unknown repo, not disabling it"</span><span class="p">,</span> <span class="n">r</span><span class="p">)</span>
|
||||
<span class="k">else</span><span class="p">:</span>
|
||||
<span class="n">repolist</span><span class="o">.</span><span class="n">disable</span><span class="p">()</span>
|
||||
<span class="n">log</span><span class="o">.</span><span class="n">info</span><span class="p">(</span><span class="s2">"Disabled repo </span><span class="si">%s</span><span class="s2">"</span><span class="p">,</span> <span class="n">r</span><span class="p">)</span>
|
||||
|
||||
<span class="n">dnfbase</span><span class="o">.</span><span class="n">fill_sack</span><span class="p">(</span><span class="n">load_system_repo</span><span class="o">=</span><span class="kc">False</span><span class="p">)</span>
|
||||
<span class="n">dnfbase</span><span class="o">.</span><span class="n">read_comps</span><span class="p">()</span>
|
||||
|
||||
<span class="k">return</span> <span class="n">dnfbase</span></div>
|
||||
</pre></div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<footer>
|
||||
|
||||
|
||||
<hr/>
|
||||
|
||||
<div role="contentinfo">
|
||||
<p>
|
||||
© Copyright 2018, Red Hat, Inc..
|
||||
|
||||
</p>
|
||||
</div>
|
||||
Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/rtfd/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>.
|
||||
|
||||
</footer>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</section>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT:'../../',
|
||||
VERSION:'29.20',
|
||||
LANGUAGE:'None',
|
||||
COLLAPSE_INDEX:false,
|
||||
FILE_SUFFIX:'.html',
|
||||
HAS_SOURCE: true,
|
||||
SOURCELINK_SUFFIX: '.txt'
|
||||
};
|
||||
</script>
|
||||
<script type="text/javascript" src="../../_static/jquery.js"></script>
|
||||
<script type="text/javascript" src="../../_static/underscore.js"></script>
|
||||
<script type="text/javascript" src="../../_static/doctools.js"></script>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<script type="text/javascript" src="../../_static/js/theme.js"></script>
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
jQuery(function () {
|
||||
SphinxRtdTheme.Navigation.enable(true);
|
||||
});
|
||||
</script>
|
||||
|
||||
</body>
|
||||
</html>
|
@ -8,7 +8,7 @@
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<title>pylorax.dnfhelper — Lorax 29.14 documentation</title>
|
||||
<title>pylorax.dnfhelper — Lorax 29.20 documentation</title>
|
||||
|
||||
|
||||
|
||||
@ -57,7 +57,7 @@
|
||||
|
||||
|
||||
<div class="version">
|
||||
29.14
|
||||
29.20
|
||||
</div>
|
||||
|
||||
|
||||
@ -299,7 +299,7 @@
|
||||
<script type="text/javascript">
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT:'../../',
|
||||
VERSION:'29.14',
|
||||
VERSION:'29.20',
|
||||
LANGUAGE:'None',
|
||||
COLLAPSE_INDEX:false,
|
||||
FILE_SUFFIX:'.html',
|
||||
|
@ -8,7 +8,7 @@
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<title>pylorax.executils — Lorax 29.14 documentation</title>
|
||||
<title>pylorax.executils — Lorax 29.20 documentation</title>
|
||||
|
||||
|
||||
|
||||
@ -57,7 +57,7 @@
|
||||
|
||||
|
||||
<div class="version">
|
||||
29.14
|
||||
29.20
|
||||
</div>
|
||||
|
||||
|
||||
@ -184,6 +184,7 @@
|
||||
<span class="n">log</span> <span class="o">=</span> <span class="n">logging</span><span class="o">.</span><span class="n">getLogger</span><span class="p">(</span><span class="s2">"pylorax"</span><span class="p">)</span>
|
||||
<span class="n">program_log</span> <span class="o">=</span> <span class="n">logging</span><span class="o">.</span><span class="n">getLogger</span><span class="p">(</span><span class="s2">"program"</span><span class="p">)</span>
|
||||
|
||||
<span class="c1"># pylint: disable=not-context-manager</span>
|
||||
<span class="kn">from</span> <span class="nn">threading</span> <span class="k">import</span> <span class="n">Lock</span>
|
||||
<span class="n">program_log_lock</span> <span class="o">=</span> <span class="n">Lock</span><span class="p">()</span>
|
||||
|
||||
@ -272,6 +273,7 @@
|
||||
<span class="k">if</span> <span class="n">env_add</span><span class="p">:</span>
|
||||
<span class="n">env</span><span class="o">.</span><span class="n">update</span><span class="p">(</span><span class="n">env_add</span><span class="p">)</span>
|
||||
|
||||
<span class="c1"># pylint: disable=subprocess-popen-preexec-fn</span>
|
||||
<span class="k">return</span> <span class="n">subprocess</span><span class="o">.</span><span class="n">Popen</span><span class="p">(</span><span class="n">argv</span><span class="p">,</span>
|
||||
<span class="n">stdin</span><span class="o">=</span><span class="n">stdin</span><span class="p">,</span>
|
||||
<span class="n">stdout</span><span class="o">=</span><span class="n">stdout</span><span class="p">,</span>
|
||||
@ -536,7 +538,7 @@
|
||||
<script type="text/javascript">
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT:'../../',
|
||||
VERSION:'29.14',
|
||||
VERSION:'29.20',
|
||||
LANGUAGE:'None',
|
||||
COLLAPSE_INDEX:false,
|
||||
FILE_SUFFIX:'.html',
|
||||
|
@ -8,7 +8,7 @@
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<title>pylorax.imgutils — Lorax 29.14 documentation</title>
|
||||
<title>pylorax.imgutils — Lorax 29.20 documentation</title>
|
||||
|
||||
|
||||
|
||||
@ -57,7 +57,7 @@
|
||||
|
||||
|
||||
<div class="version">
|
||||
29.14
|
||||
29.20
|
||||
</div>
|
||||
|
||||
|
||||
@ -353,10 +353,7 @@
|
||||
|
||||
<span class="c1"># Sometimes the loop device isn't ready yet, make extra sure before returning</span>
|
||||
<span class="n">loop_waitfor</span><span class="p">(</span><span class="n">dev</span><span class="p">,</span> <span class="n">outfile</span><span class="p">)</span>
|
||||
<span class="k">except</span> <span class="n">CalledProcessError</span><span class="p">:</span>
|
||||
<span class="c1"># Problems running losetup are always errors, raise immediately</span>
|
||||
<span class="k">raise</span>
|
||||
<span class="k">except</span> <span class="ne">RuntimeError</span> <span class="k">as</span> <span class="n">e</span><span class="p">:</span>
|
||||
<span class="k">except</span> <span class="ne">RuntimeError</span><span class="p">:</span>
|
||||
<span class="c1"># Try to setup the loop device 3 times</span>
|
||||
<span class="k">if</span> <span class="n">retries</span> <span class="o">==</span> <span class="mi">3</span><span class="p">:</span>
|
||||
<span class="n">logger</span><span class="o">.</span><span class="n">error</span><span class="p">(</span><span class="s2">"loop_attach failed, retries exhausted."</span><span class="p">)</span>
|
||||
@ -729,7 +726,7 @@
|
||||
<script type="text/javascript">
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT:'../../',
|
||||
VERSION:'29.14',
|
||||
VERSION:'29.20',
|
||||
LANGUAGE:'None',
|
||||
COLLAPSE_INDEX:false,
|
||||
FILE_SUFFIX:'.html',
|
||||
|
@ -8,7 +8,7 @@
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<title>pylorax.installer — Lorax 29.14 documentation</title>
|
||||
<title>pylorax.installer — Lorax 29.20 documentation</title>
|
||||
|
||||
|
||||
|
||||
@ -57,7 +57,7 @@
|
||||
|
||||
|
||||
<div class="version">
|
||||
29.14
|
||||
29.20
|
||||
</div>
|
||||
|
||||
|
||||
@ -542,16 +542,23 @@
|
||||
<span class="n">setfiles_args</span> <span class="o">=</span> <span class="p">[</span><span class="s2">"-e"</span><span class="p">,</span> <span class="s2">"/proc"</span><span class="p">,</span> <span class="s2">"-e"</span><span class="p">,</span> <span class="s2">"/sys"</span><span class="p">,</span> <span class="s2">"-e"</span><span class="p">,</span> <span class="s2">"/dev"</span><span class="p">,</span>
|
||||
<span class="s2">"/etc/selinux/targeted/contexts/files/file_contexts"</span><span class="p">,</span> <span class="s2">"/"</span><span class="p">]</span>
|
||||
|
||||
<span class="c1"># setfiles may not be available, warn instead of fail</span>
|
||||
<span class="k">try</span><span class="p">:</span>
|
||||
<span class="k">if</span> <span class="s2">"--dirinstall"</span> <span class="ow">in</span> <span class="n">args</span><span class="p">:</span>
|
||||
<span class="k">if</span> <span class="s2">"--dirinstall"</span> <span class="ow">in</span> <span class="n">args</span><span class="p">:</span>
|
||||
<span class="c1"># setfiles may not be available, warn instead of fail</span>
|
||||
<span class="k">try</span><span class="p">:</span>
|
||||
<span class="n">execWithRedirect</span><span class="p">(</span><span class="s2">"setfiles"</span><span class="p">,</span> <span class="n">setfiles_args</span><span class="p">,</span> <span class="n">root</span><span class="o">=</span><span class="n">dirinstall_path</span><span class="p">)</span>
|
||||
<span class="k">else</span><span class="p">:</span>
|
||||
<span class="k">with</span> <span class="n">PartitionMount</span><span class="p">(</span><span class="n">disk_img</span><span class="p">)</span> <span class="k">as</span> <span class="n">img_mount</span><span class="p">:</span>
|
||||
<span class="k">if</span> <span class="n">img_mount</span> <span class="ow">and</span> <span class="n">img_mount</span><span class="o">.</span><span class="n">mount_dir</span><span class="p">:</span>
|
||||
<span class="k">except</span> <span class="p">(</span><span class="n">subprocess</span><span class="o">.</span><span class="n">CalledProcessError</span><span class="p">,</span> <span class="ne">OSError</span><span class="p">)</span> <span class="k">as</span> <span class="n">e</span><span class="p">:</span>
|
||||
<span class="n">log</span><span class="o">.</span><span class="n">warning</span><span class="p">(</span><span class="s2">"Running setfiles on install tree failed: </span><span class="si">%s</span><span class="s2">"</span><span class="p">,</span> <span class="nb">str</span><span class="p">(</span><span class="n">e</span><span class="p">))</span>
|
||||
<span class="k">else</span><span class="p">:</span>
|
||||
<span class="k">with</span> <span class="n">PartitionMount</span><span class="p">(</span><span class="n">disk_img</span><span class="p">)</span> <span class="k">as</span> <span class="n">img_mount</span><span class="p">:</span>
|
||||
<span class="k">if</span> <span class="n">img_mount</span> <span class="ow">and</span> <span class="n">img_mount</span><span class="o">.</span><span class="n">mount_dir</span><span class="p">:</span>
|
||||
<span class="k">try</span><span class="p">:</span>
|
||||
<span class="n">execWithRedirect</span><span class="p">(</span><span class="s2">"setfiles"</span><span class="p">,</span> <span class="n">setfiles_args</span><span class="p">,</span> <span class="n">root</span><span class="o">=</span><span class="n">img_mount</span><span class="o">.</span><span class="n">mount_dir</span><span class="p">)</span>
|
||||
<span class="k">except</span> <span class="p">(</span><span class="n">subprocess</span><span class="o">.</span><span class="n">CalledProcessError</span><span class="p">,</span> <span class="ne">OSError</span><span class="p">)</span> <span class="k">as</span> <span class="n">e</span><span class="p">:</span>
|
||||
<span class="n">log</span><span class="o">.</span><span class="n">warning</span><span class="p">(</span><span class="s2">"Running setfiles on install tree failed: </span><span class="si">%s</span><span class="s2">"</span><span class="p">,</span> <span class="nb">str</span><span class="p">(</span><span class="n">e</span><span class="p">))</span>
|
||||
<span class="k">except</span> <span class="p">(</span><span class="n">subprocess</span><span class="o">.</span><span class="n">CalledProcessError</span><span class="p">,</span> <span class="ne">OSError</span><span class="p">)</span> <span class="k">as</span> <span class="n">e</span><span class="p">:</span>
|
||||
<span class="n">log</span><span class="o">.</span><span class="n">warning</span><span class="p">(</span><span class="s2">"Running setfiles on install tree failed: </span><span class="si">%s</span><span class="s2">"</span><span class="p">,</span> <span class="nb">str</span><span class="p">(</span><span class="n">e</span><span class="p">))</span>
|
||||
|
||||
<span class="c1"># For image installs, run fstrim to discard unused blocks. This way</span>
|
||||
<span class="c1"># unused blocks do not need to be allocated for sparse image types</span>
|
||||
<span class="n">execWithRedirect</span><span class="p">(</span><span class="s2">"fstrim"</span><span class="p">,</span> <span class="p">[</span><span class="n">img_mount</span><span class="o">.</span><span class="n">mount_dir</span><span class="p">])</span>
|
||||
|
||||
<span class="k">except</span> <span class="p">(</span><span class="n">subprocess</span><span class="o">.</span><span class="n">CalledProcessError</span><span class="p">,</span> <span class="ne">OSError</span><span class="p">)</span> <span class="k">as</span> <span class="n">e</span><span class="p">:</span>
|
||||
<span class="n">log</span><span class="o">.</span><span class="n">error</span><span class="p">(</span><span class="s2">"Running anaconda failed: </span><span class="si">%s</span><span class="s2">"</span><span class="p">,</span> <span class="n">e</span><span class="p">)</span>
|
||||
@ -637,7 +644,10 @@
|
||||
<span class="n">rc</span> <span class="o">=</span> <span class="n">mktar</span><span class="p">(</span><span class="n">ROOT_PATH</span><span class="p">,</span> <span class="n">disk_img</span><span class="p">,</span> <span class="n">opts</span><span class="o">.</span><span class="n">compression</span><span class="p">,</span> <span class="n">compress_args</span><span class="p">)</span>
|
||||
|
||||
<span class="k">if</span> <span class="n">rc</span><span class="p">:</span>
|
||||
<span class="k">raise</span> <span class="n">InstallError</span><span class="p">(</span><span class="s2">"novirt_install mktar failed: rc=</span><span class="si">%s</span><span class="s2">"</span> <span class="o">%</span> <span class="n">rc</span><span class="p">)</span></div>
|
||||
<span class="k">raise</span> <span class="n">InstallError</span><span class="p">(</span><span class="s2">"novirt_install mktar failed: rc=</span><span class="si">%s</span><span class="s2">"</span> <span class="o">%</span> <span class="n">rc</span><span class="p">)</span>
|
||||
<span class="k">else</span><span class="p">:</span>
|
||||
<span class="c1"># For raw disk images, use fallocate to deallocate unused space</span>
|
||||
<span class="n">execWithRedirect</span><span class="p">(</span><span class="s2">"fallocate"</span><span class="p">,</span> <span class="p">[</span><span class="s2">"--dig-holes"</span><span class="p">,</span> <span class="n">disk_img</span><span class="p">],</span> <span class="n">raise_err</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span></div>
|
||||
|
||||
|
||||
<div class="viewcode-block" id="virt_install"><a class="viewcode-back" href="../../pylorax.html#pylorax.installer.virt_install">[docs]</a><span class="k">def</span> <span class="nf">virt_install</span><span class="p">(</span><span class="n">opts</span><span class="p">,</span> <span class="n">install_log</span><span class="p">,</span> <span class="n">disk_img</span><span class="p">,</span> <span class="n">disk_size</span><span class="p">):</span>
|
||||
@ -792,7 +802,7 @@
|
||||
<script type="text/javascript">
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT:'../../',
|
||||
VERSION:'29.14',
|
||||
VERSION:'29.20',
|
||||
LANGUAGE:'None',
|
||||
COLLAPSE_INDEX:false,
|
||||
FILE_SUFFIX:'.html',
|
||||
|
@ -8,7 +8,7 @@
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<title>pylorax.ltmpl — Lorax 29.14 documentation</title>
|
||||
<title>pylorax.ltmpl — Lorax 29.20 documentation</title>
|
||||
|
||||
|
||||
|
||||
@ -57,7 +57,7 @@
|
||||
|
||||
|
||||
<div class="version">
|
||||
29.14
|
||||
29.20
|
||||
</div>
|
||||
|
||||
|
||||
@ -158,7 +158,7 @@
|
||||
<span></span><span class="c1">#</span>
|
||||
<span class="c1"># ltmpl.py</span>
|
||||
<span class="c1">#</span>
|
||||
<span class="c1"># Copyright (C) 2009-2015 Red Hat, Inc.</span>
|
||||
<span class="c1"># Copyright (C) 2009-2018 Red Hat, Inc.</span>
|
||||
<span class="c1">#</span>
|
||||
<span class="c1"># This program is free software; you can redistribute it and/or modify</span>
|
||||
<span class="c1"># it under the terms of the GNU General Public License as published by</span>
|
||||
@ -366,7 +366,6 @@
|
||||
<span class="k">for</span> <span class="n">pkg</span> <span class="ow">in</span> <span class="n">debug_pkgs</span><span class="p">:</span>
|
||||
<span class="n">f</span><span class="o">.</span><span class="n">write</span><span class="p">(</span><span class="s2">"</span><span class="si">%s</span><span class="se">\n</span><span class="s2">"</span> <span class="o">%</span> <span class="n">pkg</span><span class="p">)</span>
|
||||
|
||||
|
||||
<div class="viewcode-block" id="LoraxTemplateRunner.run"><a class="viewcode-back" href="../../pylorax.html#pylorax.ltmpl.LoraxTemplateRunner.run">[docs]</a> <span class="k">def</span> <span class="nf">run</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">templatefile</span><span class="p">,</span> <span class="o">**</span><span class="n">variables</span><span class="p">):</span>
|
||||
<span class="k">for</span> <span class="n">k</span><span class="p">,</span><span class="n">v</span> <span class="ow">in</span> <span class="nb">list</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">defaults</span><span class="o">.</span><span class="n">items</span><span class="p">())</span> <span class="o">+</span> <span class="nb">list</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">builtins</span><span class="o">.</span><span class="n">items</span><span class="p">()):</span>
|
||||
<span class="n">variables</span><span class="o">.</span><span class="n">setdefault</span><span class="p">(</span><span class="n">k</span><span class="p">,</span><span class="n">v</span><span class="p">)</span>
|
||||
@ -405,10 +404,10 @@
|
||||
<span class="c1"># skip the bit about "ltmpl.py, in _run()" - we know that</span>
|
||||
<span class="n">exclines</span><span class="o">.</span><span class="n">pop</span><span class="p">(</span><span class="mi">1</span><span class="p">)</span>
|
||||
<span class="c1"># log the "ErrorType: this is what happened" line</span>
|
||||
<span class="n">logger</span><span class="o">.</span><span class="n">error</span><span class="p">(</span><span class="s2">" "</span> <span class="o">+</span> <span class="n">exclines</span><span class="p">[</span><span class="o">-</span><span class="mi">1</span><span class="p">]</span><span class="o">.</span><span class="n">strip</span><span class="p">())</span>
|
||||
<span class="n">logger</span><span class="o">.</span><span class="n">error</span><span class="p">(</span><span class="s2">" </span><span class="si">%s</span><span class="s2">"</span><span class="p">,</span> <span class="n">exclines</span><span class="p">[</span><span class="o">-</span><span class="mi">1</span><span class="p">]</span><span class="o">.</span><span class="n">strip</span><span class="p">())</span>
|
||||
<span class="c1"># and log the entire traceback to the debug log</span>
|
||||
<span class="k">for</span> <span class="n">_line</span> <span class="ow">in</span> <span class="s1">''</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="n">exclines</span><span class="p">)</span><span class="o">.</span><span class="n">splitlines</span><span class="p">():</span>
|
||||
<span class="n">logger</span><span class="o">.</span><span class="n">debug</span><span class="p">(</span><span class="s2">" "</span> <span class="o">+</span> <span class="n">_line</span><span class="p">)</span>
|
||||
<span class="n">logger</span><span class="o">.</span><span class="n">debug</span><span class="p">(</span><span class="s2">" </span><span class="si">%s</span><span class="s2">"</span><span class="p">,</span> <span class="n">_line</span><span class="p">)</span>
|
||||
<span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">fatalerrors</span><span class="p">:</span>
|
||||
<span class="k">raise</span>
|
||||
|
||||
@ -960,7 +959,7 @@
|
||||
<script type="text/javascript">
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT:'../../',
|
||||
VERSION:'29.14',
|
||||
VERSION:'29.20',
|
||||
LANGUAGE:'None',
|
||||
COLLAPSE_INDEX:false,
|
||||
FILE_SUFFIX:'.html',
|
||||
|
@ -8,7 +8,7 @@
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<title>pylorax.monitor — Lorax 29.14 documentation</title>
|
||||
<title>pylorax.monitor — Lorax 29.20 documentation</title>
|
||||
|
||||
|
||||
|
||||
@ -57,7 +57,7 @@
|
||||
|
||||
|
||||
<div class="version">
|
||||
29.14
|
||||
29.20
|
||||
</div>
|
||||
|
||||
|
||||
@ -392,7 +392,7 @@
|
||||
<script type="text/javascript">
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT:'../../',
|
||||
VERSION:'29.14',
|
||||
VERSION:'29.20',
|
||||
LANGUAGE:'None',
|
||||
COLLAPSE_INDEX:false,
|
||||
FILE_SUFFIX:'.html',
|
||||
|
@ -8,7 +8,7 @@
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<title>pylorax.mount — Lorax 29.14 documentation</title>
|
||||
<title>pylorax.mount — Lorax 29.20 documentation</title>
|
||||
|
||||
|
||||
|
||||
@ -57,7 +57,7 @@
|
||||
|
||||
|
||||
<div class="version">
|
||||
29.14
|
||||
29.20
|
||||
</div>
|
||||
|
||||
|
||||
@ -291,7 +291,7 @@
|
||||
<script type="text/javascript">
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT:'../../',
|
||||
VERSION:'29.14',
|
||||
VERSION:'29.20',
|
||||
LANGUAGE:'None',
|
||||
COLLAPSE_INDEX:false,
|
||||
FILE_SUFFIX:'.html',
|
||||
|
@ -8,7 +8,7 @@
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<title>pylorax.sysutils — Lorax 29.14 documentation</title>
|
||||
<title>pylorax.sysutils — Lorax 29.20 documentation</title>
|
||||
|
||||
|
||||
|
||||
@ -57,7 +57,7 @@
|
||||
|
||||
|
||||
<div class="version">
|
||||
29.14
|
||||
29.20
|
||||
</div>
|
||||
|
||||
|
||||
@ -321,7 +321,7 @@
|
||||
<script type="text/javascript">
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT:'../../',
|
||||
VERSION:'29.14',
|
||||
VERSION:'29.20',
|
||||
LANGUAGE:'None',
|
||||
COLLAPSE_INDEX:false,
|
||||
FILE_SUFFIX:'.html',
|
||||
|
@ -8,7 +8,7 @@
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<title>pylorax.treebuilder — Lorax 29.14 documentation</title>
|
||||
<title>pylorax.treebuilder — Lorax 29.20 documentation</title>
|
||||
|
||||
|
||||
|
||||
@ -57,7 +57,7 @@
|
||||
|
||||
|
||||
<div class="version">
|
||||
29.14
|
||||
29.20
|
||||
</div>
|
||||
|
||||
|
||||
@ -589,7 +589,7 @@
|
||||
<script type="text/javascript">
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT:'../../',
|
||||
VERSION:'29.14',
|
||||
VERSION:'29.20',
|
||||
LANGUAGE:'None',
|
||||
COLLAPSE_INDEX:false,
|
||||
FILE_SUFFIX:'.html',
|
||||
|
@ -8,7 +8,7 @@
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<title>pylorax.treeinfo — Lorax 29.14 documentation</title>
|
||||
<title>pylorax.treeinfo — Lorax 29.20 documentation</title>
|
||||
|
||||
|
||||
|
||||
@ -57,7 +57,7 @@
|
||||
|
||||
|
||||
<div class="version">
|
||||
29.14
|
||||
29.20
|
||||
</div>
|
||||
|
||||
|
||||
@ -246,7 +246,7 @@
|
||||
<script type="text/javascript">
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT:'../../',
|
||||
VERSION:'29.14',
|
||||
VERSION:'29.20',
|
||||
LANGUAGE:'None',
|
||||
COLLAPSE_INDEX:false,
|
||||
FILE_SUFFIX:'.html',
|
||||
|
@ -39,9 +39,10 @@ Build a ``qcow2`` disk image from this blueprint by running ``composer-cli
|
||||
compose start http-server qcow2``. It will print a UUID that you can use to
|
||||
keep track of the build. You can also cancel the build if needed.
|
||||
|
||||
<<<<<<< HEAD
|
||||
The available types of images is displayed by ``composer-cli compose types``.
|
||||
Currently this consists of: ext4-filesystem, live-iso, partitioned-disk, qcow2,
|
||||
tar
|
||||
Currently this consists of: ami, ext4-filesystem, live-iso, partitioned-disk,
|
||||
qcow2, tar, vhd, vmdk
|
||||
|
||||
Monitor the build status
|
||||
------------------------
|
||||
|
@ -13,6 +13,18 @@ Behind the scenes it uses `livemedia-creator <livemedia-creator.html>`_ and
|
||||
`Anaconda <https://anaconda-installer.readthedocs.io/en/latest/>`_ to handle the
|
||||
installation and configuration of the images.
|
||||
|
||||
Important Things To Note
|
||||
------------------------
|
||||
|
||||
* SELinux must be in Permissive mode. Anaconda requires SELinux be in permissive mode
|
||||
for image creation to work correctly. You can either edit the setting in the
|
||||
``/etc/sysconfig/selinux`` file, or run ``setenforce 0`` before starting lorax-composer.
|
||||
|
||||
* All image types lock the root account, except for live-iso. You will need to either
|
||||
use one of the `Customizations`_ methods for setting a ssh key/password, install a
|
||||
package that creates a user, or use something like `cloud-init` to setup access at
|
||||
boot time.
|
||||
|
||||
Installation
|
||||
------------
|
||||
|
||||
|
@ -59,6 +59,14 @@ pylorax.discinfo module
|
||||
:undoc-members:
|
||||
:show-inheritance:
|
||||
|
||||
pylorax.dnfbase module
|
||||
----------------------
|
||||
|
||||
.. automodule:: pylorax.dnfbase
|
||||
:members:
|
||||
:undoc-members:
|
||||
:show-inheritance:
|
||||
|
||||
pylorax.dnfhelper module
|
||||
------------------------
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT: document.getElementById("documentation_options").getAttribute('data-url_root'),
|
||||
VERSION: '29.14',
|
||||
VERSION: '29.20',
|
||||
LANGUAGE: 'None',
|
||||
COLLAPSE_INDEX: false,
|
||||
FILE_SUFFIX: '.html',
|
||||
|
@ -8,7 +8,7 @@
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<title>composer-cli — Lorax 29.14 documentation</title>
|
||||
<title>composer-cli — Lorax 29.20 documentation</title>
|
||||
|
||||
|
||||
|
||||
@ -59,7 +59,7 @@
|
||||
|
||||
|
||||
<div class="version">
|
||||
29.14
|
||||
29.20
|
||||
</div>
|
||||
|
||||
|
||||
@ -329,9 +329,10 @@ saved by viewing the changelog - <code class="docutils literal notranslate"><spa
|
||||
<p>Build a <code class="docutils literal notranslate"><span class="pre">qcow2</span></code> disk image from this blueprint by running <code class="docutils literal notranslate"><span class="pre">composer-cli</span>
|
||||
<span class="pre">compose</span> <span class="pre">start</span> <span class="pre">http-server</span> <span class="pre">qcow2</span></code>. It will print a UUID that you can use to
|
||||
keep track of the build. You can also cancel the build if needed.</p>
|
||||
<p>The available types of images is displayed by <code class="docutils literal notranslate"><span class="pre">composer-cli</span> <span class="pre">compose</span> <span class="pre">types</span></code>.
|
||||
Currently this consists of: ext4-filesystem, live-iso, partitioned-disk, qcow2,
|
||||
tar</p>
|
||||
<p><<<<<<< HEAD
|
||||
The available types of images is displayed by <code class="docutils literal notranslate"><span class="pre">composer-cli</span> <span class="pre">compose</span> <span class="pre">types</span></code>.
|
||||
Currently this consists of: ami, ext4-filesystem, live-iso, partitioned-disk,
|
||||
qcow2, tar, vhd, vmdk</p>
|
||||
</div>
|
||||
<div class="section" id="monitor-the-build-status">
|
||||
<h2>Monitor the build status<a class="headerlink" href="#monitor-the-build-status" title="Permalink to this headline">¶</a></h2>
|
||||
@ -393,7 +394,7 @@ save the qcow2 image as <code class="docutils literal notranslate"><span class="
|
||||
<script type="text/javascript">
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT:'./',
|
||||
VERSION:'29.14',
|
||||
VERSION:'29.20',
|
||||
LANGUAGE:'None',
|
||||
COLLAPSE_INDEX:false,
|
||||
FILE_SUFFIX:'.html',
|
||||
|
@ -8,7 +8,7 @@
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<title>composer.cli package — Lorax 29.14 documentation</title>
|
||||
<title>composer.cli package — Lorax 29.20 documentation</title>
|
||||
|
||||
|
||||
|
||||
@ -59,7 +59,7 @@
|
||||
|
||||
|
||||
<div class="version">
|
||||
29.14
|
||||
29.20
|
||||
</div>
|
||||
|
||||
|
||||
@ -1200,7 +1200,7 @@ not to continue processing the results.</p>
|
||||
<script type="text/javascript">
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT:'./',
|
||||
VERSION:'29.14',
|
||||
VERSION:'29.20',
|
||||
LANGUAGE:'None',
|
||||
COLLAPSE_INDEX:false,
|
||||
FILE_SUFFIX:'.html',
|
||||
|
@ -8,7 +8,7 @@
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<title>composer package — Lorax 29.14 documentation</title>
|
||||
<title>composer package — Lorax 29.20 documentation</title>
|
||||
|
||||
|
||||
|
||||
@ -59,7 +59,7 @@
|
||||
|
||||
|
||||
<div class="version">
|
||||
29.14
|
||||
29.20
|
||||
</div>
|
||||
|
||||
|
||||
@ -531,7 +531,7 @@ fetch all results for the given request.</p>
|
||||
<script type="text/javascript">
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT:'./',
|
||||
VERSION:'29.14',
|
||||
VERSION:'29.20',
|
||||
LANGUAGE:'None',
|
||||
COLLAPSE_INDEX:false,
|
||||
FILE_SUFFIX:'.html',
|
||||
|
@ -9,7 +9,7 @@
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<title>Index — Lorax 29.14 documentation</title>
|
||||
<title>Index — Lorax 29.20 documentation</title>
|
||||
|
||||
|
||||
|
||||
@ -58,7 +58,7 @@
|
||||
|
||||
|
||||
<div class="version">
|
||||
29.14
|
||||
29.20
|
||||
</div>
|
||||
|
||||
|
||||
@ -430,6 +430,8 @@
|
||||
<li><a href="pylorax.html#pylorax.imgutils.DMDev">DMDev (class in pylorax.imgutils)</a>
|
||||
</li>
|
||||
<li><a href="pylorax.api.html#pylorax.api.projects.dnf_repo_to_file_repo">dnf_repo_to_file_repo() (in module pylorax.api.projects)</a>
|
||||
</li>
|
||||
<li><a href="pylorax.api.html#pylorax.api.dnfbase.DNFLock">DNFLock (class in pylorax.api.dnfbase)</a>
|
||||
</li>
|
||||
<li><a href="pylorax.html#pylorax.imgutils.do_grafts">do_grafts() (in module pylorax.imgutils)</a>
|
||||
</li>
|
||||
@ -516,6 +518,8 @@
|
||||
<li><a href="pylorax.api.html#pylorax.api.queue.get_compose_type">get_compose_type() (in module pylorax.api.queue)</a>
|
||||
</li>
|
||||
<li><a href="pylorax.api.html#pylorax.api.config.ComposerConfig.get_default">get_default() (pylorax.api.config.ComposerConfig method)</a>
|
||||
</li>
|
||||
<li><a href="pylorax.html#pylorax.dnfbase.get_dnf_base_object">get_dnf_base_object() (in module pylorax.dnfbase)</a>
|
||||
</li>
|
||||
<li><a href="composer.html#composer.http_client.get_filename">get_filename() (in module composer.http_client)</a>
|
||||
</li>
|
||||
@ -637,18 +641,24 @@
|
||||
</li>
|
||||
<li><a href="pylorax.html#pylorax.cmdline.lmc_parser">lmc_parser() (in module pylorax.cmdline)</a>
|
||||
</li>
|
||||
<li><a href="pylorax.api.html#pylorax.api.server.GitLock.lock">lock (pylorax.api.server.GitLock attribute)</a>
|
||||
<li><a href="pylorax.api.html#pylorax.api.dnfbase.DNFLock.lock">lock (pylorax.api.dnfbase.DNFLock attribute)</a>
|
||||
|
||||
<ul>
|
||||
<li><a href="pylorax.api.html#pylorax.api.server.GitLock.lock">(pylorax.api.server.GitLock attribute)</a>
|
||||
</li>
|
||||
</ul></li>
|
||||
<li><a href="pylorax.api.html#pylorax.api.dnfbase.DNFLock.lock_check">lock_check (pylorax.api.dnfbase.DNFLock attribute)</a>
|
||||
</li>
|
||||
<li><a href="pylorax.html#pylorax.ltmpl.LoraxTemplateRunner.log">log() (pylorax.ltmpl.LoraxTemplateRunner method)</a>
|
||||
</li>
|
||||
<li><a href="pylorax.html#pylorax.monitor.LogServer.log_check">log_check() (pylorax.monitor.LogServer method)</a>
|
||||
</li>
|
||||
<li><a href="pylorax.html#pylorax.monitor.LogMonitor">LogMonitor (class in pylorax.monitor)</a>
|
||||
</li>
|
||||
<li><a href="pylorax.html#pylorax.monitor.LogRequestHandler">LogRequestHandler (class in pylorax.monitor)</a>
|
||||
</li>
|
||||
</ul></td>
|
||||
<td style="width: 33%; vertical-align: top;"><ul>
|
||||
<li><a href="pylorax.html#pylorax.monitor.LogRequestHandler">LogRequestHandler (class in pylorax.monitor)</a>
|
||||
</li>
|
||||
<li><a href="pylorax.html#pylorax.monitor.LogServer">LogServer (class in pylorax.monitor)</a>
|
||||
</li>
|
||||
<li><a href="pylorax.html#pylorax.imgutils.loop_attach">loop_attach() (in module pylorax.imgutils)</a>
|
||||
@ -692,6 +702,8 @@
|
||||
<li><a href="pylorax.html#pylorax.creator.make_live_images">make_live_images() (in module pylorax.creator)</a>
|
||||
</li>
|
||||
<li><a href="pylorax.html#pylorax.creator.make_livecd">make_livecd() (in module pylorax.creator)</a>
|
||||
</li>
|
||||
<li><a href="pylorax.api.html#pylorax.api.config.make_owned_dir">make_owned_dir() (in module pylorax.api.config)</a>
|
||||
</li>
|
||||
<li><a href="pylorax.api.html#pylorax.api.config.make_queue_dirs">make_queue_dirs() (in module pylorax.api.config)</a>
|
||||
</li>
|
||||
@ -847,10 +859,10 @@
|
||||
</li>
|
||||
<li><a href="pylorax.html#module-pylorax">pylorax (module)</a>
|
||||
</li>
|
||||
</ul></td>
|
||||
<td style="width: 33%; vertical-align: top;"><ul>
|
||||
<li><a href="pylorax.api.html#module-pylorax.api">pylorax.api (module)</a>
|
||||
</li>
|
||||
</ul></td>
|
||||
<td style="width: 33%; vertical-align: top;"><ul>
|
||||
<li><a href="pylorax.api.html#module-pylorax.api.checkparams">pylorax.api.checkparams (module)</a>
|
||||
</li>
|
||||
<li><a href="pylorax.api.html#module-pylorax.api.cmdline">pylorax.api.cmdline (module)</a>
|
||||
@ -892,6 +904,8 @@
|
||||
<li><a href="pylorax.html#module-pylorax.decorators">pylorax.decorators (module)</a>
|
||||
</li>
|
||||
<li><a href="pylorax.html#module-pylorax.discinfo">pylorax.discinfo (module)</a>
|
||||
</li>
|
||||
<li><a href="pylorax.html#module-pylorax.dnfbase">pylorax.dnfbase (module)</a>
|
||||
</li>
|
||||
<li><a href="pylorax.html#module-pylorax.dnfhelper">pylorax.dnfhelper (module)</a>
|
||||
</li>
|
||||
@ -1192,6 +1206,8 @@
|
||||
<li><a href="pylorax.api.html#pylorax.api.recipes.write_commit">write_commit() (in module pylorax.api.recipes)</a>
|
||||
</li>
|
||||
<li><a href="pylorax.api.html#pylorax.api.compose.write_ks_group">write_ks_group() (in module pylorax.api.compose)</a>
|
||||
</li>
|
||||
<li><a href="pylorax.api.html#pylorax.api.compose.write_ks_root">write_ks_root() (in module pylorax.api.compose)</a>
|
||||
</li>
|
||||
<li><a href="pylorax.api.html#pylorax.api.compose.write_ks_user">write_ks_user() (in module pylorax.api.compose)</a>
|
||||
</li>
|
||||
@ -1238,7 +1254,7 @@
|
||||
<script type="text/javascript">
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT:'./',
|
||||
VERSION:'29.14',
|
||||
VERSION:'29.20',
|
||||
LANGUAGE:'None',
|
||||
COLLAPSE_INDEX:false,
|
||||
FILE_SUFFIX:'.html',
|
||||
|
@ -8,7 +8,7 @@
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<title>Welcome to Lorax’s documentation! — Lorax 29.14 documentation</title>
|
||||
<title>Welcome to Lorax’s documentation! — Lorax 29.20 documentation</title>
|
||||
|
||||
|
||||
|
||||
@ -58,7 +58,7 @@
|
||||
|
||||
|
||||
<div class="version">
|
||||
29.14
|
||||
29.20
|
||||
</div>
|
||||
|
||||
|
||||
@ -227,7 +227,7 @@
|
||||
<script type="text/javascript">
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT:'./',
|
||||
VERSION:'29.14',
|
||||
VERSION:'29.20',
|
||||
LANGUAGE:'None',
|
||||
COLLAPSE_INDEX:false,
|
||||
FILE_SUFFIX:'.html',
|
||||
|
@ -8,7 +8,7 @@
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<title>Introduction to Lorax — Lorax 29.14 documentation</title>
|
||||
<title>Introduction to Lorax — Lorax 29.20 documentation</title>
|
||||
|
||||
|
||||
|
||||
@ -59,7 +59,7 @@
|
||||
|
||||
|
||||
<div class="version">
|
||||
29.14
|
||||
29.20
|
||||
</div>
|
||||
|
||||
|
||||
@ -250,7 +250,7 @@ upd-instroot and mk-images* scripts.</p>
|
||||
<script type="text/javascript">
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT:'./',
|
||||
VERSION:'29.14',
|
||||
VERSION:'29.20',
|
||||
LANGUAGE:'None',
|
||||
COLLAPSE_INDEX:false,
|
||||
FILE_SUFFIX:'.html',
|
||||
|
@ -8,7 +8,7 @@
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<title>livemedia-creator — Lorax 29.14 documentation</title>
|
||||
<title>livemedia-creator — Lorax 29.20 documentation</title>
|
||||
|
||||
|
||||
|
||||
@ -59,7 +59,7 @@
|
||||
|
||||
|
||||
<div class="version">
|
||||
29.14
|
||||
29.20
|
||||
</div>
|
||||
|
||||
|
||||
@ -1178,7 +1178,7 @@ report bugs against the lorax component.</p>
|
||||
<script type="text/javascript">
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT:'./',
|
||||
VERSION:'29.14',
|
||||
VERSION:'29.20',
|
||||
LANGUAGE:'None',
|
||||
COLLAPSE_INDEX:false,
|
||||
FILE_SUFFIX:'.html',
|
||||
|
@ -8,7 +8,7 @@
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<title>lorax-composer — Lorax 29.14 documentation</title>
|
||||
<title>lorax-composer — Lorax 29.20 documentation</title>
|
||||
|
||||
|
||||
|
||||
@ -59,7 +59,7 @@
|
||||
|
||||
|
||||
<div class="version">
|
||||
29.14
|
||||
29.20
|
||||
</div>
|
||||
|
||||
|
||||
@ -89,6 +89,7 @@
|
||||
<li class="toctree-l1"><a class="reference internal" href="lorax.html">Lorax</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="livemedia-creator.html">livemedia-creator</a></li>
|
||||
<li class="toctree-l1 current"><a class="current reference internal" href="#">lorax-composer</a><ul>
|
||||
<li class="toctree-l2"><a class="reference internal" href="#important-things-to-note">Important Things To Note</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="#installation">Installation</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="#quickstart">Quickstart</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="#logs">Logs</a></li>
|
||||
@ -205,6 +206,18 @@ information on Weldr can be found <a class="reference external" href="http://www
|
||||
<p>Behind the scenes it uses <a class="reference external" href="livemedia-creator.html">livemedia-creator</a> and
|
||||
<a class="reference external" href="https://anaconda-installer.readthedocs.io/en/latest/">Anaconda</a> to handle the
|
||||
installation and configuration of the images.</p>
|
||||
<div class="section" id="important-things-to-note">
|
||||
<h2>Important Things To Note<a class="headerlink" href="#important-things-to-note" title="Permalink to this headline">¶</a></h2>
|
||||
<ul class="simple">
|
||||
<li>SELinux must be in Permissive mode. Anaconda requires SELinux be in permissive mode
|
||||
for image creation to work correctly. You can either edit the setting in the
|
||||
<code class="docutils literal notranslate"><span class="pre">/etc/sysconfig/selinux</span></code> file, or run <code class="docutils literal notranslate"><span class="pre">setenforce</span> <span class="pre">0</span></code> before starting lorax-composer.</li>
|
||||
<li>All image types lock the root account, except for live-iso. You will need to either
|
||||
use one of the <a class="reference internal" href="#customizations">Customizations</a> methods for setting a ssh key/password, install a
|
||||
package that creates a user, or use something like <cite>cloud-init</cite> to setup access at
|
||||
boot time.</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="section" id="installation">
|
||||
<h2>Installation<a class="headerlink" href="#installation" title="Permalink to this headline">¶</a></h2>
|
||||
<p>The best way to install <code class="docutils literal notranslate"><span class="pre">lorax-composer</span></code> is to use <code class="docutils literal notranslate"><span class="pre">sudo</span> <span class="pre">dnf</span> <span class="pre">install</span>
|
||||
@ -619,7 +632,7 @@ sources from <code class="docutils literal notranslate"><span class="pre">/etc/y
|
||||
<script type="text/javascript">
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT:'./',
|
||||
VERSION:'29.14',
|
||||
VERSION:'29.20',
|
||||
LANGUAGE:'None',
|
||||
COLLAPSE_INDEX:false,
|
||||
FILE_SUFFIX:'.html',
|
||||
|
@ -8,7 +8,7 @@
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<title>Lorax — Lorax 29.14 documentation</title>
|
||||
<title>Lorax — Lorax 29.20 documentation</title>
|
||||
|
||||
|
||||
|
||||
@ -59,7 +59,7 @@
|
||||
|
||||
|
||||
<div class="version">
|
||||
29.14
|
||||
29.20
|
||||
</div>
|
||||
|
||||
|
||||
@ -574,7 +574,7 @@ should) select the specific template directory by passing <code class="docutils
|
||||
<script type="text/javascript">
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT:'./',
|
||||
VERSION:'29.14',
|
||||
VERSION:'29.20',
|
||||
LANGUAGE:'None',
|
||||
COLLAPSE_INDEX:false,
|
||||
FILE_SUFFIX:'.html',
|
||||
|
@ -8,7 +8,7 @@
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<title>src — Lorax 29.14 documentation</title>
|
||||
<title>src — Lorax 29.20 documentation</title>
|
||||
|
||||
|
||||
|
||||
@ -59,7 +59,7 @@
|
||||
|
||||
|
||||
<div class="version">
|
||||
29.14
|
||||
29.20
|
||||
</div>
|
||||
|
||||
|
||||
@ -219,6 +219,7 @@
|
||||
<li class="toctree-l2"><a class="reference internal" href="pylorax.html#module-pylorax.creator">pylorax.creator module</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="pylorax.html#module-pylorax.decorators">pylorax.decorators module</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="pylorax.html#module-pylorax.discinfo">pylorax.discinfo module</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="pylorax.html#module-pylorax.dnfbase">pylorax.dnfbase module</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="pylorax.html#module-pylorax.dnfhelper">pylorax.dnfhelper module</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="pylorax.html#module-pylorax.executils">pylorax.executils module</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="pylorax.html#module-pylorax.imgutils">pylorax.imgutils module</a></li>
|
||||
@ -279,7 +280,7 @@
|
||||
<script type="text/javascript">
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT:'./',
|
||||
VERSION:'29.14',
|
||||
VERSION:'29.20',
|
||||
LANGUAGE:'None',
|
||||
COLLAPSE_INDEX:false,
|
||||
FILE_SUFFIX:'.html',
|
||||
|
Binary file not shown.
@ -8,7 +8,7 @@
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<title>Product and Updates Images — Lorax 29.14 documentation</title>
|
||||
<title>Product and Updates Images — Lorax 29.20 documentation</title>
|
||||
|
||||
|
||||
|
||||
@ -59,7 +59,7 @@
|
||||
|
||||
|
||||
<div class="version">
|
||||
29.14
|
||||
29.20
|
||||
</div>
|
||||
|
||||
|
||||
@ -222,7 +222,7 @@ command or the installpkgs paramater of <a class="reference internal" href="pylo
|
||||
<script type="text/javascript">
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT:'./',
|
||||
VERSION:'29.14',
|
||||
VERSION:'29.20',
|
||||
LANGUAGE:'None',
|
||||
COLLAPSE_INDEX:false,
|
||||
FILE_SUFFIX:'.html',
|
||||
|
@ -8,7 +8,7 @@
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<title>Python Module Index — Lorax 29.14 documentation</title>
|
||||
<title>Python Module Index — Lorax 29.20 documentation</title>
|
||||
|
||||
|
||||
|
||||
@ -60,7 +60,7 @@
|
||||
|
||||
|
||||
<div class="version">
|
||||
29.14
|
||||
29.20
|
||||
</div>
|
||||
|
||||
|
||||
@ -350,6 +350,11 @@
|
||||
<td>   
|
||||
<a href="pylorax.html#module-pylorax.discinfo"><code class="xref">pylorax.discinfo</code></a></td><td>
|
||||
<em></em></td></tr>
|
||||
<tr class="cg-2">
|
||||
<td></td>
|
||||
<td>   
|
||||
<a href="pylorax.html#module-pylorax.dnfbase"><code class="xref">pylorax.dnfbase</code></a></td><td>
|
||||
<em></em></td></tr>
|
||||
<tr class="cg-2">
|
||||
<td></td>
|
||||
<td>   
|
||||
@ -440,7 +445,7 @@
|
||||
<script type="text/javascript">
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT:'./',
|
||||
VERSION:'29.14',
|
||||
VERSION:'29.20',
|
||||
LANGUAGE:'None',
|
||||
COLLAPSE_INDEX:false,
|
||||
FILE_SUFFIX:'.html',
|
||||
|
@ -8,7 +8,7 @@
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<title>pylorax.api package — Lorax 29.14 documentation</title>
|
||||
<title>pylorax.api package — Lorax 29.20 documentation</title>
|
||||
|
||||
|
||||
|
||||
@ -58,7 +58,7 @@
|
||||
|
||||
|
||||
<div class="version">
|
||||
29.14
|
||||
29.20
|
||||
</div>
|
||||
|
||||
|
||||
@ -104,6 +104,7 @@
|
||||
<li class="toctree-l3"><a class="reference internal" href="pylorax.html#module-pylorax.creator">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>
|
||||
@ -366,6 +367,34 @@ Other options will be filled in by <cite>make_compose()</cite></p>
|
||||
<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>
|
||||
@ -393,8 +422,8 @@ with whatever options are relevant.</p>
|
||||
<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>*args</em>, <em>**kwargs</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: <code class="xref py py-class docutils literal notranslate"><span class="pre">configparser.SafeConfigParser</span></code></p>
|
||||
<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=<class 'collections.OrderedDict'></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=<object object></em>, <em>converters=<object object></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>
|
||||
@ -423,20 +452,55 @@ with whatever options are relevant.</p>
|
||||
|
||||
<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><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</p>
|
||||
<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"><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</td>
|
||||
<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">None</td>
|
||||
<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>
|
||||
@ -472,6 +536,31 @@ with whatever options are relevant.</p>
|
||||
</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>
|
||||
@ -2447,14 +2536,20 @@ store the new blueprint on the new branch.</p>
|
||||
</div>
|
||||
</div></blockquote>
|
||||
</div>
|
||||
<div class="section" id="api-v0-blueprints-info-blueprint-names">
|
||||
<h4><cite>/api/v0/blueprints/info/<blueprint_names></cite><a class="headerlink" href="#api-v0-blueprints-info-blueprint-names" title="Permalink to this headline">¶</a></h4>
|
||||
<div class="section" id="api-v0-blueprints-info-blueprint-names-format-json-toml">
|
||||
<h4><cite>/api/v0/blueprints/info/<blueprint_names>[?format=<json|toml>]</cite><a class="headerlink" href="#api-v0-blueprints-info-blueprint-names-format-json-toml" title="Permalink to this headline">¶</a></h4>
|
||||
<blockquote>
|
||||
<div><p>Return the JSON representation of the blueprint. This includes 3 top level
|
||||
objects. <cite>changes</cite> which lists whether or not the workspace is different from
|
||||
the most recent commit. <cite>blueprints</cite> which lists the JSON representation of the
|
||||
blueprint, and <cite>errors</cite> which will list any errors, like non-existant blueprints.</p>
|
||||
<p>Example:</p>
|
||||
<p>By default the response is JSON, but if <cite>?format=toml</cite> is included in the URL’s
|
||||
arguments it will return the response as the blueprint’s raw TOML content.
|
||||
<em>Unless</em> there is an error which will only return a 400 and a standard error
|
||||
<a href="#id1"><span class="problematic" id="id2">`Status Response`_</span></a>.</p>
|
||||
<p>If there is an error when JSON is requested the successful blueprints and the
|
||||
errors will both be returned.</p>
|
||||
<p>Example of json response:</p>
|
||||
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="p">{</span>
|
||||
<span class="s2">"changes"</span><span class="p">:</span> <span class="p">[</span>
|
||||
<span class="p">{</span>
|
||||
@ -3572,7 +3667,7 @@ a line boundry.</p>
|
||||
<script type="text/javascript">
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT:'./',
|
||||
VERSION:'29.14',
|
||||
VERSION:'29.20',
|
||||
LANGUAGE:'None',
|
||||
COLLAPSE_INDEX:false,
|
||||
FILE_SUFFIX:'.html',
|
||||
|
@ -8,7 +8,7 @@
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<title>pylorax package — Lorax 29.14 documentation</title>
|
||||
<title>pylorax package — Lorax 29.20 documentation</title>
|
||||
|
||||
|
||||
|
||||
@ -59,7 +59,7 @@
|
||||
|
||||
|
||||
<div class="version">
|
||||
29.14
|
||||
29.20
|
||||
</div>
|
||||
|
||||
|
||||
@ -105,6 +105,7 @@
|
||||
<li class="toctree-l3"><a class="reference internal" href="#module-pylorax.creator">pylorax.creator module</a></li>
|
||||
<li class="toctree-l3"><a class="reference internal" href="#module-pylorax.decorators">pylorax.decorators module</a></li>
|
||||
<li class="toctree-l3"><a class="reference internal" href="#module-pylorax.discinfo">pylorax.discinfo module</a></li>
|
||||
<li class="toctree-l3"><a class="reference internal" href="#module-pylorax.dnfbase">pylorax.dnfbase module</a></li>
|
||||
<li class="toctree-l3"><a class="reference internal" href="#module-pylorax.dnfhelper">pylorax.dnfhelper module</a></li>
|
||||
<li class="toctree-l3"><a class="reference internal" href="#module-pylorax.executils">pylorax.executils module</a></li>
|
||||
<li class="toctree-l3"><a class="reference internal" href="#module-pylorax.imgutils">pylorax.imgutils module</a></li>
|
||||
@ -215,7 +216,7 @@
|
||||
<li class="toctree-l3"><a class="reference internal" href="pylorax.api.html#status-responses">Status Responses</a></li>
|
||||
<li class="toctree-l3"><a class="reference internal" href="pylorax.api.html#api-routes">API Routes</a><ul>
|
||||
<li class="toctree-l4"><a class="reference internal" href="pylorax.api.html#api-v0-blueprints-list"><cite>/api/v0/blueprints/list</cite></a></li>
|
||||
<li class="toctree-l4"><a class="reference internal" href="pylorax.api.html#api-v0-blueprints-info-blueprint-names"><cite>/api/v0/blueprints/info/<blueprint_names></cite></a></li>
|
||||
<li class="toctree-l4"><a class="reference internal" href="pylorax.api.html#api-v0-blueprints-info-blueprint-names-format-json-toml"><cite>/api/v0/blueprints/info/<blueprint_names>[?format=<json|toml>]</cite></a></li>
|
||||
<li class="toctree-l4"><a class="reference internal" href="pylorax.api.html#api-v0-blueprints-changes-blueprint-names-offset-0-limit-20"><cite>/api/v0/blueprints/changes/<blueprint_names>[?offset=0&limit=20]</cite></a></li>
|
||||
<li class="toctree-l4"><a class="reference internal" href="pylorax.api.html#post-api-v0-blueprints-new">POST <cite>/api/v0/blueprints/new</cite></a></li>
|
||||
<li class="toctree-l4"><a class="reference internal" href="pylorax.api.html#delete-api-v0-blueprints-delete-blueprint-name">DELETE <cite>/api/v0/blueprints/delete/<blueprint_name></cite></a></li>
|
||||
@ -698,6 +699,37 @@ See the cmdline –help for livemedia-creator for the possible options</p>
|
||||
|
||||
</dd></dl>
|
||||
|
||||
</div>
|
||||
<div class="section" id="module-pylorax.dnfbase">
|
||||
<span id="pylorax-dnfbase-module"></span><h2>pylorax.dnfbase module<a class="headerlink" href="#module-pylorax.dnfbase" title="Permalink to this headline">¶</a></h2>
|
||||
<dl class="function">
|
||||
<dt id="pylorax.dnfbase.get_dnf_base_object">
|
||||
<code class="descclassname">pylorax.dnfbase.</code><code class="descname">get_dnf_base_object</code><span class="sig-paren">(</span><em>installroot</em>, <em>sources</em>, <em>mirrorlists=None</em>, <em>repos=None</em>, <em>enablerepos=None</em>, <em>disablerepos=None</em>, <em>tempdir='/var/tmp'</em>, <em>proxy=None</em>, <em>releasever='29'</em>, <em>cachedir=None</em>, <em>logdir=None</em>, <em>sslverify=True</em>, <em>dnfplugins=None</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/dnfbase.html#get_dnf_base_object"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.dnfbase.get_dnf_base_object" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Create a dnf Base object and setup the repositories and installroot</p>
|
||||
<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>installroot</strong> (<em>string</em>) – Full path to the installroot</li>
|
||||
<li><strong>sources</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#list" title="(in Python v3.7)"><em>list</em></a>) – List of source repo urls to use for the installation</li>
|
||||
<li><strong>enablerepos</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#list" title="(in Python v3.7)"><em>list</em></a>) – List of repo names to enable</li>
|
||||
<li><strong>disablerepos</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#list" title="(in Python v3.7)"><em>list</em></a>) – List of repo names to disable</li>
|
||||
<li><strong>mirrorlist</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#list" title="(in Python v3.7)"><em>list</em></a>) – List of mirrors to use</li>
|
||||
<li><strong>tempdir</strong> (<em>string</em>) – Path of temporary directory</li>
|
||||
<li><strong>proxy</strong> (<em>string</em>) – http proxy to use when fetching packages</li>
|
||||
<li><strong>releasever</strong> (<em>string</em>) – Release version to pass to dnf</li>
|
||||
<li><strong>cachedir</strong> (<em>string</em>) – Directory to use for caching packages</li>
|
||||
<li><strong>noverifyssl</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 ignore the CA of ssl certs. eg. use self-signed ssl for https repos.</li>
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<p>If tempdir is not set /var/tmp is used.
|
||||
If cachedir is None a dnf.cache directory is created inside tmpdir</p>
|
||||
</dd></dl>
|
||||
|
||||
</div>
|
||||
<div class="section" id="module-pylorax.dnfhelper">
|
||||
<span id="pylorax-dnfhelper-module"></span><h2>pylorax.dnfhelper module<a class="headerlink" href="#module-pylorax.dnfhelper" title="Permalink to this headline">¶</a></h2>
|
||||
@ -2278,7 +2310,7 @@ lowest numbered directory entry is returned.</p>
|
||||
<script type="text/javascript">
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT:'./',
|
||||
VERSION:'29.14',
|
||||
VERSION:'29.20',
|
||||
LANGUAGE:'None',
|
||||
COLLAPSE_INDEX:false,
|
||||
FILE_SUFFIX:'.html',
|
||||
|
@ -8,7 +8,7 @@
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<title>Search — Lorax 29.14 documentation</title>
|
||||
<title>Search — Lorax 29.20 documentation</title>
|
||||
|
||||
|
||||
|
||||
@ -57,7 +57,7 @@
|
||||
|
||||
|
||||
<div class="version">
|
||||
29.14
|
||||
29.20
|
||||
</div>
|
||||
|
||||
|
||||
@ -198,7 +198,7 @@
|
||||
<script type="text/javascript">
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT:'./',
|
||||
VERSION:'29.14',
|
||||
VERSION:'29.20',
|
||||
LANGUAGE:'None',
|
||||
COLLAPSE_INDEX:false,
|
||||
FILE_SUFFIX:'.html',
|
||||
|
File diff suppressed because one or more lines are too long
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -1,6 +1,6 @@
|
||||
.\" Man page generated from reStructuredText.
|
||||
.
|
||||
.TH "COMPOSER-CLI" "1" "Oct 24, 2018" "30.5" "Lorax"
|
||||
.TH "COMPOSER-CLI" "1" "Oct 29, 2018" "29.20" "Lorax"
|
||||
.SH NAME
|
||||
composer-cli \- Composer Cmdline Utility Documentation
|
||||
.
|
||||
@ -220,6 +220,7 @@ Build a \fBqcow2\fP disk image from this blueprint by running \fBcomposer\-cli
|
||||
compose start http\-server qcow2\fP\&. It will print a UUID that you can use to
|
||||
keep track of the build. You can also cancel the build if needed.
|
||||
.sp
|
||||
<<<<<<< HEAD
|
||||
The available types of images is displayed by \fBcomposer\-cli compose types\fP\&.
|
||||
Currently this consists of: ami, ext4\-filesystem, live\-iso, partitioned\-disk,
|
||||
qcow2, tar, vhd, vmdk
|
||||
|
@ -1,6 +1,6 @@
|
||||
.\" Man page generated from reStructuredText.
|
||||
.
|
||||
.TH "LIVEMEDIA-CREATOR" "1" "Oct 24, 2018" "30.5" "Lorax"
|
||||
.TH "LIVEMEDIA-CREATOR" "1" "Oct 29, 2018" "29.20" "Lorax"
|
||||
.SH NAME
|
||||
livemedia-creator \- Live Media Creator Documentation
|
||||
.
|
||||
|
@ -1,6 +1,6 @@
|
||||
.\" Man page generated from reStructuredText.
|
||||
.
|
||||
.TH "LORAX-COMPOSER" "1" "Oct 24, 2018" "30.5" "Lorax"
|
||||
.TH "LORAX-COMPOSER" "1" "Oct 29, 2018" "29.20" "Lorax"
|
||||
.SH NAME
|
||||
lorax-composer \- Lorax Composer Documentation
|
||||
.
|
||||
|
@ -1,6 +1,6 @@
|
||||
.\" Man page generated from reStructuredText.
|
||||
.
|
||||
.TH "LORAX" "1" "Oct 24, 2018" "30.5" "Lorax"
|
||||
.TH "LORAX" "1" "Oct 29, 2018" "29.20" "Lorax"
|
||||
.SH NAME
|
||||
lorax \- Lorax Documentation
|
||||
.
|
||||
|
@ -59,6 +59,14 @@ pylorax.discinfo module
|
||||
:undoc-members:
|
||||
:show-inheritance:
|
||||
|
||||
pylorax.dnfbase module
|
||||
----------------------
|
||||
|
||||
.. automodule:: pylorax.dnfbase
|
||||
:members:
|
||||
:undoc-members:
|
||||
:show-inheritance:
|
||||
|
||||
pylorax.dnfhelper module
|
||||
------------------------
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user