New lorax documentation - 29.11
This commit is contained in:
parent
83e5f3f885
commit
c638926880
@ -60,6 +60,14 @@ composer.cli.sources module
|
||||
:undoc-members:
|
||||
:show-inheritance:
|
||||
|
||||
composer.cli.status module
|
||||
--------------------------
|
||||
|
||||
.. automodule:: composer.cli.status
|
||||
:members:
|
||||
:undoc-members:
|
||||
:show-inheritance:
|
||||
|
||||
composer.cli.utilities module
|
||||
-----------------------------
|
||||
|
||||
|
@ -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: e80e6682af221be2c0304b50951dd150
|
||||
config: df84227b4f6d45f96e4ae4c3727d149b
|
||||
tags: 645f666f9bcd5a90fca523b33c5a78b7
|
||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
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.10 documentation</title>
|
||||
<title>composer.cli — Lorax 29.11 documentation</title>
|
||||
|
||||
|
||||
|
||||
@ -24,7 +24,8 @@
|
||||
|
||||
|
||||
|
||||
<link rel="stylesheet" href="../../_static/css/theme.css" type="text/css" />
|
||||
|
||||
<link rel="stylesheet" href="../../_static/css/theme.css" type="text/css" />
|
||||
<link rel="stylesheet" href="../../_static/pygments.css" type="text/css" />
|
||||
<link rel="index" title="Index" href="../../genindex.html" />
|
||||
<link rel="search" title="Search" href="../../search.html" />
|
||||
@ -56,7 +57,7 @@
|
||||
|
||||
|
||||
<div class="version">
|
||||
29.10
|
||||
29.11
|
||||
</div>
|
||||
|
||||
|
||||
@ -178,13 +179,15 @@
|
||||
<span class="kn">from</span> <span class="nn">composer.cli.projects</span> <span class="k">import</span> <span class="n">projects_cmd</span>
|
||||
<span class="kn">from</span> <span class="nn">composer.cli.compose</span> <span class="k">import</span> <span class="n">compose_cmd</span>
|
||||
<span class="kn">from</span> <span class="nn">composer.cli.sources</span> <span class="k">import</span> <span class="n">sources_cmd</span>
|
||||
<span class="kn">from</span> <span class="nn">composer.cli.status</span> <span class="k">import</span> <span class="n">status_cmd</span>
|
||||
|
||||
<span class="n">command_map</span> <span class="o">=</span> <span class="p">{</span>
|
||||
<span class="s2">"blueprints"</span><span class="p">:</span> <span class="n">blueprints_cmd</span><span class="p">,</span>
|
||||
<span class="s2">"modules"</span><span class="p">:</span> <span class="n">modules_cmd</span><span class="p">,</span>
|
||||
<span class="s2">"projects"</span><span class="p">:</span> <span class="n">projects_cmd</span><span class="p">,</span>
|
||||
<span class="s2">"compose"</span><span class="p">:</span> <span class="n">compose_cmd</span><span class="p">,</span>
|
||||
<span class="s2">"sources"</span><span class="p">:</span> <span class="n">sources_cmd</span>
|
||||
<span class="s2">"sources"</span><span class="p">:</span> <span class="n">sources_cmd</span><span class="p">,</span>
|
||||
<span class="s2">"status"</span><span class="p">:</span> <span class="n">status_cmd</span>
|
||||
<span class="p">}</span>
|
||||
|
||||
|
||||
@ -240,7 +243,7 @@
|
||||
<script type="text/javascript">
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT:'../../',
|
||||
VERSION:'29.10',
|
||||
VERSION:'29.11',
|
||||
LANGUAGE:'None',
|
||||
COLLAPSE_INDEX:false,
|
||||
FILE_SUFFIX:'.html',
|
||||
@ -254,7 +257,10 @@
|
||||
|
||||
|
||||
|
||||
<script type="text/javascript" src="../../_static/js/theme.js"></script>
|
||||
|
||||
|
||||
<script type="text/javascript" src="../../_static/js/theme.js"></script>
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
jQuery(function () {
|
||||
|
@ -8,7 +8,7 @@
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<title>composer.cli.blueprints — Lorax 29.10 documentation</title>
|
||||
<title>composer.cli.blueprints — Lorax 29.11 documentation</title>
|
||||
|
||||
|
||||
|
||||
@ -24,7 +24,8 @@
|
||||
|
||||
|
||||
|
||||
<link rel="stylesheet" href="../../../_static/css/theme.css" type="text/css" />
|
||||
|
||||
<link rel="stylesheet" href="../../../_static/css/theme.css" type="text/css" />
|
||||
<link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" />
|
||||
<link rel="index" title="Index" href="../../../genindex.html" />
|
||||
<link rel="search" title="Search" href="../../../search.html" />
|
||||
@ -56,7 +57,7 @@
|
||||
|
||||
|
||||
<div class="version">
|
||||
29.10
|
||||
29.11
|
||||
</div>
|
||||
|
||||
|
||||
@ -174,7 +175,6 @@
|
||||
<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">"composer-cli"</span><span class="p">)</span>
|
||||
|
||||
<span class="kn">import</span> <span class="nn">os</span>
|
||||
<span class="kn">import</span> <span class="nn">json</span>
|
||||
|
||||
<span class="kn">from</span> <span class="nn">composer</span> <span class="k">import</span> <span class="n">http_client</span> <span class="k">as</span> <span class="n">client</span>
|
||||
<span class="kn">from</span> <span class="nn">composer.cli.help</span> <span class="k">import</span> <span class="n">blueprints_help</span>
|
||||
@ -230,13 +230,14 @@
|
||||
<span class="sd"> """</span>
|
||||
<span class="n">api_route</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">api_url</span><span class="p">(</span><span class="n">api_version</span><span class="p">,</span> <span class="s2">"/blueprints/list"</span><span class="p">)</span>
|
||||
<span class="n">result</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">get_url_json</span><span class="p">(</span><span class="n">socket_path</span><span class="p">,</span> <span class="n">api_route</span><span class="p">)</span>
|
||||
<span class="k">if</span> <span class="n">show_json</span><span class="p">:</span>
|
||||
<span class="nb">print</span><span class="p">(</span><span class="n">json</span><span class="o">.</span><span class="n">dumps</span><span class="p">(</span><span class="n">result</span><span class="p">,</span> <span class="n">indent</span><span class="o">=</span><span class="mi">4</span><span class="p">))</span>
|
||||
<span class="k">return</span> <span class="mi">0</span>
|
||||
<span class="p">(</span><span class="n">rc</span><span class="p">,</span> <span class="n">exit_now</span><span class="p">)</span> <span class="o">=</span> <span class="n">handle_api_result</span><span class="p">(</span><span class="n">result</span><span class="p">,</span> <span class="n">show_json</span><span class="p">)</span>
|
||||
<span class="k">if</span> <span class="n">exit_now</span><span class="p">:</span>
|
||||
<span class="k">return</span> <span class="n">rc</span>
|
||||
|
||||
<span class="nb">print</span><span class="p">(</span><span class="s2">"blueprints: "</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">r</span> <span class="k">for</span> <span class="n">r</span> <span class="ow">in</span> <span class="n">result</span><span class="p">[</span><span class="s2">"blueprints"</span><span class="p">]]))</span>
|
||||
<span class="c1"># "list" should output a plain list of identifiers, one per line.</span>
|
||||
<span class="nb">print</span><span class="p">(</span><span class="s2">"</span><span class="se">\n</span><span class="s2">"</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="n">result</span><span class="p">[</span><span class="s2">"blueprints"</span><span class="p">]))</span>
|
||||
|
||||
<span class="k">return</span> <span class="mi">0</span></div>
|
||||
<span class="k">return</span> <span class="n">rc</span></div>
|
||||
|
||||
<div class="viewcode-block" id="blueprints_show"><a class="viewcode-back" href="../../../composer.cli.html#composer.cli.blueprints.blueprints_show">[docs]</a><span class="k">def</span> <span class="nf">blueprints_show</span><span class="p">(</span><span class="n">socket_path</span><span class="p">,</span> <span class="n">api_version</span><span class="p">,</span> <span class="n">args</span><span class="p">,</span> <span class="n">show_json</span><span class="o">=</span><span class="kc">False</span><span class="p">):</span>
|
||||
<span class="sd">"""Show the blueprints, in TOML format</span>
|
||||
@ -276,16 +277,16 @@
|
||||
<span class="sd"> """</span>
|
||||
<span class="n">api_route</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">api_url</span><span class="p">(</span><span class="n">api_version</span><span class="p">,</span> <span class="s2">"/blueprints/changes/</span><span class="si">%s</span><span class="s2">"</span> <span class="o">%</span> <span class="p">(</span><span class="s2">","</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="n">argify</span><span class="p">(</span><span class="n">args</span><span class="p">))))</span>
|
||||
<span class="n">result</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">get_url_json</span><span class="p">(</span><span class="n">socket_path</span><span class="p">,</span> <span class="n">api_route</span><span class="p">)</span>
|
||||
<span class="k">if</span> <span class="n">show_json</span><span class="p">:</span>
|
||||
<span class="nb">print</span><span class="p">(</span><span class="n">json</span><span class="o">.</span><span class="n">dumps</span><span class="p">(</span><span class="n">result</span><span class="p">,</span> <span class="n">indent</span><span class="o">=</span><span class="mi">4</span><span class="p">))</span>
|
||||
<span class="k">return</span> <span class="mi">0</span>
|
||||
<span class="p">(</span><span class="n">rc</span><span class="p">,</span> <span class="n">exit_now</span><span class="p">)</span> <span class="o">=</span> <span class="n">handle_api_result</span><span class="p">(</span><span class="n">result</span><span class="p">,</span> <span class="n">show_json</span><span class="p">)</span>
|
||||
<span class="k">if</span> <span class="n">exit_now</span><span class="p">:</span>
|
||||
<span class="k">return</span> <span class="n">rc</span>
|
||||
|
||||
<span class="k">for</span> <span class="n">blueprint</span> <span class="ow">in</span> <span class="n">result</span><span class="p">[</span><span class="s2">"blueprints"</span><span class="p">]:</span>
|
||||
<span class="nb">print</span><span class="p">(</span><span class="n">blueprint</span><span class="p">[</span><span class="s2">"name"</span><span class="p">])</span>
|
||||
<span class="k">for</span> <span class="n">change</span> <span class="ow">in</span> <span class="n">blueprint</span><span class="p">[</span><span class="s2">"changes"</span><span class="p">]:</span>
|
||||
<span class="n">prettyCommitDetails</span><span class="p">(</span><span class="n">change</span><span class="p">)</span>
|
||||
|
||||
<span class="k">return</span> <span class="mi">0</span></div>
|
||||
<span class="k">return</span> <span class="n">rc</span></div>
|
||||
|
||||
<div class="viewcode-block" id="prettyCommitDetails"><a class="viewcode-back" href="../../../composer.cli.html#composer.cli.blueprints.prettyCommitDetails">[docs]</a><span class="k">def</span> <span class="nf">prettyCommitDetails</span><span class="p">(</span><span class="n">change</span><span class="p">,</span> <span class="n">indent</span><span class="o">=</span><span class="mi">4</span><span class="p">):</span>
|
||||
<span class="sd">"""Print the blueprint's change in a nice way</span>
|
||||
@ -332,21 +333,14 @@
|
||||
|
||||
<span class="n">api_route</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">api_url</span><span class="p">(</span><span class="n">api_version</span><span class="p">,</span> <span class="s2">"/blueprints/diff/</span><span class="si">%s</span><span class="s2">/</span><span class="si">%s</span><span class="s2">/</span><span class="si">%s</span><span class="s2">"</span> <span class="o">%</span> <span class="p">(</span><span class="n">args</span><span class="p">[</span><span class="mi">0</span><span class="p">],</span> <span class="n">args</span><span class="p">[</span><span class="mi">1</span><span class="p">],</span> <span class="n">args</span><span class="p">[</span><span class="mi">2</span><span class="p">]))</span>
|
||||
<span class="n">result</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">get_url_json</span><span class="p">(</span><span class="n">socket_path</span><span class="p">,</span> <span class="n">api_route</span><span class="p">)</span>
|
||||
|
||||
<span class="k">if</span> <span class="n">show_json</span><span class="p">:</span>
|
||||
<span class="nb">print</span><span class="p">(</span><span class="n">json</span><span class="o">.</span><span class="n">dumps</span><span class="p">(</span><span class="n">result</span><span class="p">,</span> <span class="n">indent</span><span class="o">=</span><span class="mi">4</span><span class="p">))</span>
|
||||
<span class="k">return</span> <span class="mi">0</span>
|
||||
|
||||
<span class="k">for</span> <span class="n">err</span> <span class="ow">in</span> <span class="n">result</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">"errors"</span><span class="p">,</span> <span class="p">[]):</span>
|
||||
<span class="n">log</span><span class="o">.</span><span class="n">error</span><span class="p">(</span><span class="n">err</span><span class="p">)</span>
|
||||
|
||||
<span class="k">if</span> <span class="n">result</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">"errors"</span><span class="p">,</span> <span class="kc">False</span><span class="p">):</span>
|
||||
<span class="k">return</span> <span class="mi">1</span>
|
||||
<span class="p">(</span><span class="n">rc</span><span class="p">,</span> <span class="n">exit_now</span><span class="p">)</span> <span class="o">=</span> <span class="n">handle_api_result</span><span class="p">(</span><span class="n">result</span><span class="p">,</span> <span class="n">show_json</span><span class="p">)</span>
|
||||
<span class="k">if</span> <span class="n">exit_now</span><span class="p">:</span>
|
||||
<span class="k">return</span> <span class="n">rc</span>
|
||||
|
||||
<span class="k">for</span> <span class="n">diff</span> <span class="ow">in</span> <span class="n">result</span><span class="p">[</span><span class="s2">"diff"</span><span class="p">]:</span>
|
||||
<span class="nb">print</span><span class="p">(</span><span class="n">prettyDiffEntry</span><span class="p">(</span><span class="n">diff</span><span class="p">))</span>
|
||||
|
||||
<span class="k">return</span> <span class="mi">0</span></div>
|
||||
<span class="k">return</span> <span class="n">rc</span></div>
|
||||
|
||||
<div class="viewcode-block" id="prettyDiffEntry"><a class="viewcode-back" href="../../../composer.cli.html#composer.cli.blueprints.prettyDiffEntry">[docs]</a><span class="k">def</span> <span class="nf">prettyDiffEntry</span><span class="p">(</span><span class="n">diff</span><span class="p">):</span>
|
||||
<span class="sd">"""Generate nice diff entry string.</span>
|
||||
@ -387,11 +381,15 @@
|
||||
<span class="k">elif</span> <span class="n">change</span><span class="p">(</span><span class="n">diff</span><span class="p">)</span> <span class="o">==</span> <span class="s2">"Added"</span><span class="p">:</span>
|
||||
<span class="k">if</span> <span class="n">name</span><span class="p">(</span><span class="n">diff</span><span class="p">)</span> <span class="ow">in</span> <span class="p">[</span><span class="s2">"Module"</span><span class="p">,</span> <span class="s2">"Package"</span><span class="p">]:</span>
|
||||
<span class="k">return</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">diff</span><span class="p">[</span><span class="s2">"new"</span><span class="p">][</span><span class="n">name</span><span class="p">(</span><span class="n">diff</span><span class="p">)][</span><span class="s2">"name"</span><span class="p">],</span> <span class="n">diff</span><span class="p">[</span><span class="s2">"new"</span><span class="p">][</span><span class="n">name</span><span class="p">(</span><span class="n">diff</span><span class="p">)][</span><span class="s2">"version"</span><span class="p">])</span>
|
||||
<span class="k">elif</span> <span class="n">name</span><span class="p">(</span><span class="n">diff</span><span class="p">)</span> <span class="ow">in</span> <span class="p">[</span><span class="s2">"Group"</span><span class="p">]:</span>
|
||||
<span class="k">return</span> <span class="n">diff</span><span class="p">[</span><span class="s2">"new"</span><span class="p">][</span><span class="n">name</span><span class="p">(</span><span class="n">diff</span><span class="p">)][</span><span class="s2">"name"</span><span class="p">]</span>
|
||||
<span class="k">else</span><span class="p">:</span>
|
||||
<span class="k">return</span> <span class="s2">" "</span><span class="o">.</span><span class="n">join</span><span class="p">([</span><span class="n">diff</span><span class="p">[</span><span class="s2">"new"</span><span class="p">][</span><span class="n">k</span><span class="p">]</span> <span class="k">for</span> <span class="n">k</span> <span class="ow">in</span> <span class="n">diff</span><span class="p">[</span><span class="s2">"new"</span><span class="p">]])</span>
|
||||
<span class="k">elif</span> <span class="n">change</span><span class="p">(</span><span class="n">diff</span><span class="p">)</span> <span class="o">==</span> <span class="s2">"Removed"</span><span class="p">:</span>
|
||||
<span class="k">if</span> <span class="n">name</span><span class="p">(</span><span class="n">diff</span><span class="p">)</span> <span class="ow">in</span> <span class="p">[</span><span class="s2">"Module"</span><span class="p">,</span> <span class="s2">"Package"</span><span class="p">]:</span>
|
||||
<span class="k">return</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">diff</span><span class="p">[</span><span class="s2">"old"</span><span class="p">][</span><span class="n">name</span><span class="p">(</span><span class="n">diff</span><span class="p">)][</span><span class="s2">"name"</span><span class="p">],</span> <span class="n">diff</span><span class="p">[</span><span class="s2">"old"</span><span class="p">][</span><span class="n">name</span><span class="p">(</span><span class="n">diff</span><span class="p">)][</span><span class="s2">"version"</span><span class="p">])</span>
|
||||
<span class="k">elif</span> <span class="n">name</span><span class="p">(</span><span class="n">diff</span><span class="p">)</span> <span class="ow">in</span> <span class="p">[</span><span class="s2">"Group"</span><span class="p">]:</span>
|
||||
<span class="k">return</span> <span class="n">diff</span><span class="p">[</span><span class="s2">"old"</span><span class="p">][</span><span class="n">name</span><span class="p">(</span><span class="n">diff</span><span class="p">)][</span><span class="s2">"name"</span><span class="p">]</span>
|
||||
<span class="k">else</span><span class="p">:</span>
|
||||
<span class="k">return</span> <span class="s2">" "</span><span class="o">.</span><span class="n">join</span><span class="p">([</span><span class="n">diff</span><span class="p">[</span><span class="s2">"old"</span><span class="p">][</span><span class="n">k</span><span class="p">]</span> <span class="k">for</span> <span class="n">k</span> <span class="ow">in</span> <span class="n">diff</span><span class="p">[</span><span class="s2">"old"</span><span class="p">]])</span>
|
||||
|
||||
@ -435,7 +433,7 @@
|
||||
<span class="n">api_route</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">api_url</span><span class="p">(</span><span class="n">api_version</span><span class="p">,</span> <span class="s2">"/blueprints/delete/</span><span class="si">%s</span><span class="s2">"</span> <span class="o">%</span> <span class="n">args</span><span class="p">[</span><span class="mi">0</span><span class="p">])</span>
|
||||
<span class="n">result</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">delete_url_json</span><span class="p">(</span><span class="n">socket_path</span><span class="p">,</span> <span class="n">api_route</span><span class="p">)</span>
|
||||
|
||||
<span class="k">return</span> <span class="n">handle_api_result</span><span class="p">(</span><span class="n">result</span><span class="p">,</span> <span class="n">show_json</span><span class="p">)</span></div>
|
||||
<span class="k">return</span> <span class="n">handle_api_result</span><span class="p">(</span><span class="n">result</span><span class="p">,</span> <span class="n">show_json</span><span class="p">)[</span><span class="mi">0</span><span class="p">]</span></div>
|
||||
|
||||
<div class="viewcode-block" id="blueprints_depsolve"><a class="viewcode-back" href="../../../composer.cli.html#composer.cli.blueprints.blueprints_depsolve">[docs]</a><span class="k">def</span> <span class="nf">blueprints_depsolve</span><span class="p">(</span><span class="n">socket_path</span><span class="p">,</span> <span class="n">api_version</span><span class="p">,</span> <span class="n">args</span><span class="p">,</span> <span class="n">show_json</span><span class="o">=</span><span class="kc">False</span><span class="p">):</span>
|
||||
<span class="sd">"""Display the packages needed to install the blueprint</span>
|
||||
@ -453,10 +451,9 @@
|
||||
<span class="sd"> """</span>
|
||||
<span class="n">api_route</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">api_url</span><span class="p">(</span><span class="n">api_version</span><span class="p">,</span> <span class="s2">"/blueprints/depsolve/</span><span class="si">%s</span><span class="s2">"</span> <span class="o">%</span> <span class="p">(</span><span class="s2">","</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="n">argify</span><span class="p">(</span><span class="n">args</span><span class="p">))))</span>
|
||||
<span class="n">result</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">get_url_json</span><span class="p">(</span><span class="n">socket_path</span><span class="p">,</span> <span class="n">api_route</span><span class="p">)</span>
|
||||
|
||||
<span class="k">if</span> <span class="n">show_json</span><span class="p">:</span>
|
||||
<span class="nb">print</span><span class="p">(</span><span class="n">json</span><span class="o">.</span><span class="n">dumps</span><span class="p">(</span><span class="n">result</span><span class="p">,</span> <span class="n">indent</span><span class="o">=</span><span class="mi">4</span><span class="p">))</span>
|
||||
<span class="k">return</span> <span class="mi">0</span>
|
||||
<span class="p">(</span><span class="n">rc</span><span class="p">,</span> <span class="n">exit_now</span><span class="p">)</span> <span class="o">=</span> <span class="n">handle_api_result</span><span class="p">(</span><span class="n">result</span><span class="p">,</span> <span class="n">show_json</span><span class="p">)</span>
|
||||
<span class="k">if</span> <span class="n">exit_now</span><span class="p">:</span>
|
||||
<span class="k">return</span> <span class="n">rc</span>
|
||||
|
||||
<span class="k">for</span> <span class="n">blueprint</span> <span class="ow">in</span> <span class="n">result</span><span class="p">[</span><span class="s2">"blueprints"</span><span class="p">]:</span>
|
||||
<span class="k">if</span> <span class="n">blueprint</span><span class="p">[</span><span class="s2">"blueprint"</span><span class="p">]</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">"version"</span><span class="p">,</span> <span class="s2">""</span><span class="p">):</span>
|
||||
@ -466,7 +463,7 @@
|
||||
<span class="k">for</span> <span class="n">dep</span> <span class="ow">in</span> <span class="n">blueprint</span><span class="p">[</span><span class="s2">"dependencies"</span><span class="p">]:</span>
|
||||
<span class="nb">print</span><span class="p">(</span><span class="s2">" "</span> <span class="o">+</span> <span class="n">packageNEVRA</span><span class="p">(</span><span class="n">dep</span><span class="p">))</span>
|
||||
|
||||
<span class="k">return</span> <span class="mi">0</span></div>
|
||||
<span class="k">return</span> <span class="n">rc</span></div>
|
||||
|
||||
<div class="viewcode-block" id="blueprints_push"><a class="viewcode-back" href="../../../composer.cli.html#composer.cli.blueprints.blueprints_push">[docs]</a><span class="k">def</span> <span class="nf">blueprints_push</span><span class="p">(</span><span class="n">socket_path</span><span class="p">,</span> <span class="n">api_version</span><span class="p">,</span> <span class="n">args</span><span class="p">,</span> <span class="n">show_json</span><span class="o">=</span><span class="kc">False</span><span class="p">):</span>
|
||||
<span class="sd">"""Push a blueprint TOML file to the server, updating the blueprint</span>
|
||||
@ -491,7 +488,7 @@
|
||||
<span class="n">blueprint_toml</span> <span class="o">=</span> <span class="nb">open</span><span class="p">(</span><span class="n">blueprint</span><span class="p">,</span> <span class="s2">"r"</span><span class="p">)</span><span class="o">.</span><span class="n">read</span><span class="p">()</span>
|
||||
|
||||
<span class="n">result</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">post_url_toml</span><span class="p">(</span><span class="n">socket_path</span><span class="p">,</span> <span class="n">api_route</span><span class="p">,</span> <span class="n">blueprint_toml</span><span class="p">)</span>
|
||||
<span class="k">if</span> <span class="n">handle_api_result</span><span class="p">(</span><span class="n">result</span><span class="p">,</span> <span class="n">show_json</span><span class="p">):</span>
|
||||
<span class="k">if</span> <span class="n">handle_api_result</span><span class="p">(</span><span class="n">result</span><span class="p">,</span> <span class="n">show_json</span><span class="p">)[</span><span class="mi">0</span><span class="p">]:</span>
|
||||
<span class="n">rval</span> <span class="o">=</span> <span class="mi">1</span>
|
||||
|
||||
<span class="k">return</span> <span class="n">rval</span></div>
|
||||
@ -523,32 +520,24 @@
|
||||
|
||||
<span class="n">api_route</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">api_url</span><span class="p">(</span><span class="n">api_version</span><span class="p">,</span> <span class="s2">"/blueprints/freeze/</span><span class="si">%s</span><span class="s2">"</span> <span class="o">%</span> <span class="p">(</span><span class="s2">","</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="n">argify</span><span class="p">(</span><span class="n">args</span><span class="p">))))</span>
|
||||
<span class="n">result</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">get_url_json</span><span class="p">(</span><span class="n">socket_path</span><span class="p">,</span> <span class="n">api_route</span><span class="p">)</span>
|
||||
<span class="p">(</span><span class="n">rc</span><span class="p">,</span> <span class="n">exit_now</span><span class="p">)</span> <span class="o">=</span> <span class="n">handle_api_result</span><span class="p">(</span><span class="n">result</span><span class="p">,</span> <span class="n">show_json</span><span class="p">)</span>
|
||||
<span class="k">if</span> <span class="n">exit_now</span><span class="p">:</span>
|
||||
<span class="k">return</span> <span class="n">rc</span>
|
||||
|
||||
<span class="k">if</span> <span class="n">show_json</span><span class="p">:</span>
|
||||
<span class="nb">print</span><span class="p">(</span><span class="n">json</span><span class="o">.</span><span class="n">dumps</span><span class="p">(</span><span class="n">result</span><span class="p">,</span> <span class="n">indent</span><span class="o">=</span><span class="mi">4</span><span class="p">))</span>
|
||||
<span class="k">else</span><span class="p">:</span>
|
||||
<span class="k">for</span> <span class="n">entry</span> <span class="ow">in</span> <span class="n">result</span><span class="p">[</span><span class="s2">"blueprints"</span><span class="p">]:</span>
|
||||
<span class="n">blueprint</span> <span class="o">=</span> <span class="n">entry</span><span class="p">[</span><span class="s2">"blueprint"</span><span class="p">]</span>
|
||||
<span class="k">if</span> <span class="n">blueprint</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">"version"</span><span class="p">,</span> <span class="s2">""</span><span class="p">):</span>
|
||||
<span class="nb">print</span><span class="p">(</span><span class="s2">"blueprint: </span><span class="si">%s</span><span class="s2"> v</span><span class="si">%s</span><span class="s2">"</span> <span class="o">%</span> <span class="p">(</span><span class="n">blueprint</span><span class="p">[</span><span class="s2">"name"</span><span class="p">],</span> <span class="n">blueprint</span><span class="p">[</span><span class="s2">"version"</span><span class="p">]))</span>
|
||||
<span class="k">else</span><span class="p">:</span>
|
||||
<span class="nb">print</span><span class="p">(</span><span class="s2">"blueprint: </span><span class="si">%s</span><span class="s2">"</span> <span class="o">%</span> <span class="p">(</span><span class="n">blueprint</span><span class="p">[</span><span class="s2">"name"</span><span class="p">]))</span>
|
||||
<span class="k">for</span> <span class="n">entry</span> <span class="ow">in</span> <span class="n">result</span><span class="p">[</span><span class="s2">"blueprints"</span><span class="p">]:</span>
|
||||
<span class="n">blueprint</span> <span class="o">=</span> <span class="n">entry</span><span class="p">[</span><span class="s2">"blueprint"</span><span class="p">]</span>
|
||||
<span class="k">if</span> <span class="n">blueprint</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">"version"</span><span class="p">,</span> <span class="s2">""</span><span class="p">):</span>
|
||||
<span class="nb">print</span><span class="p">(</span><span class="s2">"blueprint: </span><span class="si">%s</span><span class="s2"> v</span><span class="si">%s</span><span class="s2">"</span> <span class="o">%</span> <span class="p">(</span><span class="n">blueprint</span><span class="p">[</span><span class="s2">"name"</span><span class="p">],</span> <span class="n">blueprint</span><span class="p">[</span><span class="s2">"version"</span><span class="p">]))</span>
|
||||
<span class="k">else</span><span class="p">:</span>
|
||||
<span class="nb">print</span><span class="p">(</span><span class="s2">"blueprint: </span><span class="si">%s</span><span class="s2">"</span> <span class="o">%</span> <span class="p">(</span><span class="n">blueprint</span><span class="p">[</span><span class="s2">"name"</span><span class="p">]))</span>
|
||||
|
||||
<span class="k">for</span> <span class="n">m</span> <span class="ow">in</span> <span class="n">blueprint</span><span class="p">[</span><span class="s2">"modules"</span><span class="p">]:</span>
|
||||
<span class="nb">print</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">m</span><span class="p">[</span><span class="s2">"name"</span><span class="p">],</span> <span class="n">m</span><span class="p">[</span><span class="s2">"version"</span><span class="p">]))</span>
|
||||
<span class="k">for</span> <span class="n">m</span> <span class="ow">in</span> <span class="n">blueprint</span><span class="p">[</span><span class="s2">"modules"</span><span class="p">]:</span>
|
||||
<span class="nb">print</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">m</span><span class="p">[</span><span class="s2">"name"</span><span class="p">],</span> <span class="n">m</span><span class="p">[</span><span class="s2">"version"</span><span class="p">]))</span>
|
||||
|
||||
<span class="k">for</span> <span class="n">p</span> <span class="ow">in</span> <span class="n">blueprint</span><span class="p">[</span><span class="s2">"packages"</span><span class="p">]:</span>
|
||||
<span class="nb">print</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">p</span><span class="p">[</span><span class="s2">"name"</span><span class="p">],</span> <span class="n">p</span><span class="p">[</span><span class="s2">"version"</span><span class="p">]))</span>
|
||||
<span class="k">for</span> <span class="n">p</span> <span class="ow">in</span> <span class="n">blueprint</span><span class="p">[</span><span class="s2">"packages"</span><span class="p">]:</span>
|
||||
<span class="nb">print</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">p</span><span class="p">[</span><span class="s2">"name"</span><span class="p">],</span> <span class="n">p</span><span class="p">[</span><span class="s2">"version"</span><span class="p">]))</span>
|
||||
|
||||
<span class="c1"># Print any errors</span>
|
||||
<span class="k">for</span> <span class="n">err</span> <span class="ow">in</span> <span class="n">result</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">"errors"</span><span class="p">,</span> <span class="p">[]):</span>
|
||||
<span class="n">log</span><span class="o">.</span><span class="n">error</span><span class="p">(</span><span class="n">err</span><span class="p">)</span>
|
||||
|
||||
<span class="c1"># Return a 1 if there are any errors</span>
|
||||
<span class="k">if</span> <span class="n">result</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">"errors"</span><span class="p">,</span> <span class="p">[]):</span>
|
||||
<span class="k">return</span> <span class="mi">1</span>
|
||||
<span class="k">else</span><span class="p">:</span>
|
||||
<span class="k">return</span> <span class="mi">0</span></div>
|
||||
<span class="k">return</span> <span class="n">rc</span></div>
|
||||
|
||||
<div class="viewcode-block" id="blueprints_freeze_show"><a class="viewcode-back" href="../../../composer.cli.html#composer.cli.blueprints.blueprints_freeze_show">[docs]</a><span class="k">def</span> <span class="nf">blueprints_freeze_show</span><span class="p">(</span><span class="n">socket_path</span><span class="p">,</span> <span class="n">api_version</span><span class="p">,</span> <span class="n">args</span><span class="p">,</span> <span class="n">show_json</span><span class="o">=</span><span class="kc">False</span><span class="p">):</span>
|
||||
<span class="sd">"""Show the frozen blueprint in TOML format</span>
|
||||
@ -616,7 +605,7 @@
|
||||
<span class="n">api_route</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">api_url</span><span class="p">(</span><span class="n">api_version</span><span class="p">,</span> <span class="s2">"/blueprints/tag/</span><span class="si">%s</span><span class="s2">"</span> <span class="o">%</span> <span class="n">args</span><span class="p">[</span><span class="mi">0</span><span class="p">])</span>
|
||||
<span class="n">result</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">post_url</span><span class="p">(</span><span class="n">socket_path</span><span class="p">,</span> <span class="n">api_route</span><span class="p">,</span> <span class="s2">""</span><span class="p">)</span>
|
||||
|
||||
<span class="k">return</span> <span class="n">handle_api_result</span><span class="p">(</span><span class="n">result</span><span class="p">,</span> <span class="n">show_json</span><span class="p">)</span></div>
|
||||
<span class="k">return</span> <span class="n">handle_api_result</span><span class="p">(</span><span class="n">result</span><span class="p">,</span> <span class="n">show_json</span><span class="p">)[</span><span class="mi">0</span><span class="p">]</span></div>
|
||||
|
||||
<div class="viewcode-block" id="blueprints_undo"><a class="viewcode-back" href="../../../composer.cli.html#composer.cli.blueprints.blueprints_undo">[docs]</a><span class="k">def</span> <span class="nf">blueprints_undo</span><span class="p">(</span><span class="n">socket_path</span><span class="p">,</span> <span class="n">api_version</span><span class="p">,</span> <span class="n">args</span><span class="p">,</span> <span class="n">show_json</span><span class="o">=</span><span class="kc">False</span><span class="p">):</span>
|
||||
<span class="sd">"""Undo changes to a blueprint</span>
|
||||
@ -642,7 +631,7 @@
|
||||
<span class="n">api_route</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">api_url</span><span class="p">(</span><span class="n">api_version</span><span class="p">,</span> <span class="s2">"/blueprints/undo/</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">args</span><span class="p">[</span><span class="mi">0</span><span class="p">],</span> <span class="n">args</span><span class="p">[</span><span class="mi">1</span><span class="p">]))</span>
|
||||
<span class="n">result</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">post_url</span><span class="p">(</span><span class="n">socket_path</span><span class="p">,</span> <span class="n">api_route</span><span class="p">,</span> <span class="s2">""</span><span class="p">)</span>
|
||||
|
||||
<span class="k">return</span> <span class="n">handle_api_result</span><span class="p">(</span><span class="n">result</span><span class="p">,</span> <span class="n">show_json</span><span class="p">)</span></div>
|
||||
<span class="k">return</span> <span class="n">handle_api_result</span><span class="p">(</span><span class="n">result</span><span class="p">,</span> <span class="n">show_json</span><span class="p">)[</span><span class="mi">0</span><span class="p">]</span></div>
|
||||
|
||||
<div class="viewcode-block" id="blueprints_workspace"><a class="viewcode-back" href="../../../composer.cli.html#composer.cli.blueprints.blueprints_workspace">[docs]</a><span class="k">def</span> <span class="nf">blueprints_workspace</span><span class="p">(</span><span class="n">socket_path</span><span class="p">,</span> <span class="n">api_version</span><span class="p">,</span> <span class="n">args</span><span class="p">,</span> <span class="n">show_json</span><span class="o">=</span><span class="kc">False</span><span class="p">):</span>
|
||||
<span class="sd">"""Push the blueprint TOML to the temporary workspace storage</span>
|
||||
@ -667,14 +656,7 @@
|
||||
<span class="n">blueprint_toml</span> <span class="o">=</span> <span class="nb">open</span><span class="p">(</span><span class="n">blueprint</span><span class="p">,</span> <span class="s2">"r"</span><span class="p">)</span><span class="o">.</span><span class="n">read</span><span class="p">()</span>
|
||||
|
||||
<span class="n">result</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">post_url_toml</span><span class="p">(</span><span class="n">socket_path</span><span class="p">,</span> <span class="n">api_route</span><span class="p">,</span> <span class="n">blueprint_toml</span><span class="p">)</span>
|
||||
<span class="k">if</span> <span class="n">show_json</span><span class="p">:</span>
|
||||
<span class="nb">print</span><span class="p">(</span><span class="n">json</span><span class="o">.</span><span class="n">dumps</span><span class="p">(</span><span class="n">result</span><span class="p">,</span> <span class="n">indent</span><span class="o">=</span><span class="mi">4</span><span class="p">))</span>
|
||||
|
||||
<span class="k">for</span> <span class="n">err</span> <span class="ow">in</span> <span class="n">result</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">"errors"</span><span class="p">,</span> <span class="p">[]):</span>
|
||||
<span class="n">log</span><span class="o">.</span><span class="n">error</span><span class="p">(</span><span class="n">err</span><span class="p">)</span>
|
||||
|
||||
<span class="c1"># Any errors results in returning a 1, but we continue with the rest first</span>
|
||||
<span class="k">if</span> <span class="ow">not</span> <span class="n">result</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">"status"</span><span class="p">,</span> <span class="kc">False</span><span class="p">):</span>
|
||||
<span class="k">if</span> <span class="n">handle_api_result</span><span class="p">(</span><span class="n">result</span><span class="p">,</span> <span class="n">show_json</span><span class="p">)[</span><span class="mi">0</span><span class="p">]:</span>
|
||||
<span class="n">rval</span> <span class="o">=</span> <span class="mi">1</span>
|
||||
|
||||
<span class="k">return</span> <span class="n">rval</span></div>
|
||||
@ -712,7 +694,7 @@
|
||||
<script type="text/javascript">
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT:'../../../',
|
||||
VERSION:'29.10',
|
||||
VERSION:'29.11',
|
||||
LANGUAGE:'None',
|
||||
COLLAPSE_INDEX:false,
|
||||
FILE_SUFFIX:'.html',
|
||||
@ -726,7 +708,10 @@
|
||||
|
||||
|
||||
|
||||
<script type="text/javascript" src="../../../_static/js/theme.js"></script>
|
||||
|
||||
|
||||
<script type="text/javascript" src="../../../_static/js/theme.js"></script>
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
jQuery(function () {
|
||||
|
@ -8,7 +8,7 @@
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<title>composer.cli.cmdline — Lorax 29.10 documentation</title>
|
||||
<title>composer.cli.cmdline — Lorax 29.11 documentation</title>
|
||||
|
||||
|
||||
|
||||
@ -24,7 +24,8 @@
|
||||
|
||||
|
||||
|
||||
<link rel="stylesheet" href="../../../_static/css/theme.css" type="text/css" />
|
||||
|
||||
<link rel="stylesheet" href="../../../_static/css/theme.css" type="text/css" />
|
||||
<link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" />
|
||||
<link rel="index" title="Index" href="../../../genindex.html" />
|
||||
<link rel="search" title="Search" href="../../../search.html" />
|
||||
@ -56,7 +57,7 @@
|
||||
|
||||
|
||||
<div class="version">
|
||||
29.10
|
||||
29.11
|
||||
</div>
|
||||
|
||||
|
||||
@ -238,7 +239,7 @@
|
||||
<script type="text/javascript">
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT:'../../../',
|
||||
VERSION:'29.10',
|
||||
VERSION:'29.11',
|
||||
LANGUAGE:'None',
|
||||
COLLAPSE_INDEX:false,
|
||||
FILE_SUFFIX:'.html',
|
||||
@ -252,7 +253,10 @@
|
||||
|
||||
|
||||
|
||||
<script type="text/javascript" src="../../../_static/js/theme.js"></script>
|
||||
|
||||
|
||||
<script type="text/javascript" src="../../../_static/js/theme.js"></script>
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
jQuery(function () {
|
||||
|
@ -8,7 +8,7 @@
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<title>composer.cli.compose — Lorax 29.10 documentation</title>
|
||||
<title>composer.cli.compose — Lorax 29.11 documentation</title>
|
||||
|
||||
|
||||
|
||||
@ -24,7 +24,8 @@
|
||||
|
||||
|
||||
|
||||
<link rel="stylesheet" href="../../../_static/css/theme.css" type="text/css" />
|
||||
|
||||
<link rel="stylesheet" href="../../../_static/css/theme.css" type="text/css" />
|
||||
<link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" />
|
||||
<link rel="index" title="Index" href="../../../genindex.html" />
|
||||
<link rel="search" title="Search" href="../../../search.html" />
|
||||
@ -56,7 +57,7 @@
|
||||
|
||||
|
||||
<div class="version">
|
||||
29.10
|
||||
29.11
|
||||
</div>
|
||||
|
||||
|
||||
@ -173,6 +174,7 @@
|
||||
<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">"composer-cli"</span><span class="p">)</span>
|
||||
|
||||
<span class="kn">from</span> <span class="nn">datetime</span> <span class="k">import</span> <span class="n">datetime</span>
|
||||
<span class="kn">import</span> <span class="nn">sys</span>
|
||||
<span class="kn">import</span> <span class="nn">json</span>
|
||||
|
||||
@ -191,6 +193,7 @@
|
||||
<span class="sd"> This dispatches the compose commands to a function</span>
|
||||
<span class="sd"> """</span>
|
||||
<span class="n">cmd_map</span> <span class="o">=</span> <span class="p">{</span>
|
||||
<span class="s2">"list"</span><span class="p">:</span> <span class="n">compose_list</span><span class="p">,</span>
|
||||
<span class="s2">"status"</span><span class="p">:</span> <span class="n">compose_status</span><span class="p">,</span>
|
||||
<span class="s2">"types"</span><span class="p">:</span> <span class="n">compose_types</span><span class="p">,</span>
|
||||
<span class="s2">"start"</span><span class="p">:</span> <span class="n">compose_start</span><span class="p">,</span>
|
||||
@ -203,7 +206,7 @@
|
||||
<span class="s2">"logs"</span><span class="p">:</span> <span class="n">compose_logs</span><span class="p">,</span>
|
||||
<span class="s2">"image"</span><span class="p">:</span> <span class="n">compose_image</span><span class="p">,</span>
|
||||
<span class="p">}</span>
|
||||
<span class="k">if</span> <span class="n">opts</span><span class="o">.</span><span class="n">args</span> <span class="o">==</span> <span class="s2">"help"</span> <span class="ow">or</span> <span class="n">opts</span><span class="o">.</span><span class="n">args</span> <span class="o">==</span> <span class="s2">"--help"</span><span class="p">:</span>
|
||||
<span class="k">if</span> <span class="n">opts</span><span class="o">.</span><span class="n">args</span><span class="p">[</span><span class="mi">1</span><span class="p">]</span> <span class="o">==</span> <span class="s2">"help"</span> <span class="ow">or</span> <span class="n">opts</span><span class="o">.</span><span class="n">args</span><span class="p">[</span><span class="mi">1</span><span class="p">]</span> <span class="o">==</span> <span class="s2">"--help"</span><span class="p">:</span>
|
||||
<span class="nb">print</span><span class="p">(</span><span class="n">compose_help</span><span class="p">)</span>
|
||||
<span class="k">return</span> <span class="mi">0</span>
|
||||
<span class="k">elif</span> <span class="n">opts</span><span class="o">.</span><span class="n">args</span><span class="p">[</span><span class="mi">1</span><span class="p">]</span> <span class="ow">not</span> <span class="ow">in</span> <span class="n">cmd_map</span><span class="p">:</span>
|
||||
@ -212,6 +215,50 @@
|
||||
|
||||
<span class="k">return</span> <span class="n">cmd_map</span><span class="p">[</span><span class="n">opts</span><span class="o">.</span><span class="n">args</span><span class="p">[</span><span class="mi">1</span><span class="p">]](</span><span class="n">opts</span><span class="o">.</span><span class="n">socket</span><span class="p">,</span> <span class="n">opts</span><span class="o">.</span><span class="n">api_version</span><span class="p">,</span> <span class="n">opts</span><span class="o">.</span><span class="n">args</span><span class="p">[</span><span class="mi">2</span><span class="p">:],</span> <span class="n">opts</span><span class="o">.</span><span class="n">json</span><span class="p">,</span> <span class="n">opts</span><span class="o">.</span><span class="n">testmode</span><span class="p">)</span></div>
|
||||
|
||||
<div class="viewcode-block" id="compose_list"><a class="viewcode-back" href="../../../composer.cli.html#composer.cli.compose.compose_list">[docs]</a><span class="k">def</span> <span class="nf">compose_list</span><span class="p">(</span><span class="n">socket_path</span><span class="p">,</span> <span class="n">api_version</span><span class="p">,</span> <span class="n">args</span><span class="p">,</span> <span class="n">show_json</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="n">testmode</span><span class="o">=</span><span class="mi">0</span><span class="p">):</span>
|
||||
<span class="sd">"""Return a simple list of compose identifiers"""</span>
|
||||
|
||||
<span class="n">states</span> <span class="o">=</span> <span class="p">(</span><span class="s2">"running"</span><span class="p">,</span> <span class="s2">"waiting"</span><span class="p">,</span> <span class="s2">"finished"</span><span class="p">,</span> <span class="s2">"failed"</span><span class="p">)</span>
|
||||
|
||||
<span class="n">which</span> <span class="o">=</span> <span class="nb">set</span><span class="p">()</span>
|
||||
|
||||
<span class="k">if</span> <span class="nb">any</span><span class="p">(</span><span class="n">a</span> <span class="ow">not</span> <span class="ow">in</span> <span class="n">states</span> <span class="k">for</span> <span class="n">a</span> <span class="ow">in</span> <span class="n">args</span><span class="p">):</span>
|
||||
<span class="c1"># TODO: error about unknown state</span>
|
||||
<span class="k">return</span> <span class="mi">1</span>
|
||||
<span class="k">elif</span> <span class="ow">not</span> <span class="n">args</span><span class="p">:</span>
|
||||
<span class="n">which</span><span class="o">.</span><span class="n">update</span><span class="p">(</span><span class="n">states</span><span class="p">)</span>
|
||||
<span class="k">else</span><span class="p">:</span>
|
||||
<span class="n">which</span><span class="o">.</span><span class="n">update</span><span class="p">(</span><span class="n">args</span><span class="p">)</span>
|
||||
|
||||
<span class="n">results</span> <span class="o">=</span> <span class="p">[]</span>
|
||||
|
||||
<span class="k">if</span> <span class="s2">"running"</span> <span class="ow">in</span> <span class="n">which</span> <span class="ow">or</span> <span class="s2">"waiting"</span> <span class="ow">in</span> <span class="n">which</span><span class="p">:</span>
|
||||
<span class="n">api_route</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">api_url</span><span class="p">(</span><span class="n">api_version</span><span class="p">,</span> <span class="s2">"/compose/queue"</span><span class="p">)</span>
|
||||
<span class="n">r</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">get_url_json</span><span class="p">(</span><span class="n">socket_path</span><span class="p">,</span> <span class="n">api_route</span><span class="p">)</span>
|
||||
<span class="k">if</span> <span class="s2">"running"</span> <span class="ow">in</span> <span class="n">which</span><span class="p">:</span>
|
||||
<span class="n">results</span> <span class="o">+=</span> <span class="n">r</span><span class="p">[</span><span class="s2">"run"</span><span class="p">]</span>
|
||||
<span class="k">if</span> <span class="s2">"waiting"</span> <span class="ow">in</span> <span class="n">which</span><span class="p">:</span>
|
||||
<span class="n">results</span> <span class="o">+=</span> <span class="n">r</span><span class="p">[</span><span class="s2">"new"</span><span class="p">]</span>
|
||||
|
||||
<span class="k">if</span> <span class="s2">"finished"</span> <span class="ow">in</span> <span class="n">which</span><span class="p">:</span>
|
||||
<span class="n">api_route</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">api_url</span><span class="p">(</span><span class="n">api_version</span><span class="p">,</span> <span class="s2">"/compose/finished"</span><span class="p">)</span>
|
||||
<span class="n">r</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">get_url_json</span><span class="p">(</span><span class="n">socket_path</span><span class="p">,</span> <span class="n">api_route</span><span class="p">)</span>
|
||||
<span class="n">results</span> <span class="o">+=</span> <span class="n">r</span><span class="p">[</span><span class="s2">"finished"</span><span class="p">]</span>
|
||||
|
||||
<span class="k">if</span> <span class="s2">"failed"</span> <span class="ow">in</span> <span class="n">which</span><span class="p">:</span>
|
||||
<span class="n">api_route</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">api_url</span><span class="p">(</span><span class="n">api_version</span><span class="p">,</span> <span class="s2">"/compose/failed"</span><span class="p">)</span>
|
||||
<span class="n">r</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">get_url_json</span><span class="p">(</span><span class="n">socket_path</span><span class="p">,</span> <span class="n">api_route</span><span class="p">)</span>
|
||||
<span class="n">results</span> <span class="o">+=</span> <span class="n">r</span><span class="p">[</span><span class="s2">"failed"</span><span class="p">]</span>
|
||||
|
||||
<span class="k">if</span> <span class="n">results</span><span class="p">:</span>
|
||||
<span class="k">if</span> <span class="n">show_json</span><span class="p">:</span>
|
||||
<span class="nb">print</span><span class="p">(</span><span class="n">json</span><span class="o">.</span><span class="n">dumps</span><span class="p">(</span><span class="n">results</span><span class="p">,</span> <span class="n">indent</span><span class="o">=</span><span class="mi">4</span><span class="p">))</span>
|
||||
<span class="k">else</span><span class="p">:</span>
|
||||
<span class="n">list_fmt</span> <span class="o">=</span> <span class="s2">"</span><span class="si">{id}</span><span class="s2"> </span><span class="si">{queue_status}</span><span class="s2"> </span><span class="si">{blueprint}</span><span class="s2"> </span><span class="si">{version}</span><span class="s2"> </span><span class="si">{compose_type}</span><span class="s2">"</span>
|
||||
<span class="nb">print</span><span class="p">(</span><span class="s2">"</span><span class="se">\n</span><span class="s2">"</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="n">list_fmt</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="o">**</span><span class="n">c</span><span class="p">)</span> <span class="k">for</span> <span class="n">c</span> <span class="ow">in</span> <span class="n">results</span><span class="p">))</span>
|
||||
|
||||
<span class="k">return</span> <span class="mi">0</span></div>
|
||||
|
||||
<div class="viewcode-block" id="compose_status"><a class="viewcode-back" href="../../../composer.cli.html#composer.cli.compose.compose_status">[docs]</a><span class="k">def</span> <span class="nf">compose_status</span><span class="p">(</span><span class="n">socket_path</span><span class="p">,</span> <span class="n">api_version</span><span class="p">,</span> <span class="n">args</span><span class="p">,</span> <span class="n">show_json</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="n">testmode</span><span class="o">=</span><span class="mi">0</span><span class="p">):</span>
|
||||
<span class="sd">"""Return the status of all known composes</span>
|
||||
|
||||
@ -235,7 +282,10 @@
|
||||
<span class="s2">"version"</span><span class="p">:</span> <span class="n">compose</span><span class="p">[</span><span class="s2">"version"</span><span class="p">],</span>
|
||||
<span class="s2">"compose_type"</span><span class="p">:</span> <span class="n">compose</span><span class="p">[</span><span class="s2">"compose_type"</span><span class="p">],</span>
|
||||
<span class="s2">"image_size"</span><span class="p">:</span> <span class="n">compose</span><span class="p">[</span><span class="s2">"image_size"</span><span class="p">],</span>
|
||||
<span class="s2">"status"</span><span class="p">:</span> <span class="n">compose</span><span class="p">[</span><span class="s2">"queue_status"</span><span class="p">]}</span>
|
||||
<span class="s2">"status"</span><span class="p">:</span> <span class="n">compose</span><span class="p">[</span><span class="s2">"queue_status"</span><span class="p">],</span>
|
||||
<span class="s2">"created"</span><span class="p">:</span> <span class="n">compose</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">"job_created"</span><span class="p">),</span>
|
||||
<span class="s2">"started"</span><span class="p">:</span> <span class="n">compose</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">"job_started"</span><span class="p">),</span>
|
||||
<span class="s2">"finished"</span><span class="p">:</span> <span class="n">compose</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">"job_finished"</span><span class="p">)}</span>
|
||||
|
||||
<span class="c1"># Sort the status in a specific order</span>
|
||||
<span class="k">def</span> <span class="nf">sort_status</span><span class="p">(</span><span class="n">a</span><span class="p">):</span>
|
||||
@ -273,8 +323,10 @@
|
||||
<span class="k">else</span><span class="p">:</span>
|
||||
<span class="n">image_size</span> <span class="o">=</span> <span class="s2">""</span>
|
||||
|
||||
<span class="nb">print</span><span class="p">(</span><span class="s2">"</span><span class="si">%s</span><span class="s2"> </span><span class="si">%-8s</span><span class="s2"> </span><span class="si">%-15s</span><span class="s2"> </span><span class="si">%s</span><span class="s2"> </span><span class="si">%-16s</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">c</span><span class="p">[</span><span class="s2">"id"</span><span class="p">],</span> <span class="n">c</span><span class="p">[</span><span class="s2">"status"</span><span class="p">],</span> <span class="n">c</span><span class="p">[</span><span class="s2">"blueprint"</span><span class="p">],</span> <span class="n">c</span><span class="p">[</span><span class="s2">"version"</span><span class="p">],</span> <span class="n">c</span><span class="p">[</span><span class="s2">"compose_type"</span><span class="p">],</span>
|
||||
<span class="n">image_size</span><span class="p">))</span></div>
|
||||
<span class="n">dt</span> <span class="o">=</span> <span class="n">datetime</span><span class="o">.</span><span class="n">fromtimestamp</span><span class="p">(</span><span class="n">c</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">"finished"</span><span class="p">)</span> <span class="ow">or</span> <span class="n">c</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">"started"</span><span class="p">)</span> <span class="ow">or</span> <span class="n">c</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">"created"</span><span class="p">))</span>
|
||||
|
||||
<span class="nb">print</span><span class="p">(</span><span class="s2">"</span><span class="si">%s</span><span class="s2"> </span><span class="si">%-8s</span><span class="s2"> </span><span class="si">%s</span><span class="s2"> </span><span class="si">%-15s</span><span class="s2"> </span><span class="si">%s</span><span class="s2"> </span><span class="si">%-16s</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">c</span><span class="p">[</span><span class="s2">"id"</span><span class="p">],</span> <span class="n">c</span><span class="p">[</span><span class="s2">"status"</span><span class="p">],</span> <span class="n">dt</span><span class="o">.</span><span class="n">strftime</span><span class="p">(</span><span class="s2">"</span><span class="si">%c</span><span class="s2">"</span><span class="p">),</span> <span class="n">c</span><span class="p">[</span><span class="s2">"blueprint"</span><span class="p">],</span>
|
||||
<span class="n">c</span><span class="p">[</span><span class="s2">"version"</span><span class="p">],</span> <span class="n">c</span><span class="p">[</span><span class="s2">"compose_type"</span><span class="p">],</span> <span class="n">image_size</span><span class="p">))</span></div>
|
||||
|
||||
|
||||
<div class="viewcode-block" id="compose_types"><a class="viewcode-back" href="../../../composer.cli.html#composer.cli.compose.compose_types">[docs]</a><span class="k">def</span> <span class="nf">compose_types</span><span class="p">(</span><span class="n">socket_path</span><span class="p">,</span> <span class="n">api_version</span><span class="p">,</span> <span class="n">args</span><span class="p">,</span> <span class="n">show_json</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="n">testmode</span><span class="o">=</span><span class="mi">0</span><span class="p">):</span>
|
||||
@ -300,7 +352,8 @@
|
||||
<span class="nb">print</span><span class="p">(</span><span class="n">json</span><span class="o">.</span><span class="n">dumps</span><span class="p">(</span><span class="n">result</span><span class="p">,</span> <span class="n">indent</span><span class="o">=</span><span class="mi">4</span><span class="p">))</span>
|
||||
<span class="k">return</span> <span class="mi">0</span>
|
||||
|
||||
<span class="nb">print</span><span class="p">(</span><span class="s2">"Compose Types: "</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">t</span><span class="p">[</span><span class="s2">"name"</span><span class="p">]</span> <span class="k">for</span> <span class="n">t</span> <span class="ow">in</span> <span class="n">result</span><span class="p">[</span><span class="s2">"types"</span><span class="p">]]))</span></div>
|
||||
<span class="c1"># output a plain list of identifiers, one per line</span>
|
||||
<span class="nb">print</span><span class="p">(</span><span class="s2">"</span><span class="se">\n</span><span class="s2">"</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="n">t</span><span class="p">[</span><span class="s2">"name"</span><span class="p">]</span> <span class="k">for</span> <span class="n">t</span> <span class="ow">in</span> <span class="n">result</span><span class="p">[</span><span class="s2">"types"</span><span class="p">]))</span></div>
|
||||
|
||||
<div class="viewcode-block" id="compose_start"><a class="viewcode-back" href="../../../composer.cli.html#composer.cli.compose.compose_start">[docs]</a><span class="k">def</span> <span class="nf">compose_start</span><span class="p">(</span><span class="n">socket_path</span><span class="p">,</span> <span class="n">api_version</span><span class="p">,</span> <span class="n">args</span><span class="p">,</span> <span class="n">show_json</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="n">testmode</span><span class="o">=</span><span class="mi">0</span><span class="p">):</span>
|
||||
<span class="sd">"""Start a new compose using the selected blueprint and type</span>
|
||||
@ -336,19 +389,12 @@
|
||||
<span class="n">test_url</span> <span class="o">=</span> <span class="s2">""</span>
|
||||
<span class="n">api_route</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">api_url</span><span class="p">(</span><span class="n">api_version</span><span class="p">,</span> <span class="s2">"/compose"</span> <span class="o">+</span> <span class="n">test_url</span><span class="p">)</span>
|
||||
<span class="n">result</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">post_url_json</span><span class="p">(</span><span class="n">socket_path</span><span class="p">,</span> <span class="n">api_route</span><span class="p">,</span> <span class="n">json</span><span class="o">.</span><span class="n">dumps</span><span class="p">(</span><span class="n">config</span><span class="p">))</span>
|
||||
|
||||
<span class="k">if</span> <span class="n">show_json</span><span class="p">:</span>
|
||||
<span class="nb">print</span><span class="p">(</span><span class="n">json</span><span class="o">.</span><span class="n">dumps</span><span class="p">(</span><span class="n">result</span><span class="p">,</span> <span class="n">indent</span><span class="o">=</span><span class="mi">4</span><span class="p">))</span>
|
||||
<span class="k">return</span> <span class="mi">0</span>
|
||||
|
||||
<span class="k">for</span> <span class="n">err</span> <span class="ow">in</span> <span class="n">result</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">"errors"</span><span class="p">,</span> <span class="p">[]):</span>
|
||||
<span class="n">log</span><span class="o">.</span><span class="n">error</span><span class="p">(</span><span class="n">err</span><span class="p">)</span>
|
||||
|
||||
<span class="k">if</span> <span class="n">result</span><span class="p">[</span><span class="s2">"status"</span><span class="p">]</span> <span class="o">==</span> <span class="kc">False</span> <span class="ow">or</span> <span class="n">result</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">"errors"</span><span class="p">,</span> <span class="kc">False</span><span class="p">):</span>
|
||||
<span class="k">return</span> <span class="mi">1</span>
|
||||
<span class="p">(</span><span class="n">rc</span><span class="p">,</span> <span class="n">exit_now</span><span class="p">)</span> <span class="o">=</span> <span class="n">handle_api_result</span><span class="p">(</span><span class="n">result</span><span class="p">,</span> <span class="n">show_json</span><span class="p">)</span>
|
||||
<span class="k">if</span> <span class="n">exit_now</span><span class="p">:</span>
|
||||
<span class="k">return</span> <span class="n">rc</span>
|
||||
|
||||
<span class="nb">print</span><span class="p">(</span><span class="s2">"Compose </span><span class="si">%s</span><span class="s2"> added to the queue"</span> <span class="o">%</span> <span class="n">result</span><span class="p">[</span><span class="s2">"build_id"</span><span class="p">])</span>
|
||||
<span class="k">return</span> <span class="mi">0</span></div>
|
||||
<span class="k">return</span> <span class="n">rc</span></div>
|
||||
|
||||
<div class="viewcode-block" id="compose_log"><a class="viewcode-back" href="../../../composer.cli.html#composer.cli.compose.compose_log">[docs]</a><span class="k">def</span> <span class="nf">compose_log</span><span class="p">(</span><span class="n">socket_path</span><span class="p">,</span> <span class="n">api_version</span><span class="p">,</span> <span class="n">args</span><span class="p">,</span> <span class="n">show_json</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="n">testmode</span><span class="o">=</span><span class="mi">0</span><span class="p">):</span>
|
||||
<span class="sd">"""Show the last part of the compose log</span>
|
||||
@ -415,7 +461,7 @@
|
||||
|
||||
<span class="n">api_route</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">api_url</span><span class="p">(</span><span class="n">api_version</span><span class="p">,</span> <span class="s2">"/compose/cancel/</span><span class="si">%s</span><span class="s2">"</span> <span class="o">%</span> <span class="n">args</span><span class="p">[</span><span class="mi">0</span><span class="p">])</span>
|
||||
<span class="n">result</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">delete_url_json</span><span class="p">(</span><span class="n">socket_path</span><span class="p">,</span> <span class="n">api_route</span><span class="p">)</span>
|
||||
<span class="k">return</span> <span class="n">handle_api_result</span><span class="p">(</span><span class="n">result</span><span class="p">,</span> <span class="n">show_json</span><span class="p">)</span></div>
|
||||
<span class="k">return</span> <span class="n">handle_api_result</span><span class="p">(</span><span class="n">result</span><span class="p">,</span> <span class="n">show_json</span><span class="p">)[</span><span class="mi">0</span><span class="p">]</span></div>
|
||||
|
||||
<div class="viewcode-block" id="compose_delete"><a class="viewcode-back" href="../../../composer.cli.html#composer.cli.compose.compose_delete">[docs]</a><span class="k">def</span> <span class="nf">compose_delete</span><span class="p">(</span><span class="n">socket_path</span><span class="p">,</span> <span class="n">api_version</span><span class="p">,</span> <span class="n">args</span><span class="p">,</span> <span class="n">show_json</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="n">testmode</span><span class="o">=</span><span class="mi">0</span><span class="p">):</span>
|
||||
<span class="sd">"""Delete a finished compose's results</span>
|
||||
@ -442,19 +488,7 @@
|
||||
|
||||
<span class="n">api_route</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">api_url</span><span class="p">(</span><span class="n">api_version</span><span class="p">,</span> <span class="s2">"/compose/delete/</span><span class="si">%s</span><span class="s2">"</span> <span class="o">%</span> <span class="p">(</span><span class="s2">","</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="n">argify</span><span class="p">(</span><span class="n">args</span><span class="p">))))</span>
|
||||
<span class="n">result</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">delete_url_json</span><span class="p">(</span><span class="n">socket_path</span><span class="p">,</span> <span class="n">api_route</span><span class="p">)</span>
|
||||
|
||||
<span class="k">if</span> <span class="n">show_json</span><span class="p">:</span>
|
||||
<span class="nb">print</span><span class="p">(</span><span class="n">json</span><span class="o">.</span><span class="n">dumps</span><span class="p">(</span><span class="n">result</span><span class="p">,</span> <span class="n">indent</span><span class="o">=</span><span class="mi">4</span><span class="p">))</span>
|
||||
<span class="k">return</span> <span class="mi">0</span>
|
||||
|
||||
<span class="c1"># Print any errors</span>
|
||||
<span class="k">for</span> <span class="n">err</span> <span class="ow">in</span> <span class="n">result</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">"errors"</span><span class="p">,</span> <span class="p">[]):</span>
|
||||
<span class="n">log</span><span class="o">.</span><span class="n">error</span><span class="p">(</span><span class="n">err</span><span class="p">)</span>
|
||||
|
||||
<span class="k">if</span> <span class="n">result</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">"errors"</span><span class="p">,</span> <span class="p">[]):</span>
|
||||
<span class="k">return</span> <span class="mi">1</span>
|
||||
<span class="k">else</span><span class="p">:</span>
|
||||
<span class="k">return</span> <span class="mi">0</span></div>
|
||||
<span class="k">return</span> <span class="n">handle_api_result</span><span class="p">(</span><span class="n">result</span><span class="p">,</span> <span class="n">show_json</span><span class="p">)[</span><span class="mi">0</span><span class="p">]</span></div>
|
||||
|
||||
<div class="viewcode-block" id="compose_info"><a class="viewcode-back" href="../../../composer.cli.html#composer.cli.compose.compose_info">[docs]</a><span class="k">def</span> <span class="nf">compose_info</span><span class="p">(</span><span class="n">socket_path</span><span class="p">,</span> <span class="n">api_version</span><span class="p">,</span> <span class="n">args</span><span class="p">,</span> <span class="n">show_json</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="n">testmode</span><span class="o">=</span><span class="mi">0</span><span class="p">):</span>
|
||||
<span class="sd">"""Return detailed information about the compose</span>
|
||||
@ -480,15 +514,9 @@
|
||||
|
||||
<span class="n">api_route</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">api_url</span><span class="p">(</span><span class="n">api_version</span><span class="p">,</span> <span class="s2">"/compose/info/</span><span class="si">%s</span><span class="s2">"</span> <span class="o">%</span> <span class="n">args</span><span class="p">[</span><span class="mi">0</span><span class="p">])</span>
|
||||
<span class="n">result</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">get_url_json</span><span class="p">(</span><span class="n">socket_path</span><span class="p">,</span> <span class="n">api_route</span><span class="p">)</span>
|
||||
<span class="k">if</span> <span class="n">show_json</span><span class="p">:</span>
|
||||
<span class="nb">print</span><span class="p">(</span><span class="n">json</span><span class="o">.</span><span class="n">dumps</span><span class="p">(</span><span class="n">result</span><span class="p">,</span> <span class="n">indent</span><span class="o">=</span><span class="mi">4</span><span class="p">))</span>
|
||||
<span class="k">return</span> <span class="mi">0</span>
|
||||
|
||||
<span class="k">for</span> <span class="n">err</span> <span class="ow">in</span> <span class="n">result</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">"errors"</span><span class="p">,</span> <span class="p">[]):</span>
|
||||
<span class="n">log</span><span class="o">.</span><span class="n">error</span><span class="p">(</span><span class="n">err</span><span class="p">)</span>
|
||||
|
||||
<span class="k">if</span> <span class="n">result</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">"errors"</span><span class="p">,</span> <span class="p">[]):</span>
|
||||
<span class="k">return</span> <span class="mi">1</span>
|
||||
<span class="p">(</span><span class="n">rc</span><span class="p">,</span> <span class="n">exit_now</span><span class="p">)</span> <span class="o">=</span> <span class="n">handle_api_result</span><span class="p">(</span><span class="n">result</span><span class="p">,</span> <span class="n">show_json</span><span class="p">)</span>
|
||||
<span class="k">if</span> <span class="n">exit_now</span><span class="p">:</span>
|
||||
<span class="k">return</span> <span class="n">rc</span>
|
||||
|
||||
<span class="k">if</span> <span class="n">result</span><span class="p">[</span><span class="s2">"image_size"</span><span class="p">]</span> <span class="o">></span> <span class="mi">0</span><span class="p">:</span>
|
||||
<span class="n">image_size</span> <span class="o">=</span> <span class="nb">str</span><span class="p">(</span><span class="n">result</span><span class="p">[</span><span class="s2">"image_size"</span><span class="p">])</span>
|
||||
@ -512,7 +540,9 @@
|
||||
|
||||
<span class="nb">print</span><span class="p">(</span><span class="s2">"Dependencies:"</span><span class="p">)</span>
|
||||
<span class="k">for</span> <span class="n">d</span> <span class="ow">in</span> <span class="n">result</span><span class="p">[</span><span class="s2">"deps"</span><span class="p">][</span><span class="s2">"packages"</span><span class="p">]:</span>
|
||||
<span class="nb">print</span><span class="p">(</span><span class="s2">" "</span> <span class="o">+</span> <span class="n">packageNEVRA</span><span class="p">(</span><span class="n">d</span><span class="p">))</span></div>
|
||||
<span class="nb">print</span><span class="p">(</span><span class="s2">" "</span> <span class="o">+</span> <span class="n">packageNEVRA</span><span class="p">(</span><span class="n">d</span><span class="p">))</span>
|
||||
|
||||
<span class="k">return</span> <span class="n">rc</span></div>
|
||||
|
||||
<div class="viewcode-block" id="compose_metadata"><a class="viewcode-back" href="../../../composer.cli.html#composer.cli.compose.compose_metadata">[docs]</a><span class="k">def</span> <span class="nf">compose_metadata</span><span class="p">(</span><span class="n">socket_path</span><span class="p">,</span> <span class="n">api_version</span><span class="p">,</span> <span class="n">args</span><span class="p">,</span> <span class="n">show_json</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="n">testmode</span><span class="o">=</span><span class="mi">0</span><span class="p">):</span>
|
||||
<span class="sd">"""Download a tar file of the compose's metadata</span>
|
||||
@ -537,7 +567,13 @@
|
||||
<span class="k">return</span> <span class="mi">1</span>
|
||||
|
||||
<span class="n">api_route</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">api_url</span><span class="p">(</span><span class="n">api_version</span><span class="p">,</span> <span class="s2">"/compose/metadata/</span><span class="si">%s</span><span class="s2">"</span> <span class="o">%</span> <span class="n">args</span><span class="p">[</span><span class="mi">0</span><span class="p">])</span>
|
||||
<span class="k">return</span> <span class="n">client</span><span class="o">.</span><span class="n">download_file</span><span class="p">(</span><span class="n">socket_path</span><span class="p">,</span> <span class="n">api_route</span><span class="p">)</span></div>
|
||||
<span class="k">try</span><span class="p">:</span>
|
||||
<span class="n">rc</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">download_file</span><span class="p">(</span><span class="n">socket_path</span><span class="p">,</span> <span class="n">api_route</span><span class="p">)</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="nb">print</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">rc</span> <span class="o">=</span> <span class="mi">1</span>
|
||||
|
||||
<span class="k">return</span> <span class="n">rc</span></div>
|
||||
|
||||
<div class="viewcode-block" id="compose_results"><a class="viewcode-back" href="../../../composer.cli.html#composer.cli.compose.compose_results">[docs]</a><span class="k">def</span> <span class="nf">compose_results</span><span class="p">(</span><span class="n">socket_path</span><span class="p">,</span> <span class="n">api_version</span><span class="p">,</span> <span class="n">args</span><span class="p">,</span> <span class="n">show_json</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="n">testmode</span><span class="o">=</span><span class="mi">0</span><span class="p">):</span>
|
||||
<span class="sd">"""Download a tar file of the compose's results</span>
|
||||
@ -563,7 +599,13 @@
|
||||
<span class="k">return</span> <span class="mi">1</span>
|
||||
|
||||
<span class="n">api_route</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">api_url</span><span class="p">(</span><span class="n">api_version</span><span class="p">,</span> <span class="s2">"/compose/results/</span><span class="si">%s</span><span class="s2">"</span> <span class="o">%</span> <span class="n">args</span><span class="p">[</span><span class="mi">0</span><span class="p">])</span>
|
||||
<span class="k">return</span> <span class="n">client</span><span class="o">.</span><span class="n">download_file</span><span class="p">(</span><span class="n">socket_path</span><span class="p">,</span> <span class="n">api_route</span><span class="p">,</span> <span class="n">sys</span><span class="o">.</span><span class="n">stdout</span><span class="o">.</span><span class="n">isatty</span><span class="p">())</span></div>
|
||||
<span class="k">try</span><span class="p">:</span>
|
||||
<span class="n">rc</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">download_file</span><span class="p">(</span><span class="n">socket_path</span><span class="p">,</span> <span class="n">api_route</span><span class="p">,</span> <span class="n">sys</span><span class="o">.</span><span class="n">stdout</span><span class="o">.</span><span class="n">isatty</span><span class="p">())</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="nb">print</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">rc</span> <span class="o">=</span> <span class="mi">1</span>
|
||||
|
||||
<span class="k">return</span> <span class="n">rc</span></div>
|
||||
|
||||
<div class="viewcode-block" id="compose_logs"><a class="viewcode-back" href="../../../composer.cli.html#composer.cli.compose.compose_logs">[docs]</a><span class="k">def</span> <span class="nf">compose_logs</span><span class="p">(</span><span class="n">socket_path</span><span class="p">,</span> <span class="n">api_version</span><span class="p">,</span> <span class="n">args</span><span class="p">,</span> <span class="n">show_json</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="n">testmode</span><span class="o">=</span><span class="mi">0</span><span class="p">):</span>
|
||||
<span class="sd">"""Download a tar of the compose's logs</span>
|
||||
@ -588,7 +630,13 @@
|
||||
<span class="k">return</span> <span class="mi">1</span>
|
||||
|
||||
<span class="n">api_route</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">api_url</span><span class="p">(</span><span class="n">api_version</span><span class="p">,</span> <span class="s2">"/compose/logs/</span><span class="si">%s</span><span class="s2">"</span> <span class="o">%</span> <span class="n">args</span><span class="p">[</span><span class="mi">0</span><span class="p">])</span>
|
||||
<span class="k">return</span> <span class="n">client</span><span class="o">.</span><span class="n">download_file</span><span class="p">(</span><span class="n">socket_path</span><span class="p">,</span> <span class="n">api_route</span><span class="p">,</span> <span class="n">sys</span><span class="o">.</span><span class="n">stdout</span><span class="o">.</span><span class="n">isatty</span><span class="p">())</span></div>
|
||||
<span class="k">try</span><span class="p">:</span>
|
||||
<span class="n">rc</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">download_file</span><span class="p">(</span><span class="n">socket_path</span><span class="p">,</span> <span class="n">api_route</span><span class="p">,</span> <span class="n">sys</span><span class="o">.</span><span class="n">stdout</span><span class="o">.</span><span class="n">isatty</span><span class="p">())</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="nb">print</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">rc</span> <span class="o">=</span> <span class="mi">1</span>
|
||||
|
||||
<span class="k">return</span> <span class="n">rc</span></div>
|
||||
|
||||
<div class="viewcode-block" id="compose_image"><a class="viewcode-back" href="../../../composer.cli.html#composer.cli.compose.compose_image">[docs]</a><span class="k">def</span> <span class="nf">compose_image</span><span class="p">(</span><span class="n">socket_path</span><span class="p">,</span> <span class="n">api_version</span><span class="p">,</span> <span class="n">args</span><span class="p">,</span> <span class="n">show_json</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="n">testmode</span><span class="o">=</span><span class="mi">0</span><span class="p">):</span>
|
||||
<span class="sd">"""Download the compose's output image</span>
|
||||
@ -614,7 +662,13 @@
|
||||
<span class="k">return</span> <span class="mi">1</span>
|
||||
|
||||
<span class="n">api_route</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">api_url</span><span class="p">(</span><span class="n">api_version</span><span class="p">,</span> <span class="s2">"/compose/image/</span><span class="si">%s</span><span class="s2">"</span> <span class="o">%</span> <span class="n">args</span><span class="p">[</span><span class="mi">0</span><span class="p">])</span>
|
||||
<span class="k">return</span> <span class="n">client</span><span class="o">.</span><span class="n">download_file</span><span class="p">(</span><span class="n">socket_path</span><span class="p">,</span> <span class="n">api_route</span><span class="p">,</span> <span class="n">sys</span><span class="o">.</span><span class="n">stdout</span><span class="o">.</span><span class="n">isatty</span><span class="p">())</span></div>
|
||||
<span class="k">try</span><span class="p">:</span>
|
||||
<span class="n">rc</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">download_file</span><span class="p">(</span><span class="n">socket_path</span><span class="p">,</span> <span class="n">api_route</span><span class="p">,</span> <span class="n">sys</span><span class="o">.</span><span class="n">stdout</span><span class="o">.</span><span class="n">isatty</span><span class="p">())</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="nb">print</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">rc</span> <span class="o">=</span> <span class="mi">1</span>
|
||||
|
||||
<span class="k">return</span> <span class="n">rc</span></div>
|
||||
</pre></div>
|
||||
|
||||
</div>
|
||||
@ -649,7 +703,7 @@
|
||||
<script type="text/javascript">
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT:'../../../',
|
||||
VERSION:'29.10',
|
||||
VERSION:'29.11',
|
||||
LANGUAGE:'None',
|
||||
COLLAPSE_INDEX:false,
|
||||
FILE_SUFFIX:'.html',
|
||||
@ -663,7 +717,10 @@
|
||||
|
||||
|
||||
|
||||
<script type="text/javascript" src="../../../_static/js/theme.js"></script>
|
||||
|
||||
|
||||
<script type="text/javascript" src="../../../_static/js/theme.js"></script>
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
jQuery(function () {
|
||||
|
@ -8,7 +8,7 @@
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<title>composer.cli.modules — Lorax 29.10 documentation</title>
|
||||
<title>composer.cli.modules — Lorax 29.11 documentation</title>
|
||||
|
||||
|
||||
|
||||
@ -24,7 +24,8 @@
|
||||
|
||||
|
||||
|
||||
<link rel="stylesheet" href="../../../_static/css/theme.css" type="text/css" />
|
||||
|
||||
<link rel="stylesheet" href="../../../_static/css/theme.css" type="text/css" />
|
||||
<link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" />
|
||||
<link rel="index" title="Index" href="../../../genindex.html" />
|
||||
<link rel="search" title="Search" href="../../../search.html" />
|
||||
@ -56,7 +57,7 @@
|
||||
|
||||
|
||||
<div class="version">
|
||||
29.10
|
||||
29.11
|
||||
</div>
|
||||
|
||||
|
||||
@ -173,10 +174,9 @@
|
||||
<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">"composer-cli"</span><span class="p">)</span>
|
||||
|
||||
<span class="kn">import</span> <span class="nn">json</span>
|
||||
|
||||
<span class="kn">from</span> <span class="nn">composer</span> <span class="k">import</span> <span class="n">http_client</span> <span class="k">as</span> <span class="n">client</span>
|
||||
<span class="kn">from</span> <span class="nn">composer.cli.help</span> <span class="k">import</span> <span class="n">modules_help</span>
|
||||
<span class="kn">from</span> <span class="nn">composer.cli.utilities</span> <span class="k">import</span> <span class="n">handle_api_result</span>
|
||||
|
||||
<div class="viewcode-block" id="modules_cmd"><a class="viewcode-back" href="../../../composer.cli.html#composer.cli.modules.modules_cmd">[docs]</a><span class="k">def</span> <span class="nf">modules_cmd</span><span class="p">(</span><span class="n">opts</span><span class="p">):</span>
|
||||
<span class="sd">"""Process modules commands</span>
|
||||
@ -195,13 +195,14 @@
|
||||
|
||||
<span class="n">api_route</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">api_url</span><span class="p">(</span><span class="n">opts</span><span class="o">.</span><span class="n">api_version</span><span class="p">,</span> <span class="s2">"/modules/list"</span><span class="p">)</span>
|
||||
<span class="n">result</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">get_url_json</span><span class="p">(</span><span class="n">opts</span><span class="o">.</span><span class="n">socket</span><span class="p">,</span> <span class="n">api_route</span><span class="p">)</span>
|
||||
<span class="k">if</span> <span class="n">opts</span><span class="o">.</span><span class="n">json</span><span class="p">:</span>
|
||||
<span class="nb">print</span><span class="p">(</span><span class="n">json</span><span class="o">.</span><span class="n">dumps</span><span class="p">(</span><span class="n">result</span><span class="p">,</span> <span class="n">indent</span><span class="o">=</span><span class="mi">4</span><span class="p">))</span>
|
||||
<span class="k">return</span> <span class="mi">0</span>
|
||||
<span class="p">(</span><span class="n">rc</span><span class="p">,</span> <span class="n">exit_now</span><span class="p">)</span> <span class="o">=</span> <span class="n">handle_api_result</span><span class="p">(</span><span class="n">result</span><span class="p">,</span> <span class="n">opts</span><span class="o">.</span><span class="n">json</span><span class="p">)</span>
|
||||
<span class="k">if</span> <span class="n">exit_now</span><span class="p">:</span>
|
||||
<span class="k">return</span> <span class="n">rc</span>
|
||||
|
||||
<span class="nb">print</span><span class="p">(</span><span class="s2">"Modules:</span><span class="se">\n</span><span class="s2">"</span> <span class="o">+</span> <span class="s2">"</span><span class="se">\n</span><span class="s2">"</span><span class="o">.</span><span class="n">join</span><span class="p">([</span><span class="s2">" "</span><span class="o">+</span><span class="n">r</span><span class="p">[</span><span class="s2">"name"</span><span class="p">]</span> <span class="k">for</span> <span class="n">r</span> <span class="ow">in</span> <span class="n">result</span><span class="p">[</span><span class="s2">"modules"</span><span class="p">]]))</span>
|
||||
<span class="c1"># "list" should output a plain list of identifiers, one per line.</span>
|
||||
<span class="nb">print</span><span class="p">(</span><span class="s2">"</span><span class="se">\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="p">[</span><span class="s2">"name"</span><span class="p">]</span> <span class="k">for</span> <span class="n">r</span> <span class="ow">in</span> <span class="n">result</span><span class="p">[</span><span class="s2">"modules"</span><span class="p">]))</span>
|
||||
|
||||
<span class="k">return</span> <span class="mi">0</span></div>
|
||||
<span class="k">return</span> <span class="n">rc</span></div>
|
||||
</pre></div>
|
||||
|
||||
</div>
|
||||
@ -236,7 +237,7 @@
|
||||
<script type="text/javascript">
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT:'../../../',
|
||||
VERSION:'29.10',
|
||||
VERSION:'29.11',
|
||||
LANGUAGE:'None',
|
||||
COLLAPSE_INDEX:false,
|
||||
FILE_SUFFIX:'.html',
|
||||
@ -250,7 +251,10 @@
|
||||
|
||||
|
||||
|
||||
<script type="text/javascript" src="../../../_static/js/theme.js"></script>
|
||||
|
||||
|
||||
<script type="text/javascript" src="../../../_static/js/theme.js"></script>
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
jQuery(function () {
|
||||
|
@ -8,7 +8,7 @@
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<title>composer.cli.projects — Lorax 29.10 documentation</title>
|
||||
<title>composer.cli.projects — Lorax 29.11 documentation</title>
|
||||
|
||||
|
||||
|
||||
@ -24,7 +24,8 @@
|
||||
|
||||
|
||||
|
||||
<link rel="stylesheet" href="../../../_static/css/theme.css" type="text/css" />
|
||||
|
||||
<link rel="stylesheet" href="../../../_static/css/theme.css" type="text/css" />
|
||||
<link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" />
|
||||
<link rel="index" title="Index" href="../../../genindex.html" />
|
||||
<link rel="search" title="Search" href="../../../search.html" />
|
||||
@ -56,7 +57,7 @@
|
||||
|
||||
|
||||
<div class="version">
|
||||
29.10
|
||||
29.11
|
||||
</div>
|
||||
|
||||
|
||||
@ -173,11 +174,11 @@
|
||||
<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">"composer-cli"</span><span class="p">)</span>
|
||||
|
||||
<span class="kn">import</span> <span class="nn">json</span>
|
||||
<span class="kn">import</span> <span class="nn">textwrap</span>
|
||||
|
||||
<span class="kn">from</span> <span class="nn">composer</span> <span class="k">import</span> <span class="n">http_client</span> <span class="k">as</span> <span class="n">client</span>
|
||||
<span class="kn">from</span> <span class="nn">composer.cli.help</span> <span class="k">import</span> <span class="n">projects_help</span>
|
||||
<span class="kn">from</span> <span class="nn">composer.cli.utilities</span> <span class="k">import</span> <span class="n">handle_api_result</span>
|
||||
|
||||
<div class="viewcode-block" id="projects_cmd"><a class="viewcode-back" href="../../../composer.cli.html#composer.cli.projects.projects_cmd">[docs]</a><span class="k">def</span> <span class="nf">projects_cmd</span><span class="p">(</span><span class="n">opts</span><span class="p">):</span>
|
||||
<span class="sd">"""Process projects commands</span>
|
||||
@ -216,16 +217,16 @@
|
||||
<span class="sd"> """</span>
|
||||
<span class="n">api_route</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">api_url</span><span class="p">(</span><span class="n">api_version</span><span class="p">,</span> <span class="s2">"/projects/list"</span><span class="p">)</span>
|
||||
<span class="n">result</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">get_url_json</span><span class="p">(</span><span class="n">socket_path</span><span class="p">,</span> <span class="n">api_route</span><span class="p">)</span>
|
||||
<span class="k">if</span> <span class="n">show_json</span><span class="p">:</span>
|
||||
<span class="nb">print</span><span class="p">(</span><span class="n">json</span><span class="o">.</span><span class="n">dumps</span><span class="p">(</span><span class="n">result</span><span class="p">,</span> <span class="n">indent</span><span class="o">=</span><span class="mi">4</span><span class="p">))</span>
|
||||
<span class="k">return</span> <span class="mi">0</span>
|
||||
<span class="p">(</span><span class="n">rc</span><span class="p">,</span> <span class="n">exit_now</span><span class="p">)</span> <span class="o">=</span> <span class="n">handle_api_result</span><span class="p">(</span><span class="n">result</span><span class="p">,</span> <span class="n">show_json</span><span class="p">)</span>
|
||||
<span class="k">if</span> <span class="n">exit_now</span><span class="p">:</span>
|
||||
<span class="k">return</span> <span class="n">rc</span>
|
||||
|
||||
<span class="k">for</span> <span class="n">proj</span> <span class="ow">in</span> <span class="n">result</span><span class="p">[</span><span class="s2">"projects"</span><span class="p">]:</span>
|
||||
<span class="k">for</span> <span class="n">k</span> <span class="ow">in</span> <span class="p">[</span><span class="n">field</span> <span class="k">for</span> <span class="n">field</span> <span class="ow">in</span> <span class="p">(</span><span class="s2">"name"</span><span class="p">,</span> <span class="s2">"summary"</span><span class="p">,</span> <span class="s2">"homepage"</span><span class="p">,</span> <span class="s2">"description"</span><span class="p">)</span> <span class="k">if</span> <span class="n">proj</span><span class="p">[</span><span class="n">field</span><span class="p">]]:</span>
|
||||
<span class="nb">print</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">k</span><span class="o">.</span><span class="n">title</span><span class="p">(),</span> <span class="n">textwrap</span><span class="o">.</span><span class="n">fill</span><span class="p">(</span><span class="n">proj</span><span class="p">[</span><span class="n">k</span><span class="p">],</span> <span class="n">subsequent_indent</span><span class="o">=</span><span class="s2">" "</span> <span class="o">*</span> <span class="p">(</span><span class="nb">len</span><span class="p">(</span><span class="n">k</span><span class="p">)</span><span class="o">+</span><span class="mi">2</span><span class="p">))))</span>
|
||||
<span class="nb">print</span><span class="p">(</span><span class="s2">"</span><span class="se">\n\n</span><span class="s2">"</span><span class="p">)</span>
|
||||
|
||||
<span class="k">return</span> <span class="mi">0</span></div>
|
||||
<span class="k">return</span> <span class="n">rc</span></div>
|
||||
|
||||
<div class="viewcode-block" id="projects_info"><a class="viewcode-back" href="../../../composer.cli.html#composer.cli.projects.projects_info">[docs]</a><span class="k">def</span> <span class="nf">projects_info</span><span class="p">(</span><span class="n">socket_path</span><span class="p">,</span> <span class="n">api_version</span><span class="p">,</span> <span class="n">args</span><span class="p">,</span> <span class="n">show_json</span><span class="o">=</span><span class="kc">False</span><span class="p">):</span>
|
||||
<span class="sd">"""Output info on a list of projects</span>
|
||||
@ -247,23 +248,23 @@
|
||||
|
||||
<span class="n">api_route</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">api_url</span><span class="p">(</span><span class="n">api_version</span><span class="p">,</span> <span class="s2">"/projects/info/</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="n">args</span><span class="p">))</span>
|
||||
<span class="n">result</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">get_url_json</span><span class="p">(</span><span class="n">socket_path</span><span class="p">,</span> <span class="n">api_route</span><span class="p">)</span>
|
||||
<span class="k">if</span> <span class="n">show_json</span><span class="p">:</span>
|
||||
<span class="nb">print</span><span class="p">(</span><span class="n">json</span><span class="o">.</span><span class="n">dumps</span><span class="p">(</span><span class="n">result</span><span class="p">,</span> <span class="n">indent</span><span class="o">=</span><span class="mi">4</span><span class="p">))</span>
|
||||
<span class="k">return</span> <span class="mi">0</span>
|
||||
<span class="p">(</span><span class="n">rc</span><span class="p">,</span> <span class="n">exit_now</span><span class="p">)</span> <span class="o">=</span> <span class="n">handle_api_result</span><span class="p">(</span><span class="n">result</span><span class="p">,</span> <span class="n">show_json</span><span class="p">)</span>
|
||||
<span class="k">if</span> <span class="n">exit_now</span><span class="p">:</span>
|
||||
<span class="k">return</span> <span class="n">rc</span>
|
||||
|
||||
<span class="k">for</span> <span class="n">proj</span> <span class="ow">in</span> <span class="n">result</span><span class="p">[</span><span class="s2">"projects"</span><span class="p">]:</span>
|
||||
<span class="k">for</span> <span class="n">k</span> <span class="ow">in</span> <span class="p">[</span><span class="n">field</span> <span class="k">for</span> <span class="n">field</span> <span class="ow">in</span> <span class="p">(</span><span class="s2">"name"</span><span class="p">,</span> <span class="s2">"summary"</span><span class="p">,</span> <span class="s2">"homepage"</span><span class="p">,</span> <span class="s2">"description"</span><span class="p">)</span> <span class="k">if</span> <span class="n">proj</span><span class="p">[</span><span class="n">field</span><span class="p">]]:</span>
|
||||
<span class="nb">print</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">k</span><span class="o">.</span><span class="n">title</span><span class="p">(),</span> <span class="n">textwrap</span><span class="o">.</span><span class="n">fill</span><span class="p">(</span><span class="n">proj</span><span class="p">[</span><span class="n">k</span><span class="p">],</span> <span class="n">subsequent_indent</span><span class="o">=</span><span class="s2">" "</span> <span class="o">*</span> <span class="p">(</span><span class="nb">len</span><span class="p">(</span><span class="n">k</span><span class="p">)</span><span class="o">+</span><span class="mi">2</span><span class="p">))))</span>
|
||||
<span class="nb">print</span><span class="p">(</span><span class="s2">"Builds: "</span><span class="p">)</span>
|
||||
<span class="k">for</span> <span class="n">build</span> <span class="ow">in</span> <span class="n">proj</span><span class="p">[</span><span class="s2">"builds"</span><span class="p">]:</span>
|
||||
<span class="nb">print</span><span class="p">(</span><span class="s2">" </span><span class="si">%s%s</span><span class="s2">-</span><span class="si">%s</span><span class="s2">.</span><span class="si">%s</span><span class="s2"> at </span><span class="si">%s</span><span class="s2"> for </span><span class="si">%s</span><span class="s2">"</span> <span class="o">%</span> <span class="p">(</span><span class="s2">""</span> <span class="k">if</span> <span class="ow">not</span> <span class="n">build</span><span class="p">[</span><span class="s2">"epoch"</span><span class="p">]</span> <span class="k">else</span> <span class="n">build</span><span class="p">[</span><span class="s2">"epoch"</span><span class="p">]</span> <span class="o">+</span> <span class="s2">":"</span><span class="p">,</span>
|
||||
<span class="nb">print</span><span class="p">(</span><span class="s2">" </span><span class="si">%s%s</span><span class="s2">-</span><span class="si">%s</span><span class="s2">.</span><span class="si">%s</span><span class="s2"> at </span><span class="si">%s</span><span class="s2"> for </span><span class="si">%s</span><span class="s2">"</span> <span class="o">%</span> <span class="p">(</span><span class="s2">""</span> <span class="k">if</span> <span class="ow">not</span> <span class="n">build</span><span class="p">[</span><span class="s2">"epoch"</span><span class="p">]</span> <span class="k">else</span> <span class="nb">str</span><span class="p">(</span><span class="n">build</span><span class="p">[</span><span class="s2">"epoch"</span><span class="p">])</span> <span class="o">+</span> <span class="s2">":"</span><span class="p">,</span>
|
||||
<span class="n">build</span><span class="p">[</span><span class="s2">"source"</span><span class="p">][</span><span class="s2">"version"</span><span class="p">],</span>
|
||||
<span class="n">build</span><span class="p">[</span><span class="s2">"release"</span><span class="p">],</span>
|
||||
<span class="n">build</span><span class="p">[</span><span class="s2">"arch"</span><span class="p">],</span>
|
||||
<span class="n">build</span><span class="p">[</span><span class="s2">"build_time"</span><span class="p">],</span>
|
||||
<span class="n">build</span><span class="p">[</span><span class="s2">"changelog"</span><span class="p">]))</span>
|
||||
<span class="nb">print</span><span class="p">(</span><span class="s2">""</span><span class="p">)</span>
|
||||
<span class="k">return</span> <span class="mi">0</span></div>
|
||||
<span class="k">return</span> <span class="n">rc</span></div>
|
||||
</pre></div>
|
||||
|
||||
</div>
|
||||
@ -298,7 +299,7 @@
|
||||
<script type="text/javascript">
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT:'../../../',
|
||||
VERSION:'29.10',
|
||||
VERSION:'29.11',
|
||||
LANGUAGE:'None',
|
||||
COLLAPSE_INDEX:false,
|
||||
FILE_SUFFIX:'.html',
|
||||
@ -312,7 +313,10 @@
|
||||
|
||||
|
||||
|
||||
<script type="text/javascript" src="../../../_static/js/theme.js"></script>
|
||||
|
||||
|
||||
<script type="text/javascript" src="../../../_static/js/theme.js"></script>
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
jQuery(function () {
|
||||
|
@ -8,7 +8,7 @@
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<title>composer.cli.sources — Lorax 29.10 documentation</title>
|
||||
<title>composer.cli.sources — Lorax 29.11 documentation</title>
|
||||
|
||||
|
||||
|
||||
@ -24,7 +24,8 @@
|
||||
|
||||
|
||||
|
||||
<link rel="stylesheet" href="../../../_static/css/theme.css" type="text/css" />
|
||||
|
||||
<link rel="stylesheet" href="../../../_static/css/theme.css" type="text/css" />
|
||||
<link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" />
|
||||
<link rel="index" title="Index" href="../../../genindex.html" />
|
||||
<link rel="search" title="Search" href="../../../search.html" />
|
||||
@ -56,7 +57,7 @@
|
||||
|
||||
|
||||
<div class="version">
|
||||
29.10
|
||||
29.11
|
||||
</div>
|
||||
|
||||
|
||||
@ -174,7 +175,6 @@
|
||||
<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">"composer-cli"</span><span class="p">)</span>
|
||||
|
||||
<span class="kn">import</span> <span class="nn">os</span>
|
||||
<span class="kn">import</span> <span class="nn">json</span>
|
||||
|
||||
<span class="kn">from</span> <span class="nn">composer</span> <span class="k">import</span> <span class="n">http_client</span> <span class="k">as</span> <span class="n">client</span>
|
||||
<span class="kn">from</span> <span class="nn">composer.cli.help</span> <span class="k">import</span> <span class="n">sources_help</span>
|
||||
@ -220,12 +220,13 @@
|
||||
<span class="sd"> """</span>
|
||||
<span class="n">api_route</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">api_url</span><span class="p">(</span><span class="n">api_version</span><span class="p">,</span> <span class="s2">"/projects/source/list"</span><span class="p">)</span>
|
||||
<span class="n">result</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">get_url_json</span><span class="p">(</span><span class="n">socket_path</span><span class="p">,</span> <span class="n">api_route</span><span class="p">)</span>
|
||||
<span class="k">if</span> <span class="n">show_json</span><span class="p">:</span>
|
||||
<span class="nb">print</span><span class="p">(</span><span class="n">json</span><span class="o">.</span><span class="n">dumps</span><span class="p">(</span><span class="n">result</span><span class="p">,</span> <span class="n">indent</span><span class="o">=</span><span class="mi">4</span><span class="p">))</span>
|
||||
<span class="k">return</span> <span class="mi">0</span>
|
||||
<span class="p">(</span><span class="n">rc</span><span class="p">,</span> <span class="n">exit_now</span><span class="p">)</span> <span class="o">=</span> <span class="n">handle_api_result</span><span class="p">(</span><span class="n">result</span><span class="p">,</span> <span class="n">show_json</span><span class="p">)</span>
|
||||
<span class="k">if</span> <span class="n">exit_now</span><span class="p">:</span>
|
||||
<span class="k">return</span> <span class="n">rc</span>
|
||||
|
||||
<span class="nb">print</span><span class="p">(</span><span class="s2">"Sources: </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="n">result</span><span class="p">[</span><span class="s2">"sources"</span><span class="p">]))</span>
|
||||
<span class="k">return</span> <span class="mi">0</span></div>
|
||||
<span class="c1"># "list" should output a plain list of identifiers, one per line.</span>
|
||||
<span class="nb">print</span><span class="p">(</span><span class="s2">"</span><span class="se">\n</span><span class="s2">"</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="n">result</span><span class="p">[</span><span class="s2">"sources"</span><span class="p">]))</span>
|
||||
<span class="k">return</span> <span class="n">rc</span></div>
|
||||
|
||||
<div class="viewcode-block" id="sources_info"><a class="viewcode-back" href="../../../composer.cli.html#composer.cli.sources.sources_info">[docs]</a><span class="k">def</span> <span class="nf">sources_info</span><span class="p">(</span><span class="n">socket_path</span><span class="p">,</span> <span class="n">api_version</span><span class="p">,</span> <span class="n">args</span><span class="p">,</span> <span class="n">show_json</span><span class="o">=</span><span class="kc">False</span><span class="p">):</span>
|
||||
<span class="sd">"""Output info on a list of projects</span>
|
||||
@ -248,13 +249,18 @@
|
||||
<span class="k">if</span> <span class="n">show_json</span><span class="p">:</span>
|
||||
<span class="n">api_route</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">api_url</span><span class="p">(</span><span class="n">api_version</span><span class="p">,</span> <span class="s2">"/projects/source/info/</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="n">args</span><span class="p">))</span>
|
||||
<span class="n">result</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">get_url_json</span><span class="p">(</span><span class="n">socket_path</span><span class="p">,</span> <span class="n">api_route</span><span class="p">)</span>
|
||||
<span class="nb">print</span><span class="p">(</span><span class="n">json</span><span class="o">.</span><span class="n">dumps</span><span class="p">(</span><span class="n">result</span><span class="p">,</span> <span class="n">indent</span><span class="o">=</span><span class="mi">4</span><span class="p">))</span>
|
||||
<span class="k">return</span> <span class="mi">0</span>
|
||||
<span class="n">rc</span> <span class="o">=</span> <span class="n">handle_api_result</span><span class="p">(</span><span class="n">result</span><span class="p">,</span> <span class="n">show_json</span><span class="p">)[</span><span class="mi">0</span><span class="p">]</span>
|
||||
<span class="k">else</span><span class="p">:</span>
|
||||
<span class="n">api_route</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">api_url</span><span class="p">(</span><span class="n">api_version</span><span class="p">,</span> <span class="s2">"/projects/source/info/</span><span class="si">%s</span><span class="s2">?format=toml"</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">args</span><span class="p">))</span>
|
||||
<span class="n">result</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">get_url_raw</span><span class="p">(</span><span class="n">socket_path</span><span class="p">,</span> <span class="n">api_route</span><span class="p">)</span>
|
||||
<span class="nb">print</span><span class="p">(</span><span class="n">result</span><span class="p">)</span>
|
||||
<span class="k">return</span> <span class="mi">0</span></div>
|
||||
<span class="k">try</span><span class="p">:</span>
|
||||
<span class="n">result</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">get_url_raw</span><span class="p">(</span><span class="n">socket_path</span><span class="p">,</span> <span class="n">api_route</span><span class="p">)</span>
|
||||
<span class="nb">print</span><span class="p">(</span><span class="n">result</span><span class="p">)</span>
|
||||
<span class="n">rc</span> <span class="o">=</span> <span class="mi">0</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="nb">print</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">rc</span> <span class="o">=</span> <span class="mi">1</span>
|
||||
|
||||
<span class="k">return</span> <span class="n">rc</span></div>
|
||||
|
||||
<div class="viewcode-block" id="sources_add"><a class="viewcode-back" href="../../../composer.cli.html#composer.cli.sources.sources_add">[docs]</a><span class="k">def</span> <span class="nf">sources_add</span><span class="p">(</span><span class="n">socket_path</span><span class="p">,</span> <span class="n">api_version</span><span class="p">,</span> <span class="n">args</span><span class="p">,</span> <span class="n">show_json</span><span class="o">=</span><span class="kc">False</span><span class="p">):</span>
|
||||
<span class="sd">"""Add or change a source</span>
|
||||
@ -279,7 +285,7 @@
|
||||
<span class="n">source_toml</span> <span class="o">=</span> <span class="nb">open</span><span class="p">(</span><span class="n">source</span><span class="p">,</span> <span class="s2">"r"</span><span class="p">)</span><span class="o">.</span><span class="n">read</span><span class="p">()</span>
|
||||
|
||||
<span class="n">result</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">post_url_toml</span><span class="p">(</span><span class="n">socket_path</span><span class="p">,</span> <span class="n">api_route</span><span class="p">,</span> <span class="n">source_toml</span><span class="p">)</span>
|
||||
<span class="k">if</span> <span class="n">handle_api_result</span><span class="p">(</span><span class="n">result</span><span class="p">,</span> <span class="n">show_json</span><span class="p">):</span>
|
||||
<span class="k">if</span> <span class="n">handle_api_result</span><span class="p">(</span><span class="n">result</span><span class="p">,</span> <span class="n">show_json</span><span class="p">)[</span><span class="mi">0</span><span class="p">]:</span>
|
||||
<span class="n">rval</span> <span class="o">=</span> <span class="mi">1</span>
|
||||
<span class="k">return</span> <span class="n">rval</span></div>
|
||||
|
||||
@ -300,7 +306,7 @@
|
||||
<span class="n">api_route</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">api_url</span><span class="p">(</span><span class="n">api_version</span><span class="p">,</span> <span class="s2">"/projects/source/delete/</span><span class="si">%s</span><span class="s2">"</span> <span class="o">%</span> <span class="n">args</span><span class="p">[</span><span class="mi">0</span><span class="p">])</span>
|
||||
<span class="n">result</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">delete_url_json</span><span class="p">(</span><span class="n">socket_path</span><span class="p">,</span> <span class="n">api_route</span><span class="p">)</span>
|
||||
|
||||
<span class="k">return</span> <span class="n">handle_api_result</span><span class="p">(</span><span class="n">result</span><span class="p">,</span> <span class="n">show_json</span><span class="p">)</span></div>
|
||||
<span class="k">return</span> <span class="n">handle_api_result</span><span class="p">(</span><span class="n">result</span><span class="p">,</span> <span class="n">show_json</span><span class="p">)[</span><span class="mi">0</span><span class="p">]</span></div>
|
||||
</pre></div>
|
||||
|
||||
</div>
|
||||
@ -335,7 +341,7 @@
|
||||
<script type="text/javascript">
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT:'../../../',
|
||||
VERSION:'29.10',
|
||||
VERSION:'29.11',
|
||||
LANGUAGE:'None',
|
||||
COLLAPSE_INDEX:false,
|
||||
FILE_SUFFIX:'.html',
|
||||
@ -349,7 +355,10 @@
|
||||
|
||||
|
||||
|
||||
<script type="text/javascript" src="../../../_static/js/theme.js"></script>
|
||||
|
||||
|
||||
<script type="text/javascript" src="../../../_static/js/theme.js"></script>
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
jQuery(function () {
|
||||
|
274
docs/html/_modules/composer/cli/status.html
Normal file
274
docs/html/_modules/composer/cli/status.html
Normal file
@ -0,0 +1,274 @@
|
||||
|
||||
|
||||
<!DOCTYPE html>
|
||||
<!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]-->
|
||||
<!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]-->
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<title>composer.cli.status — Lorax 29.11 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.11
|
||||
</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="../cli.html">composer.cli</a> »</li>
|
||||
|
||||
<li>composer.cli.status</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 composer.cli.status</h1><div class="highlight"><pre>
|
||||
<span></span><span class="c1">#</span>
|
||||
<span class="c1"># Copyright (C) 2018 Red Hat, Inc.</span>
|
||||
<span class="c1">#</span>
|
||||
<span class="c1"># This program is free software; you can redistribute it and/or modify</span>
|
||||
<span class="c1"># it under the terms of the GNU General Public License as published by</span>
|
||||
<span class="c1"># the Free Software Foundation; either version 2 of the License, or</span>
|
||||
<span class="c1"># (at your option) any later version.</span>
|
||||
<span class="c1">#</span>
|
||||
<span class="c1"># This program is distributed in the hope that it will be useful,</span>
|
||||
<span class="c1"># but WITHOUT ANY WARRANTY; without even the implied warranty of</span>
|
||||
<span class="c1"># MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the</span>
|
||||
<span class="c1"># GNU General Public License for more details.</span>
|
||||
<span class="c1">#</span>
|
||||
<span class="c1"># You should have received a copy of the GNU General Public License</span>
|
||||
<span class="c1"># along with this program. If not, see <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">"composer-cli"</span><span class="p">)</span>
|
||||
|
||||
<span class="kn">from</span> <span class="nn">composer</span> <span class="k">import</span> <span class="n">http_client</span> <span class="k">as</span> <span class="n">client</span>
|
||||
<span class="kn">from</span> <span class="nn">composer.cli.help</span> <span class="k">import</span> <span class="n">status_help</span>
|
||||
<span class="kn">from</span> <span class="nn">composer.cli.utilities</span> <span class="k">import</span> <span class="n">handle_api_result</span>
|
||||
|
||||
<div class="viewcode-block" id="status_cmd"><a class="viewcode-back" href="../../../composer.cli.html#composer.cli.status.status_cmd">[docs]</a><span class="k">def</span> <span class="nf">status_cmd</span><span class="p">(</span><span class="n">opts</span><span class="p">):</span>
|
||||
<span class="sd">"""Process status commands</span>
|
||||
|
||||
<span class="sd"> :param opts: Cmdline arguments</span>
|
||||
<span class="sd"> :type opts: argparse.Namespace</span>
|
||||
<span class="sd"> :returns: Value to return from sys.exit()</span>
|
||||
<span class="sd"> :rtype: int</span>
|
||||
<span class="sd"> """</span>
|
||||
<span class="k">if</span> <span class="n">opts</span><span class="o">.</span><span class="n">args</span><span class="p">[</span><span class="mi">1</span><span class="p">]</span> <span class="o">==</span> <span class="s2">"help"</span> <span class="ow">or</span> <span class="n">opts</span><span class="o">.</span><span class="n">args</span><span class="p">[</span><span class="mi">1</span><span class="p">]</span> <span class="o">==</span> <span class="s2">"--help"</span><span class="p">:</span>
|
||||
<span class="nb">print</span><span class="p">(</span><span class="n">status_help</span><span class="p">)</span>
|
||||
<span class="k">return</span> <span class="mi">0</span>
|
||||
<span class="k">elif</span> <span class="n">opts</span><span class="o">.</span><span class="n">args</span><span class="p">[</span><span class="mi">1</span><span class="p">]</span> <span class="o">!=</span> <span class="s2">"show"</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">"Unknown status command: </span><span class="si">%s</span><span class="s2">"</span><span class="p">,</span> <span class="n">opts</span><span class="o">.</span><span class="n">args</span><span class="p">[</span><span class="mi">1</span><span class="p">])</span>
|
||||
<span class="k">return</span> <span class="mi">1</span>
|
||||
|
||||
<span class="n">result</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">get_url_json</span><span class="p">(</span><span class="n">opts</span><span class="o">.</span><span class="n">socket</span><span class="p">,</span> <span class="s2">"/api/status"</span><span class="p">)</span>
|
||||
<span class="p">(</span><span class="n">rc</span><span class="p">,</span> <span class="n">exit_now</span><span class="p">)</span> <span class="o">=</span> <span class="n">handle_api_result</span><span class="p">(</span><span class="n">result</span><span class="p">,</span> <span class="n">opts</span><span class="o">.</span><span class="n">json</span><span class="p">)</span>
|
||||
<span class="k">if</span> <span class="n">exit_now</span><span class="p">:</span>
|
||||
<span class="k">return</span> <span class="n">rc</span>
|
||||
|
||||
<span class="nb">print</span><span class="p">(</span><span class="s2">"API server status:"</span><span class="p">)</span>
|
||||
<span class="nb">print</span><span class="p">(</span><span class="s2">" Database version: "</span> <span class="o">+</span> <span class="n">result</span><span class="p">[</span><span class="s2">"db_version"</span><span class="p">])</span>
|
||||
<span class="nb">print</span><span class="p">(</span><span class="s2">" Database supported: </span><span class="si">%s</span><span class="s2">"</span> <span class="o">%</span> <span class="n">result</span><span class="p">[</span><span class="s2">"db_supported"</span><span class="p">])</span>
|
||||
<span class="nb">print</span><span class="p">(</span><span class="s2">" Schema version: "</span> <span class="o">+</span> <span class="n">result</span><span class="p">[</span><span class="s2">"schema_version"</span><span class="p">])</span>
|
||||
<span class="nb">print</span><span class="p">(</span><span class="s2">" API version: "</span> <span class="o">+</span> <span class="n">result</span><span class="p">[</span><span class="s2">"api"</span><span class="p">])</span>
|
||||
<span class="nb">print</span><span class="p">(</span><span class="s2">" Backend: "</span> <span class="o">+</span> <span class="n">result</span><span class="p">[</span><span class="s2">"backend"</span><span class="p">])</span>
|
||||
<span class="nb">print</span><span class="p">(</span><span class="s2">" Build: "</span> <span class="o">+</span> <span class="n">result</span><span class="p">[</span><span class="s2">"build"</span><span class="p">])</span>
|
||||
|
||||
<span class="k">if</span> <span class="n">result</span><span class="p">[</span><span class="s2">"msgs"</span><span class="p">]:</span>
|
||||
<span class="nb">print</span><span class="p">(</span><span class="s2">"Error messages:"</span><span class="p">)</span>
|
||||
<span class="nb">print</span><span class="p">(</span><span class="s2">"</span><span class="se">\n</span><span class="s2">"</span><span class="o">.</span><span class="n">join</span><span class="p">([</span><span class="s2">" "</span> <span class="o">+</span> <span class="n">r</span> <span class="k">for</span> <span class="n">r</span> <span class="ow">in</span> <span class="n">result</span><span class="p">[</span><span class="s2">"msgs"</span><span class="p">]]))</span>
|
||||
|
||||
<span class="k">return</span> <span class="n">rc</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.11',
|
||||
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>composer.cli.utilities — Lorax 29.10 documentation</title>
|
||||
<title>composer.cli.utilities — Lorax 29.11 documentation</title>
|
||||
|
||||
|
||||
|
||||
@ -24,7 +24,8 @@
|
||||
|
||||
|
||||
|
||||
<link rel="stylesheet" href="../../../_static/css/theme.css" type="text/css" />
|
||||
|
||||
<link rel="stylesheet" href="../../../_static/css/theme.css" type="text/css" />
|
||||
<link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" />
|
||||
<link rel="index" title="Index" href="../../../genindex.html" />
|
||||
<link rel="search" title="Search" href="../../../search.html" />
|
||||
@ -56,7 +57,7 @@
|
||||
|
||||
|
||||
<div class="version">
|
||||
29.10
|
||||
29.11
|
||||
</div>
|
||||
|
||||
|
||||
@ -214,17 +215,28 @@
|
||||
|
||||
<span class="sd"> :param result: JSON result from the http query</span>
|
||||
<span class="sd"> :type result: dict</span>
|
||||
<span class="sd"> :rtype: tuple</span>
|
||||
<span class="sd"> :returns: (rc, should_exit_now)</span>
|
||||
|
||||
<span class="sd"> Return the correct rc for the program (0 or 1), and whether or</span>
|
||||
<span class="sd"> not to continue processing the results.</span>
|
||||
<span class="sd"> """</span>
|
||||
<span class="k">if</span> <span class="n">show_json</span><span class="p">:</span>
|
||||
<span class="nb">print</span><span class="p">(</span><span class="n">json</span><span class="o">.</span><span class="n">dumps</span><span class="p">(</span><span class="n">result</span><span class="p">,</span> <span class="n">indent</span><span class="o">=</span><span class="mi">4</span><span class="p">))</span>
|
||||
|
||||
<span class="k">for</span> <span class="n">err</span> <span class="ow">in</span> <span class="n">result</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">"errors"</span><span class="p">,</span> <span class="p">[]):</span>
|
||||
<span class="n">log</span><span class="o">.</span><span class="n">error</span><span class="p">(</span><span class="n">err</span><span class="p">)</span>
|
||||
|
||||
<span class="k">if</span> <span class="n">result</span><span class="p">[</span><span class="s2">"status"</span><span class="p">]</span> <span class="o">==</span> <span class="kc">True</span><span class="p">:</span>
|
||||
<span class="k">return</span> <span class="mi">0</span>
|
||||
<span class="k">else</span><span class="p">:</span>
|
||||
<span class="k">return</span> <span class="mi">1</span></div>
|
||||
<span class="k">for</span> <span class="n">err</span> <span class="ow">in</span> <span class="n">result</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">"errors"</span><span class="p">,</span> <span class="p">[]):</span>
|
||||
<span class="n">log</span><span class="o">.</span><span class="n">error</span><span class="p">(</span><span class="n">err</span><span class="p">[</span><span class="s2">"msg"</span><span class="p">])</span>
|
||||
|
||||
<span class="c1"># What's the rc? If status is present, use that</span>
|
||||
<span class="c1"># If not, use length of errors</span>
|
||||
<span class="k">if</span> <span class="s2">"status"</span> <span class="ow">in</span> <span class="n">result</span><span class="p">:</span>
|
||||
<span class="n">rc</span> <span class="o">=</span> <span class="nb">bool</span><span class="p">(</span><span class="ow">not</span> <span class="n">result</span><span class="p">[</span><span class="s2">"status"</span><span class="p">])</span>
|
||||
<span class="k">else</span><span class="p">:</span>
|
||||
<span class="n">rc</span> <span class="o">=</span> <span class="nb">bool</span><span class="p">(</span><span class="nb">len</span><span class="p">(</span><span class="n">result</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">"errors"</span><span class="p">,</span> <span class="p">[]))</span> <span class="o">></span> <span class="mi">0</span><span class="p">)</span>
|
||||
|
||||
<span class="c1"># Caller should return if showing json, or status was present and False</span>
|
||||
<span class="n">exit_now</span> <span class="o">=</span> <span class="n">show_json</span> <span class="ow">or</span> <span class="p">(</span><span class="s2">"status"</span> <span class="ow">in</span> <span class="n">result</span> <span class="ow">and</span> <span class="n">rc</span><span class="p">)</span>
|
||||
<span class="k">return</span> <span class="p">(</span><span class="n">rc</span><span class="p">,</span> <span class="n">exit_now</span><span class="p">)</span></div>
|
||||
|
||||
<div class="viewcode-block" id="packageNEVRA"><a class="viewcode-back" href="../../../composer.cli.html#composer.cli.utilities.packageNEVRA">[docs]</a><span class="k">def</span> <span class="nf">packageNEVRA</span><span class="p">(</span><span class="n">pkg</span><span class="p">):</span>
|
||||
<span class="sd">"""Return the package info as a NEVRA</span>
|
||||
@ -272,7 +284,7 @@
|
||||
<script type="text/javascript">
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT:'../../../',
|
||||
VERSION:'29.10',
|
||||
VERSION:'29.11',
|
||||
LANGUAGE:'None',
|
||||
COLLAPSE_INDEX:false,
|
||||
FILE_SUFFIX:'.html',
|
||||
@ -286,7 +298,10 @@
|
||||
|
||||
|
||||
|
||||
<script type="text/javascript" src="../../../_static/js/theme.js"></script>
|
||||
|
||||
|
||||
<script type="text/javascript" src="../../../_static/js/theme.js"></script>
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
jQuery(function () {
|
||||
|
@ -8,7 +8,7 @@
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<title>composer.http_client — Lorax 29.10 documentation</title>
|
||||
<title>composer.http_client — Lorax 29.11 documentation</title>
|
||||
|
||||
|
||||
|
||||
@ -24,7 +24,8 @@
|
||||
|
||||
|
||||
|
||||
<link rel="stylesheet" href="../../_static/css/theme.css" type="text/css" />
|
||||
|
||||
<link rel="stylesheet" href="../../_static/css/theme.css" type="text/css" />
|
||||
<link rel="stylesheet" href="../../_static/pygments.css" type="text/css" />
|
||||
<link rel="index" title="Index" href="../../genindex.html" />
|
||||
<link rel="search" title="Search" href="../../search.html" />
|
||||
@ -56,7 +57,7 @@
|
||||
|
||||
|
||||
<div class="version">
|
||||
29.10
|
||||
29.11
|
||||
</div>
|
||||
|
||||
|
||||
@ -204,7 +205,8 @@
|
||||
<span class="k">if</span> <span class="n">r</span><span class="o">.</span><span class="n">status</span> <span class="o">==</span> <span class="mi">400</span><span class="p">:</span>
|
||||
<span class="n">err</span> <span class="o">=</span> <span class="n">json</span><span class="o">.</span><span class="n">loads</span><span class="p">(</span><span class="n">r</span><span class="o">.</span><span class="n">data</span><span class="o">.</span><span class="n">decode</span><span class="p">(</span><span class="s2">"utf-8"</span><span class="p">))</span>
|
||||
<span class="k">if</span> <span class="s2">"status"</span> <span class="ow">in</span> <span class="n">err</span> <span class="ow">and</span> <span class="n">err</span><span class="p">[</span><span class="s2">"status"</span><span class="p">]</span> <span class="o">==</span> <span class="kc">False</span><span class="p">:</span>
|
||||
<span class="k">raise</span> <span class="ne">RuntimeError</span><span class="p">(</span><span class="s2">", "</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="n">err</span><span class="p">[</span><span class="s2">"errors"</span><span class="p">]))</span>
|
||||
<span class="n">msgs</span> <span class="o">=</span> <span class="p">[</span><span class="n">e</span><span class="p">[</span><span class="s2">"msg"</span><span class="p">]</span> <span class="k">for</span> <span class="n">e</span> <span class="ow">in</span> <span class="n">err</span><span class="p">[</span><span class="s2">"errors"</span><span class="p">]]</span>
|
||||
<span class="k">raise</span> <span class="ne">RuntimeError</span><span class="p">(</span><span class="s2">", "</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="n">msgs</span><span class="p">))</span>
|
||||
|
||||
<span class="k">return</span> <span class="n">r</span><span class="o">.</span><span class="n">data</span><span class="o">.</span><span class="n">decode</span><span class="p">(</span><span class="s1">'utf-8'</span><span class="p">)</span></div>
|
||||
|
||||
@ -326,7 +328,8 @@
|
||||
<span class="k">if</span> <span class="n">r</span><span class="o">.</span><span class="n">status</span> <span class="o">==</span> <span class="mi">400</span><span class="p">:</span>
|
||||
<span class="n">err</span> <span class="o">=</span> <span class="n">json</span><span class="o">.</span><span class="n">loads</span><span class="p">(</span><span class="n">r</span><span class="o">.</span><span class="n">data</span><span class="o">.</span><span class="n">decode</span><span class="p">(</span><span class="s2">"utf-8"</span><span class="p">))</span>
|
||||
<span class="k">if</span> <span class="ow">not</span> <span class="n">err</span><span class="p">[</span><span class="s2">"status"</span><span class="p">]:</span>
|
||||
<span class="k">raise</span> <span class="ne">RuntimeError</span><span class="p">(</span><span class="s2">", "</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="n">err</span><span class="p">[</span><span class="s2">"errors"</span><span class="p">]))</span>
|
||||
<span class="n">msgs</span> <span class="o">=</span> <span class="p">[</span><span class="n">e</span><span class="p">[</span><span class="s2">"msg"</span><span class="p">]</span> <span class="k">for</span> <span class="n">e</span> <span class="ow">in</span> <span class="n">err</span><span class="p">[</span><span class="s2">"errors"</span><span class="p">]]</span>
|
||||
<span class="k">raise</span> <span class="ne">RuntimeError</span><span class="p">(</span><span class="s2">", "</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="n">msgs</span><span class="p">))</span>
|
||||
|
||||
<span class="n">filename</span> <span class="o">=</span> <span class="n">get_filename</span><span class="p">(</span><span class="n">r</span><span class="o">.</span><span class="n">headers</span><span class="p">)</span>
|
||||
<span class="k">if</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">exists</span><span class="p">(</span><span class="n">filename</span><span class="p">):</span>
|
||||
@ -387,7 +390,7 @@
|
||||
<script type="text/javascript">
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT:'../../',
|
||||
VERSION:'29.10',
|
||||
VERSION:'29.11',
|
||||
LANGUAGE:'None',
|
||||
COLLAPSE_INDEX:false,
|
||||
FILE_SUFFIX:'.html',
|
||||
@ -401,7 +404,10 @@
|
||||
|
||||
|
||||
|
||||
<script type="text/javascript" src="../../_static/js/theme.js"></script>
|
||||
|
||||
|
||||
<script type="text/javascript" src="../../_static/js/theme.js"></script>
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
jQuery(function () {
|
||||
|
@ -8,7 +8,7 @@
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<title>composer.unix_socket — Lorax 29.10 documentation</title>
|
||||
<title>composer.unix_socket — Lorax 29.11 documentation</title>
|
||||
|
||||
|
||||
|
||||
@ -24,7 +24,8 @@
|
||||
|
||||
|
||||
|
||||
<link rel="stylesheet" href="../../_static/css/theme.css" type="text/css" />
|
||||
|
||||
<link rel="stylesheet" href="../../_static/css/theme.css" type="text/css" />
|
||||
<link rel="stylesheet" href="../../_static/pygments.css" type="text/css" />
|
||||
<link rel="index" title="Index" href="../../genindex.html" />
|
||||
<link rel="search" title="Search" href="../../search.html" />
|
||||
@ -56,7 +57,7 @@
|
||||
|
||||
|
||||
<div class="version">
|
||||
29.10
|
||||
29.11
|
||||
</div>
|
||||
|
||||
|
||||
@ -247,7 +248,7 @@
|
||||
<script type="text/javascript">
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT:'../../',
|
||||
VERSION:'29.10',
|
||||
VERSION:'29.11',
|
||||
LANGUAGE:'None',
|
||||
COLLAPSE_INDEX:false,
|
||||
FILE_SUFFIX:'.html',
|
||||
@ -261,7 +262,10 @@
|
||||
|
||||
|
||||
|
||||
<script type="text/javascript" src="../../_static/js/theme.js"></script>
|
||||
|
||||
|
||||
<script type="text/javascript" src="../../_static/js/theme.js"></script>
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
jQuery(function () {
|
||||
|
@ -8,7 +8,7 @@
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<title>Overview: module code — Lorax 29.10 documentation</title>
|
||||
<title>Overview: module code — Lorax 29.11 documentation</title>
|
||||
|
||||
|
||||
|
||||
@ -24,7 +24,8 @@
|
||||
|
||||
|
||||
|
||||
<link rel="stylesheet" href="../_static/css/theme.css" type="text/css" />
|
||||
|
||||
<link rel="stylesheet" href="../_static/css/theme.css" type="text/css" />
|
||||
<link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
|
||||
<link rel="index" title="Index" href="../genindex.html" />
|
||||
<link rel="search" title="Search" href="../search.html" />
|
||||
@ -56,7 +57,7 @@
|
||||
|
||||
|
||||
<div class="version">
|
||||
29.10
|
||||
29.11
|
||||
</div>
|
||||
|
||||
|
||||
@ -157,18 +158,22 @@
|
||||
<li><a href="composer/cli/modules.html">composer.cli.modules</a></li>
|
||||
<li><a href="composer/cli/projects.html">composer.cli.projects</a></li>
|
||||
<li><a href="composer/cli/sources.html">composer.cli.sources</a></li>
|
||||
<li><a href="composer/cli/status.html">composer.cli.status</a></li>
|
||||
<li><a href="composer/cli/utilities.html">composer.cli.utilities</a></li>
|
||||
</ul><li><a href="composer/http_client.html">composer.http_client</a></li>
|
||||
<li><a href="composer/unix_socket.html">composer.unix_socket</a></li>
|
||||
<li><a href="pylorax.html">pylorax</a></li>
|
||||
<ul><li><a href="pylorax/api/cmdline.html">pylorax.api.cmdline</a></li>
|
||||
<ul><li><a href="pylorax/api/checkparams.html">pylorax.api.checkparams</a></li>
|
||||
<li><a href="pylorax/api/cmdline.html">pylorax.api.cmdline</a></li>
|
||||
<li><a href="pylorax/api/compose.html">pylorax.api.compose</a></li>
|
||||
<li><a href="pylorax/api/config.html">pylorax.api.config</a></li>
|
||||
<li><a href="pylorax/api/crossdomain.html">pylorax.api.crossdomain</a></li>
|
||||
<li><a href="pylorax/api/dnfbase.html">pylorax.api.dnfbase</a></li>
|
||||
<li><a href="pylorax/api/projects.html">pylorax.api.projects</a></li>
|
||||
<li><a href="pylorax/api/queue.html">pylorax.api.queue</a></li>
|
||||
<li><a href="pylorax/api/recipes.html">pylorax.api.recipes</a></li>
|
||||
<li><a href="pylorax/api/server.html">pylorax.api.server</a></li>
|
||||
<li><a href="pylorax/api/timestamp.html">pylorax.api.timestamp</a></li>
|
||||
<li><a href="pylorax/api/v0.html">pylorax.api.v0</a></li>
|
||||
<li><a href="pylorax/api/workspace.html">pylorax.api.workspace</a></li>
|
||||
<li><a href="pylorax/base.html">pylorax.base</a></li>
|
||||
@ -221,7 +226,7 @@
|
||||
<script type="text/javascript">
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT:'../',
|
||||
VERSION:'29.10',
|
||||
VERSION:'29.11',
|
||||
LANGUAGE:'None',
|
||||
COLLAPSE_INDEX:false,
|
||||
FILE_SUFFIX:'.html',
|
||||
@ -235,7 +240,10 @@
|
||||
|
||||
|
||||
|
||||
<script type="text/javascript" src="../_static/js/theme.js"></script>
|
||||
|
||||
|
||||
<script type="text/javascript" src="../_static/js/theme.js"></script>
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
jQuery(function () {
|
||||
|
@ -8,7 +8,7 @@
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<title>pylorax — Lorax 29.10 documentation</title>
|
||||
<title>pylorax — Lorax 29.11 documentation</title>
|
||||
|
||||
|
||||
|
||||
@ -24,7 +24,8 @@
|
||||
|
||||
|
||||
|
||||
<link rel="stylesheet" href="../_static/css/theme.css" type="text/css" />
|
||||
|
||||
<link rel="stylesheet" href="../_static/css/theme.css" type="text/css" />
|
||||
<link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
|
||||
<link rel="index" title="Index" href="../genindex.html" />
|
||||
<link rel="search" title="Search" href="../search.html" />
|
||||
@ -56,7 +57,7 @@
|
||||
|
||||
|
||||
<div class="version">
|
||||
29.10
|
||||
29.11
|
||||
</div>
|
||||
|
||||
|
||||
@ -641,7 +642,7 @@
|
||||
<script type="text/javascript">
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT:'../',
|
||||
VERSION:'29.10',
|
||||
VERSION:'29.11',
|
||||
LANGUAGE:'None',
|
||||
COLLAPSE_INDEX:false,
|
||||
FILE_SUFFIX:'.html',
|
||||
@ -655,7 +656,10 @@
|
||||
|
||||
|
||||
|
||||
<script type="text/javascript" src="../_static/js/theme.js"></script>
|
||||
|
||||
|
||||
<script type="text/javascript" src="../_static/js/theme.js"></script>
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
jQuery(function () {
|
||||
|
262
docs/html/_modules/pylorax/api/checkparams.html
Normal file
262
docs/html/_modules/pylorax/api/checkparams.html
Normal file
@ -0,0 +1,262 @@
|
||||
|
||||
|
||||
<!DOCTYPE html>
|
||||
<!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]-->
|
||||
<!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]-->
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<title>pylorax.api.checkparams — Lorax 29.11 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.11
|
||||
</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.api.checkparams</li>
|
||||
|
||||
|
||||
<li class="wy-breadcrumbs-aside">
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
<hr/>
|
||||
</div>
|
||||
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
|
||||
<div itemprop="articleBody">
|
||||
|
||||
<h1>Source code for pylorax.api.checkparams</h1><div class="highlight"><pre>
|
||||
<span></span><span class="c1">#</span>
|
||||
<span class="c1"># Copyright (C) 2018 Red Hat, Inc.</span>
|
||||
<span class="c1">#</span>
|
||||
<span class="c1"># This program is free software; you can redistribute it and/or modify</span>
|
||||
<span class="c1"># it under the terms of the GNU General Public License as published by</span>
|
||||
<span class="c1"># the Free Software Foundation; either version 2 of the License, or</span>
|
||||
<span class="c1"># (at your option) any later version.</span>
|
||||
<span class="c1">#</span>
|
||||
<span class="c1"># This program is distributed in the hope that it will be useful,</span>
|
||||
<span class="c1"># but WITHOUT ANY WARRANTY; without even the implied warranty of</span>
|
||||
<span class="c1"># MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the</span>
|
||||
<span class="c1"># GNU General Public License for more details.</span>
|
||||
<span class="c1">#</span>
|
||||
<span class="c1"># You should have received a copy of the GNU General Public License</span>
|
||||
<span class="c1"># along with this program. If not, see <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">"lorax-composer"</span><span class="p">)</span>
|
||||
|
||||
<span class="kn">from</span> <span class="nn">flask</span> <span class="k">import</span> <span class="n">jsonify</span>
|
||||
<span class="kn">from</span> <span class="nn">functools</span> <span class="k">import</span> <span class="n">update_wrapper</span>
|
||||
|
||||
<span class="c1"># A decorator for checking the parameters provided to the API route implementing</span>
|
||||
<span class="c1"># functions. The tuples parameter is a list of tuples. Each tuple is the string</span>
|
||||
<span class="c1"># name of a parameter ("blueprint_name", not blueprint_name), the value it's set</span>
|
||||
<span class="c1"># to by flask if the caller did not provide it, and a message to be returned to</span>
|
||||
<span class="c1"># the user.</span>
|
||||
<span class="c1">#</span>
|
||||
<span class="c1"># If the parameter is set to its default, the error message is returned. Otherwise,</span>
|
||||
<span class="c1"># the decorated function is called and its return value is returned.</span>
|
||||
<div class="viewcode-block" id="checkparams"><a class="viewcode-back" href="../../../pylorax.api.html#pylorax.api.checkparams.checkparams">[docs]</a><span class="k">def</span> <span class="nf">checkparams</span><span class="p">(</span><span class="n">tuples</span><span class="p">):</span>
|
||||
<span class="k">def</span> <span class="nf">decorator</span><span class="p">(</span><span class="n">f</span><span class="p">):</span>
|
||||
<span class="k">def</span> <span class="nf">wrapped_function</span><span class="p">(</span><span class="o">*</span><span class="n">args</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">):</span>
|
||||
<span class="k">for</span> <span class="n">tup</span> <span class="ow">in</span> <span class="n">tuples</span><span class="p">:</span>
|
||||
<span class="k">if</span> <span class="n">kwargs</span><span class="p">[</span><span class="n">tup</span><span class="p">[</span><span class="mi">0</span><span class="p">]]</span> <span class="o">==</span> <span class="n">tup</span><span class="p">[</span><span class="mi">1</span><span class="p">]:</span>
|
||||
<span class="n">log</span><span class="o">.</span><span class="n">error</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="p">,</span> <span class="n">f</span><span class="o">.</span><span class="vm">__name__</span><span class="p">,</span> <span class="n">tup</span><span class="p">[</span><span class="mi">2</span><span class="p">])</span>
|
||||
<span class="k">return</span> <span class="n">jsonify</span><span class="p">(</span><span class="n">status</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="n">errors</span><span class="o">=</span><span class="p">[</span><span class="n">tup</span><span class="p">[</span><span class="mi">2</span><span class="p">]]),</span> <span class="mi">400</span>
|
||||
|
||||
<span class="k">return</span> <span class="n">f</span><span class="p">(</span><span class="o">*</span><span class="n">args</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">)</span>
|
||||
|
||||
<span class="k">return</span> <span class="n">update_wrapper</span><span class="p">(</span><span class="n">wrapped_function</span><span class="p">,</span> <span class="n">f</span><span class="p">)</span>
|
||||
|
||||
<span class="k">return</span> <span class="n">decorator</span></div>
|
||||
</pre></div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<footer>
|
||||
|
||||
|
||||
<hr/>
|
||||
|
||||
<div role="contentinfo">
|
||||
<p>
|
||||
© 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.11',
|
||||
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.api.cmdline — Lorax 29.10 documentation</title>
|
||||
<title>pylorax.api.cmdline — Lorax 29.11 documentation</title>
|
||||
|
||||
|
||||
|
||||
@ -24,7 +24,8 @@
|
||||
|
||||
|
||||
|
||||
<link rel="stylesheet" href="../../../_static/css/theme.css" type="text/css" />
|
||||
|
||||
<link rel="stylesheet" href="../../../_static/css/theme.css" type="text/css" />
|
||||
<link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" />
|
||||
<link rel="index" title="Index" href="../../../genindex.html" />
|
||||
<link rel="search" title="Search" href="../../../search.html" />
|
||||
@ -56,7 +57,7 @@
|
||||
|
||||
|
||||
<div class="version">
|
||||
29.10
|
||||
29.11
|
||||
</div>
|
||||
|
||||
|
||||
@ -246,7 +247,7 @@
|
||||
<script type="text/javascript">
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT:'../../../',
|
||||
VERSION:'29.10',
|
||||
VERSION:'29.11',
|
||||
LANGUAGE:'None',
|
||||
COLLAPSE_INDEX:false,
|
||||
FILE_SUFFIX:'.html',
|
||||
@ -260,7 +261,10 @@
|
||||
|
||||
|
||||
|
||||
<script type="text/javascript" src="../../../_static/js/theme.js"></script>
|
||||
|
||||
|
||||
<script type="text/javascript" src="../../../_static/js/theme.js"></script>
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
jQuery(function () {
|
||||
|
@ -8,7 +8,7 @@
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<title>pylorax.api.compose — Lorax 29.10 documentation</title>
|
||||
<title>pylorax.api.compose — Lorax 29.11 documentation</title>
|
||||
|
||||
|
||||
|
||||
@ -24,7 +24,8 @@
|
||||
|
||||
|
||||
|
||||
<link rel="stylesheet" href="../../../_static/css/theme.css" type="text/css" />
|
||||
|
||||
<link rel="stylesheet" href="../../../_static/css/theme.css" type="text/css" />
|
||||
<link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" />
|
||||
<link rel="index" title="Index" href="../../../genindex.html" />
|
||||
<link rel="search" title="Search" href="../../../search.html" />
|
||||
@ -56,7 +57,7 @@
|
||||
|
||||
|
||||
<div class="version">
|
||||
29.10
|
||||
29.11
|
||||
</div>
|
||||
|
||||
|
||||
@ -205,6 +206,7 @@
|
||||
<span class="kn">from</span> <span class="nn">pylorax.api.projects</span> <span class="k">import</span> <span class="n">projects_depsolve</span><span class="p">,</span> <span class="n">projects_depsolve_with_size</span><span class="p">,</span> <span class="n">dep_nevra</span>
|
||||
<span class="kn">from</span> <span class="nn">pylorax.api.projects</span> <span class="k">import</span> <span class="n">ProjectsError</span>
|
||||
<span class="kn">from</span> <span class="nn">pylorax.api.recipes</span> <span class="k">import</span> <span class="n">read_recipe_and_id</span>
|
||||
<span class="kn">from</span> <span class="nn">pylorax.api.timestamp</span> <span class="k">import</span> <span class="n">TS_CREATED</span><span class="p">,</span> <span class="n">write_timestamp</span>
|
||||
<span class="kn">from</span> <span class="nn">pylorax.imgutils</span> <span class="k">import</span> <span class="n">default_image_name</span>
|
||||
<span class="kn">from</span> <span class="nn">pylorax.sysutils</span> <span class="k">import</span> <span class="n">joinpaths</span>
|
||||
|
||||
@ -489,6 +491,10 @@
|
||||
<span class="n">log</span><span class="o">.</span><span class="n">debug</span><span class="p">(</span><span class="s2">"repo composer-</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">idx</span><span class="p">,</span> <span class="n">ks_repo</span><span class="p">)</span>
|
||||
<span class="n">f</span><span class="o">.</span><span class="n">write</span><span class="p">(</span><span class="s1">'repo --name="composer-</span><span class="si">%s</span><span class="s1">" </span><span class="si">%s</span><span class="se">\n</span><span class="s1">'</span> <span class="o">%</span> <span class="p">(</span><span class="n">idx</span><span class="p">,</span> <span class="n">ks_repo</span><span class="p">))</span>
|
||||
|
||||
<span class="c1"># Setup the disk for booting</span>
|
||||
<span class="c1"># TODO Add GPT and UEFI boot support</span>
|
||||
<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>
|
||||
|
||||
@ -534,6 +540,7 @@
|
||||
<span class="k">if</span> <span class="n">test_mode</span> <span class="o">></span> <span class="mi">0</span><span class="p">:</span>
|
||||
<span class="nb">open</span><span class="p">(</span><span class="n">joinpaths</span><span class="p">(</span><span class="n">results_dir</span><span class="p">,</span> <span class="s2">"TEST"</span><span class="p">),</span> <span class="s2">"w"</span><span class="p">)</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="s2">"</span> <span class="o">%</span> <span class="n">test_mode</span><span class="p">)</span>
|
||||
|
||||
<span class="n">write_timestamp</span><span class="p">(</span><span class="n">results_dir</span><span class="p">,</span> <span class="n">TS_CREATED</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">"Adding </span><span class="si">%s</span><span class="s2"> (</span><span class="si">%s</span><span class="s2"> </span><span class="si">%s</span><span class="s2">) to compose queue"</span><span class="p">,</span> <span class="n">build_id</span><span class="p">,</span> <span class="n">recipe</span><span class="p">[</span><span class="s2">"name"</span><span class="p">],</span> <span class="n">compose_type</span><span class="p">)</span>
|
||||
<span class="n">os</span><span class="o">.</span><span class="n">symlink</span><span class="p">(</span><span class="n">results_dir</span><span class="p">,</span> <span class="n">joinpaths</span><span class="p">(</span><span class="n">lib_dir</span><span class="p">,</span> <span class="s2">"queue/new/"</span><span class="p">,</span> <span class="n">build_id</span><span class="p">))</span>
|
||||
|
||||
@ -727,7 +734,7 @@
|
||||
<script type="text/javascript">
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT:'../../../',
|
||||
VERSION:'29.10',
|
||||
VERSION:'29.11',
|
||||
LANGUAGE:'None',
|
||||
COLLAPSE_INDEX:false,
|
||||
FILE_SUFFIX:'.html',
|
||||
@ -741,7 +748,10 @@
|
||||
|
||||
|
||||
|
||||
<script type="text/javascript" src="../../../_static/js/theme.js"></script>
|
||||
|
||||
|
||||
<script type="text/javascript" src="../../../_static/js/theme.js"></script>
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
jQuery(function () {
|
||||
|
@ -8,7 +8,7 @@
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<title>pylorax.api.config — Lorax 29.10 documentation</title>
|
||||
<title>pylorax.api.config — Lorax 29.11 documentation</title>
|
||||
|
||||
|
||||
|
||||
@ -24,7 +24,8 @@
|
||||
|
||||
|
||||
|
||||
<link rel="stylesheet" href="../../../_static/css/theme.css" type="text/css" />
|
||||
|
||||
<link rel="stylesheet" href="../../../_static/css/theme.css" type="text/css" />
|
||||
<link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" />
|
||||
<link rel="index" title="Index" href="../../../genindex.html" />
|
||||
<link rel="search" title="Search" href="../../../search.html" />
|
||||
@ -56,7 +57,7 @@
|
||||
|
||||
|
||||
<div class="version">
|
||||
29.10
|
||||
29.11
|
||||
</div>
|
||||
|
||||
|
||||
@ -301,7 +302,7 @@
|
||||
<script type="text/javascript">
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT:'../../../',
|
||||
VERSION:'29.10',
|
||||
VERSION:'29.11',
|
||||
LANGUAGE:'None',
|
||||
COLLAPSE_INDEX:false,
|
||||
FILE_SUFFIX:'.html',
|
||||
@ -315,7 +316,10 @@
|
||||
|
||||
|
||||
|
||||
<script type="text/javascript" src="../../../_static/js/theme.js"></script>
|
||||
|
||||
|
||||
<script type="text/javascript" src="../../../_static/js/theme.js"></script>
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
jQuery(function () {
|
||||
|
@ -8,7 +8,7 @@
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<title>pylorax.api.crossdomain — Lorax 29.10 documentation</title>
|
||||
<title>pylorax.api.crossdomain — Lorax 29.11 documentation</title>
|
||||
|
||||
|
||||
|
||||
@ -24,7 +24,8 @@
|
||||
|
||||
|
||||
|
||||
<link rel="stylesheet" href="../../../_static/css/theme.css" type="text/css" />
|
||||
|
||||
<link rel="stylesheet" href="../../../_static/css/theme.css" type="text/css" />
|
||||
<link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" />
|
||||
<link rel="index" title="Index" href="../../../genindex.html" />
|
||||
<link rel="search" title="Search" href="../../../search.html" />
|
||||
@ -56,7 +57,7 @@
|
||||
|
||||
|
||||
<div class="version">
|
||||
29.10
|
||||
29.11
|
||||
</div>
|
||||
|
||||
|
||||
@ -252,7 +253,7 @@
|
||||
<script type="text/javascript">
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT:'../../../',
|
||||
VERSION:'29.10',
|
||||
VERSION:'29.11',
|
||||
LANGUAGE:'None',
|
||||
COLLAPSE_INDEX:false,
|
||||
FILE_SUFFIX:'.html',
|
||||
@ -266,7 +267,10 @@
|
||||
|
||||
|
||||
|
||||
<script type="text/javascript" src="../../../_static/js/theme.js"></script>
|
||||
|
||||
|
||||
<script type="text/javascript" src="../../../_static/js/theme.js"></script>
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
jQuery(function () {
|
||||
|
310
docs/html/_modules/pylorax/api/dnfbase.html
Normal file
310
docs/html/_modules/pylorax/api/dnfbase.html
Normal file
@ -0,0 +1,310 @@
|
||||
|
||||
|
||||
<!DOCTYPE html>
|
||||
<!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]-->
|
||||
<!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]-->
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<title>pylorax.api.dnfbase — Lorax 29.11 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.11
|
||||
</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.api.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.api.dnfbase</h1><div class="highlight"><pre>
|
||||
<span></span><span class="c1">#</span>
|
||||
<span class="c1"># Copyright (C) 2017-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="c1"># pylint: disable=bad-preconf-access</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">"lorax-composer"</span><span class="p">)</span>
|
||||
|
||||
<span class="kn">import</span> <span class="nn">dnf</span>
|
||||
<span class="kn">import</span> <span class="nn">dnf.logging</span>
|
||||
<span class="kn">from</span> <span class="nn">glob</span> <span class="k">import</span> <span class="n">glob</span>
|
||||
<span class="kn">import</span> <span class="nn">os</span>
|
||||
<span class="kn">import</span> <span class="nn">shutil</span>
|
||||
|
||||
|
||||
<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>
|
||||
|
||||
<span class="sd"> :param conf: configuration object</span>
|
||||
<span class="sd"> :type conf: ComposerParser</span>
|
||||
<span class="sd"> :returns: A DNF Base object</span>
|
||||
<span class="sd"> :rtype: dnf.Base</span>
|
||||
<span class="sd"> """</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">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="s2">"cache_dir"</span><span class="p">))</span>
|
||||
<span class="n">dnfconf</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="s2">"dnf_conf"</span><span class="p">))</span>
|
||||
<span class="n">dnfroot</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="s2">"dnf_root"</span><span class="p">))</span>
|
||||
<span class="n">repodir</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="s2">"repo_dir"</span><span class="p">))</span>
|
||||
|
||||
<span class="c1"># Setup the config for the DNF Base object</span>
|
||||
<span class="n">dbo</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="n">dbc</span> <span class="o">=</span> <span class="n">dbo</span><span class="o">.</span><span class="n">conf</span>
|
||||
<span class="c1"># TODO - Handle this</span>
|
||||
<span class="c1"># dbc.logdir = logdir</span>
|
||||
<span class="n">dbc</span><span class="o">.</span><span class="n">installroot</span> <span class="o">=</span> <span class="n">dnfroot</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">dnfroot</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">dnfroot</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">repodir</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">repodir</span><span class="p">)</span>
|
||||
|
||||
<span class="n">dbc</span><span class="o">.</span><span class="n">cachedir</span> <span class="o">=</span> <span class="n">cachedir</span>
|
||||
<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="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>
|
||||
|
||||
<span class="k">if</span> <span class="n">conf</span><span class="o">.</span><span class="n">has_option</span><span class="p">(</span><span class="s2">"dnf"</span><span class="p">,</span> <span class="s2">"sslverify"</span><span class="p">)</span> <span class="ow">and</span> <span class="ow">not</span> <span class="n">conf</span><span class="o">.</span><span class="n">getboolean</span><span class="p">(</span><span class="s2">"dnf"</span><span class="p">,</span> <span class="s2">"sslverify"</span><span class="p">):</span>
|
||||
<span class="n">dbc</span><span class="o">.</span><span class="n">sslverify</span> <span class="o">=</span> <span class="kc">False</span>
|
||||
|
||||
<span class="n">_releasever</span> <span class="o">=</span> <span class="n">conf</span><span class="o">.</span><span class="n">get_default</span><span class="p">(</span><span class="s2">"composer"</span><span class="p">,</span> <span class="s2">"releasever"</span><span class="p">,</span> <span class="kc">None</span><span class="p">)</span>
|
||||
<span class="k">if</span> <span class="ow">not</span> <span class="n">_releasever</span><span class="p">:</span>
|
||||
<span class="c1"># Use the releasever of the host system</span>
|
||||
<span class="n">_releasever</span> <span class="o">=</span> <span class="n">dnf</span><span class="o">.</span><span class="n">rpm</span><span class="o">.</span><span class="n">detect_releasever</span><span class="p">(</span><span class="s2">"/"</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">"releasever = </span><span class="si">%s</span><span class="s2">"</span><span class="p">,</span> <span class="n">_releasever</span><span class="p">)</span>
|
||||
<span class="n">dbc</span><span class="o">.</span><span class="n">releasever</span> <span class="o">=</span> <span class="n">_releasever</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>
|
||||
|
||||
<span class="c1"># dnf needs the repos all in one directory, composer uses repodir for this</span>
|
||||
<span class="c1"># if system repos are supposed to be used, copy them into repodir, overwriting any previous copies</span>
|
||||
<span class="k">if</span> <span class="ow">not</span> <span class="n">conf</span><span class="o">.</span><span class="n">has_option</span><span class="p">(</span><span class="s2">"repos"</span><span class="p">,</span> <span class="s2">"use_system_repos"</span><span class="p">)</span> <span class="ow">or</span> <span class="n">conf</span><span class="o">.</span><span class="n">getboolean</span><span class="p">(</span><span class="s2">"repos"</span><span class="p">,</span> <span class="s2">"use_system_repos"</span><span class="p">):</span>
|
||||
<span class="k">for</span> <span class="n">repo_file</span> <span class="ow">in</span> <span class="n">glob</span><span class="p">(</span><span class="s2">"/etc/yum.repos.d/*.repo"</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">repo_file</span><span class="p">,</span> <span class="n">repodir</span><span class="p">)</span>
|
||||
<span class="n">dbo</span><span class="o">.</span><span class="n">read_all_repos</span><span class="p">()</span>
|
||||
|
||||
<span class="c1"># Update the metadata from the enabled repos to speed up later operations</span>
|
||||
<span class="n">log</span><span class="o">.</span><span class="n">info</span><span class="p">(</span><span class="s2">"Updating repository metadata"</span><span class="p">)</span>
|
||||
<span class="k">try</span><span class="p">:</span>
|
||||
<span class="n">dbo</span><span class="o">.</span><span class="n">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="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>
|
||||
|
||||
<span class="k">return</span> <span class="n">dbo</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.11',
|
||||
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.api.projects — Lorax 29.10 documentation</title>
|
||||
<title>pylorax.api.projects — Lorax 29.11 documentation</title>
|
||||
|
||||
|
||||
|
||||
@ -24,7 +24,8 @@
|
||||
|
||||
|
||||
|
||||
<link rel="stylesheet" href="../../../_static/css/theme.css" type="text/css" />
|
||||
|
||||
<link rel="stylesheet" href="../../../_static/css/theme.css" type="text/css" />
|
||||
<link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" />
|
||||
<link rel="index" title="Index" href="../../../genindex.html" />
|
||||
<link rel="search" title="Search" href="../../../search.html" />
|
||||
@ -56,7 +57,7 @@
|
||||
|
||||
|
||||
<div class="version">
|
||||
29.10
|
||||
29.11
|
||||
</div>
|
||||
|
||||
|
||||
@ -737,7 +738,7 @@
|
||||
<script type="text/javascript">
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT:'../../../',
|
||||
VERSION:'29.10',
|
||||
VERSION:'29.11',
|
||||
LANGUAGE:'None',
|
||||
COLLAPSE_INDEX:false,
|
||||
FILE_SUFFIX:'.html',
|
||||
@ -751,7 +752,10 @@
|
||||
|
||||
|
||||
|
||||
<script type="text/javascript" src="../../../_static/js/theme.js"></script>
|
||||
|
||||
|
||||
<script type="text/javascript" src="../../../_static/js/theme.js"></script>
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
jQuery(function () {
|
||||
|
@ -8,7 +8,7 @@
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<title>pylorax.api.queue — Lorax 29.10 documentation</title>
|
||||
<title>pylorax.api.queue — Lorax 29.11 documentation</title>
|
||||
|
||||
|
||||
|
||||
@ -24,7 +24,8 @@
|
||||
|
||||
|
||||
|
||||
<link rel="stylesheet" href="../../../_static/css/theme.css" type="text/css" />
|
||||
|
||||
<link rel="stylesheet" href="../../../_static/css/theme.css" type="text/css" />
|
||||
<link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" />
|
||||
<link rel="index" title="Index" href="../../../genindex.html" />
|
||||
<link rel="search" title="Search" href="../../../search.html" />
|
||||
@ -56,7 +57,7 @@
|
||||
|
||||
|
||||
<div class="version">
|
||||
29.10
|
||||
29.11
|
||||
</div>
|
||||
|
||||
|
||||
@ -187,6 +188,7 @@
|
||||
<span class="kn">from</span> <span class="nn">pylorax</span> <span class="k">import</span> <span class="n">find_templates</span>
|
||||
<span class="kn">from</span> <span class="nn">pylorax.api.compose</span> <span class="k">import</span> <span class="n">move_compose_results</span>
|
||||
<span class="kn">from</span> <span class="nn">pylorax.api.recipes</span> <span class="k">import</span> <span class="n">recipe_from_file</span>
|
||||
<span class="kn">from</span> <span class="nn">pylorax.api.timestamp</span> <span class="k">import</span> <span class="n">TS_CREATED</span><span class="p">,</span> <span class="n">TS_STARTED</span><span class="p">,</span> <span class="n">TS_FINISHED</span><span class="p">,</span> <span class="n">write_timestamp</span><span class="p">,</span> <span class="n">timestamp_dict</span>
|
||||
<span class="kn">from</span> <span class="nn">pylorax.base</span> <span class="k">import</span> <span class="n">DataHolder</span>
|
||||
<span class="kn">from</span> <span class="nn">pylorax.creator</span> <span class="k">import</span> <span class="n">run_creator</span>
|
||||
<span class="kn">from</span> <span class="nn">pylorax.sysutils</span> <span class="k">import</span> <span class="n">joinpaths</span>
|
||||
@ -263,6 +265,7 @@
|
||||
<span class="n">make_compose</span><span class="p">(</span><span class="n">cfg</span><span class="p">,</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">realpath</span><span class="p">(</span><span class="n">dst</span><span class="p">))</span>
|
||||
<span class="n">log</span><span class="o">.</span><span class="n">info</span><span class="p">(</span><span class="s2">"Finished building </span><span class="si">%s</span><span class="s2">, results are in </span><span class="si">%s</span><span class="s2">"</span><span class="p">,</span> <span class="n">dst</span><span class="p">,</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">realpath</span><span class="p">(</span><span class="n">dst</span><span class="p">))</span>
|
||||
<span class="nb">open</span><span class="p">(</span><span class="n">joinpaths</span><span class="p">(</span><span class="n">dst</span><span class="p">,</span> <span class="s2">"STATUS"</span><span class="p">),</span> <span class="s2">"w"</span><span class="p">)</span><span class="o">.</span><span class="n">write</span><span class="p">(</span><span class="s2">"FINISHED</span><span class="se">\n</span><span class="s2">"</span><span class="p">)</span>
|
||||
<span class="n">write_timestamp</span><span class="p">(</span><span class="n">dst</span><span class="p">,</span> <span class="n">TS_FINISHED</span><span class="p">)</span>
|
||||
<span class="k">except</span> <span class="ne">Exception</span><span class="p">:</span>
|
||||
<span class="kn">import</span> <span class="nn">traceback</span>
|
||||
<span class="n">log</span><span class="o">.</span><span class="n">error</span><span class="p">(</span><span class="s2">"traceback: </span><span class="si">%s</span><span class="s2">"</span><span class="p">,</span> <span class="n">traceback</span><span class="o">.</span><span class="n">format_exc</span><span class="p">())</span>
|
||||
@ -270,6 +273,7 @@
|
||||
<span class="c1"># TODO - Write the error message to an ERROR-LOG file to include with the status</span>
|
||||
<span class="c1"># log.error("Error running compose: %s", e)</span>
|
||||
<span class="nb">open</span><span class="p">(</span><span class="n">joinpaths</span><span class="p">(</span><span class="n">dst</span><span class="p">,</span> <span class="s2">"STATUS"</span><span class="p">),</span> <span class="s2">"w"</span><span class="p">)</span><span class="o">.</span><span class="n">write</span><span class="p">(</span><span class="s2">"FAILED</span><span class="se">\n</span><span class="s2">"</span><span class="p">)</span>
|
||||
<span class="n">write_timestamp</span><span class="p">(</span><span class="n">dst</span><span class="p">,</span> <span class="n">TS_FINISHED</span><span class="p">)</span>
|
||||
|
||||
<span class="n">os</span><span class="o">.</span><span class="n">unlink</span><span class="p">(</span><span class="n">dst</span><span class="p">)</span></div>
|
||||
|
||||
@ -350,6 +354,7 @@
|
||||
<span class="n">log</span><span class="o">.</span><span class="n">debug</span><span class="p">(</span><span class="s2">"cfg = </span><span class="si">%s</span><span class="s2">"</span><span class="p">,</span> <span class="n">install_cfg</span><span class="p">)</span>
|
||||
<span class="k">try</span><span class="p">:</span>
|
||||
<span class="n">test_path</span> <span class="o">=</span> <span class="n">joinpaths</span><span class="p">(</span><span class="n">results_dir</span><span class="p">,</span> <span class="s2">"TEST"</span><span class="p">)</span>
|
||||
<span class="n">write_timestamp</span><span class="p">(</span><span class="n">results_dir</span><span class="p">,</span> <span class="n">TS_STARTED</span><span class="p">)</span>
|
||||
<span class="k">if</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">exists</span><span class="p">(</span><span class="n">test_path</span><span class="p">):</span>
|
||||
<span class="c1"># Pretend to run the compose</span>
|
||||
<span class="n">time</span><span class="o">.</span><span class="n">sleep</span><span class="p">(</span><span class="mi">5</span><span class="p">)</span>
|
||||
@ -409,15 +414,21 @@
|
||||
|
||||
<span class="sd"> * id - The uuid of the comoposition</span>
|
||||
<span class="sd"> * queue_status - The final status of the composition (FINISHED or FAILED)</span>
|
||||
<span class="sd"> * timestamp - The time of the last status change</span>
|
||||
<span class="sd"> * compose_type - The type of output generated (tar, iso, etc.)</span>
|
||||
<span class="sd"> * blueprint - Blueprint name</span>
|
||||
<span class="sd"> * version - Blueprint version</span>
|
||||
<span class="sd"> * image_size - Size of the image, if finished. 0 otherwise.</span>
|
||||
|
||||
<span class="sd"> Various timestamps are also included in the dict. These are all Unix UTC timestamps.</span>
|
||||
<span class="sd"> It is possible for these timestamps to not always exist, in which case they will be</span>
|
||||
<span class="sd"> None in Python (or null in JSON). The following timestamps are included:</span>
|
||||
|
||||
<span class="sd"> * job_created - When the user submitted the compose</span>
|
||||
<span class="sd"> * job_started - Anaconda started running</span>
|
||||
<span class="sd"> * job_finished - Job entered FINISHED or FAILED state</span>
|
||||
<span class="sd"> """</span>
|
||||
<span class="n">build_id</span> <span class="o">=</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">basename</span><span class="p">(</span><span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">abspath</span><span class="p">(</span><span class="n">results_dir</span><span class="p">))</span>
|
||||
<span class="n">status</span> <span class="o">=</span> <span class="nb">open</span><span class="p">(</span><span class="n">joinpaths</span><span class="p">(</span><span class="n">results_dir</span><span class="p">,</span> <span class="s2">"STATUS"</span><span class="p">))</span><span class="o">.</span><span class="n">read</span><span class="p">()</span><span class="o">.</span><span class="n">strip</span><span class="p">()</span>
|
||||
<span class="n">mtime</span> <span class="o">=</span> <span class="n">os</span><span class="o">.</span><span class="n">stat</span><span class="p">(</span><span class="n">joinpaths</span><span class="p">(</span><span class="n">results_dir</span><span class="p">,</span> <span class="s2">"STATUS"</span><span class="p">))</span><span class="o">.</span><span class="n">st_mtime</span>
|
||||
<span class="n">blueprint</span> <span class="o">=</span> <span class="n">recipe_from_file</span><span class="p">(</span><span class="n">joinpaths</span><span class="p">(</span><span class="n">results_dir</span><span class="p">,</span> <span class="s2">"blueprint.toml"</span><span class="p">))</span>
|
||||
|
||||
<span class="n">compose_type</span> <span class="o">=</span> <span class="n">get_compose_type</span><span class="p">(</span><span class="n">results_dir</span><span class="p">)</span>
|
||||
@ -428,9 +439,13 @@
|
||||
<span class="k">else</span><span class="p">:</span>
|
||||
<span class="n">image_size</span> <span class="o">=</span> <span class="mi">0</span>
|
||||
|
||||
<span class="n">times</span> <span class="o">=</span> <span class="n">timestamp_dict</span><span class="p">(</span><span class="n">results_dir</span><span class="p">)</span>
|
||||
|
||||
<span class="k">return</span> <span class="p">{</span><span class="s2">"id"</span><span class="p">:</span> <span class="n">build_id</span><span class="p">,</span>
|
||||
<span class="s2">"queue_status"</span><span class="p">:</span> <span class="n">status</span><span class="p">,</span>
|
||||
<span class="s2">"timestamp"</span><span class="p">:</span> <span class="n">mtime</span><span class="p">,</span>
|
||||
<span class="s2">"job_created"</span><span class="p">:</span> <span class="n">times</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="n">TS_CREATED</span><span class="p">),</span>
|
||||
<span class="s2">"job_started"</span><span class="p">:</span> <span class="n">times</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="n">TS_STARTED</span><span class="p">),</span>
|
||||
<span class="s2">"job_finished"</span><span class="p">:</span> <span class="n">times</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="n">TS_FINISHED</span><span class="p">),</span>
|
||||
<span class="s2">"compose_type"</span><span class="p">:</span> <span class="n">compose_type</span><span class="p">,</span>
|
||||
<span class="s2">"blueprint"</span><span class="p">:</span> <span class="n">blueprint</span><span class="p">[</span><span class="s2">"name"</span><span class="p">],</span>
|
||||
<span class="s2">"version"</span><span class="p">:</span> <span class="n">blueprint</span><span class="p">[</span><span class="s2">"version"</span><span class="p">],</span>
|
||||
@ -598,7 +613,7 @@
|
||||
<span class="sd"> :type cfg: ComposerConfig</span>
|
||||
<span class="sd"> :param uuid: The UUID of the build</span>
|
||||
<span class="sd"> :type uuid: str</span>
|
||||
<span class="sd"> :returns: dictionary of information about the composition</span>
|
||||
<span class="sd"> :returns: dictionary of information about the composition or None</span>
|
||||
<span class="sd"> :rtype: dict</span>
|
||||
<span class="sd"> :raises: RuntimeError if there was a problem</span>
|
||||
|
||||
@ -614,7 +629,7 @@
|
||||
<span class="sd"> """</span>
|
||||
<span class="n">uuid_dir</span> <span class="o">=</span> <span class="n">joinpaths</span><span class="p">(</span><span class="n">cfg</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">"composer"</span><span class="p">,</span> <span class="s2">"lib_dir"</span><span class="p">),</span> <span class="s2">"results"</span><span class="p">,</span> <span class="n">uuid</span><span class="p">)</span>
|
||||
<span class="k">if</span> <span class="ow">not</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">exists</span><span class="p">(</span><span class="n">uuid_dir</span><span class="p">):</span>
|
||||
<span class="k">raise</span> <span class="ne">RuntimeError</span><span class="p">(</span><span class="s2">"</span><span class="si">%s</span><span class="s2"> is not a valid build_id"</span> <span class="o">%</span> <span class="n">uuid</span><span class="p">)</span>
|
||||
<span class="k">return</span> <span class="kc">None</span>
|
||||
|
||||
<span class="c1"># Load the compose configuration</span>
|
||||
<span class="n">cfg_path</span> <span class="o">=</span> <span class="n">joinpaths</span><span class="p">(</span><span class="n">uuid_dir</span><span class="p">,</span> <span class="s2">"config.toml"</span><span class="p">)</span>
|
||||
@ -804,7 +819,7 @@
|
||||
<script type="text/javascript">
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT:'../../../',
|
||||
VERSION:'29.10',
|
||||
VERSION:'29.11',
|
||||
LANGUAGE:'None',
|
||||
COLLAPSE_INDEX:false,
|
||||
FILE_SUFFIX:'.html',
|
||||
@ -818,7 +833,10 @@
|
||||
|
||||
|
||||
|
||||
<script type="text/javascript" src="../../../_static/js/theme.js"></script>
|
||||
|
||||
|
||||
<script type="text/javascript" src="../../../_static/js/theme.js"></script>
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
jQuery(function () {
|
||||
|
@ -8,7 +8,7 @@
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<title>pylorax.api.recipes — Lorax 29.10 documentation</title>
|
||||
<title>pylorax.api.recipes — Lorax 29.11 documentation</title>
|
||||
|
||||
|
||||
|
||||
@ -24,7 +24,8 @@
|
||||
|
||||
|
||||
|
||||
<link rel="stylesheet" href="../../../_static/css/theme.css" type="text/css" />
|
||||
|
||||
<link rel="stylesheet" href="../../../_static/css/theme.css" type="text/css" />
|
||||
<link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" />
|
||||
<link rel="index" title="Index" href="../../../genindex.html" />
|
||||
<link rel="search" title="Search" href="../../../search.html" />
|
||||
@ -56,7 +57,7 @@
|
||||
|
||||
|
||||
<div class="version">
|
||||
29.10
|
||||
29.11
|
||||
</div>
|
||||
|
||||
|
||||
@ -1110,7 +1111,7 @@
|
||||
<script type="text/javascript">
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT:'../../../',
|
||||
VERSION:'29.10',
|
||||
VERSION:'29.11',
|
||||
LANGUAGE:'None',
|
||||
COLLAPSE_INDEX:false,
|
||||
FILE_SUFFIX:'.html',
|
||||
@ -1124,7 +1125,10 @@
|
||||
|
||||
|
||||
|
||||
<script type="text/javascript" src="../../../_static/js/theme.js"></script>
|
||||
|
||||
|
||||
<script type="text/javascript" src="../../../_static/js/theme.js"></script>
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
jQuery(function () {
|
||||
|
@ -8,7 +8,7 @@
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<title>pylorax.api.server — Lorax 29.10 documentation</title>
|
||||
<title>pylorax.api.server — Lorax 29.11 documentation</title>
|
||||
|
||||
|
||||
|
||||
@ -24,7 +24,8 @@
|
||||
|
||||
|
||||
|
||||
<link rel="stylesheet" href="../../../_static/css/theme.css" type="text/css" />
|
||||
|
||||
<link rel="stylesheet" href="../../../_static/css/theme.css" type="text/css" />
|
||||
<link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" />
|
||||
<link rel="index" title="Index" href="../../../genindex.html" />
|
||||
<link rel="search" title="Search" href="../../../search.html" />
|
||||
@ -56,7 +57,7 @@
|
||||
|
||||
|
||||
<div class="version">
|
||||
29.10
|
||||
29.11
|
||||
</div>
|
||||
|
||||
|
||||
@ -271,7 +272,7 @@
|
||||
<script type="text/javascript">
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT:'../../../',
|
||||
VERSION:'29.10',
|
||||
VERSION:'29.11',
|
||||
LANGUAGE:'None',
|
||||
COLLAPSE_INDEX:false,
|
||||
FILE_SUFFIX:'.html',
|
||||
@ -285,7 +286,10 @@
|
||||
|
||||
|
||||
|
||||
<script type="text/javascript" src="../../../_static/js/theme.js"></script>
|
||||
|
||||
|
||||
<script type="text/javascript" src="../../../_static/js/theme.js"></script>
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
jQuery(function () {
|
||||
|
269
docs/html/_modules/pylorax/api/timestamp.html
Normal file
269
docs/html/_modules/pylorax/api/timestamp.html
Normal file
@ -0,0 +1,269 @@
|
||||
|
||||
|
||||
<!DOCTYPE html>
|
||||
<!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]-->
|
||||
<!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]-->
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<title>pylorax.api.timestamp — Lorax 29.11 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.11
|
||||
</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.api.timestamp</li>
|
||||
|
||||
|
||||
<li class="wy-breadcrumbs-aside">
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
<hr/>
|
||||
</div>
|
||||
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
|
||||
<div itemprop="articleBody">
|
||||
|
||||
<h1>Source code for pylorax.api.timestamp</h1><div class="highlight"><pre>
|
||||
<span></span><span class="c1">#</span>
|
||||
<span class="c1"># Copyright (C) 2018 Red Hat, Inc.</span>
|
||||
<span class="c1">#</span>
|
||||
<span class="c1"># This program is free software; you can redistribute it and/or modify</span>
|
||||
<span class="c1"># it under the terms of the GNU General Public License as published by</span>
|
||||
<span class="c1"># the Free Software Foundation; either version 2 of the License, or</span>
|
||||
<span class="c1"># (at your option) any later version.</span>
|
||||
<span class="c1">#</span>
|
||||
<span class="c1"># This program is distributed in the hope that it will be useful,</span>
|
||||
<span class="c1"># but WITHOUT ANY WARRANTY; without even the implied warranty of</span>
|
||||
<span class="c1"># MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the</span>
|
||||
<span class="c1"># GNU General Public License for more details.</span>
|
||||
<span class="c1">#</span>
|
||||
<span class="c1"># You should have received a copy of the GNU General Public License</span>
|
||||
<span class="c1"># along with this program. If not, see <http://www.gnu.org/licenses/>.</span>
|
||||
<span class="c1">#</span>
|
||||
|
||||
<span class="kn">import</span> <span class="nn">pytoml</span> <span class="k">as</span> <span class="nn">toml</span>
|
||||
<span class="kn">import</span> <span class="nn">time</span>
|
||||
|
||||
<span class="kn">from</span> <span class="nn">pylorax.sysutils</span> <span class="k">import</span> <span class="n">joinpaths</span>
|
||||
|
||||
<span class="n">TS_CREATED</span> <span class="o">=</span> <span class="s2">"created"</span>
|
||||
<span class="n">TS_STARTED</span> <span class="o">=</span> <span class="s2">"started"</span>
|
||||
<span class="n">TS_FINISHED</span> <span class="o">=</span> <span class="s2">"finished"</span>
|
||||
|
||||
<div class="viewcode-block" id="write_timestamp"><a class="viewcode-back" href="../../../pylorax.api.html#pylorax.api.timestamp.write_timestamp">[docs]</a><span class="k">def</span> <span class="nf">write_timestamp</span><span class="p">(</span><span class="n">destdir</span><span class="p">,</span> <span class="n">ty</span><span class="p">):</span>
|
||||
<span class="n">path</span> <span class="o">=</span> <span class="n">joinpaths</span><span class="p">(</span><span class="n">destdir</span><span class="p">,</span> <span class="s2">"times.toml"</span><span class="p">)</span>
|
||||
|
||||
<span class="k">try</span><span class="p">:</span>
|
||||
<span class="n">contents</span> <span class="o">=</span> <span class="n">toml</span><span class="o">.</span><span class="n">loads</span><span class="p">(</span><span class="nb">open</span><span class="p">(</span><span class="n">path</span><span class="p">,</span> <span class="s2">"r"</span><span class="p">)</span><span class="o">.</span><span class="n">read</span><span class="p">())</span>
|
||||
<span class="k">except</span> <span class="ne">IOError</span><span class="p">:</span>
|
||||
<span class="n">contents</span> <span class="o">=</span> <span class="n">toml</span><span class="o">.</span><span class="n">loads</span><span class="p">(</span><span class="s2">""</span><span class="p">)</span>
|
||||
|
||||
<span class="k">if</span> <span class="n">ty</span> <span class="o">==</span> <span class="n">TS_CREATED</span><span class="p">:</span>
|
||||
<span class="n">contents</span><span class="p">[</span><span class="n">TS_CREATED</span><span class="p">]</span> <span class="o">=</span> <span class="n">time</span><span class="o">.</span><span class="n">time</span><span class="p">()</span>
|
||||
<span class="k">elif</span> <span class="n">ty</span> <span class="o">==</span> <span class="n">TS_STARTED</span><span class="p">:</span>
|
||||
<span class="n">contents</span><span class="p">[</span><span class="n">TS_STARTED</span><span class="p">]</span> <span class="o">=</span> <span class="n">time</span><span class="o">.</span><span class="n">time</span><span class="p">()</span>
|
||||
<span class="k">elif</span> <span class="n">ty</span> <span class="o">==</span> <span class="n">TS_FINISHED</span><span class="p">:</span>
|
||||
<span class="n">contents</span><span class="p">[</span><span class="n">TS_FINISHED</span><span class="p">]</span> <span class="o">=</span> <span class="n">time</span><span class="o">.</span><span class="n">time</span><span class="p">()</span>
|
||||
|
||||
<span class="k">with</span> <span class="nb">open</span><span class="p">(</span><span class="n">path</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">toml</span><span class="o">.</span><span class="n">dumps</span><span class="p">(</span><span class="n">contents</span><span class="p">))</span></div>
|
||||
|
||||
<div class="viewcode-block" id="timestamp_dict"><a class="viewcode-back" href="../../../pylorax.api.html#pylorax.api.timestamp.timestamp_dict">[docs]</a><span class="k">def</span> <span class="nf">timestamp_dict</span><span class="p">(</span><span class="n">destdir</span><span class="p">):</span>
|
||||
<span class="n">path</span> <span class="o">=</span> <span class="n">joinpaths</span><span class="p">(</span><span class="n">destdir</span><span class="p">,</span> <span class="s2">"times.toml"</span><span class="p">)</span>
|
||||
|
||||
<span class="k">try</span><span class="p">:</span>
|
||||
<span class="k">return</span> <span class="n">toml</span><span class="o">.</span><span class="n">loads</span><span class="p">(</span><span class="nb">open</span><span class="p">(</span><span class="n">path</span><span class="p">,</span> <span class="s2">"r"</span><span class="p">)</span><span class="o">.</span><span class="n">read</span><span class="p">())</span>
|
||||
<span class="k">except</span> <span class="ne">IOError</span><span class="p">:</span>
|
||||
<span class="k">return</span> <span class="n">toml</span><span class="o">.</span><span class="n">loads</span><span class="p">(</span><span class="s2">""</span><span class="p">)</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.11',
|
||||
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.api.v0 — Lorax 29.10 documentation</title>
|
||||
<title>pylorax.api.v0 — Lorax 29.11 documentation</title>
|
||||
|
||||
|
||||
|
||||
@ -24,7 +24,8 @@
|
||||
|
||||
|
||||
|
||||
<link rel="stylesheet" href="../../../_static/css/theme.css" type="text/css" />
|
||||
|
||||
<link rel="stylesheet" href="../../../_static/css/theme.css" type="text/css" />
|
||||
<link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" />
|
||||
<link rel="index" title="Index" href="../../../genindex.html" />
|
||||
<link rel="search" title="Search" href="../../../search.html" />
|
||||
@ -56,7 +57,7 @@
|
||||
|
||||
|
||||
<div class="version">
|
||||
29.10
|
||||
29.11
|
||||
</div>
|
||||
|
||||
|
||||
@ -883,14 +884,14 @@
|
||||
<span class="sd"> "id": "45502a6d-06e8-48a5-a215-2b4174b3614b",</span>
|
||||
<span class="sd"> "blueprint": "glusterfs",</span>
|
||||
<span class="sd"> "queue_status": "WAITING",</span>
|
||||
<span class="sd"> "timestamp": 1517362647.4570868,</span>
|
||||
<span class="sd"> "job_created": 1517362647.4570868,</span>
|
||||
<span class="sd"> "version": "0.0.6"</span>
|
||||
<span class="sd"> },</span>
|
||||
<span class="sd"> {</span>
|
||||
<span class="sd"> "id": "6d292bd0-bec7-4825-8d7d-41ef9c3e4b73",</span>
|
||||
<span class="sd"> "blueprint": "kubernetes",</span>
|
||||
<span class="sd"> "queue_status": "WAITING",</span>
|
||||
<span class="sd"> "timestamp": 1517362659.0034983,</span>
|
||||
<span class="sd"> "job_created": 1517362659.0034983,</span>
|
||||
<span class="sd"> "version": "0.0.1"</span>
|
||||
<span class="sd"> }</span>
|
||||
<span class="sd"> ],</span>
|
||||
@ -899,7 +900,8 @@
|
||||
<span class="sd"> "id": "745712b2-96db-44c0-8014-fe925c35e795",</span>
|
||||
<span class="sd"> "blueprint": "glusterfs",</span>
|
||||
<span class="sd"> "queue_status": "RUNNING",</span>
|
||||
<span class="sd"> "timestamp": 1517362633.7965999,</span>
|
||||
<span class="sd"> "job_created": 1517362633.7965999,</span>
|
||||
<span class="sd"> "job_started": 1517362633.8001345,</span>
|
||||
<span class="sd"> "version": "0.0.6"</span>
|
||||
<span class="sd"> }</span>
|
||||
<span class="sd"> ]</span>
|
||||
@ -918,14 +920,18 @@
|
||||
<span class="sd"> "id": "70b84195-9817-4b8a-af92-45e380f39894",</span>
|
||||
<span class="sd"> "blueprint": "glusterfs",</span>
|
||||
<span class="sd"> "queue_status": "FINISHED",</span>
|
||||
<span class="sd"> "timestamp": 1517351003.8210032,</span>
|
||||
<span class="sd"> "job_created": 1517351003.8210032,</span>
|
||||
<span class="sd"> "job_started": 1517351003.8230415,</span>
|
||||
<span class="sd"> "job_finished": 1517359234.1003145,</span>
|
||||
<span class="sd"> "version": "0.0.6"</span>
|
||||
<span class="sd"> },</span>
|
||||
<span class="sd"> {</span>
|
||||
<span class="sd"> "id": "e695affd-397f-4af9-9022-add2636e7459",</span>
|
||||
<span class="sd"> "blueprint": "glusterfs",</span>
|
||||
<span class="sd"> "queue_status": "FINISHED",</span>
|
||||
<span class="sd"> "timestamp": 1517362289.7193348,</span>
|
||||
<span class="sd"> "job_created": 1517362289.7193348,</span>
|
||||
<span class="sd"> "job_started": 1517362289.9751132,</span>
|
||||
<span class="sd"> "job_finished": 1517363500.1234567,</span>
|
||||
<span class="sd"> "version": "0.0.6"</span>
|
||||
<span class="sd"> }</span>
|
||||
<span class="sd"> ]</span>
|
||||
@ -944,7 +950,9 @@
|
||||
<span class="sd"> "id": "8c8435ef-d6bd-4c68-9bf1-a2ef832e6b1a",</span>
|
||||
<span class="sd"> "blueprint": "http-server",</span>
|
||||
<span class="sd"> "queue_status": "FAILED",</span>
|
||||
<span class="sd"> "timestamp": 1517523249.9301329,</span>
|
||||
<span class="sd"> "job_created": 1517523249.9301329,</span>
|
||||
<span class="sd"> "job_started": 1517523249.9314211,</span>
|
||||
<span class="sd"> "job_finished": 1517523255.5623411,</span>
|
||||
<span class="sd"> "version": "0.0.2"</span>
|
||||
<span class="sd"> }</span>
|
||||
<span class="sd"> ]</span>
|
||||
@ -963,14 +971,18 @@
|
||||
<span class="sd"> "id": "8c8435ef-d6bd-4c68-9bf1-a2ef832e6b1a",</span>
|
||||
<span class="sd"> "blueprint": "http-server",</span>
|
||||
<span class="sd"> "queue_status": "FINISHED",</span>
|
||||
<span class="sd"> "timestamp": 1517523644.2384307,</span>
|
||||
<span class="sd"> "job_created": 1517523644.2384307,</span>
|
||||
<span class="sd"> "job_started": 1517523644.2551234,</span>
|
||||
<span class="sd"> "job_finished": 1517523689.9864314,</span>
|
||||
<span class="sd"> "version": "0.0.2"</span>
|
||||
<span class="sd"> },</span>
|
||||
<span class="sd"> {</span>
|
||||
<span class="sd"> "id": "45502a6d-06e8-48a5-a215-2b4174b3614b",</span>
|
||||
<span class="sd"> "blueprint": "glusterfs",</span>
|
||||
<span class="sd"> "queue_status": "FINISHED",</span>
|
||||
<span class="sd"> "timestamp": 1517363442.188399,</span>
|
||||
<span class="sd"> "job_created": 1517363442.188399,</span>
|
||||
<span class="sd"> "job_started": 1517363442.325324,</span>
|
||||
<span class="sd"> "job_finished": 1517363451.653621,</span>
|
||||
<span class="sd"> "version": "0.0.6"</span>
|
||||
<span class="sd"> }</span>
|
||||
<span class="sd"> ]</span>
|
||||
@ -1125,16 +1137,19 @@
|
||||
<span class="kn">import</span> <span class="nn">pytoml</span> <span class="k">as</span> <span class="nn">toml</span>
|
||||
|
||||
<span class="kn">from</span> <span class="nn">pylorax.sysutils</span> <span class="k">import</span> <span class="n">joinpaths</span>
|
||||
<span class="kn">from</span> <span class="nn">pylorax.api.checkparams</span> <span class="k">import</span> <span class="n">checkparams</span>
|
||||
<span class="kn">from</span> <span class="nn">pylorax.api.compose</span> <span class="k">import</span> <span class="n">start_build</span><span class="p">,</span> <span class="n">compose_types</span>
|
||||
<span class="kn">from</span> <span class="nn">pylorax.api.crossdomain</span> <span class="k">import</span> <span class="n">crossdomain</span>
|
||||
<span class="kn">from</span> <span class="nn">pylorax.api.errors</span> <span class="k">import</span> <span class="o">*</span> <span class="c1"># pylint: disable=wildcard-import</span>
|
||||
<span class="kn">from</span> <span class="nn">pylorax.api.projects</span> <span class="k">import</span> <span class="n">projects_list</span><span class="p">,</span> <span class="n">projects_info</span><span class="p">,</span> <span class="n">projects_depsolve</span>
|
||||
<span class="kn">from</span> <span class="nn">pylorax.api.projects</span> <span class="k">import</span> <span class="n">modules_list</span><span class="p">,</span> <span class="n">modules_info</span><span class="p">,</span> <span class="n">ProjectsError</span><span class="p">,</span> <span class="n">repo_to_source</span>
|
||||
<span class="kn">from</span> <span class="nn">pylorax.api.projects</span> <span class="k">import</span> <span class="n">get_repo_sources</span><span class="p">,</span> <span class="n">delete_repo_source</span><span class="p">,</span> <span class="n">source_to_repo</span><span class="p">,</span> <span class="n">dnf_repo_to_file_repo</span>
|
||||
<span class="kn">from</span> <span class="nn">pylorax.api.queue</span> <span class="k">import</span> <span class="n">queue_status</span><span class="p">,</span> <span class="n">build_status</span><span class="p">,</span> <span class="n">uuid_delete</span><span class="p">,</span> <span class="n">uuid_status</span><span class="p">,</span> <span class="n">uuid_info</span>
|
||||
<span class="kn">from</span> <span class="nn">pylorax.api.queue</span> <span class="k">import</span> <span class="n">uuid_tar</span><span class="p">,</span> <span class="n">uuid_image</span><span class="p">,</span> <span class="n">uuid_cancel</span><span class="p">,</span> <span class="n">uuid_log</span>
|
||||
<span class="kn">from</span> <span class="nn">pylorax.api.recipes</span> <span class="k">import</span> <span class="n">list_branch_files</span><span class="p">,</span> <span class="n">read_recipe_commit</span><span class="p">,</span> <span class="n">recipe_filename</span><span class="p">,</span> <span class="n">list_commits</span>
|
||||
<span class="kn">from</span> <span class="nn">pylorax.api.recipes</span> <span class="k">import</span> <span class="n">RecipeError</span><span class="p">,</span> <span class="n">list_branch_files</span><span class="p">,</span> <span class="n">read_recipe_commit</span><span class="p">,</span> <span class="n">recipe_filename</span><span class="p">,</span> <span class="n">list_commits</span>
|
||||
<span class="kn">from</span> <span class="nn">pylorax.api.recipes</span> <span class="k">import</span> <span class="n">recipe_from_dict</span><span class="p">,</span> <span class="n">recipe_from_toml</span><span class="p">,</span> <span class="n">commit_recipe</span><span class="p">,</span> <span class="n">delete_recipe</span><span class="p">,</span> <span class="n">revert_recipe</span>
|
||||
<span class="kn">from</span> <span class="nn">pylorax.api.recipes</span> <span class="k">import</span> <span class="n">tag_recipe_commit</span><span class="p">,</span> <span class="n">recipe_diff</span>
|
||||
<span class="kn">from</span> <span class="nn">pylorax.api.regexes</span> <span class="k">import</span> <span class="n">VALID_API_STRING</span>
|
||||
<span class="kn">from</span> <span class="nn">pylorax.api.workspace</span> <span class="k">import</span> <span class="n">workspace_read</span><span class="p">,</span> <span class="n">workspace_write</span><span class="p">,</span> <span class="n">workspace_delete</span>
|
||||
|
||||
<span class="c1"># The API functions don't actually get called by any code here</span>
|
||||
@ -1153,6 +1168,15 @@
|
||||
<span class="sd"> """</span>
|
||||
<span class="k">return</span> <span class="n">iterable</span><span class="p">[</span><span class="n">offset</span><span class="p">:][:</span><span class="n">limit</span><span class="p">]</span></div>
|
||||
|
||||
<div class="viewcode-block" id="blueprint_exists"><a class="viewcode-back" href="../../../pylorax.api.html#pylorax.api.v0.blueprint_exists">[docs]</a><span class="k">def</span> <span class="nf">blueprint_exists</span><span class="p">(</span><span class="n">api</span><span class="p">,</span> <span class="n">branch</span><span class="p">,</span> <span class="n">blueprint_name</span><span class="p">):</span>
|
||||
<span class="k">try</span><span class="p">:</span>
|
||||
<span class="k">with</span> <span class="n">api</span><span class="o">.</span><span class="n">config</span><span class="p">[</span><span class="s2">"GITLOCK"</span><span class="p">]</span><span class="o">.</span><span class="n">lock</span><span class="p">:</span>
|
||||
<span class="n">read_recipe_commit</span><span class="p">(</span><span class="n">api</span><span class="o">.</span><span class="n">config</span><span class="p">[</span><span class="s2">"GITLOCK"</span><span class="p">]</span><span class="o">.</span><span class="n">repo</span><span class="p">,</span> <span class="n">branch</span><span class="p">,</span> <span class="n">blueprint_name</span><span class="p">)</span>
|
||||
|
||||
<span class="k">return</span> <span class="kc">True</span>
|
||||
<span class="k">except</span> <span class="n">RecipeError</span><span class="p">:</span>
|
||||
<span class="k">return</span> <span class="kc">False</span></div>
|
||||
|
||||
<div class="viewcode-block" id="v0_api"><a class="viewcode-back" href="../../../pylorax.api.html#pylorax.api.v0.v0_api">[docs]</a><span class="k">def</span> <span class="nf">v0_api</span><span class="p">(</span><span class="n">api</span><span class="p">):</span>
|
||||
<span class="c1"># Note that Sphinx will not generate documentations for any of these.</span>
|
||||
<span class="nd">@api</span><span class="o">.</span><span class="n">route</span><span class="p">(</span><span class="s2">"/api/v0/blueprints/list"</span><span class="p">)</span>
|
||||
@ -1160,22 +1184,36 @@
|
||||
<span class="k">def</span> <span class="nf">v0_blueprints_list</span><span class="p">():</span>
|
||||
<span class="sd">"""List the available blueprints on a branch."""</span>
|
||||
<span class="n">branch</span> <span class="o">=</span> <span class="n">request</span><span class="o">.</span><span class="n">args</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">"branch"</span><span class="p">,</span> <span class="s2">"master"</span><span class="p">)</span>
|
||||
<span class="k">if</span> <span class="n">VALID_API_STRING</span><span class="o">.</span><span class="n">match</span><span class="p">(</span><span class="n">branch</span><span class="p">)</span> <span class="ow">is</span> <span class="kc">None</span><span class="p">:</span>
|
||||
<span class="k">return</span> <span class="n">jsonify</span><span class="p">(</span><span class="n">status</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="n">errors</span><span class="o">=</span><span class="p">[{</span><span class="s2">"id"</span><span class="p">:</span> <span class="n">INVALID_CHARS</span><span class="p">,</span> <span class="s2">"msg"</span><span class="p">:</span> <span class="s2">"Invalid characters in branch argument"</span><span class="p">}]),</span> <span class="mi">400</span>
|
||||
|
||||
<span class="k">try</span><span class="p">:</span>
|
||||
<span class="n">limit</span> <span class="o">=</span> <span class="nb">int</span><span class="p">(</span><span class="n">request</span><span class="o">.</span><span class="n">args</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">"limit"</span><span class="p">,</span> <span class="s2">"20"</span><span class="p">))</span>
|
||||
<span class="n">offset</span> <span class="o">=</span> <span class="nb">int</span><span class="p">(</span><span class="n">request</span><span class="o">.</span><span class="n">args</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">"offset"</span><span class="p">,</span> <span class="s2">"0"</span><span class="p">))</span>
|
||||
<span class="k">except</span> <span class="ne">ValueError</span> <span class="k">as</span> <span class="n">e</span><span class="p">:</span>
|
||||
<span class="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="p">[</span><span class="nb">str</span><span class="p">(</span><span class="n">e</span><span class="p">)]),</span> <span class="mi">400</span>
|
||||
<span class="k">return</span> <span class="n">jsonify</span><span class="p">(</span><span class="n">status</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="n">errors</span><span class="o">=</span><span class="p">[{</span><span class="s2">"id"</span><span class="p">:</span> <span class="n">BAD_LIMIT_OR_OFFSET</span><span class="p">,</span> <span class="s2">"msg"</span><span class="p">:</span> <span class="nb">str</span><span class="p">(</span><span class="n">e</span><span class="p">)}]),</span> <span class="mi">400</span>
|
||||
|
||||
<span class="k">with</span> <span class="n">api</span><span class="o">.</span><span class="n">config</span><span class="p">[</span><span class="s2">"GITLOCK"</span><span class="p">]</span><span class="o">.</span><span class="n">lock</span><span class="p">:</span>
|
||||
<span class="n">blueprints</span> <span class="o">=</span> <span class="n">take_limits</span><span class="p">([</span><span class="n">f</span><span class="p">[:</span><span class="o">-</span><span class="mi">5</span><span class="p">]</span> <span class="k">for</span> <span class="n">f</span> <span class="ow">in</span> <span class="n">list_branch_files</span><span class="p">(</span><span class="n">api</span><span class="o">.</span><span class="n">config</span><span class="p">[</span><span class="s2">"GITLOCK"</span><span class="p">]</span><span class="o">.</span><span class="n">repo</span><span class="p">,</span> <span class="n">branch</span><span class="p">)],</span> <span class="n">offset</span><span class="p">,</span> <span class="n">limit</span><span class="p">)</span>
|
||||
<span class="k">return</span> <span class="n">jsonify</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">limit</span><span class="o">=</span><span class="n">limit</span><span class="p">,</span> <span class="n">offset</span><span class="o">=</span><span class="n">offset</span><span class="p">,</span> <span class="n">total</span><span class="o">=</span><span class="nb">len</span><span class="p">(</span><span class="n">blueprints</span><span class="p">))</span>
|
||||
|
||||
<span class="nd">@api</span><span class="o">.</span><span class="n">route</span><span class="p">(</span><span class="s2">"/api/v0/blueprints/info"</span><span class="p">,</span> <span class="n">defaults</span><span class="o">=</span><span class="p">{</span><span class="s1">'blueprint_names'</span><span class="p">:</span> <span class="s2">""</span><span class="p">})</span>
|
||||
<span class="nd">@api</span><span class="o">.</span><span class="n">route</span><span class="p">(</span><span class="s2">"/api/v0/blueprints/info/<blueprint_names>"</span><span class="p">)</span>
|
||||
<span class="nd">@crossdomain</span><span class="p">(</span><span class="n">origin</span><span class="o">=</span><span class="s2">"*"</span><span class="p">)</span>
|
||||
<span class="nd">@checkparams</span><span class="p">([(</span><span class="s2">"blueprint_names"</span><span class="p">,</span> <span class="s2">""</span><span class="p">,</span> <span class="s2">"no blueprint names given"</span><span class="p">)])</span>
|
||||
<span class="k">def</span> <span class="nf">v0_blueprints_info</span><span class="p">(</span><span class="n">blueprint_names</span><span class="p">):</span>
|
||||
<span class="sd">"""Return the contents of the blueprint, or a list of blueprints"""</span>
|
||||
<span class="k">if</span> <span class="n">VALID_API_STRING</span><span class="o">.</span><span class="n">match</span><span class="p">(</span><span class="n">blueprint_names</span><span class="p">)</span> <span class="ow">is</span> <span class="kc">None</span><span class="p">:</span>
|
||||
<span class="k">return</span> <span class="n">jsonify</span><span class="p">(</span><span class="n">status</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="n">errors</span><span class="o">=</span><span class="p">[{</span><span class="s2">"id"</span><span class="p">:</span> <span class="n">INVALID_CHARS</span><span class="p">,</span> <span class="s2">"msg"</span><span class="p">:</span> <span class="s2">"Invalid characters in API path"</span><span class="p">}]),</span> <span class="mi">400</span>
|
||||
|
||||
<span class="n">branch</span> <span class="o">=</span> <span class="n">request</span><span class="o">.</span><span class="n">args</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">"branch"</span><span class="p">,</span> <span class="s2">"master"</span><span class="p">)</span>
|
||||
<span class="k">if</span> <span class="n">VALID_API_STRING</span><span class="o">.</span><span class="n">match</span><span class="p">(</span><span class="n">branch</span><span class="p">)</span> <span class="ow">is</span> <span class="kc">None</span><span class="p">:</span>
|
||||
<span class="k">return</span> <span class="n">jsonify</span><span class="p">(</span><span class="n">status</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="n">errors</span><span class="o">=</span><span class="p">[{</span><span class="s2">"id"</span><span class="p">:</span> <span class="n">INVALID_CHARS</span><span class="p">,</span> <span class="s2">"msg"</span><span class="p">:</span> <span class="s2">"Invalid characters in branch argument"</span><span class="p">}]),</span> <span class="mi">400</span>
|
||||
|
||||
<span class="n">out_fmt</span> <span class="o">=</span> <span class="n">request</span><span class="o">.</span><span class="n">args</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">"format"</span><span class="p">,</span> <span class="s2">"json"</span><span class="p">)</span>
|
||||
<span class="k">if</span> <span class="n">VALID_API_STRING</span><span class="o">.</span><span class="n">match</span><span class="p">(</span><span class="n">out_fmt</span><span class="p">)</span> <span class="ow">is</span> <span class="kc">None</span><span class="p">:</span>
|
||||
<span class="k">return</span> <span class="n">jsonify</span><span class="p">(</span><span class="n">status</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="n">errors</span><span class="o">=</span><span class="p">[{</span><span class="s2">"id"</span><span class="p">:</span> <span class="n">INVALID_CHARS</span><span class="p">,</span> <span class="s2">"msg"</span><span class="p">:</span> <span class="s2">"Invalid characters in format argument"</span><span class="p">}]),</span> <span class="mi">400</span>
|
||||
|
||||
<span class="n">blueprints</span> <span class="o">=</span> <span class="p">[]</span>
|
||||
<span class="n">changes</span> <span class="o">=</span> <span class="p">[]</span>
|
||||
<span class="n">errors</span> <span class="o">=</span> <span class="p">[]</span>
|
||||
@ -1201,7 +1239,7 @@
|
||||
|
||||
<span class="k">if</span> <span class="ow">not</span> <span class="n">ws_blueprint</span> <span class="ow">and</span> <span class="ow">not</span> <span class="n">git_blueprint</span><span class="p">:</span>
|
||||
<span class="c1"># Neither blueprint, return an error</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">: </span><span class="si">%s</span><span class="s2">"</span> <span class="o">%</span> <span class="p">(</span><span class="n">blueprint_name</span><span class="p">,</span> <span class="s2">", "</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="n">exceptions</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">"id"</span><span class="p">:</span> <span class="n">UNKNOWN_BLUEPRINT</span><span class="p">,</span> <span class="s2">"msg"</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">blueprint_name</span><span class="p">,</span> <span class="s2">", "</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="n">exceptions</span><span class="p">))})</span>
|
||||
<span class="k">elif</span> <span class="n">ws_blueprint</span> <span class="ow">and</span> <span class="ow">not</span> <span class="n">git_blueprint</span><span class="p">:</span>
|
||||
<span class="c1"># No git blueprint, return the workspace blueprint</span>
|
||||
<span class="n">changes</span><span class="o">.</span><span class="n">append</span><span class="p">({</span><span class="s2">"name"</span><span class="p">:</span><span class="n">blueprint_name</span><span class="p">,</span> <span class="s2">"changed"</span><span class="p">:</span><span class="kc">True</span><span class="p">})</span>
|
||||
@ -1218,7 +1256,6 @@
|
||||
<span class="c1"># Sort all the results by case-insensitive blueprint name</span>
|
||||
<span class="n">changes</span> <span class="o">=</span> <span class="nb">sorted</span><span class="p">(</span><span class="n">changes</span><span class="p">,</span> <span class="n">key</span><span class="o">=</span><span class="k">lambda</span> <span class="n">c</span><span class="p">:</span> <span class="n">c</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="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="n">errors</span> <span class="o">=</span> <span class="nb">sorted</span><span class="p">(</span><span class="n">errors</span><span class="p">,</span> <span class="n">key</span><span class="o">=</span><span class="k">lambda</span> <span class="n">e</span><span class="p">:</span> <span class="n">e</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>
|
||||
@ -1226,32 +1263,44 @@
|
||||
<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>
|
||||
|
||||
<span class="nd">@api</span><span class="o">.</span><span class="n">route</span><span class="p">(</span><span class="s2">"/api/v0/blueprints/changes"</span><span class="p">,</span> <span class="n">defaults</span><span class="o">=</span><span class="p">{</span><span class="s1">'blueprint_names'</span><span class="p">:</span> <span class="s2">""</span><span class="p">})</span>
|
||||
<span class="nd">@api</span><span class="o">.</span><span class="n">route</span><span class="p">(</span><span class="s2">"/api/v0/blueprints/changes/<blueprint_names>"</span><span class="p">)</span>
|
||||
<span class="nd">@crossdomain</span><span class="p">(</span><span class="n">origin</span><span class="o">=</span><span class="s2">"*"</span><span class="p">)</span>
|
||||
<span class="nd">@checkparams</span><span class="p">([(</span><span class="s2">"blueprint_names"</span><span class="p">,</span> <span class="s2">""</span><span class="p">,</span> <span class="s2">"no blueprint names given"</span><span class="p">)])</span>
|
||||
<span class="k">def</span> <span class="nf">v0_blueprints_changes</span><span class="p">(</span><span class="n">blueprint_names</span><span class="p">):</span>
|
||||
<span class="sd">"""Return the changes to a blueprint or list of blueprints"""</span>
|
||||
<span class="k">if</span> <span class="n">VALID_API_STRING</span><span class="o">.</span><span class="n">match</span><span class="p">(</span><span class="n">blueprint_names</span><span class="p">)</span> <span class="ow">is</span> <span class="kc">None</span><span class="p">:</span>
|
||||
<span class="k">return</span> <span class="n">jsonify</span><span class="p">(</span><span class="n">status</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="n">errors</span><span class="o">=</span><span class="p">[{</span><span class="s2">"id"</span><span class="p">:</span> <span class="n">INVALID_CHARS</span><span class="p">,</span> <span class="s2">"msg"</span><span class="p">:</span> <span class="s2">"Invalid characters in API path"</span><span class="p">}]),</span> <span class="mi">400</span>
|
||||
|
||||
<span class="n">branch</span> <span class="o">=</span> <span class="n">request</span><span class="o">.</span><span class="n">args</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">"branch"</span><span class="p">,</span> <span class="s2">"master"</span><span class="p">)</span>
|
||||
<span class="k">if</span> <span class="n">VALID_API_STRING</span><span class="o">.</span><span class="n">match</span><span class="p">(</span><span class="n">branch</span><span class="p">)</span> <span class="ow">is</span> <span class="kc">None</span><span class="p">:</span>
|
||||
<span class="k">return</span> <span class="n">jsonify</span><span class="p">(</span><span class="n">status</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="n">errors</span><span class="o">=</span><span class="p">[{</span><span class="s2">"id"</span><span class="p">:</span> <span class="n">INVALID_CHARS</span><span class="p">,</span> <span class="s2">"msg"</span><span class="p">:</span> <span class="s2">"Invalid characters in branch argument"</span><span class="p">}]),</span> <span class="mi">400</span>
|
||||
|
||||
<span class="k">try</span><span class="p">:</span>
|
||||
<span class="n">limit</span> <span class="o">=</span> <span class="nb">int</span><span class="p">(</span><span class="n">request</span><span class="o">.</span><span class="n">args</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">"limit"</span><span class="p">,</span> <span class="s2">"20"</span><span class="p">))</span>
|
||||
<span class="n">offset</span> <span class="o">=</span> <span class="nb">int</span><span class="p">(</span><span class="n">request</span><span class="o">.</span><span class="n">args</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">"offset"</span><span class="p">,</span> <span class="s2">"0"</span><span class="p">))</span>
|
||||
<span class="k">except</span> <span class="ne">ValueError</span> <span class="k">as</span> <span class="n">e</span><span class="p">:</span>
|
||||
<span class="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="p">[</span><span class="nb">str</span><span class="p">(</span><span class="n">e</span><span class="p">)]),</span> <span class="mi">400</span>
|
||||
<span class="k">return</span> <span class="n">jsonify</span><span class="p">(</span><span class="n">status</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="n">errors</span><span class="o">=</span><span class="p">[{</span><span class="s2">"id"</span><span class="p">:</span> <span class="n">BAD_LIMIT_OR_OFFSET</span><span class="p">,</span> <span class="s2">"msg"</span><span class="p">:</span> <span class="nb">str</span><span class="p">(</span><span class="n">e</span><span class="p">)}]),</span> <span class="mi">400</span>
|
||||
|
||||
<span class="n">blueprints</span> <span class="o">=</span> <span class="p">[]</span>
|
||||
<span class="n">errors</span> <span class="o">=</span> <span class="p">[]</span>
|
||||
<span class="k">for</span> <span class="n">blueprint_name</span> <span class="ow">in</span> <span class="p">[</span><span class="n">n</span><span class="o">.</span><span class="n">strip</span><span class="p">()</span> <span class="k">for</span> <span class="n">n</span> <span class="ow">in</span> <span class="n">blueprint_names</span><span class="o">.</span><span class="n">split</span><span class="p">(</span><span class="s2">","</span><span class="p">)]:</span>
|
||||
<span class="n">filename</span> <span class="o">=</span> <span class="n">recipe_filename</span><span class="p">(</span><span class="n">blueprint_name</span><span class="p">)</span>
|
||||
|
||||
<span class="k">if</span> <span class="ow">not</span> <span class="n">blueprint_exists</span><span class="p">(</span><span class="n">api</span><span class="p">,</span> <span class="n">branch</span><span class="p">,</span> <span class="n">blueprint_name</span><span class="p">):</span>
|
||||
<span class="n">errors</span><span class="o">.</span><span class="n">append</span><span class="p">({</span><span class="s2">"id"</span><span class="p">:</span> <span class="n">UNKNOWN_BLUEPRINT</span><span class="p">,</span> <span class="s2">"msg"</span><span class="p">:</span> <span class="s2">"Unknown blueprint name: </span><span class="si">%s</span><span class="s2">"</span> <span class="o">%</span> <span class="n">blueprint_name</span><span class="p">})</span>
|
||||
<span class="k">continue</span>
|
||||
|
||||
<span class="k">try</span><span class="p">:</span>
|
||||
<span class="k">with</span> <span class="n">api</span><span class="o">.</span><span class="n">config</span><span class="p">[</span><span class="s2">"GITLOCK"</span><span class="p">]</span><span class="o">.</span><span class="n">lock</span><span class="p">:</span>
|
||||
<span class="n">commits</span> <span class="o">=</span> <span class="n">take_limits</span><span class="p">(</span><span class="n">list_commits</span><span class="p">(</span><span class="n">api</span><span class="o">.</span><span class="n">config</span><span class="p">[</span><span class="s2">"GITLOCK"</span><span class="p">]</span><span class="o">.</span><span class="n">repo</span><span class="p">,</span> <span class="n">branch</span><span class="p">,</span> <span class="n">filename</span><span class="p">),</span> <span class="n">offset</span><span class="p">,</span> <span class="n">limit</span><span class="p">)</span>
|
||||
<span class="k">except</span> <span class="ne">Exception</span> <span class="k">as</span> <span class="n">e</span><span class="p">:</span>
|
||||
<span class="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">: </span><span class="si">%s</span><span class="s2">"</span> <span class="o">%</span> <span class="p">(</span><span class="n">blueprint_name</span><span class="p">,</span> <span class="nb">str</span><span class="p">(</span><span class="n">e</span><span class="p">)))</span>
|
||||
<span class="n">errors</span><span class="o">.</span><span class="n">append</span><span class="p">({</span><span class="s2">"id"</span><span class="p">:</span> <span class="n">BLUEPRINTS_ERROR</span><span class="p">,</span> <span class="s2">"msg"</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">blueprint_name</span><span class="p">,</span> <span class="nb">str</span><span class="p">(</span><span class="n">e</span><span class="p">))})</span>
|
||||
<span class="n">log</span><span class="o">.</span><span class="n">error</span><span class="p">(</span><span class="s2">"(v0_blueprints_changes) </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="n">blueprints</span><span class="o">.</span><span class="n">append</span><span class="p">({</span><span class="s2">"name"</span><span class="p">:</span><span class="n">blueprint_name</span><span class="p">,</span> <span class="s2">"changes"</span><span class="p">:</span><span class="n">commits</span><span class="p">,</span> <span class="s2">"total"</span><span class="p">:</span><span class="nb">len</span><span class="p">(</span><span class="n">commits</span><span class="p">)})</span>
|
||||
|
||||
<span class="n">blueprints</span> <span class="o">=</span> <span class="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="n">errors</span> <span class="o">=</span> <span class="nb">sorted</span><span class="p">(</span><span class="n">errors</span><span class="p">,</span> <span class="n">key</span><span class="o">=</span><span class="k">lambda</span> <span class="n">e</span><span class="p">:</span> <span class="n">e</span><span class="o">.</span><span class="n">lower</span><span class="p">())</span>
|
||||
|
||||
<span class="k">return</span> <span class="n">jsonify</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> <span class="n">offset</span><span class="o">=</span><span class="n">offset</span><span class="p">,</span> <span class="n">limit</span><span class="o">=</span><span class="n">limit</span><span class="p">)</span>
|
||||
|
||||
@ -1260,12 +1309,18 @@
|
||||
<span class="k">def</span> <span class="nf">v0_blueprints_new</span><span class="p">():</span>
|
||||
<span class="sd">"""Commit a new blueprint"""</span>
|
||||
<span class="n">branch</span> <span class="o">=</span> <span class="n">request</span><span class="o">.</span><span class="n">args</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">"branch"</span><span class="p">,</span> <span class="s2">"master"</span><span class="p">)</span>
|
||||
<span class="k">if</span> <span class="n">VALID_API_STRING</span><span class="o">.</span><span class="n">match</span><span class="p">(</span><span class="n">branch</span><span class="p">)</span> <span class="ow">is</span> <span class="kc">None</span><span class="p">:</span>
|
||||
<span class="k">return</span> <span class="n">jsonify</span><span class="p">(</span><span class="n">status</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="n">errors</span><span class="o">=</span><span class="p">[{</span><span class="s2">"id"</span><span class="p">:</span> <span class="n">INVALID_CHARS</span><span class="p">,</span> <span class="s2">"msg"</span><span class="p">:</span> <span class="s2">"Invalid characters in branch argument"</span><span class="p">}]),</span> <span class="mi">400</span>
|
||||
|
||||
<span class="k">try</span><span class="p">:</span>
|
||||
<span class="k">if</span> <span class="n">request</span><span class="o">.</span><span class="n">headers</span><span class="p">[</span><span class="s1">'Content-Type'</span><span class="p">]</span> <span class="o">==</span> <span class="s2">"text/x-toml"</span><span class="p">:</span>
|
||||
<span class="n">blueprint</span> <span class="o">=</span> <span class="n">recipe_from_toml</span><span class="p">(</span><span class="n">request</span><span class="o">.</span><span class="n">data</span><span class="p">)</span>
|
||||
<span class="k">else</span><span class="p">:</span>
|
||||
<span class="n">blueprint</span> <span class="o">=</span> <span class="n">recipe_from_dict</span><span class="p">(</span><span class="n">request</span><span class="o">.</span><span class="n">get_json</span><span class="p">(</span><span class="n">cache</span><span class="o">=</span><span class="kc">False</span><span class="p">))</span>
|
||||
|
||||
<span class="k">if</span> <span class="n">VALID_API_STRING</span><span class="o">.</span><span class="n">match</span><span class="p">(</span><span class="n">blueprint</span><span class="p">[</span><span class="s2">"name"</span><span class="p">])</span> <span class="ow">is</span> <span class="kc">None</span><span class="p">:</span>
|
||||
<span class="k">return</span> <span class="n">jsonify</span><span class="p">(</span><span class="n">status</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="n">errors</span><span class="o">=</span><span class="p">[{</span><span class="s2">"id"</span><span class="p">:</span> <span class="n">INVALID_CHARS</span><span class="p">,</span> <span class="s2">"msg"</span><span class="p">:</span> <span class="s2">"Invalid characters in API path"</span><span class="p">}]),</span> <span class="mi">400</span>
|
||||
|
||||
<span class="k">with</span> <span class="n">api</span><span class="o">.</span><span class="n">config</span><span class="p">[</span><span class="s2">"GITLOCK"</span><span class="p">]</span><span class="o">.</span><span class="n">lock</span><span class="p">:</span>
|
||||
<span class="n">commit_recipe</span><span class="p">(</span><span class="n">api</span><span class="o">.</span><span class="n">config</span><span class="p">[</span><span class="s2">"GITLOCK"</span><span class="p">]</span><span class="o">.</span><span class="n">repo</span><span class="p">,</span> <span class="n">branch</span><span class="p">,</span> <span class="n">blueprint</span><span class="p">)</span>
|
||||
|
||||
@ -1274,21 +1329,29 @@
|
||||
<span class="n">workspace_write</span><span class="p">(</span><span class="n">api</span><span class="o">.</span><span class="n">config</span><span class="p">[</span><span class="s2">"GITLOCK"</span><span class="p">]</span><span class="o">.</span><span class="n">repo</span><span class="p">,</span> <span class="n">branch</span><span class="p">,</span> <span class="n">blueprint</span><span class="p">)</span>
|
||||
<span class="k">except</span> <span class="ne">Exception</span> <span class="k">as</span> <span class="n">e</span><span class="p">:</span>
|
||||
<span class="n">log</span><span class="o">.</span><span class="n">error</span><span class="p">(</span><span class="s2">"(v0_blueprints_new) </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">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="p">[</span><span class="nb">str</span><span class="p">(</span><span class="n">e</span><span class="p">)]),</span> <span class="mi">400</span>
|
||||
<span class="k">return</span> <span class="n">jsonify</span><span class="p">(</span><span class="n">status</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="n">errors</span><span class="o">=</span><span class="p">[{</span><span class="s2">"id"</span><span class="p">:</span> <span class="n">BLUEPRINTS_ERROR</span><span class="p">,</span> <span class="s2">"msg"</span><span class="p">:</span> <span class="nb">str</span><span class="p">(</span><span class="n">e</span><span class="p">)}]),</span> <span class="mi">400</span>
|
||||
<span class="k">else</span><span class="p">:</span>
|
||||
<span class="k">return</span> <span class="n">jsonify</span><span class="p">(</span><span class="n">status</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span>
|
||||
|
||||
<span class="nd">@api</span><span class="o">.</span><span class="n">route</span><span class="p">(</span><span class="s2">"/api/v0/blueprints/delete"</span><span class="p">,</span> <span class="n">defaults</span><span class="o">=</span><span class="p">{</span><span class="s1">'blueprint_name'</span><span class="p">:</span> <span class="s2">""</span><span class="p">},</span> <span class="n">methods</span><span class="o">=</span><span class="p">[</span><span class="s2">"DELETE"</span><span class="p">])</span>
|
||||
<span class="nd">@api</span><span class="o">.</span><span class="n">route</span><span class="p">(</span><span class="s2">"/api/v0/blueprints/delete/<blueprint_name>"</span><span class="p">,</span> <span class="n">methods</span><span class="o">=</span><span class="p">[</span><span class="s2">"DELETE"</span><span class="p">])</span>
|
||||
<span class="nd">@crossdomain</span><span class="p">(</span><span class="n">origin</span><span class="o">=</span><span class="s2">"*"</span><span class="p">)</span>
|
||||
<span class="nd">@checkparams</span><span class="p">([(</span><span class="s2">"blueprint_name"</span><span class="p">,</span> <span class="s2">""</span><span class="p">,</span> <span class="s2">"no blueprint name given"</span><span class="p">)])</span>
|
||||
<span class="k">def</span> <span class="nf">v0_blueprints_delete</span><span class="p">(</span><span class="n">blueprint_name</span><span class="p">):</span>
|
||||
<span class="sd">"""Delete a blueprint from git"""</span>
|
||||
<span class="k">if</span> <span class="n">VALID_API_STRING</span><span class="o">.</span><span class="n">match</span><span class="p">(</span><span class="n">blueprint_name</span><span class="p">)</span> <span class="ow">is</span> <span class="kc">None</span><span class="p">:</span>
|
||||
<span class="k">return</span> <span class="n">jsonify</span><span class="p">(</span><span class="n">status</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="n">errors</span><span class="o">=</span><span class="p">[{</span><span class="s2">"id"</span><span class="p">:</span> <span class="n">INVALID_CHARS</span><span class="p">,</span> <span class="s2">"msg"</span><span class="p">:</span> <span class="s2">"Invalid characters in API path"</span><span class="p">}]),</span> <span class="mi">400</span>
|
||||
|
||||
<span class="n">branch</span> <span class="o">=</span> <span class="n">request</span><span class="o">.</span><span class="n">args</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">"branch"</span><span class="p">,</span> <span class="s2">"master"</span><span class="p">)</span>
|
||||
<span class="k">if</span> <span class="n">VALID_API_STRING</span><span class="o">.</span><span class="n">match</span><span class="p">(</span><span class="n">branch</span><span class="p">)</span> <span class="ow">is</span> <span class="kc">None</span><span class="p">:</span>
|
||||
<span class="k">return</span> <span class="n">jsonify</span><span class="p">(</span><span class="n">status</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="n">errors</span><span class="o">=</span><span class="p">[{</span><span class="s2">"id"</span><span class="p">:</span> <span class="n">INVALID_CHARS</span><span class="p">,</span> <span class="s2">"msg"</span><span class="p">:</span> <span class="s2">"Invalid characters in branch argument"</span><span class="p">}]),</span> <span class="mi">400</span>
|
||||
|
||||
<span class="k">try</span><span class="p">:</span>
|
||||
<span class="k">with</span> <span class="n">api</span><span class="o">.</span><span class="n">config</span><span class="p">[</span><span class="s2">"GITLOCK"</span><span class="p">]</span><span class="o">.</span><span class="n">lock</span><span class="p">:</span>
|
||||
<span class="n">delete_recipe</span><span class="p">(</span><span class="n">api</span><span class="o">.</span><span class="n">config</span><span class="p">[</span><span class="s2">"GITLOCK"</span><span class="p">]</span><span class="o">.</span><span class="n">repo</span><span class="p">,</span> <span class="n">branch</span><span class="p">,</span> <span class="n">blueprint_name</span><span class="p">)</span>
|
||||
<span class="k">except</span> <span class="ne">Exception</span> <span class="k">as</span> <span class="n">e</span><span class="p">:</span>
|
||||
<span class="n">log</span><span class="o">.</span><span class="n">error</span><span class="p">(</span><span class="s2">"(v0_blueprints_delete) </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">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="p">[</span><span class="nb">str</span><span class="p">(</span><span class="n">e</span><span class="p">)]),</span> <span class="mi">400</span>
|
||||
<span class="k">return</span> <span class="n">jsonify</span><span class="p">(</span><span class="n">status</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="n">errors</span><span class="o">=</span><span class="p">[{</span><span class="s2">"id"</span><span class="p">:</span> <span class="n">BLUEPRINTS_ERROR</span><span class="p">,</span> <span class="s2">"msg"</span><span class="p">:</span> <span class="nb">str</span><span class="p">(</span><span class="n">e</span><span class="p">)}]),</span> <span class="mi">400</span>
|
||||
<span class="k">else</span><span class="p">:</span>
|
||||
<span class="k">return</span> <span class="n">jsonify</span><span class="p">(</span><span class="n">status</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span>
|
||||
|
||||
@ -1297,39 +1360,63 @@
|
||||
<span class="k">def</span> <span class="nf">v0_blueprints_workspace</span><span class="p">():</span>
|
||||
<span class="sd">"""Write a blueprint to the workspace"""</span>
|
||||
<span class="n">branch</span> <span class="o">=</span> <span class="n">request</span><span class="o">.</span><span class="n">args</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">"branch"</span><span class="p">,</span> <span class="s2">"master"</span><span class="p">)</span>
|
||||
<span class="k">if</span> <span class="n">VALID_API_STRING</span><span class="o">.</span><span class="n">match</span><span class="p">(</span><span class="n">branch</span><span class="p">)</span> <span class="ow">is</span> <span class="kc">None</span><span class="p">:</span>
|
||||
<span class="k">return</span> <span class="n">jsonify</span><span class="p">(</span><span class="n">status</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="n">errors</span><span class="o">=</span><span class="p">[{</span><span class="s2">"id"</span><span class="p">:</span> <span class="n">INVALID_CHARS</span><span class="p">,</span> <span class="s2">"msg"</span><span class="p">:</span> <span class="s2">"Invalid characters in branch argument"</span><span class="p">}]),</span> <span class="mi">400</span>
|
||||
|
||||
<span class="k">try</span><span class="p">:</span>
|
||||
<span class="k">if</span> <span class="n">request</span><span class="o">.</span><span class="n">headers</span><span class="p">[</span><span class="s1">'Content-Type'</span><span class="p">]</span> <span class="o">==</span> <span class="s2">"text/x-toml"</span><span class="p">:</span>
|
||||
<span class="n">blueprint</span> <span class="o">=</span> <span class="n">recipe_from_toml</span><span class="p">(</span><span class="n">request</span><span class="o">.</span><span class="n">data</span><span class="p">)</span>
|
||||
<span class="k">else</span><span class="p">:</span>
|
||||
<span class="n">blueprint</span> <span class="o">=</span> <span class="n">recipe_from_dict</span><span class="p">(</span><span class="n">request</span><span class="o">.</span><span class="n">get_json</span><span class="p">(</span><span class="n">cache</span><span class="o">=</span><span class="kc">False</span><span class="p">))</span>
|
||||
|
||||
<span class="k">if</span> <span class="n">VALID_API_STRING</span><span class="o">.</span><span class="n">match</span><span class="p">(</span><span class="n">blueprint</span><span class="p">[</span><span class="s2">"name"</span><span class="p">])</span> <span class="ow">is</span> <span class="kc">None</span><span class="p">:</span>
|
||||
<span class="k">return</span> <span class="n">jsonify</span><span class="p">(</span><span class="n">status</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="n">errors</span><span class="o">=</span><span class="p">[{</span><span class="s2">"id"</span><span class="p">:</span> <span class="n">INVALID_CHARS</span><span class="p">,</span> <span class="s2">"msg"</span><span class="p">:</span> <span class="s2">"Invalid characters in API path"</span><span class="p">}]),</span> <span class="mi">400</span>
|
||||
|
||||
<span class="k">with</span> <span class="n">api</span><span class="o">.</span><span class="n">config</span><span class="p">[</span><span class="s2">"GITLOCK"</span><span class="p">]</span><span class="o">.</span><span class="n">lock</span><span class="p">:</span>
|
||||
<span class="n">workspace_write</span><span class="p">(</span><span class="n">api</span><span class="o">.</span><span class="n">config</span><span class="p">[</span><span class="s2">"GITLOCK"</span><span class="p">]</span><span class="o">.</span><span class="n">repo</span><span class="p">,</span> <span class="n">branch</span><span class="p">,</span> <span class="n">blueprint</span><span class="p">)</span>
|
||||
<span class="k">except</span> <span class="ne">Exception</span> <span class="k">as</span> <span class="n">e</span><span class="p">:</span>
|
||||
<span class="n">log</span><span class="o">.</span><span class="n">error</span><span class="p">(</span><span class="s2">"(v0_blueprints_workspace) </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">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="p">[</span><span class="nb">str</span><span class="p">(</span><span class="n">e</span><span class="p">)]),</span> <span class="mi">400</span>
|
||||
<span class="k">return</span> <span class="n">jsonify</span><span class="p">(</span><span class="n">status</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="n">errors</span><span class="o">=</span><span class="p">[{</span><span class="s2">"id"</span><span class="p">:</span> <span class="n">BLUEPRINTS_ERROR</span><span class="p">,</span> <span class="s2">"msg"</span><span class="p">:</span> <span class="nb">str</span><span class="p">(</span><span class="n">e</span><span class="p">)}]),</span> <span class="mi">400</span>
|
||||
<span class="k">else</span><span class="p">:</span>
|
||||
<span class="k">return</span> <span class="n">jsonify</span><span class="p">(</span><span class="n">status</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span>
|
||||
|
||||
<span class="nd">@api</span><span class="o">.</span><span class="n">route</span><span class="p">(</span><span class="s2">"/api/v0/blueprints/workspace"</span><span class="p">,</span> <span class="n">defaults</span><span class="o">=</span><span class="p">{</span><span class="s1">'blueprint_name'</span><span class="p">:</span> <span class="s2">""</span><span class="p">},</span> <span class="n">methods</span><span class="o">=</span><span class="p">[</span><span class="s2">"DELETE"</span><span class="p">])</span>
|
||||
<span class="nd">@api</span><span class="o">.</span><span class="n">route</span><span class="p">(</span><span class="s2">"/api/v0/blueprints/workspace/<blueprint_name>"</span><span class="p">,</span> <span class="n">methods</span><span class="o">=</span><span class="p">[</span><span class="s2">"DELETE"</span><span class="p">])</span>
|
||||
<span class="nd">@crossdomain</span><span class="p">(</span><span class="n">origin</span><span class="o">=</span><span class="s2">"*"</span><span class="p">)</span>
|
||||
<span class="nd">@checkparams</span><span class="p">([(</span><span class="s2">"blueprint_name"</span><span class="p">,</span> <span class="s2">""</span><span class="p">,</span> <span class="s2">"no blueprint name given"</span><span class="p">)])</span>
|
||||
<span class="k">def</span> <span class="nf">v0_blueprints_delete_workspace</span><span class="p">(</span><span class="n">blueprint_name</span><span class="p">):</span>
|
||||
<span class="sd">"""Delete a blueprint from the workspace"""</span>
|
||||
<span class="k">if</span> <span class="n">VALID_API_STRING</span><span class="o">.</span><span class="n">match</span><span class="p">(</span><span class="n">blueprint_name</span><span class="p">)</span> <span class="ow">is</span> <span class="kc">None</span><span class="p">:</span>
|
||||
<span class="k">return</span> <span class="n">jsonify</span><span class="p">(</span><span class="n">status</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="n">errors</span><span class="o">=</span><span class="p">[{</span><span class="s2">"id"</span><span class="p">:</span> <span class="n">INVALID_CHARS</span><span class="p">,</span> <span class="s2">"msg"</span><span class="p">:</span> <span class="s2">"Invalid characters in API path"</span><span class="p">}]),</span> <span class="mi">400</span>
|
||||
|
||||
<span class="n">branch</span> <span class="o">=</span> <span class="n">request</span><span class="o">.</span><span class="n">args</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">"branch"</span><span class="p">,</span> <span class="s2">"master"</span><span class="p">)</span>
|
||||
<span class="k">if</span> <span class="n">VALID_API_STRING</span><span class="o">.</span><span class="n">match</span><span class="p">(</span><span class="n">branch</span><span class="p">)</span> <span class="ow">is</span> <span class="kc">None</span><span class="p">:</span>
|
||||
<span class="k">return</span> <span class="n">jsonify</span><span class="p">(</span><span class="n">status</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="n">errors</span><span class="o">=</span><span class="p">[{</span><span class="s2">"id"</span><span class="p">:</span> <span class="n">INVALID_CHARS</span><span class="p">,</span> <span class="s2">"msg"</span><span class="p">:</span> <span class="s2">"Invalid characters in branch argument"</span><span class="p">}]),</span> <span class="mi">400</span>
|
||||
|
||||
<span class="k">try</span><span class="p">:</span>
|
||||
<span class="k">with</span> <span class="n">api</span><span class="o">.</span><span class="n">config</span><span class="p">[</span><span class="s2">"GITLOCK"</span><span class="p">]</span><span class="o">.</span><span class="n">lock</span><span class="p">:</span>
|
||||
<span class="n">workspace_delete</span><span class="p">(</span><span class="n">api</span><span class="o">.</span><span class="n">config</span><span class="p">[</span><span class="s2">"GITLOCK"</span><span class="p">]</span><span class="o">.</span><span class="n">repo</span><span class="p">,</span> <span class="n">branch</span><span class="p">,</span> <span class="n">blueprint_name</span><span class="p">)</span>
|
||||
<span class="k">except</span> <span class="ne">Exception</span> <span class="k">as</span> <span class="n">e</span><span class="p">:</span>
|
||||
<span class="n">log</span><span class="o">.</span><span class="n">error</span><span class="p">(</span><span class="s2">"(v0_blueprints_delete_workspace) </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">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">error</span><span class="o">=</span><span class="p">[</span><span class="nb">str</span><span class="p">(</span><span class="n">e</span><span class="p">)]),</span> <span class="mi">400</span>
|
||||
<span class="k">return</span> <span class="n">jsonify</span><span class="p">(</span><span class="n">status</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="n">errors</span><span class="o">=</span><span class="p">[{</span><span class="s2">"id"</span><span class="p">:</span> <span class="n">BLUEPRINTS_ERROR</span><span class="p">,</span> <span class="s2">"msg"</span><span class="p">:</span> <span class="nb">str</span><span class="p">(</span><span class="n">e</span><span class="p">)}]),</span> <span class="mi">400</span>
|
||||
<span class="k">else</span><span class="p">:</span>
|
||||
<span class="k">return</span> <span class="n">jsonify</span><span class="p">(</span><span class="n">status</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span>
|
||||
|
||||
<span class="nd">@api</span><span class="o">.</span><span class="n">route</span><span class="p">(</span><span class="s2">"/api/v0/blueprints/undo"</span><span class="p">,</span> <span class="n">defaults</span><span class="o">=</span><span class="p">{</span><span class="s1">'blueprint_name'</span><span class="p">:</span> <span class="s2">""</span><span class="p">,</span> <span class="s1">'commit'</span><span class="p">:</span> <span class="s2">""</span><span class="p">},</span> <span class="n">methods</span><span class="o">=</span><span class="p">[</span><span class="s2">"POST"</span><span class="p">])</span>
|
||||
<span class="nd">@api</span><span class="o">.</span><span class="n">route</span><span class="p">(</span><span class="s2">"/api/v0/blueprints/undo/<blueprint_name>"</span><span class="p">,</span> <span class="n">defaults</span><span class="o">=</span><span class="p">{</span><span class="s1">'commit'</span><span class="p">:</span> <span class="s2">""</span><span class="p">},</span> <span class="n">methods</span><span class="o">=</span><span class="p">[</span><span class="s2">"POST"</span><span class="p">])</span>
|
||||
<span class="nd">@api</span><span class="o">.</span><span class="n">route</span><span class="p">(</span><span class="s2">"/api/v0/blueprints/undo/<blueprint_name>/<commit>"</span><span class="p">,</span> <span class="n">methods</span><span class="o">=</span><span class="p">[</span><span class="s2">"POST"</span><span class="p">])</span>
|
||||
<span class="nd">@crossdomain</span><span class="p">(</span><span class="n">origin</span><span class="o">=</span><span class="s2">"*"</span><span class="p">)</span>
|
||||
<span class="nd">@checkparams</span><span class="p">([(</span><span class="s2">"blueprint_name"</span><span class="p">,</span> <span class="s2">""</span><span class="p">,</span> <span class="s2">"no blueprint name given"</span><span class="p">),</span>
|
||||
<span class="p">(</span><span class="s2">"commit"</span><span class="p">,</span> <span class="s2">""</span><span class="p">,</span> <span class="s2">"no commit ID given"</span><span class="p">)])</span>
|
||||
<span class="k">def</span> <span class="nf">v0_blueprints_undo</span><span class="p">(</span><span class="n">blueprint_name</span><span class="p">,</span> <span class="n">commit</span><span class="p">):</span>
|
||||
<span class="sd">"""Undo changes to a blueprint by reverting to a previous commit."""</span>
|
||||
<span class="k">if</span> <span class="n">VALID_API_STRING</span><span class="o">.</span><span class="n">match</span><span class="p">(</span><span class="n">blueprint_name</span><span class="p">)</span> <span class="ow">is</span> <span class="kc">None</span><span class="p">:</span>
|
||||
<span class="k">return</span> <span class="n">jsonify</span><span class="p">(</span><span class="n">status</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="n">errors</span><span class="o">=</span><span class="p">[{</span><span class="s2">"id"</span><span class="p">:</span> <span class="n">INVALID_CHARS</span><span class="p">,</span> <span class="s2">"msg"</span><span class="p">:</span> <span class="s2">"Invalid characters in API path"</span><span class="p">}]),</span> <span class="mi">400</span>
|
||||
|
||||
<span class="n">branch</span> <span class="o">=</span> <span class="n">request</span><span class="o">.</span><span class="n">args</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">"branch"</span><span class="p">,</span> <span class="s2">"master"</span><span class="p">)</span>
|
||||
<span class="k">if</span> <span class="n">VALID_API_STRING</span><span class="o">.</span><span class="n">match</span><span class="p">(</span><span class="n">branch</span><span class="p">)</span> <span class="ow">is</span> <span class="kc">None</span><span class="p">:</span>
|
||||
<span class="k">return</span> <span class="n">jsonify</span><span class="p">(</span><span class="n">status</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="n">errors</span><span class="o">=</span><span class="p">[{</span><span class="s2">"id"</span><span class="p">:</span> <span class="n">INVALID_CHARS</span><span class="p">,</span> <span class="s2">"msg"</span><span class="p">:</span> <span class="s2">"Invalid characters in branch argument"</span><span class="p">}]),</span> <span class="mi">400</span>
|
||||
|
||||
<span class="k">try</span><span class="p">:</span>
|
||||
<span class="k">with</span> <span class="n">api</span><span class="o">.</span><span class="n">config</span><span class="p">[</span><span class="s2">"GITLOCK"</span><span class="p">]</span><span class="o">.</span><span class="n">lock</span><span class="p">:</span>
|
||||
<span class="n">revert_recipe</span><span class="p">(</span><span class="n">api</span><span class="o">.</span><span class="n">config</span><span class="p">[</span><span class="s2">"GITLOCK"</span><span class="p">]</span><span class="o">.</span><span class="n">repo</span><span class="p">,</span> <span class="n">branch</span><span class="p">,</span> <span class="n">blueprint_name</span><span class="p">,</span> <span class="n">commit</span><span class="p">)</span>
|
||||
@ -1339,29 +1426,50 @@
|
||||
<span class="n">workspace_write</span><span class="p">(</span><span class="n">api</span><span class="o">.</span><span class="n">config</span><span class="p">[</span><span class="s2">"GITLOCK"</span><span class="p">]</span><span class="o">.</span><span class="n">repo</span><span class="p">,</span> <span class="n">branch</span><span class="p">,</span> <span class="n">blueprint</span><span class="p">)</span>
|
||||
<span class="k">except</span> <span class="ne">Exception</span> <span class="k">as</span> <span class="n">e</span><span class="p">:</span>
|
||||
<span class="n">log</span><span class="o">.</span><span class="n">error</span><span class="p">(</span><span class="s2">"(v0_blueprints_undo) </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">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="p">[</span><span class="nb">str</span><span class="p">(</span><span class="n">e</span><span class="p">)]),</span> <span class="mi">400</span>
|
||||
<span class="k">return</span> <span class="n">jsonify</span><span class="p">(</span><span class="n">status</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="n">errors</span><span class="o">=</span><span class="p">[{</span><span class="s2">"id"</span><span class="p">:</span> <span class="n">UNKNOWN_COMMIT</span><span class="p">,</span> <span class="s2">"msg"</span><span class="p">:</span> <span class="nb">str</span><span class="p">(</span><span class="n">e</span><span class="p">)}]),</span> <span class="mi">400</span>
|
||||
<span class="k">else</span><span class="p">:</span>
|
||||
<span class="k">return</span> <span class="n">jsonify</span><span class="p">(</span><span class="n">status</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span>
|
||||
|
||||
<span class="nd">@api</span><span class="o">.</span><span class="n">route</span><span class="p">(</span><span class="s2">"/api/v0/blueprints/tag"</span><span class="p">,</span> <span class="n">defaults</span><span class="o">=</span><span class="p">{</span><span class="s1">'blueprint_name'</span><span class="p">:</span> <span class="s2">""</span><span class="p">},</span> <span class="n">methods</span><span class="o">=</span><span class="p">[</span><span class="s2">"POST"</span><span class="p">])</span>
|
||||
<span class="nd">@api</span><span class="o">.</span><span class="n">route</span><span class="p">(</span><span class="s2">"/api/v0/blueprints/tag/<blueprint_name>"</span><span class="p">,</span> <span class="n">methods</span><span class="o">=</span><span class="p">[</span><span class="s2">"POST"</span><span class="p">])</span>
|
||||
<span class="nd">@crossdomain</span><span class="p">(</span><span class="n">origin</span><span class="o">=</span><span class="s2">"*"</span><span class="p">)</span>
|
||||
<span class="nd">@checkparams</span><span class="p">([(</span><span class="s2">"blueprint_name"</span><span class="p">,</span> <span class="s2">""</span><span class="p">,</span> <span class="s2">"no blueprint name given"</span><span class="p">)])</span>
|
||||
<span class="k">def</span> <span class="nf">v0_blueprints_tag</span><span class="p">(</span><span class="n">blueprint_name</span><span class="p">):</span>
|
||||
<span class="sd">"""Tag a blueprint's latest blueprint commit as a 'revision'"""</span>
|
||||
<span class="k">if</span> <span class="n">VALID_API_STRING</span><span class="o">.</span><span class="n">match</span><span class="p">(</span><span class="n">blueprint_name</span><span class="p">)</span> <span class="ow">is</span> <span class="kc">None</span><span class="p">:</span>
|
||||
<span class="k">return</span> <span class="n">jsonify</span><span class="p">(</span><span class="n">status</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="n">errors</span><span class="o">=</span><span class="p">[{</span><span class="s2">"id"</span><span class="p">:</span> <span class="n">INVALID_CHARS</span><span class="p">,</span> <span class="s2">"msg"</span><span class="p">:</span> <span class="s2">"Invalid characters in API path"</span><span class="p">}]),</span> <span class="mi">400</span>
|
||||
|
||||
<span class="n">branch</span> <span class="o">=</span> <span class="n">request</span><span class="o">.</span><span class="n">args</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">"branch"</span><span class="p">,</span> <span class="s2">"master"</span><span class="p">)</span>
|
||||
<span class="k">if</span> <span class="n">VALID_API_STRING</span><span class="o">.</span><span class="n">match</span><span class="p">(</span><span class="n">branch</span><span class="p">)</span> <span class="ow">is</span> <span class="kc">None</span><span class="p">:</span>
|
||||
<span class="k">return</span> <span class="n">jsonify</span><span class="p">(</span><span class="n">status</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="n">errors</span><span class="o">=</span><span class="p">[{</span><span class="s2">"id"</span><span class="p">:</span> <span class="n">INVALID_CHARS</span><span class="p">,</span> <span class="s2">"msg"</span><span class="p">:</span> <span class="s2">"Invalid characters in branch argument"</span><span class="p">}]),</span> <span class="mi">400</span>
|
||||
|
||||
<span class="k">try</span><span class="p">:</span>
|
||||
<span class="k">with</span> <span class="n">api</span><span class="o">.</span><span class="n">config</span><span class="p">[</span><span class="s2">"GITLOCK"</span><span class="p">]</span><span class="o">.</span><span class="n">lock</span><span class="p">:</span>
|
||||
<span class="n">tag_recipe_commit</span><span class="p">(</span><span class="n">api</span><span class="o">.</span><span class="n">config</span><span class="p">[</span><span class="s2">"GITLOCK"</span><span class="p">]</span><span class="o">.</span><span class="n">repo</span><span class="p">,</span> <span class="n">branch</span><span class="p">,</span> <span class="n">blueprint_name</span><span class="p">)</span>
|
||||
<span class="k">except</span> <span class="ne">Exception</span> <span class="k">as</span> <span class="n">e</span><span class="p">:</span>
|
||||
<span class="n">log</span><span class="o">.</span><span class="n">error</span><span class="p">(</span><span class="s2">"(v0_blueprints_tag) </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">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="p">[</span><span class="nb">str</span><span class="p">(</span><span class="n">e</span><span class="p">)]),</span> <span class="mi">400</span>
|
||||
<span class="k">return</span> <span class="n">jsonify</span><span class="p">(</span><span class="n">status</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="n">errors</span><span class="o">=</span><span class="p">[{</span><span class="s2">"id"</span><span class="p">:</span> <span class="n">BLUEPRINTS_ERROR</span><span class="p">,</span> <span class="s2">"msg"</span><span class="p">:</span> <span class="nb">str</span><span class="p">(</span><span class="n">e</span><span class="p">)}]),</span> <span class="mi">400</span>
|
||||
<span class="k">else</span><span class="p">:</span>
|
||||
<span class="k">return</span> <span class="n">jsonify</span><span class="p">(</span><span class="n">status</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span>
|
||||
|
||||
<span class="nd">@api</span><span class="o">.</span><span class="n">route</span><span class="p">(</span><span class="s2">"/api/v0/blueprints/diff"</span><span class="p">,</span> <span class="n">defaults</span><span class="o">=</span><span class="p">{</span><span class="s1">'blueprint_name'</span><span class="p">:</span> <span class="s2">""</span><span class="p">,</span> <span class="s1">'from_commit'</span><span class="p">:</span> <span class="s2">""</span><span class="p">,</span> <span class="s1">'to_commit'</span><span class="p">:</span> <span class="s2">""</span><span class="p">})</span>
|
||||
<span class="nd">@api</span><span class="o">.</span><span class="n">route</span><span class="p">(</span><span class="s2">"/api/v0/blueprints/diff/<blueprint_name>"</span><span class="p">,</span> <span class="n">defaults</span><span class="o">=</span><span class="p">{</span><span class="s1">'from_commit'</span><span class="p">:</span> <span class="s2">""</span><span class="p">,</span> <span class="s1">'to_commit'</span><span class="p">:</span> <span class="s2">""</span><span class="p">})</span>
|
||||
<span class="nd">@api</span><span class="o">.</span><span class="n">route</span><span class="p">(</span><span class="s2">"/api/v0/blueprints/diff/<blueprint_name>/<from_commit>"</span><span class="p">,</span> <span class="n">defaults</span><span class="o">=</span><span class="p">{</span><span class="s1">'to_commit'</span><span class="p">:</span> <span class="s2">""</span><span class="p">})</span>
|
||||
<span class="nd">@api</span><span class="o">.</span><span class="n">route</span><span class="p">(</span><span class="s2">"/api/v0/blueprints/diff/<blueprint_name>/<from_commit>/<to_commit>"</span><span class="p">)</span>
|
||||
<span class="nd">@crossdomain</span><span class="p">(</span><span class="n">origin</span><span class="o">=</span><span class="s2">"*"</span><span class="p">)</span>
|
||||
<span class="nd">@checkparams</span><span class="p">([(</span><span class="s2">"blueprint_name"</span><span class="p">,</span> <span class="s2">""</span><span class="p">,</span> <span class="s2">"no blueprint name given"</span><span class="p">),</span>
|
||||
<span class="p">(</span><span class="s2">"from_commit"</span><span class="p">,</span> <span class="s2">""</span><span class="p">,</span> <span class="s2">"no from commit ID given"</span><span class="p">),</span>
|
||||
<span class="p">(</span><span class="s2">"to_commit"</span><span class="p">,</span> <span class="s2">""</span><span class="p">,</span> <span class="s2">"no to commit ID given"</span><span class="p">)])</span>
|
||||
<span class="k">def</span> <span class="nf">v0_blueprints_diff</span><span class="p">(</span><span class="n">blueprint_name</span><span class="p">,</span> <span class="n">from_commit</span><span class="p">,</span> <span class="n">to_commit</span><span class="p">):</span>
|
||||
<span class="sd">"""Return the differences between two commits of a blueprint"""</span>
|
||||
<span class="k">for</span> <span class="n">s</span> <span class="ow">in</span> <span class="p">[</span><span class="n">blueprint_name</span><span class="p">,</span> <span class="n">from_commit</span><span class="p">,</span> <span class="n">to_commit</span><span class="p">]:</span>
|
||||
<span class="k">if</span> <span class="n">VALID_API_STRING</span><span class="o">.</span><span class="n">match</span><span class="p">(</span><span class="n">s</span><span class="p">)</span> <span class="ow">is</span> <span class="kc">None</span><span class="p">:</span>
|
||||
<span class="k">return</span> <span class="n">jsonify</span><span class="p">(</span><span class="n">status</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="n">errors</span><span class="o">=</span><span class="p">[{</span><span class="s2">"id"</span><span class="p">:</span> <span class="n">INVALID_CHARS</span><span class="p">,</span> <span class="s2">"msg"</span><span class="p">:</span> <span class="s2">"Invalid characters in API path"</span><span class="p">}]),</span> <span class="mi">400</span>
|
||||
|
||||
<span class="n">branch</span> <span class="o">=</span> <span class="n">request</span><span class="o">.</span><span class="n">args</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">"branch"</span><span class="p">,</span> <span class="s2">"master"</span><span class="p">)</span>
|
||||
<span class="k">if</span> <span class="n">VALID_API_STRING</span><span class="o">.</span><span class="n">match</span><span class="p">(</span><span class="n">branch</span><span class="p">)</span> <span class="ow">is</span> <span class="kc">None</span><span class="p">:</span>
|
||||
<span class="k">return</span> <span class="n">jsonify</span><span class="p">(</span><span class="n">status</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="n">errors</span><span class="o">=</span><span class="p">[{</span><span class="s2">"id"</span><span class="p">:</span> <span class="n">INVALID_CHARS</span><span class="p">,</span> <span class="s2">"msg"</span><span class="p">:</span> <span class="s2">"Invalid characters in branch argument"</span><span class="p">}]),</span> <span class="mi">400</span>
|
||||
|
||||
<span class="k">try</span><span class="p">:</span>
|
||||
<span class="k">if</span> <span class="n">from_commit</span> <span class="o">==</span> <span class="s2">"NEWEST"</span><span class="p">:</span>
|
||||
<span class="k">with</span> <span class="n">api</span><span class="o">.</span><span class="n">config</span><span class="p">[</span><span class="s2">"GITLOCK"</span><span class="p">]</span><span class="o">.</span><span class="n">lock</span><span class="p">:</span>
|
||||
@ -1371,7 +1479,7 @@
|
||||
<span class="n">old_blueprint</span> <span class="o">=</span> <span class="n">read_recipe_commit</span><span class="p">(</span><span class="n">api</span><span class="o">.</span><span class="n">config</span><span class="p">[</span><span class="s2">"GITLOCK"</span><span class="p">]</span><span class="o">.</span><span class="n">repo</span><span class="p">,</span> <span class="n">branch</span><span class="p">,</span> <span class="n">blueprint_name</span><span class="p">,</span> <span class="n">from_commit</span><span class="p">)</span>
|
||||
<span class="k">except</span> <span class="ne">Exception</span> <span class="k">as</span> <span class="n">e</span><span class="p">:</span>
|
||||
<span class="n">log</span><span class="o">.</span><span class="n">error</span><span class="p">(</span><span class="s2">"(v0_blueprints_diff) </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">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="p">[</span><span class="nb">str</span><span class="p">(</span><span class="n">e</span><span class="p">)]),</span> <span class="mi">400</span>
|
||||
<span class="k">return</span> <span class="n">jsonify</span><span class="p">(</span><span class="n">status</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="n">errors</span><span class="o">=</span><span class="p">[{</span><span class="s2">"id"</span><span class="p">:</span> <span class="n">UNKNOWN_COMMIT</span><span class="p">,</span> <span class="s2">"msg"</span><span class="p">:</span> <span class="nb">str</span><span class="p">(</span><span class="n">e</span><span class="p">)}]),</span> <span class="mi">400</span>
|
||||
|
||||
<span class="k">try</span><span class="p">:</span>
|
||||
<span class="k">if</span> <span class="n">to_commit</span> <span class="o">==</span> <span class="s2">"WORKSPACE"</span><span class="p">:</span>
|
||||
@ -1389,17 +1497,28 @@
|
||||
<span class="n">new_blueprint</span> <span class="o">=</span> <span class="n">read_recipe_commit</span><span class="p">(</span><span class="n">api</span><span class="o">.</span><span class="n">config</span><span class="p">[</span><span class="s2">"GITLOCK"</span><span class="p">]</span><span class="o">.</span><span class="n">repo</span><span class="p">,</span> <span class="n">branch</span><span class="p">,</span> <span class="n">blueprint_name</span><span class="p">,</span> <span class="n">to_commit</span><span class="p">)</span>
|
||||
<span class="k">except</span> <span class="ne">Exception</span> <span class="k">as</span> <span class="n">e</span><span class="p">:</span>
|
||||
<span class="n">log</span><span class="o">.</span><span class="n">error</span><span class="p">(</span><span class="s2">"(v0_blueprints_diff) </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">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="p">[</span><span class="nb">str</span><span class="p">(</span><span class="n">e</span><span class="p">)]),</span> <span class="mi">400</span>
|
||||
<span class="k">return</span> <span class="n">jsonify</span><span class="p">(</span><span class="n">status</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="n">errors</span><span class="o">=</span><span class="p">[{</span><span class="s2">"id"</span><span class="p">:</span> <span class="n">UNKNOWN_COMMIT</span><span class="p">,</span> <span class="s2">"msg"</span><span class="p">:</span> <span class="nb">str</span><span class="p">(</span><span class="n">e</span><span class="p">)}]),</span> <span class="mi">400</span>
|
||||
|
||||
<span class="n">diff</span> <span class="o">=</span> <span class="n">recipe_diff</span><span class="p">(</span><span class="n">old_blueprint</span><span class="p">,</span> <span class="n">new_blueprint</span><span class="p">)</span>
|
||||
<span class="k">return</span> <span class="n">jsonify</span><span class="p">(</span><span class="n">diff</span><span class="o">=</span><span class="n">diff</span><span class="p">)</span>
|
||||
|
||||
<span class="nd">@api</span><span class="o">.</span><span class="n">route</span><span class="p">(</span><span class="s2">"/api/v0/blueprints/freeze"</span><span class="p">,</span> <span class="n">defaults</span><span class="o">=</span><span class="p">{</span><span class="s1">'blueprint_names'</span><span class="p">:</span> <span class="s2">""</span><span class="p">})</span>
|
||||
<span class="nd">@api</span><span class="o">.</span><span class="n">route</span><span class="p">(</span><span class="s2">"/api/v0/blueprints/freeze/<blueprint_names>"</span><span class="p">)</span>
|
||||
<span class="nd">@crossdomain</span><span class="p">(</span><span class="n">origin</span><span class="o">=</span><span class="s2">"*"</span><span class="p">)</span>
|
||||
<span class="nd">@checkparams</span><span class="p">([(</span><span class="s2">"blueprint_names"</span><span class="p">,</span> <span class="s2">""</span><span class="p">,</span> <span class="s2">"no blueprint names given"</span><span class="p">)])</span>
|
||||
<span class="k">def</span> <span class="nf">v0_blueprints_freeze</span><span class="p">(</span><span class="n">blueprint_names</span><span class="p">):</span>
|
||||
<span class="sd">"""Return the blueprint with the exact modules and packages selected by depsolve"""</span>
|
||||
<span class="k">if</span> <span class="n">VALID_API_STRING</span><span class="o">.</span><span class="n">match</span><span class="p">(</span><span class="n">blueprint_names</span><span class="p">)</span> <span class="ow">is</span> <span class="kc">None</span><span class="p">:</span>
|
||||
<span class="k">return</span> <span class="n">jsonify</span><span class="p">(</span><span class="n">status</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="n">errors</span><span class="o">=</span><span class="p">[{</span><span class="s2">"id"</span><span class="p">:</span> <span class="n">INVALID_CHARS</span><span class="p">,</span> <span class="s2">"msg"</span><span class="p">:</span> <span class="s2">"Invalid characters in API path"</span><span class="p">}]),</span> <span class="mi">400</span>
|
||||
|
||||
<span class="n">branch</span> <span class="o">=</span> <span class="n">request</span><span class="o">.</span><span class="n">args</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">"branch"</span><span class="p">,</span> <span class="s2">"master"</span><span class="p">)</span>
|
||||
<span class="k">if</span> <span class="n">VALID_API_STRING</span><span class="o">.</span><span class="n">match</span><span class="p">(</span><span class="n">branch</span><span class="p">)</span> <span class="ow">is</span> <span class="kc">None</span><span class="p">:</span>
|
||||
<span class="k">return</span> <span class="n">jsonify</span><span class="p">(</span><span class="n">status</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="n">errors</span><span class="o">=</span><span class="p">[{</span><span class="s2">"id"</span><span class="p">:</span> <span class="n">INVALID_CHARS</span><span class="p">,</span> <span class="s2">"msg"</span><span class="p">:</span> <span class="s2">"Invalid characters in branch argument"</span><span class="p">}]),</span> <span class="mi">400</span>
|
||||
|
||||
<span class="n">out_fmt</span> <span class="o">=</span> <span class="n">request</span><span class="o">.</span><span class="n">args</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">"format"</span><span class="p">,</span> <span class="s2">"json"</span><span class="p">)</span>
|
||||
<span class="k">if</span> <span class="n">VALID_API_STRING</span><span class="o">.</span><span class="n">match</span><span class="p">(</span><span class="n">out_fmt</span><span class="p">)</span> <span class="ow">is</span> <span class="kc">None</span><span class="p">:</span>
|
||||
<span class="k">return</span> <span class="n">jsonify</span><span class="p">(</span><span class="n">status</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="n">errors</span><span class="o">=</span><span class="p">[{</span><span class="s2">"id"</span><span class="p">:</span> <span class="n">INVALID_CHARS</span><span class="p">,</span> <span class="s2">"msg"</span><span class="p">:</span> <span class="s2">"Invalid characters in format argument"</span><span class="p">}]),</span> <span class="mi">400</span>
|
||||
|
||||
<span class="n">blueprints</span> <span class="o">=</span> <span class="p">[]</span>
|
||||
<span class="n">errors</span> <span class="o">=</span> <span class="p">[]</span>
|
||||
<span class="k">for</span> <span class="n">blueprint_name</span> <span class="ow">in</span> <span class="p">[</span><span class="n">n</span><span class="o">.</span><span class="n">strip</span><span class="p">()</span> <span class="k">for</span> <span class="n">n</span> <span class="ow">in</span> <span class="nb">sorted</span><span class="p">(</span><span class="n">blueprint_names</span><span class="o">.</span><span class="n">split</span><span class="p">(</span><span class="s2">","</span><span class="p">),</span> <span class="n">key</span><span class="o">=</span><span class="k">lambda</span> <span class="n">n</span><span class="p">:</span> <span class="n">n</span><span class="o">.</span><span class="n">lower</span><span class="p">())]:</span>
|
||||
@ -1418,12 +1537,12 @@
|
||||
<span class="k">with</span> <span class="n">api</span><span class="o">.</span><span class="n">config</span><span class="p">[</span><span class="s2">"GITLOCK"</span><span class="p">]</span><span class="o">.</span><span class="n">lock</span><span class="p">:</span>
|
||||
<span class="n">blueprint</span> <span class="o">=</span> <span class="n">read_recipe_commit</span><span class="p">(</span><span class="n">api</span><span class="o">.</span><span class="n">config</span><span class="p">[</span><span class="s2">"GITLOCK"</span><span class="p">]</span><span class="o">.</span><span class="n">repo</span><span class="p">,</span> <span class="n">branch</span><span class="p">,</span> <span class="n">blueprint_name</span><span class="p">)</span>
|
||||
<span class="k">except</span> <span class="ne">Exception</span> <span class="k">as</span> <span class="n">e</span><span class="p">:</span>
|
||||
<span class="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">: </span><span class="si">%s</span><span class="s2">"</span> <span class="o">%</span> <span class="p">(</span><span class="n">blueprint_name</span><span class="p">,</span> <span class="nb">str</span><span class="p">(</span><span class="n">e</span><span class="p">)))</span>
|
||||
<span class="n">errors</span><span class="o">.</span><span class="n">append</span><span class="p">({</span><span class="s2">"id"</span><span class="p">:</span> <span class="n">BLUEPRINTS_ERROR</span><span class="p">,</span> <span class="s2">"msg"</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">blueprint_name</span><span class="p">,</span> <span class="nb">str</span><span class="p">(</span><span class="n">e</span><span class="p">))})</span>
|
||||
<span class="n">log</span><span class="o">.</span><span class="n">error</span><span class="p">(</span><span class="s2">"(v0_blueprints_freeze) </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"># No blueprint found, skip it.</span>
|
||||
<span class="k">if</span> <span class="ow">not</span> <span class="n">blueprint</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">: blueprint_not_found"</span> <span class="o">%</span> <span class="p">(</span><span class="n">blueprint_name</span><span class="p">))</span>
|
||||
<span class="n">errors</span><span class="o">.</span><span class="n">append</span><span class="p">({</span><span class="s2">"id"</span><span class="p">:</span> <span class="n">UNKNOWN_BLUEPRINT</span><span class="p">,</span> <span class="s2">"msg"</span><span class="p">:</span> <span class="s2">"</span><span class="si">%s</span><span class="s2">: blueprint_not_found"</span> <span class="o">%</span> <span class="n">blueprint_name</span><span class="p">})</span>
|
||||
<span class="k">continue</span>
|
||||
|
||||
<span class="c1"># Combine modules and packages and depsolve the list</span>
|
||||
@ -1436,7 +1555,7 @@
|
||||
<span class="k">with</span> <span class="n">api</span><span class="o">.</span><span class="n">config</span><span class="p">[</span><span class="s2">"DNFLOCK"</span><span class="p">]</span><span class="o">.</span><span class="n">lock</span><span class="p">:</span>
|
||||
<span class="n">deps</span> <span class="o">=</span> <span class="n">projects_depsolve</span><span class="p">(</span><span class="n">api</span><span class="o">.</span><span class="n">config</span><span class="p">[</span><span class="s2">"DNFLOCK"</span><span class="p">]</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">blueprint</span><span class="o">.</span><span class="n">group_names</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">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">blueprint_name</span><span class="p">,</span> <span class="nb">str</span><span class="p">(</span><span class="n">e</span><span class="p">)))</span>
|
||||
<span class="n">errors</span><span class="o">.</span><span class="n">append</span><span class="p">({</span><span class="s2">"id"</span><span class="p">:</span> <span class="n">BLUEPRINTS_ERROR</span><span class="p">,</span> <span class="s2">"msg"</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">blueprint_name</span><span class="p">,</span> <span class="nb">str</span><span class="p">(</span><span class="n">e</span><span class="p">))})</span>
|
||||
<span class="n">log</span><span class="o">.</span><span class="n">error</span><span class="p">(</span><span class="s2">"(v0_blueprints_freeze) </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="n">blueprints</span><span class="o">.</span><span class="n">append</span><span class="p">({</span><span class="s2">"blueprint"</span><span class="p">:</span> <span class="n">blueprint</span><span class="o">.</span><span class="n">freeze</span><span class="p">(</span><span class="n">deps</span><span class="p">)})</span>
|
||||
@ -1447,11 +1566,19 @@
|
||||
<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">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>
|
||||
|
||||
<span class="nd">@api</span><span class="o">.</span><span class="n">route</span><span class="p">(</span><span class="s2">"/api/v0/blueprints/depsolve"</span><span class="p">,</span> <span class="n">defaults</span><span class="o">=</span><span class="p">{</span><span class="s1">'blueprint_names'</span><span class="p">:</span> <span class="s2">""</span><span class="p">})</span>
|
||||
<span class="nd">@api</span><span class="o">.</span><span class="n">route</span><span class="p">(</span><span class="s2">"/api/v0/blueprints/depsolve/<blueprint_names>"</span><span class="p">)</span>
|
||||
<span class="nd">@crossdomain</span><span class="p">(</span><span class="n">origin</span><span class="o">=</span><span class="s2">"*"</span><span class="p">)</span>
|
||||
<span class="nd">@checkparams</span><span class="p">([(</span><span class="s2">"blueprint_names"</span><span class="p">,</span> <span class="s2">""</span><span class="p">,</span> <span class="s2">"no blueprint names given"</span><span class="p">)])</span>
|
||||
<span class="k">def</span> <span class="nf">v0_blueprints_depsolve</span><span class="p">(</span><span class="n">blueprint_names</span><span class="p">):</span>
|
||||
<span class="sd">"""Return the dependencies for a blueprint"""</span>
|
||||
<span class="k">if</span> <span class="n">VALID_API_STRING</span><span class="o">.</span><span class="n">match</span><span class="p">(</span><span class="n">blueprint_names</span><span class="p">)</span> <span class="ow">is</span> <span class="kc">None</span><span class="p">:</span>
|
||||
<span class="k">return</span> <span class="n">jsonify</span><span class="p">(</span><span class="n">status</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="n">errors</span><span class="o">=</span><span class="p">[{</span><span class="s2">"id"</span><span class="p">:</span> <span class="n">INVALID_CHARS</span><span class="p">,</span> <span class="s2">"msg"</span><span class="p">:</span> <span class="s2">"Invalid characters in API path"</span><span class="p">}]),</span> <span class="mi">400</span>
|
||||
|
||||
<span class="n">branch</span> <span class="o">=</span> <span class="n">request</span><span class="o">.</span><span class="n">args</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">"branch"</span><span class="p">,</span> <span class="s2">"master"</span><span class="p">)</span>
|
||||
<span class="k">if</span> <span class="n">VALID_API_STRING</span><span class="o">.</span><span class="n">match</span><span class="p">(</span><span class="n">branch</span><span class="p">)</span> <span class="ow">is</span> <span class="kc">None</span><span class="p">:</span>
|
||||
<span class="k">return</span> <span class="n">jsonify</span><span class="p">(</span><span class="n">status</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="n">errors</span><span class="o">=</span><span class="p">[{</span><span class="s2">"id"</span><span class="p">:</span> <span class="n">INVALID_CHARS</span><span class="p">,</span> <span class="s2">"msg"</span><span class="p">:</span> <span class="s2">"Invalid characters in branch argument"</span><span class="p">}]),</span> <span class="mi">400</span>
|
||||
|
||||
<span class="n">blueprints</span> <span class="o">=</span> <span class="p">[]</span>
|
||||
<span class="n">errors</span> <span class="o">=</span> <span class="p">[]</span>
|
||||
<span class="k">for</span> <span class="n">blueprint_name</span> <span class="ow">in</span> <span class="p">[</span><span class="n">n</span><span class="o">.</span><span class="n">strip</span><span class="p">()</span> <span class="k">for</span> <span class="n">n</span> <span class="ow">in</span> <span class="nb">sorted</span><span class="p">(</span><span class="n">blueprint_names</span><span class="o">.</span><span class="n">split</span><span class="p">(</span><span class="s2">","</span><span class="p">),</span> <span class="n">key</span><span class="o">=</span><span class="k">lambda</span> <span class="n">n</span><span class="p">:</span> <span class="n">n</span><span class="o">.</span><span class="n">lower</span><span class="p">())]:</span>
|
||||
@ -1470,12 +1597,12 @@
|
||||
<span class="k">with</span> <span class="n">api</span><span class="o">.</span><span class="n">config</span><span class="p">[</span><span class="s2">"GITLOCK"</span><span class="p">]</span><span class="o">.</span><span class="n">lock</span><span class="p">:</span>
|
||||
<span class="n">blueprint</span> <span class="o">=</span> <span class="n">read_recipe_commit</span><span class="p">(</span><span class="n">api</span><span class="o">.</span><span class="n">config</span><span class="p">[</span><span class="s2">"GITLOCK"</span><span class="p">]</span><span class="o">.</span><span class="n">repo</span><span class="p">,</span> <span class="n">branch</span><span class="p">,</span> <span class="n">blueprint_name</span><span class="p">)</span>
|
||||
<span class="k">except</span> <span class="ne">Exception</span> <span class="k">as</span> <span class="n">e</span><span class="p">:</span>
|
||||
<span class="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">: </span><span class="si">%s</span><span class="s2">"</span> <span class="o">%</span> <span class="p">(</span><span class="n">blueprint_name</span><span class="p">,</span> <span class="nb">str</span><span class="p">(</span><span class="n">e</span><span class="p">)))</span>
|
||||
<span class="n">errors</span><span class="o">.</span><span class="n">append</span><span class="p">({</span><span class="s2">"id"</span><span class="p">:</span> <span class="n">BLUEPRINTS_ERROR</span><span class="p">,</span> <span class="s2">"msg"</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">blueprint_name</span><span class="p">,</span> <span class="nb">str</span><span class="p">(</span><span class="n">e</span><span class="p">))})</span>
|
||||
<span class="n">log</span><span class="o">.</span><span class="n">error</span><span class="p">(</span><span class="s2">"(v0_blueprints_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>
|
||||
|
||||
<span class="c1"># No blueprint found, skip it.</span>
|
||||
<span class="k">if</span> <span class="ow">not</span> <span class="n">blueprint</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">: blueprint not found"</span> <span class="o">%</span> <span class="n">blueprint_name</span><span class="p">)</span>
|
||||
<span class="n">errors</span><span class="o">.</span><span class="n">append</span><span class="p">({</span><span class="s2">"id"</span><span class="p">:</span> <span class="n">UNKNOWN_BLUEPRINT</span><span class="p">,</span> <span class="s2">"msg"</span><span class="p">:</span> <span class="s2">"</span><span class="si">%s</span><span class="s2">: blueprint not found"</span> <span class="o">%</span> <span class="n">blueprint_name</span><span class="p">})</span>
|
||||
<span class="k">continue</span>
|
||||
|
||||
<span class="c1"># Combine modules and packages and depsolve the list</span>
|
||||
@ -1488,7 +1615,7 @@
|
||||
<span class="k">with</span> <span class="n">api</span><span class="o">.</span><span class="n">config</span><span class="p">[</span><span class="s2">"DNFLOCK"</span><span class="p">]</span><span class="o">.</span><span class="n">lock</span><span class="p">:</span>
|
||||
<span class="n">deps</span> <span class="o">=</span> <span class="n">projects_depsolve</span><span class="p">(</span><span class="n">api</span><span class="o">.</span><span class="n">config</span><span class="p">[</span><span class="s2">"DNFLOCK"</span><span class="p">]</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">blueprint</span><span class="o">.</span><span class="n">group_names</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">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">blueprint_name</span><span class="p">,</span> <span class="nb">str</span><span class="p">(</span><span class="n">e</span><span class="p">)))</span>
|
||||
<span class="n">errors</span><span class="o">.</span><span class="n">append</span><span class="p">({</span><span class="s2">"id"</span><span class="p">:</span> <span class="n">BLUEPRINTS_ERROR</span><span class="p">,</span> <span class="s2">"msg"</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">blueprint_name</span><span class="p">,</span> <span class="nb">str</span><span class="p">(</span><span class="n">e</span><span class="p">))})</span>
|
||||
<span class="n">log</span><span class="o">.</span><span class="n">error</span><span class="p">(</span><span class="s2">"(v0_blueprints_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>
|
||||
|
||||
<span class="c1"># Get the NEVRA's of the modules and projects, add as "modules"</span>
|
||||
@ -1510,41 +1637,61 @@
|
||||
<span class="n">limit</span> <span class="o">=</span> <span class="nb">int</span><span class="p">(</span><span class="n">request</span><span class="o">.</span><span class="n">args</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">"limit"</span><span class="p">,</span> <span class="s2">"20"</span><span class="p">))</span>
|
||||
<span class="n">offset</span> <span class="o">=</span> <span class="nb">int</span><span class="p">(</span><span class="n">request</span><span class="o">.</span><span class="n">args</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">"offset"</span><span class="p">,</span> <span class="s2">"0"</span><span class="p">))</span>
|
||||
<span class="k">except</span> <span class="ne">ValueError</span> <span class="k">as</span> <span class="n">e</span><span class="p">:</span>
|
||||
<span class="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="p">[</span><span class="nb">str</span><span class="p">(</span><span class="n">e</span><span class="p">)]),</span> <span class="mi">400</span>
|
||||
<span class="k">return</span> <span class="n">jsonify</span><span class="p">(</span><span class="n">status</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="n">errors</span><span class="o">=</span><span class="p">[{</span><span class="s2">"id"</span><span class="p">:</span> <span class="n">BAD_LIMIT_OR_OFFSET</span><span class="p">,</span> <span class="s2">"msg"</span><span class="p">:</span> <span class="nb">str</span><span class="p">(</span><span class="n">e</span><span class="p">)}]),</span> <span class="mi">400</span>
|
||||
|
||||
<span class="k">try</span><span class="p">:</span>
|
||||
<span class="k">with</span> <span class="n">api</span><span class="o">.</span><span class="n">config</span><span class="p">[</span><span class="s2">"DNFLOCK"</span><span class="p">]</span><span class="o">.</span><span class="n">lock</span><span class="p">:</span>
|
||||
<span class="n">available</span> <span class="o">=</span> <span class="n">projects_list</span><span class="p">(</span><span class="n">api</span><span class="o">.</span><span class="n">config</span><span class="p">[</span><span class="s2">"DNFLOCK"</span><span class="p">]</span><span class="o">.</span><span class="n">dbo</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">"(v0_projects_list) </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">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="p">[</span><span class="nb">str</span><span class="p">(</span><span class="n">e</span><span class="p">)]),</span> <span class="mi">400</span>
|
||||
<span class="k">return</span> <span class="n">jsonify</span><span class="p">(</span><span class="n">status</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="n">errors</span><span class="o">=</span><span class="p">[{</span><span class="s2">"id"</span><span class="p">:</span> <span class="n">PROJECTS_ERROR</span><span class="p">,</span> <span class="s2">"msg"</span><span class="p">:</span> <span class="nb">str</span><span class="p">(</span><span class="n">e</span><span class="p">)}]),</span> <span class="mi">400</span>
|
||||
|
||||
<span class="n">projects</span> <span class="o">=</span> <span class="n">take_limits</span><span class="p">(</span><span class="n">available</span><span class="p">,</span> <span class="n">offset</span><span class="p">,</span> <span class="n">limit</span><span class="p">)</span>
|
||||
<span class="k">return</span> <span class="n">jsonify</span><span class="p">(</span><span class="n">projects</span><span class="o">=</span><span class="n">projects</span><span class="p">,</span> <span class="n">offset</span><span class="o">=</span><span class="n">offset</span><span class="p">,</span> <span class="n">limit</span><span class="o">=</span><span class="n">limit</span><span class="p">,</span> <span class="n">total</span><span class="o">=</span><span class="nb">len</span><span class="p">(</span><span class="n">available</span><span class="p">))</span>
|
||||
|
||||
<span class="nd">@api</span><span class="o">.</span><span class="n">route</span><span class="p">(</span><span class="s2">"/api/v0/projects/info"</span><span class="p">,</span> <span class="n">defaults</span><span class="o">=</span><span class="p">{</span><span class="s1">'project_names'</span><span class="p">:</span> <span class="s2">""</span><span class="p">})</span>
|
||||
<span class="nd">@api</span><span class="o">.</span><span class="n">route</span><span class="p">(</span><span class="s2">"/api/v0/projects/info/<project_names>"</span><span class="p">)</span>
|
||||
<span class="nd">@crossdomain</span><span class="p">(</span><span class="n">origin</span><span class="o">=</span><span class="s2">"*"</span><span class="p">)</span>
|
||||
<span class="nd">@checkparams</span><span class="p">([(</span><span class="s2">"project_names"</span><span class="p">,</span> <span class="s2">""</span><span class="p">,</span> <span class="s2">"no project names given"</span><span class="p">)])</span>
|
||||
<span class="k">def</span> <span class="nf">v0_projects_info</span><span class="p">(</span><span class="n">project_names</span><span class="p">):</span>
|
||||
<span class="sd">"""Return detailed information about the listed projects"""</span>
|
||||
<span class="k">if</span> <span class="n">VALID_API_STRING</span><span class="o">.</span><span class="n">match</span><span class="p">(</span><span class="n">project_names</span><span class="p">)</span> <span class="ow">is</span> <span class="kc">None</span><span class="p">:</span>
|
||||
<span class="k">return</span> <span class="n">jsonify</span><span class="p">(</span><span class="n">status</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="n">errors</span><span class="o">=</span><span class="p">[{</span><span class="s2">"id"</span><span class="p">:</span> <span class="n">INVALID_CHARS</span><span class="p">,</span> <span class="s2">"msg"</span><span class="p">:</span> <span class="s2">"Invalid characters in API path"</span><span class="p">}]),</span> <span class="mi">400</span>
|
||||
|
||||
<span class="k">try</span><span class="p">:</span>
|
||||
<span class="k">with</span> <span class="n">api</span><span class="o">.</span><span class="n">config</span><span class="p">[</span><span class="s2">"DNFLOCK"</span><span class="p">]</span><span class="o">.</span><span class="n">lock</span><span class="p">:</span>
|
||||
<span class="n">projects</span> <span class="o">=</span> <span class="n">projects_info</span><span class="p">(</span><span class="n">api</span><span class="o">.</span><span class="n">config</span><span class="p">[</span><span class="s2">"DNFLOCK"</span><span class="p">]</span><span class="o">.</span><span class="n">dbo</span><span class="p">,</span> <span class="n">project_names</span><span class="o">.</span><span class="n">split</span><span class="p">(</span><span class="s2">","</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">"(v0_projects_info) </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">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="p">[</span><span class="nb">str</span><span class="p">(</span><span class="n">e</span><span class="p">)]),</span> <span class="mi">400</span>
|
||||
<span class="k">return</span> <span class="n">jsonify</span><span class="p">(</span><span class="n">status</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="n">errors</span><span class="o">=</span><span class="p">[{</span><span class="s2">"id"</span><span class="p">:</span> <span class="n">PROJECTS_ERROR</span><span class="p">,</span> <span class="s2">"msg"</span><span class="p">:</span> <span class="nb">str</span><span class="p">(</span><span class="n">e</span><span class="p">)}]),</span> <span class="mi">400</span>
|
||||
|
||||
<span class="k">if</span> <span class="ow">not</span> <span class="n">projects</span><span class="p">:</span>
|
||||
<span class="n">msg</span> <span class="o">=</span> <span class="s2">"one of the requested projects does not exist: </span><span class="si">%s</span><span class="s2">"</span> <span class="o">%</span> <span class="n">project_names</span>
|
||||
<span class="n">log</span><span class="o">.</span><span class="n">error</span><span class="p">(</span><span class="s2">"(v0_projects_info) </span><span class="si">%s</span><span class="s2">"</span><span class="p">,</span> <span class="n">msg</span><span class="p">)</span>
|
||||
<span class="k">return</span> <span class="n">jsonify</span><span class="p">(</span><span class="n">status</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="n">errors</span><span class="o">=</span><span class="p">[{</span><span class="s2">"id"</span><span class="p">:</span> <span class="n">UNKNOWN_PROJECT</span><span class="p">,</span> <span class="s2">"msg"</span><span class="p">:</span> <span class="n">msg</span><span class="p">}]),</span> <span class="mi">400</span>
|
||||
|
||||
<span class="k">return</span> <span class="n">jsonify</span><span class="p">(</span><span class="n">projects</span><span class="o">=</span><span class="n">projects</span><span class="p">)</span>
|
||||
|
||||
<span class="nd">@api</span><span class="o">.</span><span class="n">route</span><span class="p">(</span><span class="s2">"/api/v0/projects/depsolve"</span><span class="p">,</span> <span class="n">defaults</span><span class="o">=</span><span class="p">{</span><span class="s1">'project_names'</span><span class="p">:</span> <span class="s2">""</span><span class="p">})</span>
|
||||
<span class="nd">@api</span><span class="o">.</span><span class="n">route</span><span class="p">(</span><span class="s2">"/api/v0/projects/depsolve/<project_names>"</span><span class="p">)</span>
|
||||
<span class="nd">@crossdomain</span><span class="p">(</span><span class="n">origin</span><span class="o">=</span><span class="s2">"*"</span><span class="p">)</span>
|
||||
<span class="nd">@checkparams</span><span class="p">([(</span><span class="s2">"project_names"</span><span class="p">,</span> <span class="s2">""</span><span class="p">,</span> <span class="s2">"no project names given"</span><span class="p">)])</span>
|
||||
<span class="k">def</span> <span class="nf">v0_projects_depsolve</span><span class="p">(</span><span class="n">project_names</span><span class="p">):</span>
|
||||
<span class="sd">"""Return detailed information about the listed projects"""</span>
|
||||
<span class="k">if</span> <span class="n">VALID_API_STRING</span><span class="o">.</span><span class="n">match</span><span class="p">(</span><span class="n">project_names</span><span class="p">)</span> <span class="ow">is</span> <span class="kc">None</span><span class="p">:</span>
|
||||
<span class="k">return</span> <span class="n">jsonify</span><span class="p">(</span><span class="n">status</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="n">errors</span><span class="o">=</span><span class="p">[{</span><span class="s2">"id"</span><span class="p">:</span> <span class="n">INVALID_CHARS</span><span class="p">,</span> <span class="s2">"msg"</span><span class="p">:</span> <span class="s2">"Invalid characters in API path"</span><span class="p">}]),</span> <span class="mi">400</span>
|
||||
|
||||
<span class="k">try</span><span class="p">:</span>
|
||||
<span class="k">with</span> <span class="n">api</span><span class="o">.</span><span class="n">config</span><span class="p">[</span><span class="s2">"DNFLOCK"</span><span class="p">]</span><span class="o">.</span><span class="n">lock</span><span class="p">:</span>
|
||||
<span class="n">deps</span> <span class="o">=</span> <span class="n">projects_depsolve</span><span class="p">(</span><span class="n">api</span><span class="o">.</span><span class="n">config</span><span class="p">[</span><span class="s2">"DNFLOCK"</span><span class="p">]</span><span class="o">.</span><span class="n">dbo</span><span class="p">,</span> <span class="p">[(</span><span class="n">n</span><span class="p">,</span> <span class="s2">"*"</span><span class="p">)</span> <span class="k">for</span> <span class="n">n</span> <span class="ow">in</span> <span class="n">project_names</span><span class="o">.</span><span class="n">split</span><span class="p">(</span><span class="s2">","</span><span class="p">)],</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">"(v0_projects_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>
|
||||
<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="p">[</span><span class="nb">str</span><span class="p">(</span><span class="n">e</span><span class="p">)]),</span> <span class="mi">400</span>
|
||||
<span class="k">return</span> <span class="n">jsonify</span><span class="p">(</span><span class="n">status</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="n">errors</span><span class="o">=</span><span class="p">[{</span><span class="s2">"id"</span><span class="p">:</span> <span class="n">PROJECTS_ERROR</span><span class="p">,</span> <span class="s2">"msg"</span><span class="p">:</span> <span class="nb">str</span><span class="p">(</span><span class="n">e</span><span class="p">)}]),</span> <span class="mi">400</span>
|
||||
|
||||
<span class="k">if</span> <span class="ow">not</span> <span class="n">deps</span><span class="p">:</span>
|
||||
<span class="n">msg</span> <span class="o">=</span> <span class="s2">"one of the requested projects does not exist: </span><span class="si">%s</span><span class="s2">"</span> <span class="o">%</span> <span class="n">project_names</span>
|
||||
<span class="n">log</span><span class="o">.</span><span class="n">error</span><span class="p">(</span><span class="s2">"(v0_projects_depsolve) </span><span class="si">%s</span><span class="s2">"</span><span class="p">,</span> <span class="n">msg</span><span class="p">)</span>
|
||||
<span class="k">return</span> <span class="n">jsonify</span><span class="p">(</span><span class="n">status</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="n">errors</span><span class="o">=</span><span class="p">[{</span><span class="s2">"id"</span><span class="p">:</span> <span class="n">UNKNOWN_PROJECT</span><span class="p">,</span> <span class="s2">"msg"</span><span class="p">:</span> <span class="n">msg</span><span class="p">}]),</span> <span class="mi">400</span>
|
||||
|
||||
<span class="k">return</span> <span class="n">jsonify</span><span class="p">(</span><span class="n">projects</span><span class="o">=</span><span class="n">deps</span><span class="p">)</span>
|
||||
|
||||
@ -1557,11 +1704,18 @@
|
||||
<span class="n">sources</span> <span class="o">=</span> <span class="nb">sorted</span><span class="p">([</span><span class="n">r</span><span class="o">.</span><span class="n">id</span> <span class="k">for</span> <span class="n">r</span> <span class="ow">in</span> <span class="n">repos</span><span class="p">])</span>
|
||||
<span class="k">return</span> <span class="n">jsonify</span><span class="p">(</span><span class="n">sources</span><span class="o">=</span><span class="n">sources</span><span class="p">)</span>
|
||||
|
||||
<span class="nd">@api</span><span class="o">.</span><span class="n">route</span><span class="p">(</span><span class="s2">"/api/v0/projects/source/info"</span><span class="p">,</span> <span class="n">defaults</span><span class="o">=</span><span class="p">{</span><span class="s1">'source_names'</span><span class="p">:</span> <span class="s2">""</span><span class="p">})</span>
|
||||
<span class="nd">@api</span><span class="o">.</span><span class="n">route</span><span class="p">(</span><span class="s2">"/api/v0/projects/source/info/<source_names>"</span><span class="p">)</span>
|
||||
<span class="nd">@crossdomain</span><span class="p">(</span><span class="n">origin</span><span class="o">=</span><span class="s2">"*"</span><span class="p">)</span>
|
||||
<span class="nd">@checkparams</span><span class="p">([(</span><span class="s2">"source_names"</span><span class="p">,</span> <span class="s2">""</span><span class="p">,</span> <span class="s2">"no source names given"</span><span class="p">)])</span>
|
||||
<span class="k">def</span> <span class="nf">v0_projects_source_info</span><span class="p">(</span><span class="n">source_names</span><span class="p">):</span>
|
||||
<span class="sd">"""Return detailed info about the list of sources"""</span>
|
||||
<span class="k">if</span> <span class="n">VALID_API_STRING</span><span class="o">.</span><span class="n">match</span><span class="p">(</span><span class="n">source_names</span><span class="p">)</span> <span class="ow">is</span> <span class="kc">None</span><span class="p">:</span>
|
||||
<span class="k">return</span> <span class="n">jsonify</span><span class="p">(</span><span class="n">status</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="n">errors</span><span class="o">=</span><span class="p">[{</span><span class="s2">"id"</span><span class="p">:</span> <span class="n">INVALID_CHARS</span><span class="p">,</span> <span class="s2">"msg"</span><span class="p">:</span> <span class="s2">"Invalid characters in API path"</span><span class="p">}]),</span> <span class="mi">400</span>
|
||||
|
||||
<span class="n">out_fmt</span> <span class="o">=</span> <span class="n">request</span><span class="o">.</span><span class="n">args</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">"format"</span><span class="p">,</span> <span class="s2">"json"</span><span class="p">)</span>
|
||||
<span class="k">if</span> <span class="n">VALID_API_STRING</span><span class="o">.</span><span class="n">match</span><span class="p">(</span><span class="n">out_fmt</span><span class="p">)</span> <span class="ow">is</span> <span class="kc">None</span><span class="p">:</span>
|
||||
<span class="k">return</span> <span class="n">jsonify</span><span class="p">(</span><span class="n">status</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="n">errors</span><span class="o">=</span><span class="p">[{</span><span class="s2">"id"</span><span class="p">:</span> <span class="n">INVALID_CHARS</span><span class="p">,</span> <span class="s2">"msg"</span><span class="p">:</span> <span class="s2">"Invalid characters in format argument"</span><span class="p">}]),</span> <span class="mi">400</span>
|
||||
|
||||
<span class="c1"># Return info on all of the sources</span>
|
||||
<span class="k">if</span> <span class="n">source_names</span> <span class="o">==</span> <span class="s2">"*"</span><span class="p">:</span>
|
||||
@ -1575,7 +1729,7 @@
|
||||
<span class="k">with</span> <span class="n">api</span><span class="o">.</span><span class="n">config</span><span class="p">[</span><span class="s2">"DNFLOCK"</span><span class="p">]</span><span class="o">.</span><span class="n">lock</span><span class="p">:</span>
|
||||
<span class="n">repo</span> <span class="o">=</span> <span class="n">api</span><span class="o">.</span><span class="n">config</span><span class="p">[</span><span class="s2">"DNFLOCK"</span><span class="p">]</span><span class="o">.</span><span class="n">dbo</span><span class="o">.</span><span class="n">repos</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="n">source</span><span class="p">,</span> <span class="kc">None</span><span class="p">)</span>
|
||||
<span class="k">if</span> <span class="ow">not</span> <span class="n">repo</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"> is not a valid source"</span> <span class="o">%</span> <span class="n">source</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">"id"</span><span class="p">:</span> <span class="n">UNKNOWN_SOURCE</span><span class="p">,</span> <span class="s2">"msg"</span><span class="p">:</span> <span class="s2">"</span><span class="si">%s</span><span class="s2"> is not a valid source"</span> <span class="o">%</span> <span class="n">source</span><span class="p">})</span>
|
||||
<span class="k">continue</span>
|
||||
<span class="n">sources</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="o">=</span> <span class="n">repo_to_source</span><span class="p">(</span><span class="n">repo</span><span class="p">,</span> <span class="n">repo</span><span class="o">.</span><span class="n">id</span> <span class="ow">in</span> <span class="n">system_sources</span><span class="p">)</span>
|
||||
|
||||
@ -1599,7 +1753,7 @@
|
||||
|
||||
<span class="n">system_sources</span> <span class="o">=</span> <span class="n">get_repo_sources</span><span class="p">(</span><span class="s2">"/etc/yum.repos.d/*.repo"</span><span class="p">)</span>
|
||||
<span class="k">if</span> <span class="n">source</span><span class="p">[</span><span class="s2">"name"</span><span class="p">]</span> <span class="ow">in</span> <span class="n">system_sources</span><span class="p">:</span>
|
||||
<span class="k">return</span> <span class="n">jsonify</span><span class="p">(</span><span class="n">status</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="n">errors</span><span class="o">=</span><span class="p">[</span><span class="s2">"</span><span class="si">%s</span><span class="s2"> is a system source, it cannot be changed."</span> <span class="o">%</span> <span class="n">source</span><span class="p">[</span><span class="s2">"name"</span><span class="p">]]),</span> <span class="mi">400</span>
|
||||
<span class="k">return</span> <span class="n">jsonify</span><span class="p">(</span><span class="n">status</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="n">errors</span><span class="o">=</span><span class="p">[{</span><span class="s2">"id"</span><span class="p">:</span> <span class="n">SYSTEM_SOURCE</span><span class="p">,</span> <span class="s2">"msg"</span><span class="p">:</span> <span class="s2">"</span><span class="si">%s</span><span class="s2"> is a system source, it cannot be changed."</span> <span class="o">%</span> <span class="n">source</span><span class="p">[</span><span class="s2">"name"</span><span class="p">]}]),</span> <span class="mi">400</span>
|
||||
|
||||
<span class="k">try</span><span class="p">:</span>
|
||||
<span class="c1"># Remove it from the RepoDict (NOTE that this isn't explicitly supported by the DNF API)</span>
|
||||
@ -1644,17 +1798,22 @@
|
||||
<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="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="p">[</span><span class="nb">str</span><span class="p">(</span><span class="n">e</span><span class="p">)]),</span> <span class="mi">400</span>
|
||||
<span class="k">return</span> <span class="n">jsonify</span><span class="p">(</span><span class="n">status</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="n">errors</span><span class="o">=</span><span class="p">[{</span><span class="s2">"id"</span><span class="p">:</span> <span class="n">PROJECTS_ERROR</span><span class="p">,</span> <span class="s2">"msg"</span><span class="p">:</span> <span class="nb">str</span><span class="p">(</span><span class="n">e</span><span class="p">)}]),</span> <span class="mi">400</span>
|
||||
|
||||
<span class="k">return</span> <span class="n">jsonify</span><span class="p">(</span><span class="n">status</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span>
|
||||
|
||||
<span class="nd">@api</span><span class="o">.</span><span class="n">route</span><span class="p">(</span><span class="s2">"/api/v0/projects/source/delete"</span><span class="p">,</span> <span class="n">defaults</span><span class="o">=</span><span class="p">{</span><span class="s1">'source_name'</span><span class="p">:</span> <span class="s2">""</span><span class="p">},</span> <span class="n">methods</span><span class="o">=</span><span class="p">[</span><span class="s2">"DELETE"</span><span class="p">])</span>
|
||||
<span class="nd">@api</span><span class="o">.</span><span class="n">route</span><span class="p">(</span><span class="s2">"/api/v0/projects/source/delete/<source_name>"</span><span class="p">,</span> <span class="n">methods</span><span class="o">=</span><span class="p">[</span><span class="s2">"DELETE"</span><span class="p">])</span>
|
||||
<span class="nd">@crossdomain</span><span class="p">(</span><span class="n">origin</span><span class="o">=</span><span class="s2">"*"</span><span class="p">)</span>
|
||||
<span class="nd">@checkparams</span><span class="p">([(</span><span class="s2">"source_name"</span><span class="p">,</span> <span class="s2">""</span><span class="p">,</span> <span class="s2">"no source name given"</span><span class="p">)])</span>
|
||||
<span class="k">def</span> <span class="nf">v0_projects_source_delete</span><span class="p">(</span><span class="n">source_name</span><span class="p">):</span>
|
||||
<span class="sd">"""Delete the named source and return a status response"""</span>
|
||||
<span class="k">if</span> <span class="n">VALID_API_STRING</span><span class="o">.</span><span class="n">match</span><span class="p">(</span><span class="n">source_name</span><span class="p">)</span> <span class="ow">is</span> <span class="kc">None</span><span class="p">:</span>
|
||||
<span class="k">return</span> <span class="n">jsonify</span><span class="p">(</span><span class="n">status</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="n">errors</span><span class="o">=</span><span class="p">[{</span><span class="s2">"id"</span><span class="p">:</span> <span class="n">INVALID_CHARS</span><span class="p">,</span> <span class="s2">"msg"</span><span class="p">:</span> <span class="s2">"Invalid characters in API path"</span><span class="p">}]),</span> <span class="mi">400</span>
|
||||
|
||||
<span class="n">system_sources</span> <span class="o">=</span> <span class="n">get_repo_sources</span><span class="p">(</span><span class="s2">"/etc/yum.repos.d/*.repo"</span><span class="p">)</span>
|
||||
<span class="k">if</span> <span class="n">source_name</span> <span class="ow">in</span> <span class="n">system_sources</span><span class="p">:</span>
|
||||
<span class="k">return</span> <span class="n">jsonify</span><span class="p">(</span><span class="n">status</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="n">errors</span><span class="o">=</span><span class="p">[</span><span class="s2">"</span><span class="si">%s</span><span class="s2"> is a system source, it cannot be deleted."</span> <span class="o">%</span> <span class="n">source_name</span><span class="p">]),</span> <span class="mi">400</span>
|
||||
<span class="k">return</span> <span class="n">jsonify</span><span class="p">(</span><span class="n">status</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="n">errors</span><span class="o">=</span><span class="p">[{</span><span class="s2">"id"</span><span class="p">:</span> <span class="n">SYSTEM_SOURCE</span><span class="p">,</span> <span class="s2">"msg"</span><span class="p">:</span> <span class="s2">"</span><span class="si">%s</span><span class="s2"> is a system source, it cannot be deleted."</span> <span class="o">%</span> <span class="n">source_name</span><span class="p">}]),</span> <span class="mi">400</span>
|
||||
<span class="n">share_dir</span> <span class="o">=</span> <span class="n">api</span><span class="o">.</span><span class="n">config</span><span class="p">[</span><span class="s2">"COMPOSER_CFG"</span><span class="p">]</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">"repo_dir"</span><span class="p">)</span>
|
||||
<span class="k">try</span><span class="p">:</span>
|
||||
<span class="c1"># Remove the file entry for the source</span>
|
||||
@ -1670,7 +1829,7 @@
|
||||
|
||||
<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">"(v0_projects_source_delete) </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">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="p">[</span><span class="nb">str</span><span class="p">(</span><span class="n">e</span><span class="p">)]),</span> <span class="mi">400</span>
|
||||
<span class="k">return</span> <span class="n">jsonify</span><span class="p">(</span><span class="n">status</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="n">errors</span><span class="o">=</span><span class="p">[{</span><span class="s2">"id"</span><span class="p">:</span> <span class="n">UNKNOWN_SOURCE</span><span class="p">,</span> <span class="s2">"msg"</span><span class="p">:</span> <span class="nb">str</span><span class="p">(</span><span class="n">e</span><span class="p">)}]),</span> <span class="mi">400</span>
|
||||
|
||||
<span class="k">return</span> <span class="n">jsonify</span><span class="p">(</span><span class="n">status</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span>
|
||||
|
||||
@ -1679,11 +1838,14 @@
|
||||
<span class="nd">@crossdomain</span><span class="p">(</span><span class="n">origin</span><span class="o">=</span><span class="s2">"*"</span><span class="p">)</span>
|
||||
<span class="k">def</span> <span class="nf">v0_modules_list</span><span class="p">(</span><span class="n">module_names</span><span class="o">=</span><span class="kc">None</span><span class="p">):</span>
|
||||
<span class="sd">"""List available modules, filtering by module_names"""</span>
|
||||
<span class="k">if</span> <span class="n">module_names</span> <span class="ow">and</span> <span class="n">VALID_API_STRING</span><span class="o">.</span><span class="n">match</span><span class="p">(</span><span class="n">module_names</span><span class="p">)</span> <span class="ow">is</span> <span class="kc">None</span><span class="p">:</span>
|
||||
<span class="k">return</span> <span class="n">jsonify</span><span class="p">(</span><span class="n">status</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="n">errors</span><span class="o">=</span><span class="p">[{</span><span class="s2">"id"</span><span class="p">:</span> <span class="n">INVALID_CHARS</span><span class="p">,</span> <span class="s2">"msg"</span><span class="p">:</span> <span class="s2">"Invalid characters in API path"</span><span class="p">}]),</span> <span class="mi">400</span>
|
||||
|
||||
<span class="k">try</span><span class="p">:</span>
|
||||
<span class="n">limit</span> <span class="o">=</span> <span class="nb">int</span><span class="p">(</span><span class="n">request</span><span class="o">.</span><span class="n">args</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">"limit"</span><span class="p">,</span> <span class="s2">"20"</span><span class="p">))</span>
|
||||
<span class="n">offset</span> <span class="o">=</span> <span class="nb">int</span><span class="p">(</span><span class="n">request</span><span class="o">.</span><span class="n">args</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">"offset"</span><span class="p">,</span> <span class="s2">"0"</span><span class="p">))</span>
|
||||
<span class="k">except</span> <span class="ne">ValueError</span> <span class="k">as</span> <span class="n">e</span><span class="p">:</span>
|
||||
<span class="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="p">[</span><span class="nb">str</span><span class="p">(</span><span class="n">e</span><span class="p">)]),</span> <span class="mi">400</span>
|
||||
<span class="k">return</span> <span class="n">jsonify</span><span class="p">(</span><span class="n">status</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="n">errors</span><span class="o">=</span><span class="p">[{</span><span class="s2">"id"</span><span class="p">:</span> <span class="n">BAD_LIMIT_OR_OFFSET</span><span class="p">,</span> <span class="s2">"msg"</span><span class="p">:</span> <span class="nb">str</span><span class="p">(</span><span class="n">e</span><span class="p">)}]),</span> <span class="mi">400</span>
|
||||
|
||||
<span class="k">if</span> <span class="n">module_names</span><span class="p">:</span>
|
||||
<span class="n">module_names</span> <span class="o">=</span> <span class="n">module_names</span><span class="o">.</span><span class="n">split</span><span class="p">(</span><span class="s2">","</span><span class="p">)</span>
|
||||
@ -1693,21 +1855,35 @@
|
||||
<span class="n">available</span> <span class="o">=</span> <span class="n">modules_list</span><span class="p">(</span><span class="n">api</span><span class="o">.</span><span class="n">config</span><span class="p">[</span><span class="s2">"DNFLOCK"</span><span class="p">]</span><span class="o">.</span><span class="n">dbo</span><span class="p">,</span> <span class="n">module_names</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">"(v0_modules_list) </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">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="p">[</span><span class="nb">str</span><span class="p">(</span><span class="n">e</span><span class="p">)]),</span> <span class="mi">400</span>
|
||||
<span class="k">return</span> <span class="n">jsonify</span><span class="p">(</span><span class="n">status</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="n">errors</span><span class="o">=</span><span class="p">[{</span><span class="s2">"id"</span><span class="p">:</span> <span class="n">MODULES_ERROR</span><span class="p">,</span> <span class="s2">"msg"</span><span class="p">:</span> <span class="nb">str</span><span class="p">(</span><span class="n">e</span><span class="p">)}]),</span> <span class="mi">400</span>
|
||||
|
||||
<span class="k">if</span> <span class="n">module_names</span> <span class="ow">and</span> <span class="ow">not</span> <span class="n">available</span><span class="p">:</span>
|
||||
<span class="n">msg</span> <span class="o">=</span> <span class="s2">"one of the requested modules does not exist: </span><span class="si">%s</span><span class="s2">"</span> <span class="o">%</span> <span class="n">module_names</span>
|
||||
<span class="n">log</span><span class="o">.</span><span class="n">error</span><span class="p">(</span><span class="s2">"(v0_modules_list) </span><span class="si">%s</span><span class="s2">"</span><span class="p">,</span> <span class="n">msg</span><span class="p">)</span>
|
||||
<span class="k">return</span> <span class="n">jsonify</span><span class="p">(</span><span class="n">status</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="n">errors</span><span class="o">=</span><span class="p">[{</span><span class="s2">"id"</span><span class="p">:</span> <span class="n">UNKNOWN_MODULE</span><span class="p">,</span> <span class="s2">"msg"</span><span class="p">:</span> <span class="n">msg</span><span class="p">}]),</span> <span class="mi">400</span>
|
||||
|
||||
<span class="n">modules</span> <span class="o">=</span> <span class="n">take_limits</span><span class="p">(</span><span class="n">available</span><span class="p">,</span> <span class="n">offset</span><span class="p">,</span> <span class="n">limit</span><span class="p">)</span>
|
||||
<span class="k">return</span> <span class="n">jsonify</span><span class="p">(</span><span class="n">modules</span><span class="o">=</span><span class="n">modules</span><span class="p">,</span> <span class="n">offset</span><span class="o">=</span><span class="n">offset</span><span class="p">,</span> <span class="n">limit</span><span class="o">=</span><span class="n">limit</span><span class="p">,</span> <span class="n">total</span><span class="o">=</span><span class="nb">len</span><span class="p">(</span><span class="n">available</span><span class="p">))</span>
|
||||
|
||||
<span class="nd">@api</span><span class="o">.</span><span class="n">route</span><span class="p">(</span><span class="s2">"/api/v0/modules/info"</span><span class="p">,</span> <span class="n">defaults</span><span class="o">=</span><span class="p">{</span><span class="s1">'module_names'</span><span class="p">:</span> <span class="s2">""</span><span class="p">})</span>
|
||||
<span class="nd">@api</span><span class="o">.</span><span class="n">route</span><span class="p">(</span><span class="s2">"/api/v0/modules/info/<module_names>"</span><span class="p">)</span>
|
||||
<span class="nd">@crossdomain</span><span class="p">(</span><span class="n">origin</span><span class="o">=</span><span class="s2">"*"</span><span class="p">)</span>
|
||||
<span class="nd">@checkparams</span><span class="p">([(</span><span class="s2">"module_names"</span><span class="p">,</span> <span class="s2">""</span><span class="p">,</span> <span class="s2">"no module names given"</span><span class="p">)])</span>
|
||||
<span class="k">def</span> <span class="nf">v0_modules_info</span><span class="p">(</span><span class="n">module_names</span><span class="p">):</span>
|
||||
<span class="sd">"""Return detailed information about the listed modules"""</span>
|
||||
<span class="k">if</span> <span class="n">VALID_API_STRING</span><span class="o">.</span><span class="n">match</span><span class="p">(</span><span class="n">module_names</span><span class="p">)</span> <span class="ow">is</span> <span class="kc">None</span><span class="p">:</span>
|
||||
<span class="k">return</span> <span class="n">jsonify</span><span class="p">(</span><span class="n">status</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="n">errors</span><span class="o">=</span><span class="p">[{</span><span class="s2">"id"</span><span class="p">:</span> <span class="n">INVALID_CHARS</span><span class="p">,</span> <span class="s2">"msg"</span><span class="p">:</span> <span class="s2">"Invalid characters in API path"</span><span class="p">}]),</span> <span class="mi">400</span>
|
||||
<span class="k">try</span><span class="p">:</span>
|
||||
<span class="k">with</span> <span class="n">api</span><span class="o">.</span><span class="n">config</span><span class="p">[</span><span class="s2">"DNFLOCK"</span><span class="p">]</span><span class="o">.</span><span class="n">lock</span><span class="p">:</span>
|
||||
<span class="n">modules</span> <span class="o">=</span> <span class="n">modules_info</span><span class="p">(</span><span class="n">api</span><span class="o">.</span><span class="n">config</span><span class="p">[</span><span class="s2">"DNFLOCK"</span><span class="p">]</span><span class="o">.</span><span class="n">dbo</span><span class="p">,</span> <span class="n">module_names</span><span class="o">.</span><span class="n">split</span><span class="p">(</span><span class="s2">","</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">"(v0_modules_info) </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">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="p">[</span><span class="nb">str</span><span class="p">(</span><span class="n">e</span><span class="p">)]),</span> <span class="mi">400</span>
|
||||
<span class="k">return</span> <span class="n">jsonify</span><span class="p">(</span><span class="n">status</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="n">errors</span><span class="o">=</span><span class="p">[{</span><span class="s2">"id"</span><span class="p">:</span> <span class="n">MODULES_ERROR</span><span class="p">,</span> <span class="s2">"msg"</span><span class="p">:</span> <span class="nb">str</span><span class="p">(</span><span class="n">e</span><span class="p">)}]),</span> <span class="mi">400</span>
|
||||
|
||||
<span class="k">if</span> <span class="ow">not</span> <span class="n">modules</span><span class="p">:</span>
|
||||
<span class="n">msg</span> <span class="o">=</span> <span class="s2">"one of the requested modules does not exist: </span><span class="si">%s</span><span class="s2">"</span> <span class="o">%</span> <span class="n">module_names</span>
|
||||
<span class="n">log</span><span class="o">.</span><span class="n">error</span><span class="p">(</span><span class="s2">"(v0_modules_info) </span><span class="si">%s</span><span class="s2">"</span><span class="p">,</span> <span class="n">msg</span><span class="p">)</span>
|
||||
<span class="k">return</span> <span class="n">jsonify</span><span class="p">(</span><span class="n">status</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="n">errors</span><span class="o">=</span><span class="p">[{</span><span class="s2">"id"</span><span class="p">:</span> <span class="n">UNKNOWN_MODULE</span><span class="p">,</span> <span class="s2">"msg"</span><span class="p">:</span> <span class="n">msg</span><span class="p">}]),</span> <span class="mi">400</span>
|
||||
|
||||
<span class="k">return</span> <span class="n">jsonify</span><span class="p">(</span><span class="n">modules</span><span class="o">=</span><span class="n">modules</span><span class="p">)</span>
|
||||
|
||||
@ -1732,10 +1908,10 @@
|
||||
|
||||
<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">compose</span><span class="p">:</span>
|
||||
<span class="k">return</span> <span class="n">jsonify</span><span class="p">(</span><span class="n">status</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="n">errors</span><span class="o">=</span><span class="p">[</span><span class="s2">"Missing POST body"</span><span class="p">]),</span> <span class="mi">400</span>
|
||||
<span class="k">return</span> <span class="n">jsonify</span><span class="p">(</span><span class="n">status</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="n">errors</span><span class="o">=</span><span class="p">[{</span><span class="s2">"id"</span><span class="p">:</span> <span class="n">MISSING_POST</span><span class="p">,</span> <span class="s2">"msg"</span><span class="p">:</span> <span class="s2">"Missing POST body"</span><span class="p">}]),</span> <span class="mi">400</span>
|
||||
|
||||
<span class="k">if</span> <span class="s2">"blueprint_name"</span> <span class="ow">not</span> <span class="ow">in</span> <span class="n">compose</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">"No 'blueprint_name' in the JSON request"</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">"id"</span><span class="p">:</span> <span class="n">UNKNOWN_BLUEPRINT</span><span class="p">,</span><span class="s2">"msg"</span><span class="p">:</span> <span class="s2">"No 'blueprint_name' in the JSON request"</span><span class="p">})</span>
|
||||
<span class="k">else</span><span class="p">:</span>
|
||||
<span class="n">blueprint_name</span> <span class="o">=</span> <span class="n">compose</span><span class="p">[</span><span class="s2">"blueprint_name"</span><span class="p">]</span>
|
||||
|
||||
@ -1745,10 +1921,13 @@
|
||||
<span class="n">branch</span> <span class="o">=</span> <span class="n">compose</span><span class="p">[</span><span class="s2">"branch"</span><span class="p">]</span>
|
||||
|
||||
<span class="k">if</span> <span class="s2">"compose_type"</span> <span class="ow">not</span> <span class="ow">in</span> <span class="n">compose</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">"No 'compose_type' in the JSON request"</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">"id"</span><span class="p">:</span> <span class="n">BAD_COMPOSE_TYPE</span><span class="p">,</span> <span class="s2">"msg"</span><span class="p">:</span> <span class="s2">"No 'compose_type' in the JSON request"</span><span class="p">})</span>
|
||||
<span class="k">else</span><span class="p">:</span>
|
||||
<span class="n">compose_type</span> <span class="o">=</span> <span class="n">compose</span><span class="p">[</span><span class="s2">"compose_type"</span><span class="p">]</span>
|
||||
|
||||
<span class="k">if</span> <span class="n">VALID_API_STRING</span><span class="o">.</span><span class="n">match</span><span class="p">(</span><span class="n">blueprint_name</span><span class="p">)</span> <span class="ow">is</span> <span class="kc">None</span><span class="p">:</span>
|
||||
<span class="n">errors</span><span class="o">.</span><span class="n">append</span><span class="p">({</span><span class="s2">"id"</span><span class="p">:</span> <span class="n">INVALID_CHARS</span><span class="p">,</span> <span class="s2">"msg"</span><span class="p">:</span> <span class="s2">"Invalid characters in API path"</span><span class="p">})</span>
|
||||
|
||||
<span class="k">if</span> <span class="n">errors</span><span class="p">:</span>
|
||||
<span class="k">return</span> <span class="n">jsonify</span><span class="p">(</span><span class="n">status</span><span class="o">=</span><span class="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>
|
||||
|
||||
@ -1756,7 +1935,10 @@
|
||||
<span class="n">build_id</span> <span class="o">=</span> <span class="n">start_build</span><span class="p">(</span><span class="n">api</span><span class="o">.</span><span class="n">config</span><span class="p">[</span><span class="s2">"COMPOSER_CFG"</span><span class="p">],</span> <span class="n">api</span><span class="o">.</span><span class="n">config</span><span class="p">[</span><span class="s2">"DNFLOCK"</span><span class="p">],</span> <span class="n">api</span><span class="o">.</span><span class="n">config</span><span class="p">[</span><span class="s2">"GITLOCK"</span><span class="p">],</span>
|
||||
<span class="n">branch</span><span class="p">,</span> <span class="n">blueprint_name</span><span class="p">,</span> <span class="n">compose_type</span><span class="p">,</span> <span class="n">test_mode</span><span class="p">)</span>
|
||||
<span class="k">except</span> <span class="ne">Exception</span> <span class="k">as</span> <span class="n">e</span><span class="p">:</span>
|
||||
<span class="k">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="p">[</span><span class="nb">str</span><span class="p">(</span><span class="n">e</span><span class="p">)]),</span> <span class="mi">400</span>
|
||||
<span class="k">if</span> <span class="s2">"Invalid compose type"</span> <span class="ow">in</span> <span class="nb">str</span><span class="p">(</span><span class="n">e</span><span class="p">):</span>
|
||||
<span class="k">return</span> <span class="n">jsonify</span><span class="p">(</span><span class="n">status</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="n">errors</span><span class="o">=</span><span class="p">[{</span><span class="s2">"id"</span><span class="p">:</span> <span class="n">BAD_COMPOSE_TYPE</span><span class="p">,</span> <span class="s2">"msg"</span><span class="p">:</span> <span class="nb">str</span><span class="p">(</span><span class="n">e</span><span class="p">)}]),</span> <span class="mi">400</span>
|
||||
<span class="k">else</span><span class="p">:</span>
|
||||
<span class="k">return</span> <span class="n">jsonify</span><span class="p">(</span><span class="n">status</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="n">errors</span><span class="o">=</span><span class="p">[{</span><span class="s2">"id"</span><span class="p">:</span> <span class="n">BUILD_FAILED</span><span class="p">,</span> <span class="s2">"msg"</span><span class="p">:</span> <span class="nb">str</span><span class="p">(</span><span class="n">e</span><span class="p">)}]),</span> <span class="mi">400</span>
|
||||
|
||||
<span class="k">return</span> <span class="n">jsonify</span><span class="p">(</span><span class="n">status</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="n">build_id</span><span class="o">=</span><span class="n">build_id</span><span class="p">)</span>
|
||||
|
||||
@ -1788,152 +1970,203 @@
|
||||
<span class="sd">"""Return the list of failed composes"""</span>
|
||||
<span class="k">return</span> <span class="n">jsonify</span><span class="p">(</span><span class="n">failed</span><span class="o">=</span><span class="n">build_status</span><span class="p">(</span><span class="n">api</span><span class="o">.</span><span class="n">config</span><span class="p">[</span><span class="s2">"COMPOSER_CFG"</span><span class="p">],</span> <span class="s2">"FAILED"</span><span class="p">))</span>
|
||||
|
||||
<span class="nd">@api</span><span class="o">.</span><span class="n">route</span><span class="p">(</span><span class="s2">"/api/v0/compose/status"</span><span class="p">,</span> <span class="n">defaults</span><span class="o">=</span><span class="p">{</span><span class="s1">'uuids'</span><span class="p">:</span> <span class="s2">""</span><span class="p">})</span>
|
||||
<span class="nd">@api</span><span class="o">.</span><span class="n">route</span><span class="p">(</span><span class="s2">"/api/v0/compose/status/<uuids>"</span><span class="p">)</span>
|
||||
<span class="nd">@crossdomain</span><span class="p">(</span><span class="n">origin</span><span class="o">=</span><span class="s2">"*"</span><span class="p">)</span>
|
||||
<span class="nd">@checkparams</span><span class="p">([(</span><span class="s2">"uuids"</span><span class="p">,</span> <span class="s2">""</span><span class="p">,</span> <span class="s2">"no UUIDs given"</span><span class="p">)])</span>
|
||||
<span class="k">def</span> <span class="nf">v0_compose_status</span><span class="p">(</span><span class="n">uuids</span><span class="p">):</span>
|
||||
<span class="sd">"""Return the status of the listed uuids"""</span>
|
||||
<span class="k">if</span> <span class="n">VALID_API_STRING</span><span class="o">.</span><span class="n">match</span><span class="p">(</span><span class="n">uuids</span><span class="p">)</span> <span class="ow">is</span> <span class="kc">None</span><span class="p">:</span>
|
||||
<span class="k">return</span> <span class="n">jsonify</span><span class="p">(</span><span class="n">status</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="n">errors</span><span class="o">=</span><span class="p">[{</span><span class="s2">"id"</span><span class="p">:</span> <span class="n">INVALID_CHARS</span><span class="p">,</span> <span class="s2">"msg"</span><span class="p">:</span> <span class="s2">"Invalid characters in API path"</span><span class="p">}]),</span> <span class="mi">400</span>
|
||||
|
||||
<span class="n">results</span> <span class="o">=</span> <span class="p">[]</span>
|
||||
<span class="n">errors</span> <span class="o">=</span> <span class="p">[]</span>
|
||||
<span class="k">for</span> <span class="n">uuid</span> <span class="ow">in</span> <span class="p">[</span><span class="n">n</span><span class="o">.</span><span class="n">strip</span><span class="p">()</span><span class="o">.</span><span class="n">lower</span><span class="p">()</span> <span class="k">for</span> <span class="n">n</span> <span class="ow">in</span> <span class="n">uuids</span><span class="o">.</span><span class="n">split</span><span class="p">(</span><span class="s2">","</span><span class="p">)]:</span>
|
||||
<span class="n">details</span> <span class="o">=</span> <span class="n">uuid_status</span><span class="p">(</span><span class="n">api</span><span class="o">.</span><span class="n">config</span><span class="p">[</span><span class="s2">"COMPOSER_CFG"</span><span class="p">],</span> <span class="n">uuid</span><span class="p">)</span>
|
||||
<span class="k">if</span> <span class="n">details</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span><span class="p">:</span>
|
||||
<span class="n">results</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">details</span><span class="p">)</span>
|
||||
<span class="k">else</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">"id"</span><span class="p">:</span> <span class="n">UNKNOWN_UUID</span><span class="p">,</span> <span class="s2">"msg"</span><span class="p">:</span> <span class="s2">"</span><span class="si">%s</span><span class="s2"> is not a valid build uuid"</span> <span class="o">%</span> <span class="n">uuid</span><span class="p">})</span>
|
||||
|
||||
<span class="k">return</span> <span class="n">jsonify</span><span class="p">(</span><span class="n">uuids</span><span class="o">=</span><span class="n">results</span><span class="p">)</span>
|
||||
<span class="k">return</span> <span class="n">jsonify</span><span class="p">(</span><span class="n">uuids</span><span class="o">=</span><span class="n">results</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="nd">@api</span><span class="o">.</span><span class="n">route</span><span class="p">(</span><span class="s2">"/api/v0/compose/cancel"</span><span class="p">,</span> <span class="n">defaults</span><span class="o">=</span><span class="p">{</span><span class="s1">'uuid'</span><span class="p">:</span> <span class="s2">""</span><span class="p">},</span> <span class="n">methods</span><span class="o">=</span><span class="p">[</span><span class="s2">"DELETE"</span><span class="p">])</span>
|
||||
<span class="nd">@api</span><span class="o">.</span><span class="n">route</span><span class="p">(</span><span class="s2">"/api/v0/compose/cancel/<uuid>"</span><span class="p">,</span> <span class="n">methods</span><span class="o">=</span><span class="p">[</span><span class="s2">"DELETE"</span><span class="p">])</span>
|
||||
<span class="nd">@crossdomain</span><span class="p">(</span><span class="n">origin</span><span class="o">=</span><span class="s2">"*"</span><span class="p">)</span>
|
||||
<span class="nd">@checkparams</span><span class="p">([(</span><span class="s2">"uuid"</span><span class="p">,</span> <span class="s2">""</span><span class="p">,</span> <span class="s2">"no UUID given"</span><span class="p">)])</span>
|
||||
<span class="k">def</span> <span class="nf">v0_compose_cancel</span><span class="p">(</span><span class="n">uuid</span><span class="p">):</span>
|
||||
<span class="sd">"""Cancel a running compose and delete its results directory"""</span>
|
||||
<span class="k">if</span> <span class="n">VALID_API_STRING</span><span class="o">.</span><span class="n">match</span><span class="p">(</span><span class="n">uuid</span><span class="p">)</span> <span class="ow">is</span> <span class="kc">None</span><span class="p">:</span>
|
||||
<span class="k">return</span> <span class="n">jsonify</span><span class="p">(</span><span class="n">status</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="n">errors</span><span class="o">=</span><span class="p">[{</span><span class="s2">"id"</span><span class="p">:</span> <span class="n">INVALID_CHARS</span><span class="p">,</span> <span class="s2">"msg"</span><span class="p">:</span> <span class="s2">"Invalid characters in API path"</span><span class="p">}]),</span> <span class="mi">400</span>
|
||||
|
||||
<span class="n">status</span> <span class="o">=</span> <span class="n">uuid_status</span><span class="p">(</span><span class="n">api</span><span class="o">.</span><span class="n">config</span><span class="p">[</span><span class="s2">"COMPOSER_CFG"</span><span class="p">],</span> <span class="n">uuid</span><span class="p">)</span>
|
||||
<span class="k">if</span> <span class="n">status</span> <span class="ow">is</span> <span class="kc">None</span><span class="p">:</span>
|
||||
<span class="k">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="p">[</span><span class="s2">"</span><span class="si">%s</span><span class="s2"> is not a valid build uuid"</span> <span class="o">%</span> <span class="n">uuid</span><span class="p">]),</span> <span class="mi">400</span>
|
||||
<span class="k">return</span> <span class="n">jsonify</span><span class="p">(</span><span class="n">status</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="n">errors</span><span class="o">=</span><span class="p">[{</span><span class="s2">"id"</span><span class="p">:</span> <span class="n">UNKNOWN_UUID</span><span class="p">,</span> <span class="s2">"msg"</span><span class="p">:</span> <span class="s2">"</span><span class="si">%s</span><span class="s2"> is not a valid build uuid"</span> <span class="o">%</span> <span class="n">uuid</span><span class="p">}]),</span> <span class="mi">400</span>
|
||||
|
||||
<span class="k">if</span> <span class="n">status</span><span class="p">[</span><span class="s2">"queue_status"</span><span class="p">]</span> <span class="ow">not</span> <span class="ow">in</span> <span class="p">[</span><span class="s2">"WAITING"</span><span class="p">,</span> <span class="s2">"RUNNING"</span><span class="p">]:</span>
|
||||
<span class="k">return</span> <span class="n">jsonify</span><span class="p">(</span><span class="n">status</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="n">errors</span><span class="o">=</span><span class="p">[</span><span class="s2">"Build </span><span class="si">%s</span><span class="s2"> is not in WAITING or RUNNING."</span> <span class="o">%</span> <span class="n">uuid</span><span class="p">])</span>
|
||||
<span class="k">return</span> <span class="n">jsonify</span><span class="p">(</span><span class="n">status</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="n">errors</span><span class="o">=</span><span class="p">[{</span><span class="s2">"id"</span><span class="p">:</span> <span class="n">BUILD_IN_WRONG_STATE</span><span class="p">,</span> <span class="s2">"msg"</span><span class="p">:</span> <span class="s2">"Build </span><span class="si">%s</span><span class="s2"> is not in WAITING or RUNNING."</span> <span class="o">%</span> <span class="n">uuid</span><span class="p">}])</span>
|
||||
|
||||
<span class="k">try</span><span class="p">:</span>
|
||||
<span class="n">uuid_cancel</span><span class="p">(</span><span class="n">api</span><span class="o">.</span><span class="n">config</span><span class="p">[</span><span class="s2">"COMPOSER_CFG"</span><span class="p">],</span> <span class="n">uuid</span><span class="p">)</span>
|
||||
<span class="k">except</span> <span class="ne">Exception</span> <span class="k">as</span> <span class="n">e</span><span class="p">:</span>
|
||||
<span class="k">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="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">uuid</span><span class="p">,</span> <span class="nb">str</span><span class="p">(</span><span class="n">e</span><span class="p">))]),</span> <span class="mi">400</span>
|
||||
<span class="k">return</span> <span class="n">jsonify</span><span class="p">(</span><span class="n">status</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="n">errors</span><span class="o">=</span><span class="p">[{</span><span class="s2">"id"</span><span class="p">:</span> <span class="n">COMPOSE_ERROR</span><span class="p">,</span> <span class="s2">"msg"</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">uuid</span><span class="p">,</span> <span class="nb">str</span><span class="p">(</span><span class="n">e</span><span class="p">))}]),</span><span class="mi">400</span>
|
||||
<span class="k">else</span><span class="p">:</span>
|
||||
<span class="k">return</span> <span class="n">jsonify</span><span class="p">(</span><span class="n">status</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="n">uuid</span><span class="o">=</span><span class="n">uuid</span><span class="p">)</span>
|
||||
|
||||
<span class="nd">@api</span><span class="o">.</span><span class="n">route</span><span class="p">(</span><span class="s2">"/api/v0/compose/delete"</span><span class="p">,</span> <span class="n">defaults</span><span class="o">=</span><span class="p">{</span><span class="s1">'uuids'</span><span class="p">:</span> <span class="s2">""</span><span class="p">},</span> <span class="n">methods</span><span class="o">=</span><span class="p">[</span><span class="s2">"DELETE"</span><span class="p">])</span>
|
||||
<span class="nd">@api</span><span class="o">.</span><span class="n">route</span><span class="p">(</span><span class="s2">"/api/v0/compose/delete/<uuids>"</span><span class="p">,</span> <span class="n">methods</span><span class="o">=</span><span class="p">[</span><span class="s2">"DELETE"</span><span class="p">])</span>
|
||||
<span class="nd">@crossdomain</span><span class="p">(</span><span class="n">origin</span><span class="o">=</span><span class="s2">"*"</span><span class="p">)</span>
|
||||
<span class="nd">@checkparams</span><span class="p">([(</span><span class="s2">"uuids"</span><span class="p">,</span> <span class="s2">""</span><span class="p">,</span> <span class="s2">"no UUIDs given"</span><span class="p">)])</span>
|
||||
<span class="k">def</span> <span class="nf">v0_compose_delete</span><span class="p">(</span><span class="n">uuids</span><span class="p">):</span>
|
||||
<span class="sd">"""Delete the compose results for the listed uuids"""</span>
|
||||
<span class="k">if</span> <span class="n">VALID_API_STRING</span><span class="o">.</span><span class="n">match</span><span class="p">(</span><span class="n">uuids</span><span class="p">)</span> <span class="ow">is</span> <span class="kc">None</span><span class="p">:</span>
|
||||
<span class="k">return</span> <span class="n">jsonify</span><span class="p">(</span><span class="n">status</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="n">errors</span><span class="o">=</span><span class="p">[{</span><span class="s2">"id"</span><span class="p">:</span> <span class="n">INVALID_CHARS</span><span class="p">,</span> <span class="s2">"msg"</span><span class="p">:</span> <span class="s2">"Invalid characters in API path"</span><span class="p">}]),</span> <span class="mi">400</span>
|
||||
|
||||
<span class="n">results</span> <span class="o">=</span> <span class="p">[]</span>
|
||||
<span class="n">errors</span> <span class="o">=</span> <span class="p">[]</span>
|
||||
<span class="k">for</span> <span class="n">uuid</span> <span class="ow">in</span> <span class="p">[</span><span class="n">n</span><span class="o">.</span><span class="n">strip</span><span class="p">()</span><span class="o">.</span><span class="n">lower</span><span class="p">()</span> <span class="k">for</span> <span class="n">n</span> <span class="ow">in</span> <span class="n">uuids</span><span class="o">.</span><span class="n">split</span><span class="p">(</span><span class="s2">","</span><span class="p">)]:</span>
|
||||
<span class="n">status</span> <span class="o">=</span> <span class="n">uuid_status</span><span class="p">(</span><span class="n">api</span><span class="o">.</span><span class="n">config</span><span class="p">[</span><span class="s2">"COMPOSER_CFG"</span><span class="p">],</span> <span class="n">uuid</span><span class="p">)</span>
|
||||
<span class="k">if</span> <span class="n">status</span> <span class="ow">is</span> <span class="kc">None</span><span class="p">:</span>
|
||||
<span class="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"> is not a valid build uuid"</span> <span class="o">%</span> <span class="n">uuid</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">"id"</span><span class="p">:</span> <span class="n">UNKNOWN_UUID</span><span class="p">,</span> <span class="s2">"msg"</span><span class="p">:</span> <span class="s2">"</span><span class="si">%s</span><span class="s2"> is not a valid build uuid"</span> <span class="o">%</span> <span class="n">uuid</span><span class="p">})</span>
|
||||
<span class="k">elif</span> <span class="n">status</span><span class="p">[</span><span class="s2">"queue_status"</span><span class="p">]</span> <span class="ow">not</span> <span class="ow">in</span> <span class="p">[</span><span class="s2">"FINISHED"</span><span class="p">,</span> <span class="s2">"FAILED"</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">"Build </span><span class="si">%s</span><span class="s2"> is not in FINISHED or FAILED."</span> <span class="o">%</span> <span class="n">uuid</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">"id"</span><span class="p">:</span> <span class="n">BUILD_IN_WRONG_STATE</span><span class="p">,</span> <span class="s2">"msg"</span><span class="p">:</span> <span class="s2">"Build </span><span class="si">%s</span><span class="s2"> is not in FINISHED or FAILED."</span> <span class="o">%</span> <span class="n">uuid</span><span class="p">})</span>
|
||||
<span class="k">else</span><span class="p">:</span>
|
||||
<span class="k">try</span><span class="p">:</span>
|
||||
<span class="n">uuid_delete</span><span class="p">(</span><span class="n">api</span><span class="o">.</span><span class="n">config</span><span class="p">[</span><span class="s2">"COMPOSER_CFG"</span><span class="p">],</span> <span class="n">uuid</span><span class="p">)</span>
|
||||
<span class="k">except</span> <span class="ne">Exception</span> <span class="k">as</span> <span class="n">e</span><span class="p">:</span>
|
||||
<span class="n">errors</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="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">uuid</span><span class="p">,</span> <span class="nb">str</span><span class="p">(</span><span class="n">e</span><span class="p">)))</span>
|
||||
<span class="n">errors</span><span class="o">.</span><span class="n">append</span><span class="p">({</span><span class="s2">"id"</span><span class="p">:</span> <span class="n">COMPOSE_ERROR</span><span class="p">,</span> <span class="s2">"msg"</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">uuid</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="n">results</span><span class="o">.</span><span class="n">append</span><span class="p">({</span><span class="s2">"uuid"</span><span class="p">:</span><span class="n">uuid</span><span class="p">,</span> <span class="s2">"status"</span><span class="p">:</span><span class="kc">True</span><span class="p">})</span>
|
||||
<span class="k">return</span> <span class="n">jsonify</span><span class="p">(</span><span class="n">uuids</span><span class="o">=</span><span class="n">results</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="nd">@api</span><span class="o">.</span><span class="n">route</span><span class="p">(</span><span class="s2">"/api/v0/compose/info"</span><span class="p">,</span> <span class="n">defaults</span><span class="o">=</span><span class="p">{</span><span class="s1">'uuid'</span><span class="p">:</span> <span class="s2">""</span><span class="p">})</span>
|
||||
<span class="nd">@api</span><span class="o">.</span><span class="n">route</span><span class="p">(</span><span class="s2">"/api/v0/compose/info/<uuid>"</span><span class="p">)</span>
|
||||
<span class="nd">@crossdomain</span><span class="p">(</span><span class="n">origin</span><span class="o">=</span><span class="s2">"*"</span><span class="p">)</span>
|
||||
<span class="nd">@checkparams</span><span class="p">([(</span><span class="s2">"uuid"</span><span class="p">,</span> <span class="s2">""</span><span class="p">,</span> <span class="s2">"no UUID given"</span><span class="p">)])</span>
|
||||
<span class="k">def</span> <span class="nf">v0_compose_info</span><span class="p">(</span><span class="n">uuid</span><span class="p">):</span>
|
||||
<span class="sd">"""Return detailed info about a compose"""</span>
|
||||
<span class="k">if</span> <span class="n">VALID_API_STRING</span><span class="o">.</span><span class="n">match</span><span class="p">(</span><span class="n">uuid</span><span class="p">)</span> <span class="ow">is</span> <span class="kc">None</span><span class="p">:</span>
|
||||
<span class="k">return</span> <span class="n">jsonify</span><span class="p">(</span><span class="n">status</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="n">errors</span><span class="o">=</span><span class="p">[{</span><span class="s2">"id"</span><span class="p">:</span> <span class="n">INVALID_CHARS</span><span class="p">,</span> <span class="s2">"msg"</span><span class="p">:</span> <span class="s2">"Invalid characters in API path"</span><span class="p">}]),</span> <span class="mi">400</span>
|
||||
|
||||
<span class="k">try</span><span class="p">:</span>
|
||||
<span class="n">info</span> <span class="o">=</span> <span class="n">uuid_info</span><span class="p">(</span><span class="n">api</span><span class="o">.</span><span class="n">config</span><span class="p">[</span><span class="s2">"COMPOSER_CFG"</span><span class="p">],</span> <span class="n">uuid</span><span class="p">)</span>
|
||||
<span class="k">except</span> <span class="ne">Exception</span> <span class="k">as</span> <span class="n">e</span><span class="p">:</span>
|
||||
<span class="k">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="p">[</span><span class="nb">str</span><span class="p">(</span><span class="n">e</span><span class="p">)]),</span> <span class="mi">400</span>
|
||||
<span class="k">return</span> <span class="n">jsonify</span><span class="p">(</span><span class="n">status</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="n">errors</span><span class="o">=</span><span class="p">[{</span><span class="s2">"id"</span><span class="p">:</span> <span class="n">COMPOSE_ERROR</span><span class="p">,</span> <span class="s2">"msg"</span><span class="p">:</span> <span class="nb">str</span><span class="p">(</span><span class="n">e</span><span class="p">)}]),</span> <span class="mi">400</span>
|
||||
|
||||
<span class="k">return</span> <span class="n">jsonify</span><span class="p">(</span><span class="o">**</span><span class="n">info</span><span class="p">)</span>
|
||||
<span class="k">if</span> <span class="n">info</span> <span class="ow">is</span> <span class="kc">None</span><span class="p">:</span>
|
||||
<span class="k">return</span> <span class="n">jsonify</span><span class="p">(</span><span class="n">status</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="n">errors</span><span class="o">=</span><span class="p">[{</span><span class="s2">"id"</span><span class="p">:</span> <span class="n">UNKNOWN_UUID</span><span class="p">,</span> <span class="s2">"msg"</span><span class="p">:</span> <span class="s2">"</span><span class="si">%s</span><span class="s2"> is not a valid build uuid"</span> <span class="o">%</span> <span class="n">uuid</span><span class="p">}]),</span> <span class="mi">400</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="o">**</span><span class="n">info</span><span class="p">)</span>
|
||||
|
||||
<span class="nd">@api</span><span class="o">.</span><span class="n">route</span><span class="p">(</span><span class="s2">"/api/v0/compose/metadata"</span><span class="p">,</span> <span class="n">defaults</span><span class="o">=</span><span class="p">{</span><span class="s1">'uuid'</span><span class="p">:</span> <span class="s2">""</span><span class="p">})</span>
|
||||
<span class="nd">@api</span><span class="o">.</span><span class="n">route</span><span class="p">(</span><span class="s2">"/api/v0/compose/metadata/<uuid>"</span><span class="p">)</span>
|
||||
<span class="nd">@crossdomain</span><span class="p">(</span><span class="n">origin</span><span class="o">=</span><span class="s2">"*"</span><span class="p">)</span>
|
||||
<span class="nd">@checkparams</span><span class="p">([(</span><span class="s2">"uuid"</span><span class="p">,</span><span class="s2">""</span><span class="p">,</span> <span class="s2">"no UUID given"</span><span class="p">)])</span>
|
||||
<span class="k">def</span> <span class="nf">v0_compose_metadata</span><span class="p">(</span><span class="n">uuid</span><span class="p">):</span>
|
||||
<span class="sd">"""Return a tar of the metadata for the build"""</span>
|
||||
<span class="k">if</span> <span class="n">VALID_API_STRING</span><span class="o">.</span><span class="n">match</span><span class="p">(</span><span class="n">uuid</span><span class="p">)</span> <span class="ow">is</span> <span class="kc">None</span><span class="p">:</span>
|
||||
<span class="k">return</span> <span class="n">jsonify</span><span class="p">(</span><span class="n">status</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="n">errors</span><span class="o">=</span><span class="p">[{</span><span class="s2">"id"</span><span class="p">:</span> <span class="n">INVALID_CHARS</span><span class="p">,</span> <span class="s2">"msg"</span><span class="p">:</span> <span class="s2">"Invalid characters in API path"</span><span class="p">}]),</span> <span class="mi">400</span>
|
||||
|
||||
<span class="n">status</span> <span class="o">=</span> <span class="n">uuid_status</span><span class="p">(</span><span class="n">api</span><span class="o">.</span><span class="n">config</span><span class="p">[</span><span class="s2">"COMPOSER_CFG"</span><span class="p">],</span> <span class="n">uuid</span><span class="p">)</span>
|
||||
<span class="k">if</span> <span class="n">status</span> <span class="ow">is</span> <span class="kc">None</span><span class="p">:</span>
|
||||
<span class="k">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="p">[</span><span class="s2">"</span><span class="si">%s</span><span class="s2"> is not a valid build uuid"</span> <span class="o">%</span> <span class="n">uuid</span><span class="p">]),</span> <span class="mi">400</span>
|
||||
<span class="k">return</span> <span class="n">jsonify</span><span class="p">(</span><span class="n">status</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="n">errors</span><span class="o">=</span><span class="p">[{</span><span class="s2">"id"</span><span class="p">:</span> <span class="n">UNKNOWN_UUID</span><span class="p">,</span> <span class="s2">"msg"</span><span class="p">:</span> <span class="s2">"</span><span class="si">%s</span><span class="s2"> is not a valid build uuid"</span> <span class="o">%</span> <span class="n">uuid</span><span class="p">}]),</span> <span class="mi">400</span>
|
||||
<span class="k">if</span> <span class="n">status</span><span class="p">[</span><span class="s2">"queue_status"</span><span class="p">]</span> <span class="ow">not</span> <span class="ow">in</span> <span class="p">[</span><span class="s2">"FINISHED"</span><span class="p">,</span> <span class="s2">"FAILED"</span><span class="p">]:</span>
|
||||
<span class="k">return</span> <span class="n">jsonify</span><span class="p">(</span><span class="n">status</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="n">errors</span><span class="o">=</span><span class="p">[</span><span class="s2">"Build </span><span class="si">%s</span><span class="s2"> not in FINISHED or FAILED state."</span> <span class="o">%</span> <span class="n">uuid</span><span class="p">]),</span> <span class="mi">400</span>
|
||||
<span class="k">return</span> <span class="n">jsonify</span><span class="p">(</span><span class="n">status</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="n">errors</span><span class="o">=</span><span class="p">[{</span><span class="s2">"id"</span><span class="p">:</span> <span class="n">BUILD_IN_WRONG_STATE</span><span class="p">,</span> <span class="s2">"msg"</span><span class="p">:</span> <span class="s2">"Build </span><span class="si">%s</span><span class="s2"> not in FINISHED or FAILED state."</span> <span class="o">%</span> <span class="n">uuid</span><span class="p">}]),</span> <span class="mi">400</span>
|
||||
<span class="k">else</span><span class="p">:</span>
|
||||
<span class="k">return</span> <span class="n">Response</span><span class="p">(</span><span class="n">uuid_tar</span><span class="p">(</span><span class="n">api</span><span class="o">.</span><span class="n">config</span><span class="p">[</span><span class="s2">"COMPOSER_CFG"</span><span class="p">],</span> <span class="n">uuid</span><span class="p">,</span> <span class="n">metadata</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="n">image</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="n">logs</span><span class="o">=</span><span class="kc">False</span><span class="p">),</span>
|
||||
<span class="n">mimetype</span><span class="o">=</span><span class="s2">"application/x-tar"</span><span class="p">,</span>
|
||||
<span class="n">headers</span><span class="o">=</span><span class="p">[(</span><span class="s2">"Content-Disposition"</span><span class="p">,</span> <span class="s2">"attachment; filename=</span><span class="si">%s</span><span class="s2">-metadata.tar;"</span> <span class="o">%</span> <span class="n">uuid</span><span class="p">)],</span>
|
||||
<span class="n">direct_passthrough</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span>
|
||||
|
||||
<span class="nd">@api</span><span class="o">.</span><span class="n">route</span><span class="p">(</span><span class="s2">"/api/v0/compose/results"</span><span class="p">,</span> <span class="n">defaults</span><span class="o">=</span><span class="p">{</span><span class="s1">'uuid'</span><span class="p">:</span> <span class="s2">""</span><span class="p">})</span>
|
||||
<span class="nd">@api</span><span class="o">.</span><span class="n">route</span><span class="p">(</span><span class="s2">"/api/v0/compose/results/<uuid>"</span><span class="p">)</span>
|
||||
<span class="nd">@crossdomain</span><span class="p">(</span><span class="n">origin</span><span class="o">=</span><span class="s2">"*"</span><span class="p">)</span>
|
||||
<span class="nd">@checkparams</span><span class="p">([(</span><span class="s2">"uuid"</span><span class="p">,</span><span class="s2">""</span><span class="p">,</span> <span class="s2">"no UUID given"</span><span class="p">)])</span>
|
||||
<span class="k">def</span> <span class="nf">v0_compose_results</span><span class="p">(</span><span class="n">uuid</span><span class="p">):</span>
|
||||
<span class="sd">"""Return a tar of the metadata and the results for the build"""</span>
|
||||
<span class="k">if</span> <span class="n">VALID_API_STRING</span><span class="o">.</span><span class="n">match</span><span class="p">(</span><span class="n">uuid</span><span class="p">)</span> <span class="ow">is</span> <span class="kc">None</span><span class="p">:</span>
|
||||
<span class="k">return</span> <span class="n">jsonify</span><span class="p">(</span><span class="n">status</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="n">errors</span><span class="o">=</span><span class="p">[{</span><span class="s2">"id"</span><span class="p">:</span> <span class="n">INVALID_CHARS</span><span class="p">,</span> <span class="s2">"msg"</span><span class="p">:</span> <span class="s2">"Invalid characters in API path"</span><span class="p">}]),</span> <span class="mi">400</span>
|
||||
|
||||
<span class="n">status</span> <span class="o">=</span> <span class="n">uuid_status</span><span class="p">(</span><span class="n">api</span><span class="o">.</span><span class="n">config</span><span class="p">[</span><span class="s2">"COMPOSER_CFG"</span><span class="p">],</span> <span class="n">uuid</span><span class="p">)</span>
|
||||
<span class="k">if</span> <span class="n">status</span> <span class="ow">is</span> <span class="kc">None</span><span class="p">:</span>
|
||||
<span class="k">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="p">[</span><span class="s2">"</span><span class="si">%s</span><span class="s2"> is not a valid build uuid"</span> <span class="o">%</span> <span class="n">uuid</span><span class="p">]),</span> <span class="mi">400</span>
|
||||
<span class="k">return</span> <span class="n">jsonify</span><span class="p">(</span><span class="n">status</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="n">errors</span><span class="o">=</span><span class="p">[{</span><span class="s2">"id"</span><span class="p">:</span> <span class="n">UNKNOWN_UUID</span><span class="p">,</span> <span class="s2">"msg"</span><span class="p">:</span> <span class="s2">"</span><span class="si">%s</span><span class="s2"> is not a valid build uuid"</span> <span class="o">%</span> <span class="n">uuid</span><span class="p">}]),</span> <span class="mi">400</span>
|
||||
<span class="k">elif</span> <span class="n">status</span><span class="p">[</span><span class="s2">"queue_status"</span><span class="p">]</span> <span class="ow">not</span> <span class="ow">in</span> <span class="p">[</span><span class="s2">"FINISHED"</span><span class="p">,</span> <span class="s2">"FAILED"</span><span class="p">]:</span>
|
||||
<span class="k">return</span> <span class="n">jsonify</span><span class="p">(</span><span class="n">status</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="n">errors</span><span class="o">=</span><span class="p">[</span><span class="s2">"Build </span><span class="si">%s</span><span class="s2"> not in FINISHED or FAILED state."</span> <span class="o">%</span> <span class="n">uuid</span><span class="p">]),</span> <span class="mi">400</span>
|
||||
<span class="k">return</span> <span class="n">jsonify</span><span class="p">(</span><span class="n">status</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="n">errors</span><span class="o">=</span><span class="p">[{</span><span class="s2">"id"</span><span class="p">:</span> <span class="n">BUILD_IN_WRONG_STATE</span><span class="p">,</span> <span class="s2">"msg"</span><span class="p">:</span> <span class="s2">"Build </span><span class="si">%s</span><span class="s2"> not in FINISHED or FAILED state."</span> <span class="o">%</span> <span class="n">uuid</span><span class="p">}]),</span> <span class="mi">400</span>
|
||||
<span class="k">else</span><span class="p">:</span>
|
||||
<span class="k">return</span> <span class="n">Response</span><span class="p">(</span><span class="n">uuid_tar</span><span class="p">(</span><span class="n">api</span><span class="o">.</span><span class="n">config</span><span class="p">[</span><span class="s2">"COMPOSER_CFG"</span><span class="p">],</span> <span class="n">uuid</span><span class="p">,</span> <span class="n">metadata</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="n">image</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="n">logs</span><span class="o">=</span><span class="kc">True</span><span class="p">),</span>
|
||||
<span class="n">mimetype</span><span class="o">=</span><span class="s2">"application/x-tar"</span><span class="p">,</span>
|
||||
<span class="n">headers</span><span class="o">=</span><span class="p">[(</span><span class="s2">"Content-Disposition"</span><span class="p">,</span> <span class="s2">"attachment; filename=</span><span class="si">%s</span><span class="s2">.tar;"</span> <span class="o">%</span> <span class="n">uuid</span><span class="p">)],</span>
|
||||
<span class="n">direct_passthrough</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span>
|
||||
|
||||
<span class="nd">@api</span><span class="o">.</span><span class="n">route</span><span class="p">(</span><span class="s2">"/api/v0/compose/logs"</span><span class="p">,</span> <span class="n">defaults</span><span class="o">=</span><span class="p">{</span><span class="s1">'uuid'</span><span class="p">:</span> <span class="s2">""</span><span class="p">})</span>
|
||||
<span class="nd">@api</span><span class="o">.</span><span class="n">route</span><span class="p">(</span><span class="s2">"/api/v0/compose/logs/<uuid>"</span><span class="p">)</span>
|
||||
<span class="nd">@crossdomain</span><span class="p">(</span><span class="n">origin</span><span class="o">=</span><span class="s2">"*"</span><span class="p">)</span>
|
||||
<span class="nd">@checkparams</span><span class="p">([(</span><span class="s2">"uuid"</span><span class="p">,</span><span class="s2">""</span><span class="p">,</span> <span class="s2">"no UUID given"</span><span class="p">)])</span>
|
||||
<span class="k">def</span> <span class="nf">v0_compose_logs</span><span class="p">(</span><span class="n">uuid</span><span class="p">):</span>
|
||||
<span class="sd">"""Return a tar of the metadata for the build"""</span>
|
||||
<span class="k">if</span> <span class="n">VALID_API_STRING</span><span class="o">.</span><span class="n">match</span><span class="p">(</span><span class="n">uuid</span><span class="p">)</span> <span class="ow">is</span> <span class="kc">None</span><span class="p">:</span>
|
||||
<span class="k">return</span> <span class="n">jsonify</span><span class="p">(</span><span class="n">status</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="n">errors</span><span class="o">=</span><span class="p">[{</span><span class="s2">"id"</span><span class="p">:</span> <span class="n">INVALID_CHARS</span><span class="p">,</span> <span class="s2">"msg"</span><span class="p">:</span> <span class="s2">"Invalid characters in API path"</span><span class="p">}]),</span> <span class="mi">400</span>
|
||||
|
||||
<span class="n">status</span> <span class="o">=</span> <span class="n">uuid_status</span><span class="p">(</span><span class="n">api</span><span class="o">.</span><span class="n">config</span><span class="p">[</span><span class="s2">"COMPOSER_CFG"</span><span class="p">],</span> <span class="n">uuid</span><span class="p">)</span>
|
||||
<span class="k">if</span> <span class="n">status</span> <span class="ow">is</span> <span class="kc">None</span><span class="p">:</span>
|
||||
<span class="k">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="p">[</span><span class="s2">"</span><span class="si">%s</span><span class="s2"> is not a valid build uuid"</span> <span class="o">%</span> <span class="n">uuid</span><span class="p">]),</span> <span class="mi">400</span>
|
||||
<span class="k">return</span> <span class="n">jsonify</span><span class="p">(</span><span class="n">status</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="n">errors</span><span class="o">=</span><span class="p">[{</span><span class="s2">"id"</span><span class="p">:</span> <span class="n">UNKNOWN_UUID</span><span class="p">,</span> <span class="s2">"msg"</span><span class="p">:</span> <span class="s2">"</span><span class="si">%s</span><span class="s2"> is not a valid build uuid"</span> <span class="o">%</span> <span class="n">uuid</span><span class="p">}]),</span> <span class="mi">400</span>
|
||||
<span class="k">elif</span> <span class="n">status</span><span class="p">[</span><span class="s2">"queue_status"</span><span class="p">]</span> <span class="ow">not</span> <span class="ow">in</span> <span class="p">[</span><span class="s2">"FINISHED"</span><span class="p">,</span> <span class="s2">"FAILED"</span><span class="p">]:</span>
|
||||
<span class="k">return</span> <span class="n">jsonify</span><span class="p">(</span><span class="n">status</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="n">errors</span><span class="o">=</span><span class="p">[</span><span class="s2">"Build </span><span class="si">%s</span><span class="s2"> not in FINISHED or FAILED state."</span> <span class="o">%</span> <span class="n">uuid</span><span class="p">]),</span> <span class="mi">400</span>
|
||||
<span class="k">return</span> <span class="n">jsonify</span><span class="p">(</span><span class="n">status</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="n">errors</span><span class="o">=</span><span class="p">[{</span><span class="s2">"id"</span><span class="p">:</span> <span class="n">BUILD_IN_WRONG_STATE</span><span class="p">,</span> <span class="s2">"msg"</span><span class="p">:</span> <span class="s2">"Build </span><span class="si">%s</span><span class="s2"> not in FINISHED or FAILED state."</span> <span class="o">%</span> <span class="n">uuid</span><span class="p">}]),</span> <span class="mi">400</span>
|
||||
<span class="k">else</span><span class="p">:</span>
|
||||
<span class="k">return</span> <span class="n">Response</span><span class="p">(</span><span class="n">uuid_tar</span><span class="p">(</span><span class="n">api</span><span class="o">.</span><span class="n">config</span><span class="p">[</span><span class="s2">"COMPOSER_CFG"</span><span class="p">],</span> <span class="n">uuid</span><span class="p">,</span> <span class="n">metadata</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="n">image</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="n">logs</span><span class="o">=</span><span class="kc">True</span><span class="p">),</span>
|
||||
<span class="n">mimetype</span><span class="o">=</span><span class="s2">"application/x-tar"</span><span class="p">,</span>
|
||||
<span class="n">headers</span><span class="o">=</span><span class="p">[(</span><span class="s2">"Content-Disposition"</span><span class="p">,</span> <span class="s2">"attachment; filename=</span><span class="si">%s</span><span class="s2">-logs.tar;"</span> <span class="o">%</span> <span class="n">uuid</span><span class="p">)],</span>
|
||||
<span class="n">direct_passthrough</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span>
|
||||
|
||||
<span class="nd">@api</span><span class="o">.</span><span class="n">route</span><span class="p">(</span><span class="s2">"/api/v0/compose/image"</span><span class="p">,</span> <span class="n">defaults</span><span class="o">=</span><span class="p">{</span><span class="s1">'uuid'</span><span class="p">:</span> <span class="s2">""</span><span class="p">})</span>
|
||||
<span class="nd">@api</span><span class="o">.</span><span class="n">route</span><span class="p">(</span><span class="s2">"/api/v0/compose/image/<uuid>"</span><span class="p">)</span>
|
||||
<span class="nd">@crossdomain</span><span class="p">(</span><span class="n">origin</span><span class="o">=</span><span class="s2">"*"</span><span class="p">)</span>
|
||||
<span class="nd">@checkparams</span><span class="p">([(</span><span class="s2">"uuid"</span><span class="p">,</span><span class="s2">""</span><span class="p">,</span> <span class="s2">"no UUID given"</span><span class="p">)])</span>
|
||||
<span class="k">def</span> <span class="nf">v0_compose_image</span><span class="p">(</span><span class="n">uuid</span><span class="p">):</span>
|
||||
<span class="sd">"""Return the output image for the build"""</span>
|
||||
<span class="k">if</span> <span class="n">VALID_API_STRING</span><span class="o">.</span><span class="n">match</span><span class="p">(</span><span class="n">uuid</span><span class="p">)</span> <span class="ow">is</span> <span class="kc">None</span><span class="p">:</span>
|
||||
<span class="k">return</span> <span class="n">jsonify</span><span class="p">(</span><span class="n">status</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="n">errors</span><span class="o">=</span><span class="p">[{</span><span class="s2">"id"</span><span class="p">:</span> <span class="n">INVALID_CHARS</span><span class="p">,</span> <span class="s2">"msg"</span><span class="p">:</span> <span class="s2">"Invalid characters in API path"</span><span class="p">}]),</span> <span class="mi">400</span>
|
||||
|
||||
<span class="n">status</span> <span class="o">=</span> <span class="n">uuid_status</span><span class="p">(</span><span class="n">api</span><span class="o">.</span><span class="n">config</span><span class="p">[</span><span class="s2">"COMPOSER_CFG"</span><span class="p">],</span> <span class="n">uuid</span><span class="p">)</span>
|
||||
<span class="k">if</span> <span class="n">status</span> <span class="ow">is</span> <span class="kc">None</span><span class="p">:</span>
|
||||
<span class="k">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="p">[</span><span class="s2">"</span><span class="si">%s</span><span class="s2"> is not a valid build uuid"</span> <span class="o">%</span> <span class="n">uuid</span><span class="p">]),</span> <span class="mi">400</span>
|
||||
<span class="k">return</span> <span class="n">jsonify</span><span class="p">(</span><span class="n">status</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="n">errors</span><span class="o">=</span><span class="p">[{</span><span class="s2">"id"</span><span class="p">:</span> <span class="n">UNKNOWN_UUID</span><span class="p">,</span> <span class="s2">"msg"</span><span class="p">:</span> <span class="s2">"</span><span class="si">%s</span><span class="s2"> is not a valid build uuid"</span> <span class="o">%</span> <span class="n">uuid</span><span class="p">}]),</span> <span class="mi">400</span>
|
||||
<span class="k">elif</span> <span class="n">status</span><span class="p">[</span><span class="s2">"queue_status"</span><span class="p">]</span> <span class="ow">not</span> <span class="ow">in</span> <span class="p">[</span><span class="s2">"FINISHED"</span><span class="p">,</span> <span class="s2">"FAILED"</span><span class="p">]:</span>
|
||||
<span class="k">return</span> <span class="n">jsonify</span><span class="p">(</span><span class="n">status</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="n">errors</span><span class="o">=</span><span class="p">[</span><span class="s2">"Build </span><span class="si">%s</span><span class="s2"> not in FINISHED or FAILED state."</span> <span class="o">%</span> <span class="n">uuid</span><span class="p">]),</span> <span class="mi">400</span>
|
||||
<span class="k">return</span> <span class="n">jsonify</span><span class="p">(</span><span class="n">status</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="n">errors</span><span class="o">=</span><span class="p">[{</span><span class="s2">"id"</span><span class="p">:</span> <span class="n">BUILD_IN_WRONG_STATE</span><span class="p">,</span> <span class="s2">"msg"</span><span class="p">:</span> <span class="s2">"Build </span><span class="si">%s</span><span class="s2"> not in FINISHED or FAILED state."</span> <span class="o">%</span> <span class="n">uuid</span><span class="p">}]),</span> <span class="mi">400</span>
|
||||
<span class="k">else</span><span class="p">:</span>
|
||||
<span class="n">image_name</span><span class="p">,</span> <span class="n">image_path</span> <span class="o">=</span> <span class="n">uuid_image</span><span class="p">(</span><span class="n">api</span><span class="o">.</span><span class="n">config</span><span class="p">[</span><span class="s2">"COMPOSER_CFG"</span><span class="p">],</span> <span class="n">uuid</span><span class="p">)</span>
|
||||
|
||||
<span class="c1"># Make sure it really exists</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">image_path</span><span class="p">):</span>
|
||||
<span class="k">return</span> <span class="n">jsonify</span><span class="p">(</span><span class="n">status</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="n">errors</span><span class="o">=</span><span class="p">[</span><span class="s2">"Build </span><span class="si">%s</span><span class="s2"> is missing image file </span><span class="si">%s</span><span class="s2">"</span> <span class="o">%</span> <span class="p">(</span><span class="n">uuid</span><span class="p">,</span> <span class="n">image_name</span><span class="p">)]),</span> <span class="mi">400</span>
|
||||
<span class="k">return</span> <span class="n">jsonify</span><span class="p">(</span><span class="n">status</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="n">errors</span><span class="o">=</span><span class="p">[{</span><span class="s2">"id"</span><span class="p">:</span> <span class="n">BUILD_MISSING_FILE</span><span class="p">,</span> <span class="s2">"msg"</span><span class="p">:</span> <span class="s2">"Build </span><span class="si">%s</span><span class="s2"> is missing image file </span><span class="si">%s</span><span class="s2">"</span> <span class="o">%</span> <span class="p">(</span><span class="n">uuid</span><span class="p">,</span> <span class="n">image_name</span><span class="p">)}]),</span> <span class="mi">400</span>
|
||||
|
||||
<span class="c1"># Make the image name unique</span>
|
||||
<span class="n">image_name</span> <span class="o">=</span> <span class="n">uuid</span> <span class="o">+</span> <span class="s2">"-"</span> <span class="o">+</span> <span class="n">image_name</span>
|
||||
<span class="c1"># XXX - Will mime type guessing work for all our output?</span>
|
||||
<span class="k">return</span> <span class="n">send_file</span><span class="p">(</span><span class="n">image_path</span><span class="p">,</span> <span class="n">as_attachment</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="n">attachment_filename</span><span class="o">=</span><span class="n">image_name</span><span class="p">,</span> <span class="n">add_etags</span><span class="o">=</span><span class="kc">False</span><span class="p">)</span>
|
||||
|
||||
<span class="nd">@api</span><span class="o">.</span><span class="n">route</span><span class="p">(</span><span class="s2">"/api/v0/compose/log"</span><span class="p">,</span> <span class="n">defaults</span><span class="o">=</span><span class="p">{</span><span class="s1">'uuid'</span><span class="p">:</span> <span class="s2">""</span><span class="p">})</span>
|
||||
<span class="nd">@api</span><span class="o">.</span><span class="n">route</span><span class="p">(</span><span class="s2">"/api/v0/compose/log/<uuid>"</span><span class="p">)</span>
|
||||
<span class="nd">@crossdomain</span><span class="p">(</span><span class="n">origin</span><span class="o">=</span><span class="s2">"*"</span><span class="p">)</span>
|
||||
<span class="nd">@checkparams</span><span class="p">([(</span><span class="s2">"uuid"</span><span class="p">,</span><span class="s2">""</span><span class="p">,</span> <span class="s2">"no UUID given"</span><span class="p">)])</span>
|
||||
<span class="k">def</span> <span class="nf">v0_compose_log_tail</span><span class="p">(</span><span class="n">uuid</span><span class="p">):</span>
|
||||
<span class="sd">"""Return the end of the main anaconda.log, defaults to 1Mbytes"""</span>
|
||||
<span class="k">if</span> <span class="n">VALID_API_STRING</span><span class="o">.</span><span class="n">match</span><span class="p">(</span><span class="n">uuid</span><span class="p">)</span> <span class="ow">is</span> <span class="kc">None</span><span class="p">:</span>
|
||||
<span class="k">return</span> <span class="n">jsonify</span><span class="p">(</span><span class="n">status</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="n">errors</span><span class="o">=</span><span class="p">[{</span><span class="s2">"id"</span><span class="p">:</span> <span class="n">INVALID_CHARS</span><span class="p">,</span> <span class="s2">"msg"</span><span class="p">:</span> <span class="s2">"Invalid characters in API path"</span><span class="p">}]),</span> <span class="mi">400</span>
|
||||
|
||||
<span class="k">try</span><span class="p">:</span>
|
||||
<span class="n">size</span> <span class="o">=</span> <span class="nb">int</span><span class="p">(</span><span class="n">request</span><span class="o">.</span><span class="n">args</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">"size"</span><span class="p">,</span> <span class="s2">"1024"</span><span class="p">))</span>
|
||||
<span class="k">except</span> <span class="ne">ValueError</span> <span class="k">as</span> <span class="n">e</span><span class="p">:</span>
|
||||
<span class="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="p">[</span><span class="nb">str</span><span class="p">(</span><span class="n">e</span><span class="p">)]),</span> <span class="mi">400</span>
|
||||
<span class="k">return</span> <span class="n">jsonify</span><span class="p">(</span><span class="n">status</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="n">errors</span><span class="o">=</span><span class="p">[{</span><span class="s2">"id"</span><span class="p">:</span> <span class="n">COMPOSE_ERROR</span><span class="p">,</span> <span class="s2">"msg"</span><span class="p">:</span> <span class="nb">str</span><span class="p">(</span><span class="n">e</span><span class="p">)}]),</span> <span class="mi">400</span>
|
||||
|
||||
<span class="n">status</span> <span class="o">=</span> <span class="n">uuid_status</span><span class="p">(</span><span class="n">api</span><span class="o">.</span><span class="n">config</span><span class="p">[</span><span class="s2">"COMPOSER_CFG"</span><span class="p">],</span> <span class="n">uuid</span><span class="p">)</span>
|
||||
<span class="k">if</span> <span class="n">status</span> <span class="ow">is</span> <span class="kc">None</span><span class="p">:</span>
|
||||
<span class="k">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="p">[</span><span class="s2">"</span><span class="si">%s</span><span class="s2"> is not a valid build uuid"</span> <span class="o">%</span> <span class="n">uuid</span><span class="p">]),</span> <span class="mi">400</span>
|
||||
<span class="k">return</span> <span class="n">jsonify</span><span class="p">(</span><span class="n">status</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="n">errors</span><span class="o">=</span><span class="p">[{</span><span class="s2">"id"</span><span class="p">:</span> <span class="n">UNKNOWN_UUID</span><span class="p">,</span> <span class="s2">"msg"</span><span class="p">:</span> <span class="s2">"</span><span class="si">%s</span><span class="s2"> is not a valid build uuid"</span> <span class="o">%</span> <span class="n">uuid</span><span class="p">}]),</span> <span class="mi">400</span>
|
||||
<span class="k">elif</span> <span class="n">status</span><span class="p">[</span><span class="s2">"queue_status"</span><span class="p">]</span> <span class="o">==</span> <span class="s2">"WAITING"</span><span class="p">:</span>
|
||||
<span class="k">return</span> <span class="n">jsonify</span><span class="p">(</span><span class="n">status</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="n">errors</span><span class="o">=</span><span class="p">[</span><span class="s2">"Build </span><span class="si">%s</span><span class="s2"> has not started yet. No logs to view"</span> <span class="o">%</span> <span class="n">uuid</span><span class="p">])</span>
|
||||
<span class="k">return</span> <span class="n">jsonify</span><span class="p">(</span><span class="n">status</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="n">errors</span><span class="o">=</span><span class="p">[{</span><span class="s2">"id"</span><span class="p">:</span> <span class="n">BUILD_IN_WRONG_STATE</span><span class="p">,</span> <span class="s2">"msg"</span><span class="p">:</span> <span class="s2">"Build </span><span class="si">%s</span><span class="s2"> has not started yet. No logs to view"</span> <span class="o">%</span> <span class="n">uuid</span><span class="p">}])</span>
|
||||
<span class="k">try</span><span class="p">:</span>
|
||||
<span class="k">return</span> <span class="n">Response</span><span class="p">(</span><span class="n">uuid_log</span><span class="p">(</span><span class="n">api</span><span class="o">.</span><span class="n">config</span><span class="p">[</span><span class="s2">"COMPOSER_CFG"</span><span class="p">],</span> <span class="n">uuid</span><span class="p">,</span> <span class="n">size</span><span class="p">),</span> <span class="n">direct_passthrough</span><span class="o">=</span><span class="kc">True</span><span class="p">)</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">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="p">[</span><span class="nb">str</span><span class="p">(</span><span class="n">e</span><span class="p">)]),</span> <span class="mi">400</span></div>
|
||||
<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="p">[{</span><span class="s2">"id"</span><span class="p">:</span> <span class="n">COMPOSE_ERROR</span><span class="p">,</span> <span class="s2">"msg"</span><span class="p">:</span> <span class="nb">str</span><span class="p">(</span><span class="n">e</span><span class="p">)}]),</span> <span class="mi">400</span></div>
|
||||
</pre></div>
|
||||
|
||||
</div>
|
||||
@ -1968,7 +2201,7 @@
|
||||
<script type="text/javascript">
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT:'../../../',
|
||||
VERSION:'29.10',
|
||||
VERSION:'29.11',
|
||||
LANGUAGE:'None',
|
||||
COLLAPSE_INDEX:false,
|
||||
FILE_SUFFIX:'.html',
|
||||
@ -1982,7 +2215,10 @@
|
||||
|
||||
|
||||
|
||||
<script type="text/javascript" src="../../../_static/js/theme.js"></script>
|
||||
|
||||
|
||||
<script type="text/javascript" src="../../../_static/js/theme.js"></script>
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
jQuery(function () {
|
||||
|
@ -8,7 +8,7 @@
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<title>pylorax.api.workspace — Lorax 29.10 documentation</title>
|
||||
<title>pylorax.api.workspace — Lorax 29.11 documentation</title>
|
||||
|
||||
|
||||
|
||||
@ -24,7 +24,8 @@
|
||||
|
||||
|
||||
|
||||
<link rel="stylesheet" href="../../../_static/css/theme.css" type="text/css" />
|
||||
|
||||
<link rel="stylesheet" href="../../../_static/css/theme.css" type="text/css" />
|
||||
<link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" />
|
||||
<link rel="index" title="Index" href="../../../genindex.html" />
|
||||
<link rel="search" title="Search" href="../../../search.html" />
|
||||
@ -56,7 +57,7 @@
|
||||
|
||||
|
||||
<div class="version">
|
||||
29.10
|
||||
29.11
|
||||
</div>
|
||||
|
||||
|
||||
@ -287,7 +288,7 @@
|
||||
<script type="text/javascript">
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT:'../../../',
|
||||
VERSION:'29.10',
|
||||
VERSION:'29.11',
|
||||
LANGUAGE:'None',
|
||||
COLLAPSE_INDEX:false,
|
||||
FILE_SUFFIX:'.html',
|
||||
@ -301,7 +302,10 @@
|
||||
|
||||
|
||||
|
||||
<script type="text/javascript" src="../../../_static/js/theme.js"></script>
|
||||
|
||||
|
||||
<script type="text/javascript" src="../../../_static/js/theme.js"></script>
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
jQuery(function () {
|
||||
|
@ -8,7 +8,7 @@
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<title>pylorax.base — Lorax 29.10 documentation</title>
|
||||
<title>pylorax.base — Lorax 29.11 documentation</title>
|
||||
|
||||
|
||||
|
||||
@ -24,7 +24,8 @@
|
||||
|
||||
|
||||
|
||||
<link rel="stylesheet" href="../../_static/css/theme.css" type="text/css" />
|
||||
|
||||
<link rel="stylesheet" href="../../_static/css/theme.css" type="text/css" />
|
||||
<link rel="stylesheet" href="../../_static/pygments.css" type="text/css" />
|
||||
<link rel="index" title="Index" href="../../genindex.html" />
|
||||
<link rel="search" title="Search" href="../../search.html" />
|
||||
@ -56,7 +57,7 @@
|
||||
|
||||
|
||||
<div class="version">
|
||||
29.10
|
||||
29.11
|
||||
</div>
|
||||
|
||||
|
||||
@ -255,7 +256,7 @@
|
||||
<script type="text/javascript">
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT:'../../',
|
||||
VERSION:'29.10',
|
||||
VERSION:'29.11',
|
||||
LANGUAGE:'None',
|
||||
COLLAPSE_INDEX:false,
|
||||
FILE_SUFFIX:'.html',
|
||||
@ -269,7 +270,10 @@
|
||||
|
||||
|
||||
|
||||
<script type="text/javascript" src="../../_static/js/theme.js"></script>
|
||||
|
||||
|
||||
<script type="text/javascript" src="../../_static/js/theme.js"></script>
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
jQuery(function () {
|
||||
|
@ -8,7 +8,7 @@
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<title>pylorax.buildstamp — Lorax 29.10 documentation</title>
|
||||
<title>pylorax.buildstamp — Lorax 29.11 documentation</title>
|
||||
|
||||
|
||||
|
||||
@ -24,7 +24,8 @@
|
||||
|
||||
|
||||
|
||||
<link rel="stylesheet" href="../../_static/css/theme.css" type="text/css" />
|
||||
|
||||
<link rel="stylesheet" href="../../_static/css/theme.css" type="text/css" />
|
||||
<link rel="stylesheet" href="../../_static/pygments.css" type="text/css" />
|
||||
<link rel="index" title="Index" href="../../genindex.html" />
|
||||
<link rel="search" title="Search" href="../../search.html" />
|
||||
@ -56,7 +57,7 @@
|
||||
|
||||
|
||||
<div class="version">
|
||||
29.10
|
||||
29.11
|
||||
</div>
|
||||
|
||||
|
||||
@ -249,7 +250,7 @@
|
||||
<script type="text/javascript">
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT:'../../',
|
||||
VERSION:'29.10',
|
||||
VERSION:'29.11',
|
||||
LANGUAGE:'None',
|
||||
COLLAPSE_INDEX:false,
|
||||
FILE_SUFFIX:'.html',
|
||||
@ -263,7 +264,10 @@
|
||||
|
||||
|
||||
|
||||
<script type="text/javascript" src="../../_static/js/theme.js"></script>
|
||||
|
||||
|
||||
<script type="text/javascript" src="../../_static/js/theme.js"></script>
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
jQuery(function () {
|
||||
|
@ -8,7 +8,7 @@
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<title>pylorax.cmdline — Lorax 29.10 documentation</title>
|
||||
<title>pylorax.cmdline — Lorax 29.11 documentation</title>
|
||||
|
||||
|
||||
|
||||
@ -24,7 +24,8 @@
|
||||
|
||||
|
||||
|
||||
<link rel="stylesheet" href="../../_static/css/theme.css" type="text/css" />
|
||||
|
||||
<link rel="stylesheet" href="../../_static/css/theme.css" type="text/css" />
|
||||
<link rel="stylesheet" href="../../_static/pygments.css" type="text/css" />
|
||||
<link rel="index" title="Index" href="../../genindex.html" />
|
||||
<link rel="search" title="Search" href="../../search.html" />
|
||||
@ -56,7 +57,7 @@
|
||||
|
||||
|
||||
<div class="version">
|
||||
29.10
|
||||
29.11
|
||||
</div>
|
||||
|
||||
|
||||
@ -492,7 +493,7 @@
|
||||
<script type="text/javascript">
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT:'../../',
|
||||
VERSION:'29.10',
|
||||
VERSION:'29.11',
|
||||
LANGUAGE:'None',
|
||||
COLLAPSE_INDEX:false,
|
||||
FILE_SUFFIX:'.html',
|
||||
@ -506,7 +507,10 @@
|
||||
|
||||
|
||||
|
||||
<script type="text/javascript" src="../../_static/js/theme.js"></script>
|
||||
|
||||
|
||||
<script type="text/javascript" src="../../_static/js/theme.js"></script>
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
jQuery(function () {
|
||||
|
@ -8,7 +8,7 @@
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<title>pylorax.creator — Lorax 29.10 documentation</title>
|
||||
<title>pylorax.creator — Lorax 29.11 documentation</title>
|
||||
|
||||
|
||||
|
||||
@ -24,7 +24,8 @@
|
||||
|
||||
|
||||
|
||||
<link rel="stylesheet" href="../../_static/css/theme.css" type="text/css" />
|
||||
|
||||
<link rel="stylesheet" href="../../_static/css/theme.css" type="text/css" />
|
||||
<link rel="stylesheet" href="../../_static/pygments.css" type="text/css" />
|
||||
<link rel="index" title="Index" href="../../genindex.html" />
|
||||
<link rel="search" title="Search" href="../../search.html" />
|
||||
@ -56,7 +57,7 @@
|
||||
|
||||
|
||||
<div class="version">
|
||||
29.10
|
||||
29.11
|
||||
</div>
|
||||
|
||||
|
||||
@ -902,7 +903,7 @@
|
||||
<script type="text/javascript">
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT:'../../',
|
||||
VERSION:'29.10',
|
||||
VERSION:'29.11',
|
||||
LANGUAGE:'None',
|
||||
COLLAPSE_INDEX:false,
|
||||
FILE_SUFFIX:'.html',
|
||||
@ -916,7 +917,10 @@
|
||||
|
||||
|
||||
|
||||
<script type="text/javascript" src="../../_static/js/theme.js"></script>
|
||||
|
||||
|
||||
<script type="text/javascript" src="../../_static/js/theme.js"></script>
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
jQuery(function () {
|
||||
|
@ -8,7 +8,7 @@
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<title>pylorax.decorators — Lorax 29.10 documentation</title>
|
||||
<title>pylorax.decorators — Lorax 29.11 documentation</title>
|
||||
|
||||
|
||||
|
||||
@ -24,7 +24,8 @@
|
||||
|
||||
|
||||
|
||||
<link rel="stylesheet" href="../../_static/css/theme.css" type="text/css" />
|
||||
|
||||
<link rel="stylesheet" href="../../_static/css/theme.css" type="text/css" />
|
||||
<link rel="stylesheet" href="../../_static/pygments.css" type="text/css" />
|
||||
<link rel="index" title="Index" href="../../genindex.html" />
|
||||
<link rel="search" title="Search" href="../../search.html" />
|
||||
@ -56,7 +57,7 @@
|
||||
|
||||
|
||||
<div class="version">
|
||||
29.10
|
||||
29.11
|
||||
</div>
|
||||
|
||||
|
||||
@ -218,7 +219,7 @@
|
||||
<script type="text/javascript">
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT:'../../',
|
||||
VERSION:'29.10',
|
||||
VERSION:'29.11',
|
||||
LANGUAGE:'None',
|
||||
COLLAPSE_INDEX:false,
|
||||
FILE_SUFFIX:'.html',
|
||||
@ -232,7 +233,10 @@
|
||||
|
||||
|
||||
|
||||
<script type="text/javascript" src="../../_static/js/theme.js"></script>
|
||||
|
||||
|
||||
<script type="text/javascript" src="../../_static/js/theme.js"></script>
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
jQuery(function () {
|
||||
|
@ -8,7 +8,7 @@
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<title>pylorax.discinfo — Lorax 29.10 documentation</title>
|
||||
<title>pylorax.discinfo — Lorax 29.11 documentation</title>
|
||||
|
||||
|
||||
|
||||
@ -24,7 +24,8 @@
|
||||
|
||||
|
||||
|
||||
<link rel="stylesheet" href="../../_static/css/theme.css" type="text/css" />
|
||||
|
||||
<link rel="stylesheet" href="../../_static/css/theme.css" type="text/css" />
|
||||
<link rel="stylesheet" href="../../_static/pygments.css" type="text/css" />
|
||||
<link rel="index" title="Index" href="../../genindex.html" />
|
||||
<link rel="search" title="Search" href="../../search.html" />
|
||||
@ -56,7 +57,7 @@
|
||||
|
||||
|
||||
<div class="version">
|
||||
29.10
|
||||
29.11
|
||||
</div>
|
||||
|
||||
|
||||
@ -227,7 +228,7 @@
|
||||
<script type="text/javascript">
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT:'../../',
|
||||
VERSION:'29.10',
|
||||
VERSION:'29.11',
|
||||
LANGUAGE:'None',
|
||||
COLLAPSE_INDEX:false,
|
||||
FILE_SUFFIX:'.html',
|
||||
@ -241,7 +242,10 @@
|
||||
|
||||
|
||||
|
||||
<script type="text/javascript" src="../../_static/js/theme.js"></script>
|
||||
|
||||
|
||||
<script type="text/javascript" src="../../_static/js/theme.js"></script>
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
jQuery(function () {
|
||||
|
@ -8,7 +8,7 @@
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<title>pylorax.dnfhelper — Lorax 29.10 documentation</title>
|
||||
<title>pylorax.dnfhelper — Lorax 29.11 documentation</title>
|
||||
|
||||
|
||||
|
||||
@ -24,7 +24,8 @@
|
||||
|
||||
|
||||
|
||||
<link rel="stylesheet" href="../../_static/css/theme.css" type="text/css" />
|
||||
|
||||
<link rel="stylesheet" href="../../_static/css/theme.css" type="text/css" />
|
||||
<link rel="stylesheet" href="../../_static/pygments.css" type="text/css" />
|
||||
<link rel="index" title="Index" href="../../genindex.html" />
|
||||
<link rel="search" title="Search" href="../../search.html" />
|
||||
@ -56,7 +57,7 @@
|
||||
|
||||
|
||||
<div class="version">
|
||||
29.10
|
||||
29.11
|
||||
</div>
|
||||
|
||||
|
||||
@ -298,7 +299,7 @@
|
||||
<script type="text/javascript">
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT:'../../',
|
||||
VERSION:'29.10',
|
||||
VERSION:'29.11',
|
||||
LANGUAGE:'None',
|
||||
COLLAPSE_INDEX:false,
|
||||
FILE_SUFFIX:'.html',
|
||||
@ -312,7 +313,10 @@
|
||||
|
||||
|
||||
|
||||
<script type="text/javascript" src="../../_static/js/theme.js"></script>
|
||||
|
||||
|
||||
<script type="text/javascript" src="../../_static/js/theme.js"></script>
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
jQuery(function () {
|
||||
|
@ -8,7 +8,7 @@
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<title>pylorax.executils — Lorax 29.10 documentation</title>
|
||||
<title>pylorax.executils — Lorax 29.11 documentation</title>
|
||||
|
||||
|
||||
|
||||
@ -24,7 +24,8 @@
|
||||
|
||||
|
||||
|
||||
<link rel="stylesheet" href="../../_static/css/theme.css" type="text/css" />
|
||||
|
||||
<link rel="stylesheet" href="../../_static/css/theme.css" type="text/css" />
|
||||
<link rel="stylesheet" href="../../_static/pygments.css" type="text/css" />
|
||||
<link rel="index" title="Index" href="../../genindex.html" />
|
||||
<link rel="search" title="Search" href="../../search.html" />
|
||||
@ -56,7 +57,7 @@
|
||||
|
||||
|
||||
<div class="version">
|
||||
29.10
|
||||
29.11
|
||||
</div>
|
||||
|
||||
|
||||
@ -535,7 +536,7 @@
|
||||
<script type="text/javascript">
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT:'../../',
|
||||
VERSION:'29.10',
|
||||
VERSION:'29.11',
|
||||
LANGUAGE:'None',
|
||||
COLLAPSE_INDEX:false,
|
||||
FILE_SUFFIX:'.html',
|
||||
@ -549,7 +550,10 @@
|
||||
|
||||
|
||||
|
||||
<script type="text/javascript" src="../../_static/js/theme.js"></script>
|
||||
|
||||
|
||||
<script type="text/javascript" src="../../_static/js/theme.js"></script>
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
jQuery(function () {
|
||||
|
@ -8,7 +8,7 @@
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<title>pylorax.imgutils — Lorax 29.10 documentation</title>
|
||||
<title>pylorax.imgutils — Lorax 29.11 documentation</title>
|
||||
|
||||
|
||||
|
||||
@ -24,7 +24,8 @@
|
||||
|
||||
|
||||
|
||||
<link rel="stylesheet" href="../../_static/css/theme.css" type="text/css" />
|
||||
|
||||
<link rel="stylesheet" href="../../_static/css/theme.css" type="text/css" />
|
||||
<link rel="stylesheet" href="../../_static/pygments.css" type="text/css" />
|
||||
<link rel="index" title="Index" href="../../genindex.html" />
|
||||
<link rel="search" title="Search" href="../../search.html" />
|
||||
@ -56,7 +57,7 @@
|
||||
|
||||
|
||||
<div class="version">
|
||||
29.10
|
||||
29.11
|
||||
</div>
|
||||
|
||||
|
||||
@ -728,7 +729,7 @@
|
||||
<script type="text/javascript">
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT:'../../',
|
||||
VERSION:'29.10',
|
||||
VERSION:'29.11',
|
||||
LANGUAGE:'None',
|
||||
COLLAPSE_INDEX:false,
|
||||
FILE_SUFFIX:'.html',
|
||||
@ -742,7 +743,10 @@
|
||||
|
||||
|
||||
|
||||
<script type="text/javascript" src="../../_static/js/theme.js"></script>
|
||||
|
||||
|
||||
<script type="text/javascript" src="../../_static/js/theme.js"></script>
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
jQuery(function () {
|
||||
|
@ -8,7 +8,7 @@
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<title>pylorax.installer — Lorax 29.10 documentation</title>
|
||||
<title>pylorax.installer — Lorax 29.11 documentation</title>
|
||||
|
||||
|
||||
|
||||
@ -24,7 +24,8 @@
|
||||
|
||||
|
||||
|
||||
<link rel="stylesheet" href="../../_static/css/theme.css" type="text/css" />
|
||||
|
||||
<link rel="stylesheet" href="../../_static/css/theme.css" type="text/css" />
|
||||
<link rel="stylesheet" href="../../_static/pygments.css" type="text/css" />
|
||||
<link rel="index" title="Index" href="../../genindex.html" />
|
||||
<link rel="search" title="Search" href="../../search.html" />
|
||||
@ -56,7 +57,7 @@
|
||||
|
||||
|
||||
<div class="version">
|
||||
29.10
|
||||
29.11
|
||||
</div>
|
||||
|
||||
|
||||
@ -791,7 +792,7 @@
|
||||
<script type="text/javascript">
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT:'../../',
|
||||
VERSION:'29.10',
|
||||
VERSION:'29.11',
|
||||
LANGUAGE:'None',
|
||||
COLLAPSE_INDEX:false,
|
||||
FILE_SUFFIX:'.html',
|
||||
@ -805,7 +806,10 @@
|
||||
|
||||
|
||||
|
||||
<script type="text/javascript" src="../../_static/js/theme.js"></script>
|
||||
|
||||
|
||||
<script type="text/javascript" src="../../_static/js/theme.js"></script>
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
jQuery(function () {
|
||||
|
@ -8,7 +8,7 @@
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<title>pylorax.ltmpl — Lorax 29.10 documentation</title>
|
||||
<title>pylorax.ltmpl — Lorax 29.11 documentation</title>
|
||||
|
||||
|
||||
|
||||
@ -24,7 +24,8 @@
|
||||
|
||||
|
||||
|
||||
<link rel="stylesheet" href="../../_static/css/theme.css" type="text/css" />
|
||||
|
||||
<link rel="stylesheet" href="../../_static/css/theme.css" type="text/css" />
|
||||
<link rel="stylesheet" href="../../_static/pygments.css" type="text/css" />
|
||||
<link rel="index" title="Index" href="../../genindex.html" />
|
||||
<link rel="search" title="Search" href="../../search.html" />
|
||||
@ -56,7 +57,7 @@
|
||||
|
||||
|
||||
<div class="version">
|
||||
29.10
|
||||
29.11
|
||||
</div>
|
||||
|
||||
|
||||
@ -959,7 +960,7 @@
|
||||
<script type="text/javascript">
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT:'../../',
|
||||
VERSION:'29.10',
|
||||
VERSION:'29.11',
|
||||
LANGUAGE:'None',
|
||||
COLLAPSE_INDEX:false,
|
||||
FILE_SUFFIX:'.html',
|
||||
@ -973,7 +974,10 @@
|
||||
|
||||
|
||||
|
||||
<script type="text/javascript" src="../../_static/js/theme.js"></script>
|
||||
|
||||
|
||||
<script type="text/javascript" src="../../_static/js/theme.js"></script>
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
jQuery(function () {
|
||||
|
@ -8,7 +8,7 @@
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<title>pylorax.monitor — Lorax 29.10 documentation</title>
|
||||
<title>pylorax.monitor — Lorax 29.11 documentation</title>
|
||||
|
||||
|
||||
|
||||
@ -24,7 +24,8 @@
|
||||
|
||||
|
||||
|
||||
<link rel="stylesheet" href="../../_static/css/theme.css" type="text/css" />
|
||||
|
||||
<link rel="stylesheet" href="../../_static/css/theme.css" type="text/css" />
|
||||
<link rel="stylesheet" href="../../_static/pygments.css" type="text/css" />
|
||||
<link rel="index" title="Index" href="../../genindex.html" />
|
||||
<link rel="search" title="Search" href="../../search.html" />
|
||||
@ -56,7 +57,7 @@
|
||||
|
||||
|
||||
<div class="version">
|
||||
29.10
|
||||
29.11
|
||||
</div>
|
||||
|
||||
|
||||
@ -391,7 +392,7 @@
|
||||
<script type="text/javascript">
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT:'../../',
|
||||
VERSION:'29.10',
|
||||
VERSION:'29.11',
|
||||
LANGUAGE:'None',
|
||||
COLLAPSE_INDEX:false,
|
||||
FILE_SUFFIX:'.html',
|
||||
@ -405,7 +406,10 @@
|
||||
|
||||
|
||||
|
||||
<script type="text/javascript" src="../../_static/js/theme.js"></script>
|
||||
|
||||
|
||||
<script type="text/javascript" src="../../_static/js/theme.js"></script>
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
jQuery(function () {
|
||||
|
@ -8,7 +8,7 @@
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<title>pylorax.mount — Lorax 29.10 documentation</title>
|
||||
<title>pylorax.mount — Lorax 29.11 documentation</title>
|
||||
|
||||
|
||||
|
||||
@ -24,7 +24,8 @@
|
||||
|
||||
|
||||
|
||||
<link rel="stylesheet" href="../../_static/css/theme.css" type="text/css" />
|
||||
|
||||
<link rel="stylesheet" href="../../_static/css/theme.css" type="text/css" />
|
||||
<link rel="stylesheet" href="../../_static/pygments.css" type="text/css" />
|
||||
<link rel="index" title="Index" href="../../genindex.html" />
|
||||
<link rel="search" title="Search" href="../../search.html" />
|
||||
@ -56,7 +57,7 @@
|
||||
|
||||
|
||||
<div class="version">
|
||||
29.10
|
||||
29.11
|
||||
</div>
|
||||
|
||||
|
||||
@ -290,7 +291,7 @@
|
||||
<script type="text/javascript">
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT:'../../',
|
||||
VERSION:'29.10',
|
||||
VERSION:'29.11',
|
||||
LANGUAGE:'None',
|
||||
COLLAPSE_INDEX:false,
|
||||
FILE_SUFFIX:'.html',
|
||||
@ -304,7 +305,10 @@
|
||||
|
||||
|
||||
|
||||
<script type="text/javascript" src="../../_static/js/theme.js"></script>
|
||||
|
||||
|
||||
<script type="text/javascript" src="../../_static/js/theme.js"></script>
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
jQuery(function () {
|
||||
|
@ -8,7 +8,7 @@
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<title>pylorax.sysutils — Lorax 29.10 documentation</title>
|
||||
<title>pylorax.sysutils — Lorax 29.11 documentation</title>
|
||||
|
||||
|
||||
|
||||
@ -24,7 +24,8 @@
|
||||
|
||||
|
||||
|
||||
<link rel="stylesheet" href="../../_static/css/theme.css" type="text/css" />
|
||||
|
||||
<link rel="stylesheet" href="../../_static/css/theme.css" type="text/css" />
|
||||
<link rel="stylesheet" href="../../_static/pygments.css" type="text/css" />
|
||||
<link rel="index" title="Index" href="../../genindex.html" />
|
||||
<link rel="search" title="Search" href="../../search.html" />
|
||||
@ -56,7 +57,7 @@
|
||||
|
||||
|
||||
<div class="version">
|
||||
29.10
|
||||
29.11
|
||||
</div>
|
||||
|
||||
|
||||
@ -296,7 +297,7 @@
|
||||
<script type="text/javascript">
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT:'../../',
|
||||
VERSION:'29.10',
|
||||
VERSION:'29.11',
|
||||
LANGUAGE:'None',
|
||||
COLLAPSE_INDEX:false,
|
||||
FILE_SUFFIX:'.html',
|
||||
@ -310,7 +311,10 @@
|
||||
|
||||
|
||||
|
||||
<script type="text/javascript" src="../../_static/js/theme.js"></script>
|
||||
|
||||
|
||||
<script type="text/javascript" src="../../_static/js/theme.js"></script>
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
jQuery(function () {
|
||||
|
@ -8,7 +8,7 @@
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<title>pylorax.treebuilder — Lorax 29.10 documentation</title>
|
||||
<title>pylorax.treebuilder — Lorax 29.11 documentation</title>
|
||||
|
||||
|
||||
|
||||
@ -24,7 +24,8 @@
|
||||
|
||||
|
||||
|
||||
<link rel="stylesheet" href="../../_static/css/theme.css" type="text/css" />
|
||||
|
||||
<link rel="stylesheet" href="../../_static/css/theme.css" type="text/css" />
|
||||
<link rel="stylesheet" href="../../_static/pygments.css" type="text/css" />
|
||||
<link rel="index" title="Index" href="../../genindex.html" />
|
||||
<link rel="search" title="Search" href="../../search.html" />
|
||||
@ -56,7 +57,7 @@
|
||||
|
||||
|
||||
<div class="version">
|
||||
29.10
|
||||
29.11
|
||||
</div>
|
||||
|
||||
|
||||
@ -588,7 +589,7 @@
|
||||
<script type="text/javascript">
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT:'../../',
|
||||
VERSION:'29.10',
|
||||
VERSION:'29.11',
|
||||
LANGUAGE:'None',
|
||||
COLLAPSE_INDEX:false,
|
||||
FILE_SUFFIX:'.html',
|
||||
@ -602,7 +603,10 @@
|
||||
|
||||
|
||||
|
||||
<script type="text/javascript" src="../../_static/js/theme.js"></script>
|
||||
|
||||
|
||||
<script type="text/javascript" src="../../_static/js/theme.js"></script>
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
jQuery(function () {
|
||||
|
@ -8,7 +8,7 @@
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<title>pylorax.treeinfo — Lorax 29.10 documentation</title>
|
||||
<title>pylorax.treeinfo — Lorax 29.11 documentation</title>
|
||||
|
||||
|
||||
|
||||
@ -24,7 +24,8 @@
|
||||
|
||||
|
||||
|
||||
<link rel="stylesheet" href="../../_static/css/theme.css" type="text/css" />
|
||||
|
||||
<link rel="stylesheet" href="../../_static/css/theme.css" type="text/css" />
|
||||
<link rel="stylesheet" href="../../_static/pygments.css" type="text/css" />
|
||||
<link rel="index" title="Index" href="../../genindex.html" />
|
||||
<link rel="search" title="Search" href="../../search.html" />
|
||||
@ -56,7 +57,7 @@
|
||||
|
||||
|
||||
<div class="version">
|
||||
29.10
|
||||
29.11
|
||||
</div>
|
||||
|
||||
|
||||
@ -245,7 +246,7 @@
|
||||
<script type="text/javascript">
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT:'../../',
|
||||
VERSION:'29.10',
|
||||
VERSION:'29.11',
|
||||
LANGUAGE:'None',
|
||||
COLLAPSE_INDEX:false,
|
||||
FILE_SUFFIX:'.html',
|
||||
@ -259,7 +260,10 @@
|
||||
|
||||
|
||||
|
||||
<script type="text/javascript" src="../../_static/js/theme.js"></script>
|
||||
|
||||
|
||||
<script type="text/javascript" src="../../_static/js/theme.js"></script>
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
jQuery(function () {
|
||||
|
@ -60,6 +60,14 @@ composer.cli.sources module
|
||||
:undoc-members:
|
||||
:show-inheritance:
|
||||
|
||||
composer.cli.status module
|
||||
--------------------------
|
||||
|
||||
.. automodule:: composer.cli.status
|
||||
:members:
|
||||
:undoc-members:
|
||||
:show-inheritance:
|
||||
|
||||
composer.cli.utilities module
|
||||
-----------------------------
|
||||
|
||||
|
@ -22,7 +22,13 @@ systemd socket activation service. You will then need to enable it with ``sudo
|
||||
systemctl enable lorax-composer.socket && sudo systemctl start
|
||||
lorax-composer.socket``. This will leave the server off until the first request
|
||||
is made. Systemd will then launch the server and it will remain running until
|
||||
the system is rebooted.
|
||||
the system is rebooted. This will cause some delay in responding to the first
|
||||
request from the UI or `composer-cli`.
|
||||
|
||||
.. note::
|
||||
|
||||
If you want lorax-composer to respond immediately to the first request you can
|
||||
start and enable `lorax-composer.service` instead of `lorax-composer.socket`
|
||||
|
||||
Quickstart
|
||||
----------
|
||||
@ -31,8 +37,13 @@ Quickstart
|
||||
2. Remove any pre-existing socket directory with ``rm -rf /run/weldr/``
|
||||
A new directory with correct permissions will be created the first time the server runs.
|
||||
3. Enable the socket activation with ``systemctl enable lorax-composer.socket
|
||||
&& sudo systemctl start lorax-composer.socket`` or run it directly with
|
||||
``lorax-composer /path/to/blueprints/``
|
||||
&& sudo systemctl start lorax-composer.socket``.
|
||||
|
||||
NOTE: You can also run it directly with ``lorax-composer /path/to/blueprints``. However,
|
||||
``lorax-composer`` does not react well to being started both on the command line and via
|
||||
socket activation at the same time. It is therefore recommended that you run it directly
|
||||
on the command line only for testing or development purposes. For real use or development
|
||||
of other projects that simply use the API, you should stick to socket activation only.
|
||||
|
||||
The ``/path/to/blueprints/`` directory is where the blueprints' git repo will
|
||||
be created, and all the blueprints created with the ``/api/v0/blueprints/new``
|
||||
|
@ -4,6 +4,14 @@ pylorax.api package
|
||||
Submodules
|
||||
----------
|
||||
|
||||
pylorax.api.checkparams module
|
||||
------------------------------
|
||||
|
||||
.. automodule:: pylorax.api.checkparams
|
||||
:members:
|
||||
:undoc-members:
|
||||
:show-inheritance:
|
||||
|
||||
pylorax.api.cmdline module
|
||||
--------------------------
|
||||
|
||||
@ -44,6 +52,14 @@ pylorax.api.dnfbase module
|
||||
:undoc-members:
|
||||
:show-inheritance:
|
||||
|
||||
pylorax.api.errors module
|
||||
-------------------------
|
||||
|
||||
.. automodule:: pylorax.api.errors
|
||||
:members:
|
||||
:undoc-members:
|
||||
:show-inheritance:
|
||||
|
||||
pylorax.api.projects module
|
||||
---------------------------
|
||||
|
||||
@ -68,6 +84,14 @@ pylorax.api.recipes module
|
||||
:undoc-members:
|
||||
:show-inheritance:
|
||||
|
||||
pylorax.api.regexes module
|
||||
--------------------------
|
||||
|
||||
.. automodule:: pylorax.api.regexes
|
||||
:members:
|
||||
:undoc-members:
|
||||
:show-inheritance:
|
||||
|
||||
pylorax.api.server module
|
||||
-------------------------
|
||||
|
||||
@ -76,6 +100,14 @@ pylorax.api.server module
|
||||
:undoc-members:
|
||||
:show-inheritance:
|
||||
|
||||
pylorax.api.timestamp module
|
||||
----------------------------
|
||||
|
||||
.. automodule:: pylorax.api.timestamp
|
||||
:members:
|
||||
:undoc-members:
|
||||
:show-inheritance:
|
||||
|
||||
pylorax.api.v0 module
|
||||
---------------------
|
||||
|
||||
|
File diff suppressed because one or more lines are too long
@ -1,6 +1,6 @@
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT: document.getElementById("documentation_options").getAttribute('data-url_root'),
|
||||
VERSION: '29.10',
|
||||
VERSION: '29.11',
|
||||
LANGUAGE: 'None',
|
||||
COLLAPSE_INDEX: false,
|
||||
FILE_SUFFIX: '.html',
|
||||
|
@ -1,3 +1 @@
|
||||
/* sphinx_rtd_theme version 0.4.0 | MIT license */
|
||||
/* Built 20180606 11:06 */
|
||||
require=function n(e,i,t){function o(s,a){if(!i[s]){if(!e[s]){var l="function"==typeof require&&require;if(!a&&l)return l(s,!0);if(r)return r(s,!0);var c=new Error("Cannot find module '"+s+"'");throw c.code="MODULE_NOT_FOUND",c}var u=i[s]={exports:{}};e[s][0].call(u.exports,function(n){var i=e[s][1][n];return o(i||n)},u,u.exports,n,e,i,t)}return i[s].exports}for(var r="function"==typeof require&&require,s=0;s<t.length;s++)o(t[s]);return o}({"sphinx-rtd-theme":[function(n,e,i){var jQuery="undefined"!=typeof window?window.jQuery:n("jquery");e.exports.ThemeNav={navBar:null,win:null,winScroll:!1,winResize:!1,linkScroll:!1,winPosition:0,winHeight:null,docHeight:null,isRunning:!1,enable:function(n){var e=this;void 0===n&&(n=!0),e.isRunning||(e.isRunning=!0,jQuery(function(i){e.init(i),e.reset(),e.win.on("hashchange",e.reset),n&&e.win.on("scroll",function(){e.linkScroll||e.winScroll||(e.winScroll=!0,requestAnimationFrame(function(){e.onScroll()}))}),e.win.on("resize",function(){e.winResize||(e.winResize=!0,requestAnimationFrame(function(){e.onResize()}))}),e.onResize()}))},enableSticky:function(){this.enable(!0)},init:function(n){n(document);var e=this;this.navBar=n("div.wy-side-scroll:first"),this.win=n(window),n(document).on("click","[data-toggle='wy-nav-top']",function(){n("[data-toggle='wy-nav-shift']").toggleClass("shift"),n("[data-toggle='rst-versions']").toggleClass("shift")}).on("click",".wy-menu-vertical .current ul li a",function(){var i=n(this);n("[data-toggle='wy-nav-shift']").removeClass("shift"),n("[data-toggle='rst-versions']").toggleClass("shift"),e.toggleCurrent(i),e.hashChange()}).on("click","[data-toggle='rst-current-version']",function(){n("[data-toggle='rst-versions']").toggleClass("shift-up")}),n("table.docutils:not(.field-list,.footnote,.citation)").wrap("<div class='wy-table-responsive'></div>"),n("table.docutils.footnote").wrap("<div class='wy-table-responsive footnote'></div>"),n("table.docutils.citation").wrap("<div class='wy-table-responsive citation'></div>"),n(".wy-menu-vertical ul").not(".simple").siblings("a").each(function(){var i=n(this);expand=n('<span class="toctree-expand"></span>'),expand.on("click",function(n){return e.toggleCurrent(i),n.stopPropagation(),!1}),i.prepend(expand)})},reset:function(){var n=encodeURI(window.location.hash)||"#";try{var e=$(".wy-menu-vertical"),i=e.find('[href="'+n+'"]');if(0===i.length){var t=$('.document [id="'+n.substring(1)+'"]').closest("div.section");0===(i=e.find('[href="#'+t.attr("id")+'"]')).length&&(i=e.find('[href="#"]'))}i.length>0&&($(".wy-menu-vertical .current").removeClass("current"),i.addClass("current"),i.closest("li.toctree-l1").addClass("current"),i.closest("li.toctree-l1").parent().addClass("current"),i.closest("li.toctree-l1").addClass("current"),i.closest("li.toctree-l2").addClass("current"),i.closest("li.toctree-l3").addClass("current"),i.closest("li.toctree-l4").addClass("current"))}catch(o){console.log("Error expanding nav for anchor",o)}},onScroll:function(){this.winScroll=!1;var n=this.win.scrollTop(),e=n+this.winHeight,i=this.navBar.scrollTop()+(n-this.winPosition);n<0||e>this.docHeight||(this.navBar.scrollTop(i),this.winPosition=n)},onResize:function(){this.winResize=!1,this.winHeight=this.win.height(),this.docHeight=$(document).height()},hashChange:function(){this.linkScroll=!0,this.win.one("hashchange",function(){this.linkScroll=!1})},toggleCurrent:function(n){var e=n.closest("li");e.siblings("li.current").removeClass("current"),e.siblings().find("li.current").removeClass("current"),e.find("> ul li.current").removeClass("current"),e.toggleClass("current")}},"undefined"!=typeof window&&(window.SphinxRtdTheme={Navigation:e.exports.ThemeNav,StickyNav:e.exports.ThemeNav}),function(){for(var n=0,e=["ms","moz","webkit","o"],i=0;i<e.length&&!window.requestAnimationFrame;++i)window.requestAnimationFrame=window[e[i]+"RequestAnimationFrame"],window.cancelAnimationFrame=window[e[i]+"CancelAnimationFrame"]||window[e[i]+"CancelRequestAnimationFrame"];window.requestAnimationFrame||(window.requestAnimationFrame=function(e,i){var t=(new Date).getTime(),o=Math.max(0,16-(t-n)),r=window.setTimeout(function(){e(t+o)},o);return n=t+o,r}),window.cancelAnimationFrame||(window.cancelAnimationFrame=function(n){clearTimeout(n)})}()},{jquery:"jquery"}]},{},["sphinx-rtd-theme"]);
|
||||
require=function r(s,a,l){function c(i,n){if(!a[i]){if(!s[i]){var e="function"==typeof require&&require;if(!n&&e)return e(i,!0);if(u)return u(i,!0);var t=new Error("Cannot find module '"+i+"'");throw t.code="MODULE_NOT_FOUND",t}var o=a[i]={exports:{}};s[i][0].call(o.exports,function(n){var e=s[i][1][n];return c(e||n)},o,o.exports,r,s,a,l)}return a[i].exports}for(var u="function"==typeof require&&require,n=0;n<l.length;n++)c(l[n]);return c}({"sphinx-rtd-theme":[function(n,e,i){var jQuery="undefined"!=typeof window?window.jQuery:n("jquery");e.exports.ThemeNav={navBar:null,win:null,winScroll:!1,winResize:!1,linkScroll:!1,winPosition:0,winHeight:null,docHeight:null,isRunning:!1,enable:function(e){var i=this;"undefined"==typeof withStickNav&&(e=!0),i.isRunning||(i.isRunning=!0,jQuery(function(n){i.init(n),i.reset(),i.win.on("hashchange",i.reset),e&&i.win.on("scroll",function(){i.linkScroll||i.winScroll||(i.winScroll=!0,requestAnimationFrame(function(){i.onScroll()}))}),i.win.on("resize",function(){i.winResize||(i.winResize=!0,requestAnimationFrame(function(){i.onResize()}))}),i.onResize()}))},enableSticky:function(){this.enable(!0)},init:function(i){i(document);var t=this;this.navBar=i("div.wy-side-scroll:first"),this.win=i(window),i(document).on("click","[data-toggle='wy-nav-top']",function(){i("[data-toggle='wy-nav-shift']").toggleClass("shift"),i("[data-toggle='rst-versions']").toggleClass("shift")}).on("click",".wy-menu-vertical .current ul li a",function(){var n=i(this);i("[data-toggle='wy-nav-shift']").removeClass("shift"),i("[data-toggle='rst-versions']").toggleClass("shift"),t.toggleCurrent(n),t.hashChange()}).on("click","[data-toggle='rst-current-version']",function(){i("[data-toggle='rst-versions']").toggleClass("shift-up")}),i("table.docutils:not(.field-list,.footnote,.citation)").wrap("<div class='wy-table-responsive'></div>"),i("table.docutils.footnote").wrap("<div class='wy-table-responsive footnote'></div>"),i("table.docutils.citation").wrap("<div class='wy-table-responsive citation'></div>"),i(".wy-menu-vertical ul").not(".simple").siblings("a").each(function(){var e=i(this);expand=i('<span class="toctree-expand"></span>'),expand.on("click",function(n){return t.toggleCurrent(e),n.stopPropagation(),!1}),e.prepend(expand)})},reset:function(){var n=encodeURI(window.location.hash)||"#";try{var e=$(".wy-menu-vertical"),i=e.find('[href="'+n+'"]');if(0===i.length){var t=$('.document [id="'+n.substring(1)+'"]').closest("div.section");0===(i=e.find('[href="#'+t.attr("id")+'"]')).length&&(i=e.find('[href="#"]'))}0<i.length&&($(".wy-menu-vertical .current").removeClass("current"),i.addClass("current"),i.closest("li.toctree-l1").addClass("current"),i.closest("li.toctree-l1").parent().addClass("current"),i.closest("li.toctree-l1").addClass("current"),i.closest("li.toctree-l2").addClass("current"),i.closest("li.toctree-l3").addClass("current"),i.closest("li.toctree-l4").addClass("current"))}catch(o){console.log("Error expanding nav for anchor",o)}},onScroll:function(){this.winScroll=!1;var n=this.win.scrollTop(),e=n+this.winHeight,i=this.navBar.scrollTop()+(n-this.winPosition);n<0||e>this.docHeight||(this.navBar.scrollTop(i),this.winPosition=n)},onResize:function(){this.winResize=!1,this.winHeight=this.win.height(),this.docHeight=$(document).height()},hashChange:function(){this.linkScroll=!0,this.win.one("hashchange",function(){this.linkScroll=!1})},toggleCurrent:function(n){var e=n.closest("li");e.siblings("li.current").removeClass("current"),e.siblings().find("li.current").removeClass("current"),e.find("> ul li.current").removeClass("current"),e.toggleClass("current")}},"undefined"!=typeof window&&(window.SphinxRtdTheme={Navigation:e.exports.ThemeNav,StickyNav:e.exports.ThemeNav}),function(){for(var r=0,n=["ms","moz","webkit","o"],e=0;e<n.length&&!window.requestAnimationFrame;++e)window.requestAnimationFrame=window[n[e]+"RequestAnimationFrame"],window.cancelAnimationFrame=window[n[e]+"CancelAnimationFrame"]||window[n[e]+"CancelRequestAnimationFrame"];window.requestAnimationFrame||(window.requestAnimationFrame=function(n,e){var i=(new Date).getTime(),t=Math.max(0,16-(i-r)),o=window.setTimeout(function(){n(i+t)},t);return r=i+t,o}),window.cancelAnimationFrame||(window.cancelAnimationFrame=function(n){clearTimeout(n)})}()},{jquery:"jquery"}]},{},["sphinx-rtd-theme"]);
|
@ -8,7 +8,7 @@
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<title>composer-cli — Lorax 29.10 documentation</title>
|
||||
<title>composer-cli — Lorax 29.11 documentation</title>
|
||||
|
||||
|
||||
|
||||
@ -24,7 +24,8 @@
|
||||
|
||||
|
||||
|
||||
<link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
|
||||
|
||||
<link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
|
||||
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
|
||||
<link rel="index" title="Index" href="genindex.html" />
|
||||
<link rel="search" title="Search" href="search.html" />
|
||||
@ -58,7 +59,7 @@
|
||||
|
||||
|
||||
<div class="version">
|
||||
29.10
|
||||
29.11
|
||||
</div>
|
||||
|
||||
|
||||
@ -246,6 +247,8 @@ group. They do not need to be root, but all of the <a class="reference external"
|
||||
<dd>List the supported output types.</dd>
|
||||
<dt>compose status</dt>
|
||||
<dd>List the status of all running and finished composes.</dd>
|
||||
<dt>compose list [waiting|running|finished|failed]</dt>
|
||||
<dd>List basic information about composes.</dd>
|
||||
<dt>compose log <UUID> [<SIZE>]</dt>
|
||||
<dd>Show the last SIZE kB of the compose log.</dd>
|
||||
<dt>compose cancel <UUID></dt>
|
||||
@ -309,6 +312,7 @@ TO-COMMIT can be a commit hash, NEWEST, or WORKSPACE</dd>
|
||||
<dt>sources delete <SOURCE-NAME></dt>
|
||||
<dd>Delete a package source.</dd>
|
||||
</dl>
|
||||
<p>status show Show API server status.</p>
|
||||
</p>
|
||||
</div>
|
||||
<div class="section" id="edit-a-blueprint">
|
||||
@ -391,7 +395,7 @@ save the qcow2 image as <code class="docutils literal notranslate"><span class="
|
||||
<script type="text/javascript">
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT:'./',
|
||||
VERSION:'29.10',
|
||||
VERSION:'29.11',
|
||||
LANGUAGE:'None',
|
||||
COLLAPSE_INDEX:false,
|
||||
FILE_SUFFIX:'.html',
|
||||
@ -405,7 +409,10 @@ save the qcow2 image as <code class="docutils literal notranslate"><span class="
|
||||
|
||||
|
||||
|
||||
<script type="text/javascript" src="_static/js/theme.js"></script>
|
||||
|
||||
|
||||
<script type="text/javascript" src="_static/js/theme.js"></script>
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
jQuery(function () {
|
||||
|
@ -8,7 +8,7 @@
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<title>composer.cli package — Lorax 29.10 documentation</title>
|
||||
<title>composer.cli package — Lorax 29.11 documentation</title>
|
||||
|
||||
|
||||
|
||||
@ -24,7 +24,8 @@
|
||||
|
||||
|
||||
|
||||
<link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
|
||||
|
||||
<link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
|
||||
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
|
||||
<link rel="index" title="Index" href="genindex.html" />
|
||||
<link rel="search" title="Search" href="search.html" />
|
||||
@ -58,7 +59,7 @@
|
||||
|
||||
|
||||
<div class="version">
|
||||
29.10
|
||||
29.11
|
||||
</div>
|
||||
|
||||
|
||||
@ -659,6 +660,12 @@ of compose that was selected.</p>
|
||||
<p>This returns information about the compose, including the blueprint and the dependencies.</p>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="function">
|
||||
<dt id="composer.cli.compose.compose_list">
|
||||
<code class="descclassname">composer.cli.compose.</code><code class="descname">compose_list</code><span class="sig-paren">(</span><em>socket_path</em>, <em>api_version</em>, <em>args</em>, <em>show_json=False</em>, <em>testmode=0</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/composer/cli/compose.html#compose_list"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#composer.cli.compose.compose_list" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Return a simple list of compose identifiers</p>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="function">
|
||||
<dt id="composer.cli.compose.compose_log">
|
||||
<code class="descclassname">composer.cli.compose.</code><code class="descname">compose_log</code><span class="sig-paren">(</span><em>socket_path</em>, <em>api_version</em>, <em>args</em>, <em>show_json=False</em>, <em>testmode=0</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/composer/cli/compose.html#compose_log"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#composer.cli.compose.compose_log" title="Permalink to this definition">¶</a></dt>
|
||||
@ -1013,6 +1020,27 @@ include this extra information.</p>
|
||||
<p>sources list</p>
|
||||
</dd></dl>
|
||||
|
||||
</div>
|
||||
<div class="section" id="module-composer.cli.status">
|
||||
<span id="composer-cli-status-module"></span><h2>composer.cli.status module<a class="headerlink" href="#module-composer.cli.status" title="Permalink to this headline">¶</a></h2>
|
||||
<dl class="function">
|
||||
<dt id="composer.cli.status.status_cmd">
|
||||
<code class="descclassname">composer.cli.status.</code><code class="descname">status_cmd</code><span class="sig-paren">(</span><em>opts</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/composer/cli/status.html#status_cmd"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#composer.cli.status.status_cmd" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Process status commands</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>opts</strong> (<a class="reference external" href="https://docs.python.org/3/library/argparse.html#argparse.Namespace" title="(in Python v3.7)"><em>argparse.Namespace</em></a>) – Cmdline arguments</td>
|
||||
</tr>
|
||||
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">Value to return from sys.exit()</td>
|
||||
</tr>
|
||||
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.7)">int</a></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</dd></dl>
|
||||
|
||||
</div>
|
||||
<div class="section" id="module-composer.cli.utilities">
|
||||
<span id="composer-cli-utilities-module"></span><h2>composer.cli.utilities module<a class="headerlink" href="#module-composer.cli.utilities" title="Permalink to this headline">¶</a></h2>
|
||||
@ -1064,8 +1092,14 @@ include this extra information.</p>
|
||||
<tbody valign="top">
|
||||
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>result</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#dict" title="(in Python v3.7)"><em>dict</em></a>) – JSON result from the http query</td>
|
||||
</tr>
|
||||
<tr class="field-even field"><th class="field-name">Return type:</th><td class="field-body"><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#tuple" title="(in Python v3.7)">tuple</a></td>
|
||||
</tr>
|
||||
<tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">(rc, should_exit_now)</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<p>Return the correct rc for the program (0 or 1), and whether or
|
||||
not to continue processing the results.</p>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="function">
|
||||
@ -1166,7 +1200,7 @@ include this extra information.</p>
|
||||
<script type="text/javascript">
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT:'./',
|
||||
VERSION:'29.10',
|
||||
VERSION:'29.11',
|
||||
LANGUAGE:'None',
|
||||
COLLAPSE_INDEX:false,
|
||||
FILE_SUFFIX:'.html',
|
||||
@ -1180,7 +1214,10 @@ include this extra information.</p>
|
||||
|
||||
|
||||
|
||||
<script type="text/javascript" src="_static/js/theme.js"></script>
|
||||
|
||||
|
||||
<script type="text/javascript" src="_static/js/theme.js"></script>
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
jQuery(function () {
|
||||
|
@ -8,7 +8,7 @@
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<title>composer package — Lorax 29.10 documentation</title>
|
||||
<title>composer package — Lorax 29.11 documentation</title>
|
||||
|
||||
|
||||
|
||||
@ -24,7 +24,8 @@
|
||||
|
||||
|
||||
|
||||
<link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
|
||||
|
||||
<link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
|
||||
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
|
||||
<link rel="index" title="Index" href="genindex.html" />
|
||||
<link rel="search" title="Search" href="search.html" />
|
||||
@ -58,7 +59,7 @@
|
||||
|
||||
|
||||
<div class="version">
|
||||
29.10
|
||||
29.11
|
||||
</div>
|
||||
|
||||
|
||||
@ -186,6 +187,7 @@
|
||||
<li class="toctree-l2"><a class="reference internal" href="composer.cli.html#module-composer.cli.modules">composer.cli.modules module</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="composer.cli.html#module-composer.cli.projects">composer.cli.projects module</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="composer.cli.html#module-composer.cli.sources">composer.cli.sources module</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="composer.cli.html#module-composer.cli.status">composer.cli.status module</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="composer.cli.html#module-composer.cli.utilities">composer.cli.utilities module</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="composer.cli.html#module-composer.cli">Module contents</a></li>
|
||||
</ul>
|
||||
@ -476,7 +478,7 @@
|
||||
<script type="text/javascript">
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT:'./',
|
||||
VERSION:'29.10',
|
||||
VERSION:'29.11',
|
||||
LANGUAGE:'None',
|
||||
COLLAPSE_INDEX:false,
|
||||
FILE_SUFFIX:'.html',
|
||||
@ -490,7 +492,10 @@
|
||||
|
||||
|
||||
|
||||
<script type="text/javascript" src="_static/js/theme.js"></script>
|
||||
|
||||
|
||||
<script type="text/javascript" src="_static/js/theme.js"></script>
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
jQuery(function () {
|
||||
|
@ -9,7 +9,7 @@
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<title>Index — Lorax 29.10 documentation</title>
|
||||
<title>Index — Lorax 29.11 documentation</title>
|
||||
|
||||
|
||||
|
||||
@ -25,7 +25,8 @@
|
||||
|
||||
|
||||
|
||||
<link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
|
||||
|
||||
<link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
|
||||
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
|
||||
<link rel="index" title="Index" href="#" />
|
||||
<link rel="search" title="Search" href="search.html" />
|
||||
@ -57,7 +58,7 @@
|
||||
|
||||
|
||||
<div class="version">
|
||||
29.10
|
||||
29.11
|
||||
</div>
|
||||
|
||||
|
||||
@ -217,6 +218,8 @@
|
||||
<li><a href="pylorax.html#pylorax.base.BaseLoraxClass">BaseLoraxClass (class in pylorax.base)</a>
|
||||
</li>
|
||||
<li><a href="pylorax.html#pylorax.ArchData.bcj_arch">bcj_arch (pylorax.ArchData attribute)</a>
|
||||
</li>
|
||||
<li><a href="pylorax.api.html#pylorax.api.v0.blueprint_exists">blueprint_exists() (in module pylorax.api.v0)</a>
|
||||
</li>
|
||||
<li><a href="composer.cli.html#composer.cli.blueprints.blueprints_changes">blueprints_changes() (in module composer.cli.blueprints)</a>
|
||||
</li>
|
||||
@ -233,11 +236,11 @@
|
||||
<li><a href="composer.cli.html#composer.cli.blueprints.blueprints_freeze_save">blueprints_freeze_save() (in module composer.cli.blueprints)</a>
|
||||
</li>
|
||||
<li><a href="composer.cli.html#composer.cli.blueprints.blueprints_freeze_show">blueprints_freeze_show() (in module composer.cli.blueprints)</a>
|
||||
</li>
|
||||
<li><a href="composer.cli.html#composer.cli.blueprints.blueprints_list">blueprints_list() (in module composer.cli.blueprints)</a>
|
||||
</li>
|
||||
</ul></td>
|
||||
<td style="width: 33%; vertical-align: top;"><ul>
|
||||
<li><a href="composer.cli.html#composer.cli.blueprints.blueprints_list">blueprints_list() (in module composer.cli.blueprints)</a>
|
||||
</li>
|
||||
<li><a href="composer.cli.html#composer.cli.blueprints.blueprints_push">blueprints_push() (in module composer.cli.blueprints)</a>
|
||||
</li>
|
||||
<li><a href="composer.cli.html#composer.cli.blueprints.blueprints_save">blueprints_save() (in module composer.cli.blueprints)</a>
|
||||
@ -267,6 +270,8 @@
|
||||
<table style="width: 100%" class="indextable genindextable"><tr>
|
||||
<td style="width: 33%; vertical-align: top;"><ul>
|
||||
<li><a href="pylorax.html#pylorax.creator.calculate_disk_size">calculate_disk_size() (in module pylorax.creator)</a>
|
||||
</li>
|
||||
<li><a href="pylorax.api.html#pylorax.api.checkparams.checkparams">checkparams() (in module pylorax.api.checkparams)</a>
|
||||
</li>
|
||||
<li><a href="pylorax.html#pylorax.ltmpl.LoraxTemplateRunner.chmod">chmod() (pylorax.ltmpl.LoraxTemplateRunner method)</a>
|
||||
</li>
|
||||
@ -299,6 +304,8 @@
|
||||
<li><a href="composer.cli.html#composer.cli.compose.compose_image">compose_image() (in module composer.cli.compose)</a>
|
||||
</li>
|
||||
<li><a href="composer.cli.html#composer.cli.compose.compose_info">compose_info() (in module composer.cli.compose)</a>
|
||||
</li>
|
||||
<li><a href="composer.cli.html#composer.cli.compose.compose_list">compose_list() (in module composer.cli.compose)</a>
|
||||
</li>
|
||||
<li><a href="composer.cli.html#composer.cli.compose.compose_log">compose_log() (in module composer.cli.compose)</a>
|
||||
</li>
|
||||
@ -337,6 +344,8 @@
|
||||
<li><a href="composer.cli.html#module-composer.cli.projects">composer.cli.projects (module)</a>
|
||||
</li>
|
||||
<li><a href="composer.cli.html#module-composer.cli.sources">composer.cli.sources (module)</a>
|
||||
</li>
|
||||
<li><a href="composer.cli.html#module-composer.cli.status">composer.cli.status (module)</a>
|
||||
</li>
|
||||
<li><a href="composer.cli.html#module-composer.cli.utilities">composer.cli.utilities (module)</a>
|
||||
</li>
|
||||
@ -495,6 +504,8 @@
|
||||
<li><a href="pylorax.html#pylorax.treebuilder.generate_module_info">generate_module_info() (in module pylorax.treebuilder)</a>
|
||||
</li>
|
||||
<li><a href="pylorax.html#pylorax.creator.get_arch">get_arch() (in module pylorax.creator)</a>
|
||||
</li>
|
||||
<li><a href="pylorax.api.html#pylorax.api.dnfbase.get_base_object">get_base_object() (in module pylorax.api.dnfbase)</a>
|
||||
</li>
|
||||
<li><a href="pylorax.html#pylorax.get_buildarch">get_buildarch() (in module pylorax)</a>
|
||||
</li>
|
||||
@ -828,13 +839,15 @@
|
||||
</ul></li>
|
||||
<li><a href="pylorax.api.html#pylorax.api.projects.ProjectsError">ProjectsError</a>
|
||||
</li>
|
||||
</ul></td>
|
||||
<td style="width: 33%; vertical-align: top;"><ul>
|
||||
<li><a href="pylorax.html#pylorax.base.BaseLoraxClass.pwarning">pwarning() (pylorax.base.BaseLoraxClass method)</a>
|
||||
</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>
|
||||
<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>
|
||||
</li>
|
||||
@ -843,14 +856,22 @@
|
||||
<li><a href="pylorax.api.html#module-pylorax.api.config">pylorax.api.config (module)</a>
|
||||
</li>
|
||||
<li><a href="pylorax.api.html#module-pylorax.api.crossdomain">pylorax.api.crossdomain (module)</a>
|
||||
</li>
|
||||
<li><a href="pylorax.api.html#module-pylorax.api.dnfbase">pylorax.api.dnfbase (module)</a>
|
||||
</li>
|
||||
<li><a href="pylorax.api.html#module-pylorax.api.errors">pylorax.api.errors (module)</a>
|
||||
</li>
|
||||
<li><a href="pylorax.api.html#module-pylorax.api.projects">pylorax.api.projects (module)</a>
|
||||
</li>
|
||||
<li><a href="pylorax.api.html#module-pylorax.api.queue">pylorax.api.queue (module)</a>
|
||||
</li>
|
||||
<li><a href="pylorax.api.html#module-pylorax.api.recipes">pylorax.api.recipes (module)</a>
|
||||
</li>
|
||||
<li><a href="pylorax.api.html#module-pylorax.api.regexes">pylorax.api.regexes (module)</a>
|
||||
</li>
|
||||
<li><a href="pylorax.api.html#module-pylorax.api.server">pylorax.api.server (module)</a>
|
||||
</li>
|
||||
<li><a href="pylorax.api.html#module-pylorax.api.timestamp">pylorax.api.timestamp (module)</a>
|
||||
</li>
|
||||
<li><a href="pylorax.api.html#module-pylorax.api.v0">pylorax.api.v0 (module)</a>
|
||||
</li>
|
||||
@ -1030,10 +1051,10 @@
|
||||
</li>
|
||||
<li><a href="composer.cli.html#composer.cli.sources.sources_delete">sources_delete() (in module composer.cli.sources)</a>
|
||||
</li>
|
||||
</ul></td>
|
||||
<td style="width: 33%; vertical-align: top;"><ul>
|
||||
<li><a href="composer.cli.html#composer.cli.sources.sources_info">sources_info() (in module composer.cli.sources)</a>
|
||||
</li>
|
||||
</ul></td>
|
||||
<td style="width: 33%; vertical-align: top;"><ul>
|
||||
<li><a href="composer.cli.html#composer.cli.sources.sources_list">sources_list() (in module composer.cli.sources)</a>
|
||||
</li>
|
||||
<li><a href="pylorax.html#pylorax.ltmpl.split_and_expand">split_and_expand() (in module pylorax.ltmpl)</a>
|
||||
@ -1047,6 +1068,8 @@
|
||||
<li><a href="pylorax.api.html#pylorax.api.queue.start_queue_monitor">start_queue_monitor() (in module pylorax.api.queue)</a>
|
||||
</li>
|
||||
<li><a href="pylorax.html#pylorax.executils.startProgram">startProgram() (in module pylorax.executils)</a>
|
||||
</li>
|
||||
<li><a href="composer.cli.html#composer.cli.status.status_cmd">status_cmd() (in module composer.cli.status)</a>
|
||||
</li>
|
||||
<li><a href="pylorax.html#pylorax.treebuilder.string_lower">string_lower() (in module pylorax.treebuilder)</a>
|
||||
</li>
|
||||
@ -1074,6 +1097,8 @@
|
||||
</li>
|
||||
</ul></td>
|
||||
<td style="width: 33%; vertical-align: top;"><ul>
|
||||
<li><a href="pylorax.api.html#pylorax.api.timestamp.timestamp_dict">timestamp_dict() (in module pylorax.api.timestamp)</a>
|
||||
</li>
|
||||
<li><a href="pylorax.api.html#pylorax.api.recipes.Recipe.toml">toml() (pylorax.api.recipes.Recipe method)</a>
|
||||
</li>
|
||||
<li><a href="composer.cli.html#composer.cli.utilities.toml_filename">toml_filename() (in module composer.cli.utilities)</a>
|
||||
@ -1165,6 +1190,8 @@
|
||||
<li><a href="pylorax.api.html#pylorax.api.compose.write_ks_group">write_ks_group() (in module pylorax.api.compose)</a>
|
||||
</li>
|
||||
<li><a href="pylorax.api.html#pylorax.api.compose.write_ks_user">write_ks_user() (in module pylorax.api.compose)</a>
|
||||
</li>
|
||||
<li><a href="pylorax.api.html#pylorax.api.timestamp.write_timestamp">write_timestamp() (in module pylorax.api.timestamp)</a>
|
||||
</li>
|
||||
<li><a href="pylorax.html#pylorax.treebuilder.RuntimeBuilder.writepkglists">writepkglists() (pylorax.treebuilder.RuntimeBuilder method)</a>
|
||||
</li>
|
||||
@ -1207,7 +1234,7 @@
|
||||
<script type="text/javascript">
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT:'./',
|
||||
VERSION:'29.10',
|
||||
VERSION:'29.11',
|
||||
LANGUAGE:'None',
|
||||
COLLAPSE_INDEX:false,
|
||||
FILE_SUFFIX:'.html',
|
||||
@ -1221,7 +1248,10 @@
|
||||
|
||||
|
||||
|
||||
<script type="text/javascript" src="_static/js/theme.js"></script>
|
||||
|
||||
|
||||
<script type="text/javascript" src="_static/js/theme.js"></script>
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
jQuery(function () {
|
||||
|
@ -8,7 +8,7 @@
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<title>Welcome to Lorax’s documentation! — Lorax 29.10 documentation</title>
|
||||
<title>Welcome to Lorax’s documentation! — Lorax 29.11 documentation</title>
|
||||
|
||||
|
||||
|
||||
@ -24,7 +24,8 @@
|
||||
|
||||
|
||||
|
||||
<link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
|
||||
|
||||
<link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
|
||||
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
|
||||
<link rel="index" title="Index" href="genindex.html" />
|
||||
<link rel="search" title="Search" href="search.html" />
|
||||
@ -57,7 +58,7 @@
|
||||
|
||||
|
||||
<div class="version">
|
||||
29.10
|
||||
29.11
|
||||
</div>
|
||||
|
||||
|
||||
@ -226,7 +227,7 @@
|
||||
<script type="text/javascript">
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT:'./',
|
||||
VERSION:'29.10',
|
||||
VERSION:'29.11',
|
||||
LANGUAGE:'None',
|
||||
COLLAPSE_INDEX:false,
|
||||
FILE_SUFFIX:'.html',
|
||||
@ -240,7 +241,10 @@
|
||||
|
||||
|
||||
|
||||
<script type="text/javascript" src="_static/js/theme.js"></script>
|
||||
|
||||
|
||||
<script type="text/javascript" src="_static/js/theme.js"></script>
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
jQuery(function () {
|
||||
|
@ -8,7 +8,7 @@
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<title>Introduction to Lorax — Lorax 29.10 documentation</title>
|
||||
<title>Introduction to Lorax — Lorax 29.11 documentation</title>
|
||||
|
||||
|
||||
|
||||
@ -24,7 +24,8 @@
|
||||
|
||||
|
||||
|
||||
<link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
|
||||
|
||||
<link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
|
||||
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
|
||||
<link rel="index" title="Index" href="genindex.html" />
|
||||
<link rel="search" title="Search" href="search.html" />
|
||||
@ -58,7 +59,7 @@
|
||||
|
||||
|
||||
<div class="version">
|
||||
29.10
|
||||
29.11
|
||||
</div>
|
||||
|
||||
|
||||
@ -249,7 +250,7 @@ upd-instroot and mk-images* scripts.</p>
|
||||
<script type="text/javascript">
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT:'./',
|
||||
VERSION:'29.10',
|
||||
VERSION:'29.11',
|
||||
LANGUAGE:'None',
|
||||
COLLAPSE_INDEX:false,
|
||||
FILE_SUFFIX:'.html',
|
||||
@ -263,7 +264,10 @@ upd-instroot and mk-images* scripts.</p>
|
||||
|
||||
|
||||
|
||||
<script type="text/javascript" src="_static/js/theme.js"></script>
|
||||
|
||||
|
||||
<script type="text/javascript" src="_static/js/theme.js"></script>
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
jQuery(function () {
|
||||
|
@ -8,7 +8,7 @@
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<title>livemedia-creator — Lorax 29.10 documentation</title>
|
||||
<title>livemedia-creator — Lorax 29.11 documentation</title>
|
||||
|
||||
|
||||
|
||||
@ -24,7 +24,8 @@
|
||||
|
||||
|
||||
|
||||
<link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
|
||||
|
||||
<link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
|
||||
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
|
||||
<link rel="index" title="Index" href="genindex.html" />
|
||||
<link rel="search" title="Search" href="search.html" />
|
||||
@ -58,7 +59,7 @@
|
||||
|
||||
|
||||
<div class="version">
|
||||
29.10
|
||||
29.11
|
||||
</div>
|
||||
|
||||
|
||||
@ -87,7 +88,17 @@
|
||||
<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 current"><a class="current reference internal" href="#">livemedia-creator</a><ul>
|
||||
<li class="toctree-l2"><a class="reference internal" href="#livemedia-creator-cmdline-arguments">livemedia-creator cmdline arguments</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="#livemedia-creator-cmdline-arguments">livemedia-creator cmdline arguments</a><ul>
|
||||
<li class="toctree-l3"><a class="reference internal" href="#Named Arguments">Named Arguments</a></li>
|
||||
<li class="toctree-l3"><a class="reference internal" href="#disk/fs image arguments">disk/fs image arguments</a></li>
|
||||
<li class="toctree-l3"><a class="reference internal" href="#appliance arguments">appliance arguments</a></li>
|
||||
<li class="toctree-l3"><a class="reference internal" href="#qemu arguments">qemu arguments</a></li>
|
||||
<li class="toctree-l3"><a class="reference internal" href="#dracut arguments">dracut arguments</a></li>
|
||||
<li class="toctree-l3"><a class="reference internal" href="#pxe to live arguments">pxe to live arguments</a></li>
|
||||
<li class="toctree-l3"><a class="reference internal" href="#OCI arguments">OCI arguments</a></li>
|
||||
<li class="toctree-l3"><a class="reference internal" href="#Vagrant arguments">Vagrant arguments</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="#quickstart">Quickstart</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="#how-iso-creation-works">How ISO creation works</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="#kickstarts">Kickstarts</a><ul>
|
||||
@ -214,6 +225,372 @@ you have the anaconda-tui package installed.</p>
|
||||
<p><code class="docutils literal notranslate"><span class="pre">image</span></code> is the disk image being created by running livemedia-creator</p>
|
||||
<div class="section" id="livemedia-creator-cmdline-arguments">
|
||||
<h2>livemedia-creator cmdline arguments<a class="headerlink" href="#livemedia-creator-cmdline-arguments" title="Permalink to this headline">¶</a></h2>
|
||||
<p>Create Live Install Media</p>
|
||||
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">usage</span><span class="p">:</span> <span class="n">livemedia</span><span class="o">-</span><span class="n">creator</span> <span class="p">[</span><span class="o">-</span><span class="n">h</span><span class="p">]</span>
|
||||
<span class="p">(</span><span class="o">--</span><span class="n">make</span><span class="o">-</span><span class="n">iso</span> <span class="o">|</span> <span class="o">--</span><span class="n">make</span><span class="o">-</span><span class="n">disk</span> <span class="o">|</span> <span class="o">--</span><span class="n">make</span><span class="o">-</span><span class="n">fsimage</span> <span class="o">|</span> <span class="o">--</span><span class="n">make</span><span class="o">-</span><span class="n">appliance</span> <span class="o">|</span> <span class="o">--</span><span class="n">make</span><span class="o">-</span><span class="n">ami</span> <span class="o">|</span> <span class="o">--</span><span class="n">make</span><span class="o">-</span><span class="n">tar</span> <span class="o">|</span> <span class="o">--</span><span class="n">make</span><span class="o">-</span><span class="n">pxe</span><span class="o">-</span><span class="n">live</span> <span class="o">|</span> <span class="o">--</span><span class="n">make</span><span class="o">-</span><span class="n">ostree</span><span class="o">-</span><span class="n">live</span> <span class="o">|</span> <span class="o">--</span><span class="n">make</span><span class="o">-</span><span class="n">oci</span> <span class="o">|</span> <span class="o">--</span><span class="n">make</span><span class="o">-</span><span class="n">vagrant</span><span class="p">)</span>
|
||||
<span class="p">[</span><span class="o">--</span><span class="n">iso</span> <span class="n">ISO</span><span class="p">]</span> <span class="p">[</span><span class="o">--</span><span class="n">iso</span><span class="o">-</span><span class="n">only</span><span class="p">]</span> <span class="p">[</span><span class="o">--</span><span class="n">iso</span><span class="o">-</span><span class="n">name</span> <span class="n">ISO_NAME</span><span class="p">]</span>
|
||||
<span class="p">[</span><span class="o">--</span><span class="n">ks</span> <span class="n">KS</span><span class="p">]</span> <span class="p">[</span><span class="o">--</span><span class="n">image</span><span class="o">-</span><span class="n">only</span><span class="p">]</span> <span class="p">[</span><span class="o">--</span><span class="n">no</span><span class="o">-</span><span class="n">virt</span><span class="p">]</span> <span class="p">[</span><span class="o">--</span><span class="n">proxy</span> <span class="n">PROXY</span><span class="p">]</span>
|
||||
<span class="p">[</span><span class="o">--</span><span class="n">anaconda</span><span class="o">-</span><span class="n">arg</span> <span class="n">ANACONDA_ARGS</span><span class="p">]</span>
|
||||
<span class="p">[</span><span class="o">--</span><span class="n">armplatform</span> <span class="n">ARMPLATFORM</span><span class="p">]</span> <span class="p">[</span><span class="o">--</span><span class="n">location</span> <span class="n">LOCATION</span><span class="p">]</span>
|
||||
<span class="p">[</span><span class="o">--</span><span class="n">logfile</span> <span class="n">LOGFILE</span><span class="p">]</span>
|
||||
<span class="p">[</span><span class="o">--</span><span class="n">lorax</span><span class="o">-</span><span class="n">templates</span> <span class="n">LORAX_TEMPLATES</span><span class="p">]</span> <span class="p">[</span><span class="o">--</span><span class="n">tmp</span> <span class="n">TMP</span><span class="p">]</span>
|
||||
<span class="p">[</span><span class="o">--</span><span class="n">resultdir</span> <span class="n">RESULT_DIR</span><span class="p">]</span> <span class="p">[</span><span class="o">--</span><span class="n">macboot</span><span class="p">]</span> <span class="p">[</span><span class="o">--</span><span class="n">nomacboot</span><span class="p">]</span>
|
||||
<span class="p">[</span><span class="o">--</span><span class="n">disk</span><span class="o">-</span><span class="n">image</span> <span class="n">DISK_IMAGE</span><span class="p">]</span> <span class="p">[</span><span class="o">--</span><span class="n">keep</span><span class="o">-</span><span class="n">image</span><span class="p">]</span>
|
||||
<span class="p">[</span><span class="o">--</span><span class="n">fs</span><span class="o">-</span><span class="n">image</span> <span class="n">FS_IMAGE</span><span class="p">]</span> <span class="p">[</span><span class="o">--</span><span class="n">image</span><span class="o">-</span><span class="n">name</span> <span class="n">IMAGE_NAME</span><span class="p">]</span>
|
||||
<span class="p">[</span><span class="o">--</span><span class="n">fs</span><span class="o">-</span><span class="n">label</span> <span class="n">FS_LABEL</span><span class="p">]</span> <span class="p">[</span><span class="o">--</span><span class="n">image</span><span class="o">-</span><span class="nb">type</span> <span class="n">IMAGE_TYPE</span><span class="p">]</span>
|
||||
<span class="p">[</span><span class="o">--</span><span class="n">qemu</span><span class="o">-</span><span class="n">arg</span> <span class="n">QEMU_ARGS</span><span class="p">]</span> <span class="p">[</span><span class="o">--</span><span class="n">qcow2</span><span class="p">]</span>
|
||||
<span class="p">[</span><span class="o">--</span><span class="n">qcow2</span><span class="o">-</span><span class="n">arg</span> <span class="n">QEMU_ARGS</span><span class="p">]</span> <span class="p">[</span><span class="o">--</span><span class="n">compression</span> <span class="n">COMPRESSION</span><span class="p">]</span>
|
||||
<span class="p">[</span><span class="o">--</span><span class="n">compress</span><span class="o">-</span><span class="n">arg</span> <span class="n">COMPRESS_ARGS</span><span class="p">]</span> <span class="p">[</span><span class="o">--</span><span class="n">app</span><span class="o">-</span><span class="n">name</span> <span class="n">APP_NAME</span><span class="p">]</span>
|
||||
<span class="p">[</span><span class="o">--</span><span class="n">app</span><span class="o">-</span><span class="n">template</span> <span class="n">APP_TEMPLATE</span><span class="p">]</span> <span class="p">[</span><span class="o">--</span><span class="n">app</span><span class="o">-</span><span class="n">file</span> <span class="n">APP_FILE</span><span class="p">]</span>
|
||||
<span class="p">[</span><span class="o">--</span><span class="n">ram</span> <span class="n">MEMORY</span><span class="p">]</span> <span class="p">[</span><span class="o">--</span><span class="n">vcpus</span> <span class="n">VCPUS</span><span class="p">]</span> <span class="p">[</span><span class="o">--</span><span class="n">vnc</span> <span class="n">VNC</span><span class="p">]</span>
|
||||
<span class="p">[</span><span class="o">--</span><span class="n">arch</span> <span class="n">ARCH</span><span class="p">]</span> <span class="p">[</span><span class="o">--</span><span class="n">kernel</span><span class="o">-</span><span class="n">args</span> <span class="n">KERNEL_ARGS</span><span class="p">]</span>
|
||||
<span class="p">[</span><span class="o">--</span><span class="n">ovmf</span><span class="o">-</span><span class="n">path</span> <span class="n">OVMF_PATH</span><span class="p">]</span> <span class="p">[</span><span class="o">--</span><span class="n">virt</span><span class="o">-</span><span class="n">uefi</span><span class="p">]</span> <span class="p">[</span><span class="o">--</span><span class="n">no</span><span class="o">-</span><span class="n">kvm</span><span class="p">]</span>
|
||||
<span class="p">[</span><span class="o">--</span><span class="k">with</span><span class="o">-</span><span class="n">rng</span> <span class="n">WITH_RNG</span><span class="p">]</span> <span class="p">[</span><span class="o">--</span><span class="n">dracut</span><span class="o">-</span><span class="n">arg</span> <span class="n">DRACUT_ARGS</span><span class="p">]</span>
|
||||
<span class="p">[</span><span class="o">--</span><span class="n">live</span><span class="o">-</span><span class="n">rootfs</span><span class="o">-</span><span class="n">size</span> <span class="n">LIVE_ROOTFS_SIZE</span><span class="p">]</span>
|
||||
<span class="p">[</span><span class="o">--</span><span class="n">live</span><span class="o">-</span><span class="n">rootfs</span><span class="o">-</span><span class="n">keep</span><span class="o">-</span><span class="n">size</span><span class="p">]</span> <span class="p">[</span><span class="o">--</span><span class="n">oci</span><span class="o">-</span><span class="n">config</span> <span class="n">OCI_CONFIG</span><span class="p">]</span>
|
||||
<span class="p">[</span><span class="o">--</span><span class="n">oci</span><span class="o">-</span><span class="n">runtime</span> <span class="n">OCI_RUNTIME</span><span class="p">]</span>
|
||||
<span class="p">[</span><span class="o">--</span><span class="n">vagrant</span><span class="o">-</span><span class="n">metadata</span> <span class="n">VAGRANT_METADATA</span><span class="p">]</span>
|
||||
<span class="p">[</span><span class="o">--</span><span class="n">vagrantfile</span> <span class="n">VAGRANTFILE</span><span class="p">]</span> <span class="p">[</span><span class="o">--</span><span class="n">title</span> <span class="n">TITLE</span><span class="p">]</span>
|
||||
<span class="p">[</span><span class="o">--</span><span class="n">project</span> <span class="n">PROJECT</span><span class="p">]</span> <span class="p">[</span><span class="o">--</span><span class="n">releasever</span> <span class="n">RELEASEVER</span><span class="p">]</span>
|
||||
<span class="p">[</span><span class="o">--</span><span class="n">volid</span> <span class="n">VOLID</span><span class="p">]</span> <span class="p">[</span><span class="o">--</span><span class="n">squashfs_args</span> <span class="n">SQUASHFS_ARGS</span><span class="p">]</span>
|
||||
<span class="p">[</span><span class="o">--</span><span class="n">timeout</span> <span class="n">TIMEOUT</span><span class="p">]</span> <span class="p">[</span><span class="o">-</span><span class="n">V</span><span class="p">]</span>
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="section" id="Named Arguments">
|
||||
<h3>Named Arguments<a class="headerlink" href="#Named Arguments" title="Permalink to this headline">¶</a></h3>
|
||||
<table class="docutils option-list" frame="void" rules="none">
|
||||
<col class="option" />
|
||||
<col class="description" />
|
||||
<tbody valign="top">
|
||||
<tr><td class="option-group">
|
||||
<kbd>--make-iso</kbd></td>
|
||||
<td><p class="first">Build a live iso</p>
|
||||
<p class="last">Default: False</p>
|
||||
</td></tr>
|
||||
<tr><td class="option-group">
|
||||
<kbd>--make-disk</kbd></td>
|
||||
<td><p class="first">Build a partitioned disk image</p>
|
||||
<p class="last">Default: False</p>
|
||||
</td></tr>
|
||||
<tr><td class="option-group">
|
||||
<kbd>--make-fsimage</kbd></td>
|
||||
<td><p class="first">Build a filesystem image</p>
|
||||
<p class="last">Default: False</p>
|
||||
</td></tr>
|
||||
<tr><td class="option-group" colspan="2">
|
||||
<kbd>--make-appliance</kbd></td>
|
||||
</tr>
|
||||
<tr><td> </td><td><p class="first">Build an appliance image and XML description</p>
|
||||
<p class="last">Default: False</p>
|
||||
</td></tr>
|
||||
<tr><td class="option-group">
|
||||
<kbd>--make-ami</kbd></td>
|
||||
<td><p class="first">Build an ami image</p>
|
||||
<p class="last">Default: False</p>
|
||||
</td></tr>
|
||||
<tr><td class="option-group">
|
||||
<kbd>--make-tar</kbd></td>
|
||||
<td><p class="first">Build a tar of the root filesystem</p>
|
||||
<p class="last">Default: False</p>
|
||||
</td></tr>
|
||||
<tr><td class="option-group" colspan="2">
|
||||
<kbd>--make-pxe-live</kbd></td>
|
||||
</tr>
|
||||
<tr><td> </td><td><p class="first">Build a live pxe boot squashfs image</p>
|
||||
<p class="last">Default: False</p>
|
||||
</td></tr>
|
||||
<tr><td class="option-group" colspan="2">
|
||||
<kbd>--make-ostree-live</kbd></td>
|
||||
</tr>
|
||||
<tr><td> </td><td><p class="first">Build a live pxe boot squashfs image of Atomic Host</p>
|
||||
<p class="last">Default: False</p>
|
||||
</td></tr>
|
||||
<tr><td class="option-group">
|
||||
<kbd>--make-oci</kbd></td>
|
||||
<td><p class="first">Build an Open Container Initiative image</p>
|
||||
<p class="last">Default: False</p>
|
||||
</td></tr>
|
||||
<tr><td class="option-group">
|
||||
<kbd>--make-vagrant</kbd></td>
|
||||
<td><p class="first">Build a Vagrant Box image</p>
|
||||
<p class="last">Default: False</p>
|
||||
</td></tr>
|
||||
<tr><td class="option-group">
|
||||
<kbd>--iso</kbd></td>
|
||||
<td>Anaconda installation .iso path to use for qemu</td></tr>
|
||||
<tr><td class="option-group">
|
||||
<kbd>--iso-only</kbd></td>
|
||||
<td><p class="first">Remove all iso creation artifacts except the boot.iso, combine with –iso-name to rename the boot.iso</p>
|
||||
<p class="last">Default: False</p>
|
||||
</td></tr>
|
||||
<tr><td class="option-group">
|
||||
<kbd>--iso-name</kbd></td>
|
||||
<td>Name of output iso file for –iso-only. Default is boot.iso</td></tr>
|
||||
<tr><td class="option-group">
|
||||
<kbd>--ks</kbd></td>
|
||||
<td>Kickstart file defining the install.</td></tr>
|
||||
<tr><td class="option-group">
|
||||
<kbd>--image-only</kbd></td>
|
||||
<td><p class="first">Exit after creating fs/disk image.</p>
|
||||
<p class="last">Default: False</p>
|
||||
</td></tr>
|
||||
<tr><td class="option-group">
|
||||
<kbd>--no-virt</kbd></td>
|
||||
<td><p class="first">Run anaconda directly on host instead of using qemu</p>
|
||||
<p class="last">Default: False</p>
|
||||
</td></tr>
|
||||
<tr><td class="option-group">
|
||||
<kbd>--proxy</kbd></td>
|
||||
<td>proxy URL to use for the install</td></tr>
|
||||
<tr><td class="option-group">
|
||||
<kbd>--anaconda-arg</kbd></td>
|
||||
<td>Additional argument to pass to anaconda (no-virt mode). Pass once for each argument</td></tr>
|
||||
<tr><td class="option-group">
|
||||
<kbd>--armplatform</kbd></td>
|
||||
<td>the platform to use when creating images for ARM, i.e., highbank, mvebu, omap, tegra, etc.</td></tr>
|
||||
<tr><td class="option-group">
|
||||
<kbd>--location</kbd></td>
|
||||
<td>location of iso directory tree with initrd.img and vmlinuz. Used to run qemu with a newer initrd than the iso.</td></tr>
|
||||
<tr><td class="option-group">
|
||||
<kbd>--logfile</kbd></td>
|
||||
<td><p class="first">Name and path for primary logfile, other logs will be created in the same directory.</p>
|
||||
<p class="last">Default: ./livemedia.log</p>
|
||||
</td></tr>
|
||||
<tr><td class="option-group" colspan="2">
|
||||
<kbd>--lorax-templates</kbd></td>
|
||||
</tr>
|
||||
<tr><td> </td><td>Path to mako templates for lorax</td></tr>
|
||||
<tr><td class="option-group">
|
||||
<kbd>--tmp</kbd></td>
|
||||
<td><p class="first">Top level temporary directory</p>
|
||||
<p class="last">Default: /var/tmp</p>
|
||||
</td></tr>
|
||||
<tr><td class="option-group">
|
||||
<kbd>--resultdir</kbd></td>
|
||||
<td>Directory to copy the resulting images and iso into. Defaults to the temporary working directory</td></tr>
|
||||
<tr><td class="option-group">
|
||||
<kbd>--macboot</kbd></td>
|
||||
<td>Default: True</td></tr>
|
||||
<tr><td class="option-group">
|
||||
<kbd>--nomacboot</kbd></td>
|
||||
<td>Default: True</td></tr>
|
||||
<tr><td class="option-group">
|
||||
<kbd>--title</kbd></td>
|
||||
<td><p class="first">Substituted for @TITLE@ in bootloader config files</p>
|
||||
<p class="last">Default: “Linux Live Media”</p>
|
||||
</td></tr>
|
||||
<tr><td class="option-group">
|
||||
<kbd>--project</kbd></td>
|
||||
<td><p class="first">substituted for @PROJECT@ in bootloader config files</p>
|
||||
<p class="last">Default: “Linux”</p>
|
||||
</td></tr>
|
||||
<tr><td class="option-group">
|
||||
<kbd>--releasever</kbd></td>
|
||||
<td><p class="first">substituted for @VERSION@ in bootloader config files</p>
|
||||
<p class="last">Default: “29”</p>
|
||||
</td></tr>
|
||||
<tr><td class="option-group">
|
||||
<kbd>--volid</kbd></td>
|
||||
<td>volume id</td></tr>
|
||||
<tr><td class="option-group" colspan="2">
|
||||
<kbd>--squashfs_args</kbd></td>
|
||||
</tr>
|
||||
<tr><td> </td><td>additional squashfs args</td></tr>
|
||||
<tr><td class="option-group">
|
||||
<kbd>--timeout</kbd></td>
|
||||
<td>Cancel installer after X minutes</td></tr>
|
||||
<tr><td class="option-group">
|
||||
<kbd>-V</kbd></td>
|
||||
<td>show program’s version number and exit</td></tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="section" id="disk/fs image arguments">
|
||||
<h3>disk/fs image arguments<a class="headerlink" href="#disk/fs image arguments" title="Permalink to this headline">¶</a></h3>
|
||||
<table class="docutils option-list" frame="void" rules="none">
|
||||
<col class="option" />
|
||||
<col class="description" />
|
||||
<tbody valign="top">
|
||||
<tr><td class="option-group">
|
||||
<kbd>--disk-image</kbd></td>
|
||||
<td>Path to existing disk image to use for creating final image.</td></tr>
|
||||
<tr><td class="option-group">
|
||||
<kbd>--keep-image</kbd></td>
|
||||
<td><p class="first">Keep raw disk image after .iso creation</p>
|
||||
<p class="last">Default: False</p>
|
||||
</td></tr>
|
||||
<tr><td class="option-group">
|
||||
<kbd>--fs-image</kbd></td>
|
||||
<td>Path to existing filesystem image to use for creating final image.</td></tr>
|
||||
<tr><td class="option-group">
|
||||
<kbd>--image-name</kbd></td>
|
||||
<td>Name of output file to create. Used for tar, fs and disk image. Default is a random name.</td></tr>
|
||||
<tr><td class="option-group">
|
||||
<kbd>--fs-label</kbd></td>
|
||||
<td><p class="first">Label to set on fsimage, default is ‘Anaconda’</p>
|
||||
<p class="last">Default: “Anaconda”</p>
|
||||
</td></tr>
|
||||
<tr><td class="option-group">
|
||||
<kbd>--image-type</kbd></td>
|
||||
<td>Create an image with qemu-img. See qemu-img –help for supported formats.</td></tr>
|
||||
<tr><td class="option-group">
|
||||
<kbd>--qemu-arg</kbd></td>
|
||||
<td><p class="first">Arguments to pass to qemu-img. Pass once for each argument, they will be used for ALL calls to qemu-img.</p>
|
||||
<p class="last">Default: []</p>
|
||||
</td></tr>
|
||||
<tr><td class="option-group">
|
||||
<kbd>--qcow2</kbd></td>
|
||||
<td><p class="first">Create qcow2 image instead of raw sparse image when making disk images.</p>
|
||||
<p class="last">Default: False</p>
|
||||
</td></tr>
|
||||
<tr><td class="option-group">
|
||||
<kbd>--qcow2-arg</kbd></td>
|
||||
<td><p class="first">Arguments to pass to qemu-img. Pass once for each argument, they will be used for ALL calls to qemu-img.</p>
|
||||
<p class="last">Default: []</p>
|
||||
</td></tr>
|
||||
<tr><td class="option-group">
|
||||
<kbd>--compression</kbd></td>
|
||||
<td><p class="first">Compression binary for make-tar. xz, lzma, gzip, and bzip2 are supported. xz is the default.</p>
|
||||
<p class="last">Default: “xz”</p>
|
||||
</td></tr>
|
||||
<tr><td class="option-group">
|
||||
<kbd>--compress-arg</kbd></td>
|
||||
<td><p class="first">Arguments to pass to compression. Pass once for each argument</p>
|
||||
<p class="last">Default: []</p>
|
||||
</td></tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="section" id="appliance arguments">
|
||||
<h3>appliance arguments<a class="headerlink" href="#appliance arguments" title="Permalink to this headline">¶</a></h3>
|
||||
<table class="docutils option-list" frame="void" rules="none">
|
||||
<col class="option" />
|
||||
<col class="description" />
|
||||
<tbody valign="top">
|
||||
<tr><td class="option-group">
|
||||
<kbd>--app-name</kbd></td>
|
||||
<td>Name of appliance to pass to template</td></tr>
|
||||
<tr><td class="option-group">
|
||||
<kbd>--app-template</kbd></td>
|
||||
<td>Path to template to use for appliance data.</td></tr>
|
||||
<tr><td class="option-group">
|
||||
<kbd>--app-file</kbd></td>
|
||||
<td><p class="first">Appliance template results file.</p>
|
||||
<p class="last">Default: “appliance.xml”</p>
|
||||
</td></tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="section" id="qemu arguments">
|
||||
<h3>qemu arguments<a class="headerlink" href="#qemu arguments" title="Permalink to this headline">¶</a></h3>
|
||||
<table class="docutils option-list" frame="void" rules="none">
|
||||
<col class="option" />
|
||||
<col class="description" />
|
||||
<tbody valign="top">
|
||||
<tr><td class="option-group">
|
||||
<kbd>--ram</kbd></td>
|
||||
<td><p class="first">Memory to allocate for installer in megabytes.</p>
|
||||
<p class="last">Default: 2048</p>
|
||||
</td></tr>
|
||||
<tr><td class="option-group">
|
||||
<kbd>--vcpus</kbd></td>
|
||||
<td>Passed to qemu -smp command</td></tr>
|
||||
<tr><td class="option-group">
|
||||
<kbd>--vnc</kbd></td>
|
||||
<td>Passed to qemu -display command. eg. vnc=127.0.0.1:5, default is to choose the first unused vnc port.</td></tr>
|
||||
<tr><td class="option-group">
|
||||
<kbd>--arch</kbd></td>
|
||||
<td>System arch to build for. Used to select qemu-system-* command. Defaults to qemu-system-<arch></td></tr>
|
||||
<tr><td class="option-group">
|
||||
<kbd>--kernel-args</kbd></td>
|
||||
<td>Additional argument to pass to the installation kernel</td></tr>
|
||||
<tr><td class="option-group">
|
||||
<kbd>--ovmf-path</kbd></td>
|
||||
<td><p class="first">Path to OVMF firmware</p>
|
||||
<p class="last">Default: “/usr/share/edk2/ovmf/”</p>
|
||||
</td></tr>
|
||||
<tr><td class="option-group">
|
||||
<kbd>--virt-uefi</kbd></td>
|
||||
<td><p class="first">Use OVMF firmware to boot the VM in UEFI mode</p>
|
||||
<p class="last">Default: False</p>
|
||||
</td></tr>
|
||||
<tr><td class="option-group">
|
||||
<kbd>--no-kvm</kbd></td>
|
||||
<td><p class="first">Skip using kvm with qemu even if it is available.</p>
|
||||
<p class="last">Default: False</p>
|
||||
</td></tr>
|
||||
<tr><td class="option-group">
|
||||
<kbd>--with-rng</kbd></td>
|
||||
<td><p class="first">RNG device for QEMU (none for no RNG)</p>
|
||||
<p class="last">Default: “/dev/random”</p>
|
||||
</td></tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="section" id="dracut arguments">
|
||||
<h3>dracut arguments<a class="headerlink" href="#dracut arguments" title="Permalink to this headline">¶</a></h3>
|
||||
<table class="docutils option-list" frame="void" rules="none">
|
||||
<col class="option" />
|
||||
<col class="description" />
|
||||
<tbody valign="top">
|
||||
<tr><td class="option-group">
|
||||
<kbd>--dracut-arg</kbd></td>
|
||||
<td>Argument to pass to dracut when rebuilding the initramfs. Pass this once for each argument. NOTE: this overrides the default. (default: )</td></tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="section" id="pxe to live arguments">
|
||||
<h3>pxe to live arguments<a class="headerlink" href="#pxe to live arguments" title="Permalink to this headline">¶</a></h3>
|
||||
<table class="docutils option-list" frame="void" rules="none">
|
||||
<col class="option" />
|
||||
<col class="description" />
|
||||
<tbody valign="top">
|
||||
<tr><td class="option-group" colspan="2">
|
||||
<kbd>--live-rootfs-size</kbd></td>
|
||||
</tr>
|
||||
<tr><td> </td><td><p class="first">Size of root filesystem of live image in GiB</p>
|
||||
<p class="last">Default: 0</p>
|
||||
</td></tr>
|
||||
<tr><td class="option-group" colspan="2">
|
||||
<kbd>--live-rootfs-keep-size</kbd></td>
|
||||
</tr>
|
||||
<tr><td> </td><td><p class="first">Keep the original size of root filesystem in live image</p>
|
||||
<p class="last">Default: False</p>
|
||||
</td></tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="section" id="OCI arguments">
|
||||
<h3>OCI arguments<a class="headerlink" href="#OCI arguments" title="Permalink to this headline">¶</a></h3>
|
||||
<table class="docutils option-list" frame="void" rules="none">
|
||||
<col class="option" />
|
||||
<col class="description" />
|
||||
<tbody valign="top">
|
||||
<tr><td class="option-group">
|
||||
<kbd>--oci-config</kbd></td>
|
||||
<td>config.json OCI configuration file</td></tr>
|
||||
<tr><td class="option-group">
|
||||
<kbd>--oci-runtime</kbd></td>
|
||||
<td>runtime.json OCI configuration file</td></tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="section" id="Vagrant arguments">
|
||||
<h3>Vagrant arguments<a class="headerlink" href="#Vagrant arguments" title="Permalink to this headline">¶</a></h3>
|
||||
<table class="docutils option-list" frame="void" rules="none">
|
||||
<col class="option" />
|
||||
<col class="description" />
|
||||
<tbody valign="top">
|
||||
<tr><td class="option-group" colspan="2">
|
||||
<kbd>--vagrant-metadata</kbd></td>
|
||||
</tr>
|
||||
<tr><td> </td><td>optional metadata.json file</td></tr>
|
||||
<tr><td class="option-group">
|
||||
<kbd>--vagrantfile</kbd></td>
|
||||
<td>optional vagrantfile</td></tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<div class="section" id="quickstart">
|
||||
<h2>Quickstart<a class="headerlink" href="#quickstart" title="Permalink to this headline">¶</a></h2>
|
||||
@ -801,7 +1178,7 @@ report bugs against the lorax component.</p>
|
||||
<script type="text/javascript">
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT:'./',
|
||||
VERSION:'29.10',
|
||||
VERSION:'29.11',
|
||||
LANGUAGE:'None',
|
||||
COLLAPSE_INDEX:false,
|
||||
FILE_SUFFIX:'.html',
|
||||
@ -815,7 +1192,10 @@ report bugs against the lorax component.</p>
|
||||
|
||||
|
||||
|
||||
<script type="text/javascript" src="_static/js/theme.js"></script>
|
||||
|
||||
|
||||
<script type="text/javascript" src="_static/js/theme.js"></script>
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
jQuery(function () {
|
||||
|
@ -8,7 +8,7 @@
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<title>lorax-composer — Lorax 29.10 documentation</title>
|
||||
<title>lorax-composer — Lorax 29.11 documentation</title>
|
||||
|
||||
|
||||
|
||||
@ -24,7 +24,8 @@
|
||||
|
||||
|
||||
|
||||
<link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
|
||||
|
||||
<link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
|
||||
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
|
||||
<link rel="index" title="Index" href="genindex.html" />
|
||||
<link rel="search" title="Search" href="search.html" />
|
||||
@ -58,7 +59,7 @@
|
||||
|
||||
|
||||
<div class="version">
|
||||
29.10
|
||||
29.11
|
||||
</div>
|
||||
|
||||
|
||||
@ -92,7 +93,11 @@
|
||||
<li class="toctree-l2"><a class="reference internal" href="#quickstart">Quickstart</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="#logs">Logs</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="#security">Security</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="#lorax-composer-cmdline-arguments">lorax-composer cmdline arguments</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="#lorax-composer-cmdline-arguments">lorax-composer cmdline arguments</a><ul>
|
||||
<li class="toctree-l3"><a class="reference internal" href="#Positional Arguments">Positional Arguments</a></li>
|
||||
<li class="toctree-l3"><a class="reference internal" href="#Named Arguments">Named Arguments</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="#how-it-works">How it Works</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="#composing-images">Composing Images</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="#blueprints">Blueprints</a><ul>
|
||||
@ -205,7 +210,13 @@ systemd socket activation service. You will then need to enable it with <code cl
|
||||
<span class="pre">systemctl</span> <span class="pre">enable</span> <span class="pre">lorax-composer.socket</span> <span class="pre">&&</span> <span class="pre">sudo</span> <span class="pre">systemctl</span> <span class="pre">start</span>
|
||||
<span class="pre">lorax-composer.socket</span></code>. This will leave the server off until the first request
|
||||
is made. Systemd will then launch the server and it will remain running until
|
||||
the system is rebooted.</p>
|
||||
the system is rebooted. This will cause some delay in responding to the first
|
||||
request from the UI or <cite>composer-cli</cite>.</p>
|
||||
<div class="admonition note">
|
||||
<p class="first admonition-title">Note</p>
|
||||
<p class="last">If you want lorax-composer to respond immediately to the first request you can
|
||||
start and enable <cite>lorax-composer.service</cite> instead of <cite>lorax-composer.socket</cite></p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="section" id="quickstart">
|
||||
<h2>Quickstart<a class="headerlink" href="#quickstart" title="Permalink to this headline">¶</a></h2>
|
||||
@ -214,9 +225,13 @@ the system is rebooted.</p>
|
||||
<li>Remove any pre-existing socket directory with <code class="docutils literal notranslate"><span class="pre">rm</span> <span class="pre">-rf</span> <span class="pre">/run/weldr/</span></code>
|
||||
A new directory with correct permissions will be created the first time the server runs.</li>
|
||||
<li>Enable the socket activation with <code class="docutils literal notranslate"><span class="pre">systemctl</span> <span class="pre">enable</span> <span class="pre">lorax-composer.socket</span>
|
||||
<span class="pre">&&</span> <span class="pre">sudo</span> <span class="pre">systemctl</span> <span class="pre">start</span> <span class="pre">lorax-composer.socket</span></code> or run it directly with
|
||||
<code class="docutils literal notranslate"><span class="pre">lorax-composer</span> <span class="pre">/path/to/blueprints/</span></code></li>
|
||||
<span class="pre">&&</span> <span class="pre">sudo</span> <span class="pre">systemctl</span> <span class="pre">start</span> <span class="pre">lorax-composer.socket</span></code>.</li>
|
||||
</ol>
|
||||
<p>NOTE: You can also run it directly with <code class="docutils literal notranslate"><span class="pre">lorax-composer</span> <span class="pre">/path/to/blueprints</span></code>. However,
|
||||
<code class="docutils literal notranslate"><span class="pre">lorax-composer</span></code> does not react well to being started both on the command line and via
|
||||
socket activation at the same time. It is therefore recommended that you run it directly
|
||||
on the command line only for testing or development purposes. For real use or development
|
||||
of other projects that simply use the API, you should stick to socket activation only.</p>
|
||||
<p>The <code class="docutils literal notranslate"><span class="pre">/path/to/blueprints/</span></code> directory is where the blueprints’ git repo will
|
||||
be created, and all the blueprints created with the <code class="docutils literal notranslate"><span class="pre">/api/v0/blueprints/new</span></code>
|
||||
route will be stored. If there are blueprint <code class="docutils literal notranslate"><span class="pre">.toml</span></code> files in the top level
|
||||
@ -243,6 +258,84 @@ images using <code class="docutils literal notranslate"><span class="pre">lorax-
|
||||
</div>
|
||||
<div class="section" id="lorax-composer-cmdline-arguments">
|
||||
<h2>lorax-composer cmdline arguments<a class="headerlink" href="#lorax-composer-cmdline-arguments" title="Permalink to this headline">¶</a></h2>
|
||||
<p>Lorax Composer API Server</p>
|
||||
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">usage</span><span class="p">:</span> <span class="n">lorax</span><span class="o">-</span><span class="n">composer</span> <span class="p">[</span><span class="o">-</span><span class="n">h</span><span class="p">]</span> <span class="p">[</span><span class="o">--</span><span class="n">socket</span> <span class="n">SOCKET</span><span class="p">]</span> <span class="p">[</span><span class="o">--</span><span class="n">user</span> <span class="n">USER</span><span class="p">]</span> <span class="p">[</span><span class="o">--</span><span class="n">group</span> <span class="n">GROUP</span><span class="p">]</span>
|
||||
<span class="p">[</span><span class="o">--</span><span class="n">log</span> <span class="n">LOG</span><span class="p">]</span> <span class="p">[</span><span class="o">--</span><span class="n">mockfiles</span> <span class="n">MOCKFILES</span><span class="p">]</span>
|
||||
<span class="p">[</span><span class="o">--</span><span class="n">sharedir</span> <span class="n">SHAREDIR</span><span class="p">]</span> <span class="p">[</span><span class="o">-</span><span class="n">V</span><span class="p">]</span> <span class="p">[</span><span class="o">-</span><span class="n">c</span> <span class="n">CONFIG</span><span class="p">]</span>
|
||||
<span class="p">[</span><span class="o">--</span><span class="n">releasever</span> <span class="n">STRING</span><span class="p">]</span> <span class="p">[</span><span class="o">--</span><span class="n">tmp</span> <span class="n">TMP</span><span class="p">]</span> <span class="p">[</span><span class="o">--</span><span class="n">proxy</span> <span class="n">PROXY</span><span class="p">]</span>
|
||||
<span class="n">BLUEPRINTS</span>
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="section" id="Positional Arguments">
|
||||
<h3>Positional Arguments<a class="headerlink" href="#Positional Arguments" title="Permalink to this headline">¶</a></h3>
|
||||
<table class="docutils option-list" frame="void" rules="none">
|
||||
<col class="option" />
|
||||
<col class="description" />
|
||||
<tbody valign="top">
|
||||
<tr><td class="option-group">
|
||||
<kbd>BLUEPRINTS</kbd></td>
|
||||
<td>Path to the blueprints</td></tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="section" id="Named Arguments">
|
||||
<h3>Named Arguments<a class="headerlink" href="#Named Arguments" title="Permalink to this headline">¶</a></h3>
|
||||
<table class="docutils option-list" frame="void" rules="none">
|
||||
<col class="option" />
|
||||
<col class="description" />
|
||||
<tbody valign="top">
|
||||
<tr><td class="option-group">
|
||||
<kbd>--socket</kbd></td>
|
||||
<td><p class="first">Path to the socket file to listen on</p>
|
||||
<p class="last">Default: “/run/weldr/api.socket”</p>
|
||||
</td></tr>
|
||||
<tr><td class="option-group">
|
||||
<kbd>--user</kbd></td>
|
||||
<td><p class="first">User to use for reduced permissions</p>
|
||||
<p class="last">Default: “weldr”</p>
|
||||
</td></tr>
|
||||
<tr><td class="option-group">
|
||||
<kbd>--group</kbd></td>
|
||||
<td><p class="first">Group to set ownership of the socket to</p>
|
||||
<p class="last">Default: “weldr”</p>
|
||||
</td></tr>
|
||||
<tr><td class="option-group">
|
||||
<kbd>--log</kbd></td>
|
||||
<td><p class="first">Path to logfile (/var/log/lorax-composer/composer.log)</p>
|
||||
<p class="last">Default: “/var/log/lorax-composer/composer.log”</p>
|
||||
</td></tr>
|
||||
<tr><td class="option-group">
|
||||
<kbd>--mockfiles</kbd></td>
|
||||
<td><p class="first">Path to JSON files used for /api/mock/ paths (/var/tmp/bdcs-mockfiles/)</p>
|
||||
<p class="last">Default: “/var/tmp/bdcs-mockfiles/”</p>
|
||||
</td></tr>
|
||||
<tr><td class="option-group">
|
||||
<kbd>--sharedir</kbd></td>
|
||||
<td>Directory containing all the templates. Overrides config file sharedir</td></tr>
|
||||
<tr><td class="option-group">
|
||||
<kbd>-V</kbd></td>
|
||||
<td><p class="first">show program’s version number and exit</p>
|
||||
<p class="last">Default: False</p>
|
||||
</td></tr>
|
||||
<tr><td class="option-group">
|
||||
<kbd>-c, --config</kbd></td>
|
||||
<td><p class="first">Path to lorax-composer configuration file.</p>
|
||||
<p class="last">Default: “/etc/lorax/composer.conf”</p>
|
||||
</td></tr>
|
||||
<tr><td class="option-group">
|
||||
<kbd>--releasever</kbd></td>
|
||||
<td>Release version to use for $releasever in dnf repository urls</td></tr>
|
||||
<tr><td class="option-group">
|
||||
<kbd>--tmp</kbd></td>
|
||||
<td><p class="first">Top level temporary directory</p>
|
||||
<p class="last">Default: “/var/tmp”</p>
|
||||
</td></tr>
|
||||
<tr><td class="option-group">
|
||||
<kbd>--proxy</kbd></td>
|
||||
<td>Set proxy for DNF, overrides configuration file setting.</td></tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<div class="section" id="how-it-works">
|
||||
<h2>How it Works<a class="headerlink" href="#how-it-works" title="Permalink to this headline">¶</a></h2>
|
||||
@ -363,12 +456,12 @@ these are currently available via <code class="docutils literal notranslate"><sp
|
||||
lorax-composer a kickstart file needs to be added to <code class="docutils literal notranslate"><span class="pre">./share/composer/</span></code>. The
|
||||
name of the kickstart is what will be used by the <code class="docutils literal notranslate"><span class="pre">/compose/types</span></code> route, and the
|
||||
<code class="docutils literal notranslate"><span class="pre">compose_type</span></code> field of the POST to start a compose. It also needs to have
|
||||
code added to the <code class="xref py py-func docutils literal notranslate"><span class="pre">pylorax.api.compose.compose_args()</span></code> function. The
|
||||
code added to the <a class="reference internal" href="pylorax.api.html#pylorax.api.compose.compose_args" title="pylorax.api.compose.compose_args"><code class="xref py py-func docutils literal notranslate"><span class="pre">pylorax.api.compose.compose_args()</span></code></a> function. The
|
||||
<code class="docutils literal notranslate"><span class="pre">_MAP</span></code> entry in this function defines what lorax-composer will pass to
|
||||
<code class="xref py py-func docutils literal notranslate"><span class="pre">pylorax.installer.novirt_install()</span></code> when it runs the compose. When the
|
||||
<a class="reference internal" href="pylorax.html#pylorax.installer.novirt_install" title="pylorax.installer.novirt_install"><code class="xref py py-func docutils literal notranslate"><span class="pre">pylorax.installer.novirt_install()</span></code></a> when it runs the compose. When the
|
||||
compose is finished the output files need to be copied out of the build
|
||||
directory (<code class="docutils literal notranslate"><span class="pre">/var/lib/lorax/composer/results/<UUID>/compose/</span></code>),
|
||||
<code class="xref py py-func docutils literal notranslate"><span class="pre">pylorax.api.compose.move_compose_results()</span></code> handles this for each type.
|
||||
<a class="reference internal" href="pylorax.api.html#pylorax.api.compose.move_compose_results" title="pylorax.api.compose.move_compose_results"><code class="xref py py-func docutils literal notranslate"><span class="pre">pylorax.api.compose.move_compose_results()</span></code></a> handles this for each type.
|
||||
You should move them instead of copying to save space.</p>
|
||||
<p>If the new output type does not have support in livemedia-creator it should be
|
||||
added there first. This will make the output available to the widest number of
|
||||
@ -380,8 +473,8 @@ via the <code class="docutils literal notranslate"><span class="pre">--make-disk
|
||||
needs 3 things:</p>
|
||||
<ul class="simple">
|
||||
<li>A <code class="docutils literal notranslate"><span class="pre">partitioned-disk.ks</span></code> file in <code class="docutils literal notranslate"><span class="pre">./share/composer/</span></code></li>
|
||||
<li>A new entry in the _MAP in <code class="xref py py-func docutils literal notranslate"><span class="pre">pylorax.api.compose.compose_args()</span></code></li>
|
||||
<li>Add a bit of code to <code class="xref py py-func docutils literal notranslate"><span class="pre">pylorax.api.compose.move_compose_results()</span></code> to move the disk image from
|
||||
<li>A new entry in the _MAP in <a class="reference internal" href="pylorax.api.html#pylorax.api.compose.compose_args" title="pylorax.api.compose.compose_args"><code class="xref py py-func docutils literal notranslate"><span class="pre">pylorax.api.compose.compose_args()</span></code></a></li>
|
||||
<li>Add a bit of code to <a class="reference internal" href="pylorax.api.html#pylorax.api.compose.move_compose_results" title="pylorax.api.compose.move_compose_results"><code class="xref py py-func docutils literal notranslate"><span class="pre">pylorax.api.compose.move_compose_results()</span></code></a> to move the disk image from
|
||||
the compose directory to the results directory.</li>
|
||||
</ul>
|
||||
<p>The <code class="docutils literal notranslate"><span class="pre">partitioned-disk.ks</span></code> is pretty similar to the example minimal kickstart
|
||||
@ -488,7 +581,7 @@ conflict with any other package sources, otherwise depsolving will fail.</p>
|
||||
<script type="text/javascript">
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT:'./',
|
||||
VERSION:'29.10',
|
||||
VERSION:'29.11',
|
||||
LANGUAGE:'None',
|
||||
COLLAPSE_INDEX:false,
|
||||
FILE_SUFFIX:'.html',
|
||||
@ -502,7 +595,10 @@ conflict with any other package sources, otherwise depsolving will fail.</p>
|
||||
|
||||
|
||||
|
||||
<script type="text/javascript" src="_static/js/theme.js"></script>
|
||||
|
||||
|
||||
<script type="text/javascript" src="_static/js/theme.js"></script>
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
jQuery(function () {
|
||||
|
@ -8,7 +8,7 @@
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<title>Lorax — Lorax 29.10 documentation</title>
|
||||
<title>Lorax — Lorax 29.11 documentation</title>
|
||||
|
||||
|
||||
|
||||
@ -24,7 +24,8 @@
|
||||
|
||||
|
||||
|
||||
<link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
|
||||
|
||||
<link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
|
||||
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
|
||||
<link rel="index" title="Index" href="genindex.html" />
|
||||
<link rel="search" title="Search" href="search.html" />
|
||||
@ -58,7 +59,7 @@
|
||||
|
||||
|
||||
<div class="version">
|
||||
29.10
|
||||
29.11
|
||||
</div>
|
||||
|
||||
|
||||
@ -86,7 +87,14 @@
|
||||
<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 current"><a class="current reference internal" href="#">Lorax</a><ul>
|
||||
<li class="toctree-l2"><a class="reference internal" href="#lorax-cmdline-arguments">lorax cmdline arguments</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="#lorax-cmdline-arguments">lorax cmdline arguments</a><ul>
|
||||
<li class="toctree-l3"><a class="reference internal" href="#Positional Arguments">Positional Arguments</a></li>
|
||||
<li class="toctree-l3"><a class="reference internal" href="#Named Arguments">Named Arguments</a></li>
|
||||
<li class="toctree-l3"><a class="reference internal" href="#required arguments">required arguments</a></li>
|
||||
<li class="toctree-l3"><a class="reference internal" href="#Named Arguments_repeat1">Named Arguments</a></li>
|
||||
<li class="toctree-l3"><a class="reference internal" href="#dracut arguments">dracut arguments</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="#quickstart">Quickstart</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="#running-inside-of-mock">Running inside of mock</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="#how-it-works">How it works</a><ul>
|
||||
@ -190,6 +198,228 @@ rawhide version to build the boot.iso for rawhide, along with the rawhide
|
||||
repositories.</p>
|
||||
<div class="section" id="lorax-cmdline-arguments">
|
||||
<h2>lorax cmdline arguments<a class="headerlink" href="#lorax-cmdline-arguments" title="Permalink to this headline">¶</a></h2>
|
||||
<p>Create the Anaconda boot.iso</p>
|
||||
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">usage</span><span class="p">:</span> <span class="n">lorax</span> <span class="p">[</span><span class="o">-</span><span class="n">h</span><span class="p">]</span> <span class="o">-</span><span class="n">p</span> <span class="n">PRODUCT</span> <span class="o">-</span><span class="n">v</span> <span class="n">VERSION</span> <span class="o">-</span><span class="n">r</span> <span class="n">RELEASE</span> <span class="p">[</span><span class="o">-</span><span class="n">s</span> <span class="n">REPOSITORY</span><span class="p">]</span>
|
||||
<span class="p">[</span><span class="o">--</span><span class="n">repo</span> <span class="n">REPOSITORY</span><span class="p">]</span> <span class="p">[</span><span class="o">-</span><span class="n">m</span> <span class="n">REPOSITORY</span><span class="p">]</span> <span class="p">[</span><span class="o">-</span><span class="n">t</span> <span class="n">VARIANT</span><span class="p">]</span> <span class="p">[</span><span class="o">-</span><span class="n">b</span> <span class="n">URL</span><span class="p">]</span>
|
||||
<span class="p">[</span><span class="o">--</span><span class="n">isfinal</span><span class="p">]</span> <span class="p">[</span><span class="o">-</span><span class="n">c</span> <span class="n">CONFIGFILE</span><span class="p">]</span> <span class="p">[</span><span class="o">--</span><span class="n">proxy</span> <span class="n">HOST</span><span class="p">]</span> <span class="p">[</span><span class="o">-</span><span class="n">i</span> <span class="n">PACKAGE</span><span class="p">]</span>
|
||||
<span class="p">[</span><span class="o">-</span><span class="n">e</span> <span class="n">PACKAGE</span><span class="p">]</span> <span class="p">[</span><span class="o">--</span><span class="n">buildarch</span> <span class="n">ARCH</span><span class="p">]</span> <span class="p">[</span><span class="o">--</span><span class="n">volid</span> <span class="n">VOLID</span><span class="p">]</span> <span class="p">[</span><span class="o">--</span><span class="n">macboot</span><span class="p">]</span>
|
||||
<span class="p">[</span><span class="o">--</span><span class="n">nomacboot</span><span class="p">]</span> <span class="p">[</span><span class="o">--</span><span class="n">noupgrade</span><span class="p">]</span> <span class="p">[</span><span class="o">--</span><span class="n">logfile</span> <span class="n">LOGFILE</span><span class="p">]</span> <span class="p">[</span><span class="o">--</span><span class="n">tmp</span> <span class="n">TMP</span><span class="p">]</span>
|
||||
<span class="p">[</span><span class="o">--</span><span class="n">cachedir</span> <span class="n">CACHEDIR</span><span class="p">]</span> <span class="p">[</span><span class="o">--</span><span class="n">workdir</span> <span class="n">WORKDIR</span><span class="p">]</span> <span class="p">[</span><span class="o">--</span><span class="n">force</span><span class="p">]</span>
|
||||
<span class="p">[</span><span class="o">--</span><span class="n">add</span><span class="o">-</span><span class="n">template</span> <span class="n">ADD_TEMPLATES</span><span class="p">]</span>
|
||||
<span class="p">[</span><span class="o">--</span><span class="n">add</span><span class="o">-</span><span class="n">template</span><span class="o">-</span><span class="n">var</span> <span class="n">ADD_TEMPLATE_VARS</span><span class="p">]</span>
|
||||
<span class="p">[</span><span class="o">--</span><span class="n">add</span><span class="o">-</span><span class="n">arch</span><span class="o">-</span><span class="n">template</span> <span class="n">ADD_ARCH_TEMPLATES</span><span class="p">]</span>
|
||||
<span class="p">[</span><span class="o">--</span><span class="n">add</span><span class="o">-</span><span class="n">arch</span><span class="o">-</span><span class="n">template</span><span class="o">-</span><span class="n">var</span> <span class="n">ADD_ARCH_TEMPLATE_VARS</span><span class="p">]</span> <span class="p">[</span><span class="o">--</span><span class="n">noverify</span><span class="p">]</span>
|
||||
<span class="p">[</span><span class="o">--</span><span class="n">sharedir</span> <span class="n">SHAREDIR</span><span class="p">]</span> <span class="p">[</span><span class="o">--</span><span class="n">enablerepo</span> <span class="p">[</span><span class="n">repo</span><span class="p">]]</span>
|
||||
<span class="p">[</span><span class="o">--</span><span class="n">disablerepo</span> <span class="p">[</span><span class="n">repo</span><span class="p">]]</span> <span class="p">[</span><span class="o">--</span><span class="n">rootfs</span><span class="o">-</span><span class="n">size</span> <span class="n">ROOTFS_SIZE</span><span class="p">]</span>
|
||||
<span class="p">[</span><span class="o">--</span><span class="n">noverifyssl</span><span class="p">]</span> <span class="p">[</span><span class="o">--</span><span class="n">dnfplugin</span> <span class="n">DNFPLUGINS</span><span class="p">]</span>
|
||||
<span class="p">[</span><span class="o">--</span><span class="n">dracut</span><span class="o">-</span><span class="n">arg</span> <span class="n">DRACUT_ARGS</span><span class="p">]</span> <span class="p">[</span><span class="o">-</span><span class="n">V</span><span class="p">]</span>
|
||||
<span class="n">OUTPUTDIR</span>
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="section" id="Positional Arguments">
|
||||
<h3>Positional Arguments<a class="headerlink" href="#Positional Arguments" title="Permalink to this headline">¶</a></h3>
|
||||
<table class="docutils option-list" frame="void" rules="none">
|
||||
<col class="option" />
|
||||
<col class="description" />
|
||||
<tbody valign="top">
|
||||
<tr><td class="option-group">
|
||||
<kbd>OUTPUTDIR</kbd></td>
|
||||
<td>Output directory</td></tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="section" id="Named Arguments">
|
||||
<h3>Named Arguments<a class="headerlink" href="#Named Arguments" title="Permalink to this headline">¶</a></h3>
|
||||
<table class="docutils option-list" frame="void" rules="none">
|
||||
<col class="option" />
|
||||
<col class="description" />
|
||||
<tbody valign="top">
|
||||
<tr><td class="option-group">
|
||||
<kbd>-V</kbd></td>
|
||||
<td>show program’s version number and exit</td></tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="section" id="required arguments">
|
||||
<h3>required arguments<a class="headerlink" href="#required arguments" title="Permalink to this headline">¶</a></h3>
|
||||
<table class="docutils option-list" frame="void" rules="none">
|
||||
<col class="option" />
|
||||
<col class="description" />
|
||||
<tbody valign="top">
|
||||
<tr><td class="option-group">
|
||||
<kbd>-p, --product</kbd></td>
|
||||
<td>product name</td></tr>
|
||||
<tr><td class="option-group">
|
||||
<kbd>-v, --version</kbd></td>
|
||||
<td>version identifier</td></tr>
|
||||
<tr><td class="option-group">
|
||||
<kbd>-r, --release</kbd></td>
|
||||
<td>release information</td></tr>
|
||||
<tr><td class="option-group">
|
||||
<kbd>-s, --source</kbd></td>
|
||||
<td><p class="first">source repository (may be listed multiple times)</p>
|
||||
<p class="last">Default: []</p>
|
||||
</td></tr>
|
||||
<tr><td class="option-group">
|
||||
<kbd>--repo</kbd></td>
|
||||
<td><p class="first">source dnf repository file</p>
|
||||
<p class="last">Default: []</p>
|
||||
</td></tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="section" id="Named Arguments_repeat1">
|
||||
<h3>Named Arguments<a class="headerlink" href="#Named Arguments_repeat1" title="Permalink to this headline">¶</a></h3>
|
||||
<table class="docutils option-list" frame="void" rules="none">
|
||||
<col class="option" />
|
||||
<col class="description" />
|
||||
<tbody valign="top">
|
||||
<tr><td class="option-group" colspan="2">
|
||||
<kbd>-m, --mirrorlist</kbd></td>
|
||||
</tr>
|
||||
<tr><td> </td><td><p class="first">mirrorlist repository (may be listed multiple times)</p>
|
||||
<p class="last">Default: []</p>
|
||||
</td></tr>
|
||||
<tr><td class="option-group">
|
||||
<kbd>-t, --variant</kbd></td>
|
||||
<td><p class="first">variant name</p>
|
||||
<p class="last">Default: “”</p>
|
||||
</td></tr>
|
||||
<tr><td class="option-group">
|
||||
<kbd>-b, --bugurl</kbd></td>
|
||||
<td><p class="first">bug reporting URL for the product</p>
|
||||
<p class="last">Default: “your distribution provided bug reporting tool”</p>
|
||||
</td></tr>
|
||||
<tr><td class="option-group">
|
||||
<kbd>--isfinal</kbd></td>
|
||||
<td>Default: False</td></tr>
|
||||
<tr><td class="option-group">
|
||||
<kbd>-c, --config</kbd></td>
|
||||
<td><p class="first">config file</p>
|
||||
<p class="last">Default: “/etc/lorax/lorax.conf”</p>
|
||||
</td></tr>
|
||||
<tr><td class="option-group">
|
||||
<kbd>--proxy</kbd></td>
|
||||
<td>repo proxy url:port</td></tr>
|
||||
<tr><td class="option-group" colspan="2">
|
||||
<kbd>-i, --installpkgs</kbd></td>
|
||||
</tr>
|
||||
<tr><td> </td><td><p class="first">package glob to install before runtime-install.tmpl runs. (may be listed multiple times)</p>
|
||||
<p class="last">Default: []</p>
|
||||
</td></tr>
|
||||
<tr><td class="option-group" colspan="2">
|
||||
<kbd>-e, --excludepkgs</kbd></td>
|
||||
</tr>
|
||||
<tr><td> </td><td><p class="first">package glob to remove before runtime-install.tmpl runs. (may be listed multiple times)</p>
|
||||
<p class="last">Default: []</p>
|
||||
</td></tr>
|
||||
<tr><td class="option-group">
|
||||
<kbd>--buildarch</kbd></td>
|
||||
<td>build architecture</td></tr>
|
||||
<tr><td class="option-group">
|
||||
<kbd>--volid</kbd></td>
|
||||
<td>volume id</td></tr>
|
||||
<tr><td class="option-group">
|
||||
<kbd>--macboot</kbd></td>
|
||||
<td>Default: True</td></tr>
|
||||
<tr><td class="option-group">
|
||||
<kbd>--nomacboot</kbd></td>
|
||||
<td>Default: True</td></tr>
|
||||
<tr><td class="option-group">
|
||||
<kbd>--noupgrade</kbd></td>
|
||||
<td>Default: True</td></tr>
|
||||
<tr><td class="option-group">
|
||||
<kbd>--logfile</kbd></td>
|
||||
<td><p class="first">Path to logfile</p>
|
||||
<p class="last">Default: ./lorax.log</p>
|
||||
</td></tr>
|
||||
<tr><td class="option-group">
|
||||
<kbd>--tmp</kbd></td>
|
||||
<td><p class="first">Top level temporary directory</p>
|
||||
<p class="last">Default: “/var/tmp”</p>
|
||||
</td></tr>
|
||||
<tr><td class="option-group">
|
||||
<kbd>--cachedir</kbd></td>
|
||||
<td>DNF cache directory. Default is a temporary dir.</td></tr>
|
||||
<tr><td class="option-group">
|
||||
<kbd>--workdir</kbd></td>
|
||||
<td>Work directory, overrides –tmp. Default is a temporary dir under /var/tmp</td></tr>
|
||||
<tr><td class="option-group">
|
||||
<kbd>--force</kbd></td>
|
||||
<td><p class="first">Run even when the destination directory exists</p>
|
||||
<p class="last">Default: False</p>
|
||||
</td></tr>
|
||||
<tr><td class="option-group">
|
||||
<kbd>--add-template</kbd></td>
|
||||
<td><p class="first">Additional template for runtime image</p>
|
||||
<p class="last">Default: []</p>
|
||||
</td></tr>
|
||||
<tr><td class="option-group" colspan="2">
|
||||
<kbd>--add-template-var</kbd></td>
|
||||
</tr>
|
||||
<tr><td> </td><td><p class="first">Set variable for runtime image template</p>
|
||||
<p class="last">Default: []</p>
|
||||
</td></tr>
|
||||
<tr><td class="option-group" colspan="2">
|
||||
<kbd>--add-arch-template</kbd></td>
|
||||
</tr>
|
||||
<tr><td> </td><td><p class="first">Additional template for architecture-specific image</p>
|
||||
<p class="last">Default: []</p>
|
||||
</td></tr>
|
||||
<tr><td class="option-group" colspan="2">
|
||||
<kbd>--add-arch-template-var</kbd></td>
|
||||
</tr>
|
||||
<tr><td> </td><td><p class="first">Set variable for architecture-specific image</p>
|
||||
<p class="last">Default: []</p>
|
||||
</td></tr>
|
||||
<tr><td class="option-group">
|
||||
<kbd>--noverify</kbd></td>
|
||||
<td><p class="first">Do not verify the install root</p>
|
||||
<p class="last">Default: True</p>
|
||||
</td></tr>
|
||||
<tr><td class="option-group">
|
||||
<kbd>--sharedir</kbd></td>
|
||||
<td>Directory containing all the templates. Overrides config file sharedir</td></tr>
|
||||
<tr><td class="option-group">
|
||||
<kbd>--enablerepo</kbd></td>
|
||||
<td><p class="first">Names of repos to enable</p>
|
||||
<p class="last">Default: []</p>
|
||||
</td></tr>
|
||||
<tr><td class="option-group">
|
||||
<kbd>--disablerepo</kbd></td>
|
||||
<td><p class="first">Names of repos to disable</p>
|
||||
<p class="last">Default: []</p>
|
||||
</td></tr>
|
||||
<tr><td class="option-group">
|
||||
<kbd>--rootfs-size</kbd></td>
|
||||
<td><p class="first">Size of root filesystem in GiB. Defaults to 2.</p>
|
||||
<p class="last">Default: 2</p>
|
||||
</td></tr>
|
||||
<tr><td class="option-group">
|
||||
<kbd>--noverifyssl</kbd></td>
|
||||
<td><p class="first">Do not verify SSL certificates</p>
|
||||
<p class="last">Default: False</p>
|
||||
</td></tr>
|
||||
<tr><td class="option-group">
|
||||
<kbd>--dnfplugin</kbd></td>
|
||||
<td><p class="first">Enable a DNF plugin by name/glob, or * to enable all of them.</p>
|
||||
<p class="last">Default: []</p>
|
||||
</td></tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="section" id="dracut arguments">
|
||||
<h3>dracut arguments<a class="headerlink" href="#dracut arguments" title="Permalink to this headline">¶</a></h3>
|
||||
<table class="docutils option-list" frame="void" rules="none">
|
||||
<col class="option" />
|
||||
<col class="description" />
|
||||
<tbody valign="top">
|
||||
<tr><td class="option-group">
|
||||
<kbd>--dracut-arg</kbd></td>
|
||||
<td>Argument to pass to dracut when rebuilding the initramfs. Pass this once for each argument. NOTE: this overrides the default. (default: )</td></tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<div class="section" id="quickstart">
|
||||
<h2>Quickstart<a class="headerlink" href="#quickstart" title="Permalink to this headline">¶</a></h2>
|
||||
@ -224,7 +454,7 @@ files. The iso is then built using a generic initramfs and the kernel from the
|
||||
selected repositories.</p>
|
||||
<p>To drive these processes Lorax uses a custom template system, based on <a class="reference external" href="http://www.makotemplates.org/">Mako
|
||||
templates</a> with the addition of custom
|
||||
commands (documented in <code class="xref py py-class docutils literal notranslate"><span class="pre">pylorax.ltmpl.LoraxTemplateRunner</span></code>). Mako
|
||||
commands (documented in <a class="reference internal" href="pylorax.html#pylorax.ltmpl.LoraxTemplateRunner" title="pylorax.ltmpl.LoraxTemplateRunner"><code class="xref py py-class docutils literal notranslate"><span class="pre">pylorax.ltmpl.LoraxTemplateRunner</span></code></a>). Mako
|
||||
supports <code class="docutils literal notranslate"><span class="pre">%if/%endif</span></code> blocks as well as free-form python code inside <code class="docutils literal notranslate"><span class="pre"><%</span>
|
||||
<span class="pre">%></span></code> tags and variable substitution with <code class="docutils literal notranslate"><span class="pre">${}</span></code>. The default templates are
|
||||
shipped with lorax in <code class="docutils literal notranslate"><span class="pre">/usr/share/lorax/templates.d/99-generic/</span></code> and use the
|
||||
@ -245,16 +475,16 @@ start the anaconda.target instead of a default system target, and a number of
|
||||
unneeded services are disabled, some of which can interfere with the
|
||||
installation. A number of template commands are used here:</p>
|
||||
<ul class="simple">
|
||||
<li><code class="xref py py-func docutils literal notranslate"><span class="pre">append</span></code> to add text to a file.</li>
|
||||
<li><code class="xref py py-func docutils literal notranslate"><span class="pre">chmod</span></code> changes the file’s mode.</li>
|
||||
<li><code class="xref py py-func docutils literal notranslate"><span class="pre">install</span></code> to install a file into the installroot.</li>
|
||||
<li><code class="xref py py-func docutils literal notranslate"><span class="pre">mkdir</span></code> makes a new directory.</li>
|
||||
<li><code class="xref py py-func docutils literal notranslate"><span class="pre">move</span></code> to move a file into the installroot</li>
|
||||
<li><code class="xref py py-func docutils literal notranslate"><span class="pre">replace</span></code> does text substitution in a file</li>
|
||||
<li><code class="xref py py-func docutils literal notranslate"><span class="pre">remove</span></code> deletes a file</li>
|
||||
<li><code class="xref py py-func docutils literal notranslate"><span class="pre">runcmd</span></code> run arbitrary commands.</li>
|
||||
<li><code class="xref py py-func docutils literal notranslate"><span class="pre">symlink</span></code> creates a symlink</li>
|
||||
<li><code class="xref py py-func docutils literal notranslate"><span class="pre">systemctl</span></code> runs systemctl in the installroot</li>
|
||||
<li><a class="reference internal" href="pylorax.html#pylorax.ltmpl.LoraxTemplateRunner.append" title="pylorax.ltmpl.LoraxTemplateRunner.append"><code class="xref py py-func docutils literal notranslate"><span class="pre">append</span></code></a> to add text to a file.</li>
|
||||
<li><a class="reference internal" href="pylorax.html#pylorax.ltmpl.LoraxTemplateRunner.chmod" title="pylorax.ltmpl.LoraxTemplateRunner.chmod"><code class="xref py py-func docutils literal notranslate"><span class="pre">chmod</span></code></a> changes the file’s mode.</li>
|
||||
<li><a class="reference internal" href="pylorax.html#pylorax.ltmpl.LoraxTemplateRunner.install" title="pylorax.ltmpl.LoraxTemplateRunner.install"><code class="xref py py-func docutils literal notranslate"><span class="pre">install</span></code></a> to install a file into the installroot.</li>
|
||||
<li><a class="reference internal" href="pylorax.html#pylorax.ltmpl.LoraxTemplateRunner.mkdir" title="pylorax.ltmpl.LoraxTemplateRunner.mkdir"><code class="xref py py-func docutils literal notranslate"><span class="pre">mkdir</span></code></a> makes a new directory.</li>
|
||||
<li><a class="reference internal" href="pylorax.html#pylorax.ltmpl.LoraxTemplateRunner.move" title="pylorax.ltmpl.LoraxTemplateRunner.move"><code class="xref py py-func docutils literal notranslate"><span class="pre">move</span></code></a> to move a file into the installroot</li>
|
||||
<li><a class="reference internal" href="pylorax.html#pylorax.ltmpl.LoraxTemplateRunner.replace" title="pylorax.ltmpl.LoraxTemplateRunner.replace"><code class="xref py py-func docutils literal notranslate"><span class="pre">replace</span></code></a> does text substitution in a file</li>
|
||||
<li><a class="reference internal" href="pylorax.html#pylorax.ltmpl.LoraxTemplateRunner.remove" title="pylorax.ltmpl.LoraxTemplateRunner.remove"><code class="xref py py-func docutils literal notranslate"><span class="pre">remove</span></code></a> deletes a file</li>
|
||||
<li><a class="reference internal" href="pylorax.html#pylorax.ltmpl.LoraxTemplateRunner.runcmd" title="pylorax.ltmpl.LoraxTemplateRunner.runcmd"><code class="xref py py-func docutils literal notranslate"><span class="pre">runcmd</span></code></a> run arbitrary commands.</li>
|
||||
<li><a class="reference internal" href="pylorax.html#pylorax.ltmpl.LoraxTemplateRunner.symlink" title="pylorax.ltmpl.LoraxTemplateRunner.symlink"><code class="xref py py-func docutils literal notranslate"><span class="pre">symlink</span></code></a> creates a symlink</li>
|
||||
<li><a class="reference internal" href="pylorax.html#pylorax.ltmpl.LoraxTemplateRunner.systemctl" title="pylorax.ltmpl.LoraxTemplateRunner.systemctl"><code class="xref py py-func docutils literal notranslate"><span class="pre">systemctl</span></code></a> runs systemctl in the installroot</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="section" id="runtime-cleanup-tmpl">
|
||||
@ -262,13 +492,13 @@ installation. A number of template commands are used here:</p>
|
||||
<p>The <code class="docutils literal notranslate"><span class="pre">runtime-cleanup.tmpl</span></code> template is used to remove files that aren’t strictly needed
|
||||
by the installation environment. In addition to the <code class="docutils literal notranslate"><span class="pre">remove</span></code> template command it uses:</p>
|
||||
<ul class="simple">
|
||||
<li><code class="xref py py-func docutils literal notranslate"><span class="pre">removepkg</span></code>
|
||||
<li><a class="reference internal" href="pylorax.html#pylorax.ltmpl.LoraxTemplateRunner.removepkg" title="pylorax.ltmpl.LoraxTemplateRunner.removepkg"><code class="xref py py-func docutils literal notranslate"><span class="pre">removepkg</span></code></a>
|
||||
remove all of a specific package’s contents. A package may be pulled in as a dependency, but
|
||||
not really used. eg. sound support.</li>
|
||||
<li><code class="xref py py-func docutils literal notranslate"><span class="pre">removefrom</span></code>
|
||||
<li><a class="reference internal" href="pylorax.html#pylorax.ltmpl.LoraxTemplateRunner.removefrom" title="pylorax.ltmpl.LoraxTemplateRunner.removefrom"><code class="xref py py-func docutils literal notranslate"><span class="pre">removefrom</span></code></a>
|
||||
Removes some files from a package. A file glob can be used, or the –allbut option to
|
||||
remove everything except a select few.</li>
|
||||
<li><code class="xref py py-func docutils literal notranslate"><span class="pre">removekmod</span></code>
|
||||
<li><a class="reference internal" href="pylorax.html#pylorax.ltmpl.LoraxTemplateRunner.removekmod" title="pylorax.ltmpl.LoraxTemplateRunner.removekmod"><code class="xref py py-func docutils literal notranslate"><span class="pre">removekmod</span></code></a>
|
||||
Removes kernel modules</li>
|
||||
</ul>
|
||||
</div>
|
||||
@ -286,7 +516,7 @@ on the architecture that the iso is being created for. They are also stored in
|
||||
<code class="docutils literal notranslate"><span class="pre">/usr/share/lorax/templates.d/99-generic</span></code> and are named after the arch, like
|
||||
<code class="docutils literal notranslate"><span class="pre">x86.tmpl</span></code> and <code class="docutils literal notranslate"><span class="pre">aarch64.tmpl</span></code>. They handle creation of the tree, copying
|
||||
configuration template files, configuration variable substitution, treeinfo
|
||||
metadata (via the <code class="xref py py-func docutils literal notranslate"><span class="pre">treeinfo</span></code>
|
||||
metadata (via the <a class="reference internal" href="pylorax.html#pylorax.ltmpl.LoraxTemplateRunner.treeinfo" title="pylorax.ltmpl.LoraxTemplateRunner.treeinfo"><code class="xref py py-func docutils literal notranslate"><span class="pre">treeinfo</span></code></a>
|
||||
template command). Kernel and initrd are copied from the installroot to their
|
||||
final locations and then mkisofs is run to create the boot.iso</p>
|
||||
</div>
|
||||
@ -344,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.10',
|
||||
VERSION:'29.11',
|
||||
LANGUAGE:'None',
|
||||
COLLAPSE_INDEX:false,
|
||||
FILE_SUFFIX:'.html',
|
||||
@ -358,7 +588,10 @@ should) select the specific template directory by passing <code class="docutils
|
||||
|
||||
|
||||
|
||||
<script type="text/javascript" src="_static/js/theme.js"></script>
|
||||
|
||||
|
||||
<script type="text/javascript" src="_static/js/theme.js"></script>
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
jQuery(function () {
|
||||
|
@ -8,7 +8,7 @@
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<title>src — Lorax 29.10 documentation</title>
|
||||
<title>src — Lorax 29.11 documentation</title>
|
||||
|
||||
|
||||
|
||||
@ -24,7 +24,8 @@
|
||||
|
||||
|
||||
|
||||
<link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
|
||||
|
||||
<link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
|
||||
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
|
||||
<link rel="index" title="Index" href="genindex.html" />
|
||||
<link rel="search" title="Search" href="search.html" />
|
||||
@ -58,7 +59,7 @@
|
||||
|
||||
|
||||
<div class="version">
|
||||
29.10
|
||||
29.11
|
||||
</div>
|
||||
|
||||
|
||||
@ -174,6 +175,7 @@
|
||||
<li class="toctree-l4"><a class="reference internal" href="composer.cli.html#module-composer.cli.modules">composer.cli.modules module</a></li>
|
||||
<li class="toctree-l4"><a class="reference internal" href="composer.cli.html#module-composer.cli.projects">composer.cli.projects module</a></li>
|
||||
<li class="toctree-l4"><a class="reference internal" href="composer.cli.html#module-composer.cli.sources">composer.cli.sources module</a></li>
|
||||
<li class="toctree-l4"><a class="reference internal" href="composer.cli.html#module-composer.cli.status">composer.cli.status module</a></li>
|
||||
<li class="toctree-l4"><a class="reference internal" href="composer.cli.html#module-composer.cli.utilities">composer.cli.utilities module</a></li>
|
||||
<li class="toctree-l4"><a class="reference internal" href="composer.cli.html#module-composer.cli">Module contents</a></li>
|
||||
</ul>
|
||||
@ -190,15 +192,19 @@
|
||||
<li class="toctree-l2"><a class="reference internal" href="pylorax.html#subpackages">Subpackages</a><ul>
|
||||
<li class="toctree-l3"><a class="reference internal" href="pylorax.api.html">pylorax.api package</a><ul>
|
||||
<li class="toctree-l4"><a class="reference internal" href="pylorax.api.html#submodules">Submodules</a></li>
|
||||
<li class="toctree-l4"><a class="reference internal" href="pylorax.api.html#module-pylorax.api.checkparams">pylorax.api.checkparams module</a></li>
|
||||
<li class="toctree-l4"><a class="reference internal" href="pylorax.api.html#module-pylorax.api.cmdline">pylorax.api.cmdline module</a></li>
|
||||
<li class="toctree-l4"><a class="reference internal" href="pylorax.api.html#module-pylorax.api.compose">pylorax.api.compose module</a></li>
|
||||
<li class="toctree-l4"><a class="reference internal" href="pylorax.api.html#module-pylorax.api.config">pylorax.api.config module</a></li>
|
||||
<li class="toctree-l4"><a class="reference internal" href="pylorax.api.html#module-pylorax.api.crossdomain">pylorax.api.crossdomain module</a></li>
|
||||
<li class="toctree-l4"><a class="reference internal" href="pylorax.api.html#pylorax-api-dnfbase-module">pylorax.api.dnfbase module</a></li>
|
||||
<li class="toctree-l4"><a class="reference internal" href="pylorax.api.html#module-pylorax.api.dnfbase">pylorax.api.dnfbase module</a></li>
|
||||
<li class="toctree-l4"><a class="reference internal" href="pylorax.api.html#module-pylorax.api.errors">pylorax.api.errors module</a></li>
|
||||
<li class="toctree-l4"><a class="reference internal" href="pylorax.api.html#module-pylorax.api.projects">pylorax.api.projects module</a></li>
|
||||
<li class="toctree-l4"><a class="reference internal" href="pylorax.api.html#module-pylorax.api.queue">pylorax.api.queue module</a></li>
|
||||
<li class="toctree-l4"><a class="reference internal" href="pylorax.api.html#module-pylorax.api.recipes">pylorax.api.recipes module</a></li>
|
||||
<li class="toctree-l4"><a class="reference internal" href="pylorax.api.html#module-pylorax.api.regexes">pylorax.api.regexes module</a></li>
|
||||
<li class="toctree-l4"><a class="reference internal" href="pylorax.api.html#module-pylorax.api.server">pylorax.api.server module</a></li>
|
||||
<li class="toctree-l4"><a class="reference internal" href="pylorax.api.html#module-pylorax.api.timestamp">pylorax.api.timestamp module</a></li>
|
||||
<li class="toctree-l4"><a class="reference internal" href="pylorax.api.html#module-pylorax.api.v0">pylorax.api.v0 module</a></li>
|
||||
<li class="toctree-l4"><a class="reference internal" href="pylorax.api.html#module-pylorax.api.workspace">pylorax.api.workspace module</a></li>
|
||||
<li class="toctree-l4"><a class="reference internal" href="pylorax.api.html#module-pylorax.api">Module contents</a></li>
|
||||
@ -273,7 +279,7 @@
|
||||
<script type="text/javascript">
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT:'./',
|
||||
VERSION:'29.10',
|
||||
VERSION:'29.11',
|
||||
LANGUAGE:'None',
|
||||
COLLAPSE_INDEX:false,
|
||||
FILE_SUFFIX:'.html',
|
||||
@ -287,7 +293,10 @@
|
||||
|
||||
|
||||
|
||||
<script type="text/javascript" src="_static/js/theme.js"></script>
|
||||
|
||||
|
||||
<script type="text/javascript" src="_static/js/theme.js"></script>
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
jQuery(function () {
|
||||
|
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.10 documentation</title>
|
||||
<title>Product and Updates Images — Lorax 29.11 documentation</title>
|
||||
|
||||
|
||||
|
||||
@ -24,7 +24,8 @@
|
||||
|
||||
|
||||
|
||||
<link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
|
||||
|
||||
<link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
|
||||
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
|
||||
<link rel="index" title="Index" href="genindex.html" />
|
||||
<link rel="search" title="Search" href="search.html" />
|
||||
@ -58,7 +59,7 @@
|
||||
|
||||
|
||||
<div class="version">
|
||||
29.10
|
||||
29.11
|
||||
</div>
|
||||
|
||||
|
||||
@ -176,7 +177,7 @@ you would put your custom class here:</p>
|
||||
<p><code class="docutils literal notranslate"><span class="pre">/usr/share/lorax/product/run/install/product/pyanaconda/installclasses/custom.py</span></code></p>
|
||||
<p>If the packages containing the product/updates files are not included as part
|
||||
of normal dependencies you can add specific packages with the <code class="docutils literal notranslate"><span class="pre">--installpkgs</span></code>
|
||||
command or the installpkgs paramater of <code class="xref py py-class docutils literal notranslate"><span class="pre">pylorax.treebuilder.RuntimeBuilder</span></code></p>
|
||||
command or the installpkgs paramater of <a class="reference internal" href="pylorax.html#pylorax.treebuilder.RuntimeBuilder" title="pylorax.treebuilder.RuntimeBuilder"><code class="xref py py-class docutils literal notranslate"><span class="pre">pylorax.treebuilder.RuntimeBuilder</span></code></a></p>
|
||||
</div>
|
||||
|
||||
|
||||
@ -221,7 +222,7 @@ command or the installpkgs paramater of <code class="xref py py-class docutils l
|
||||
<script type="text/javascript">
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT:'./',
|
||||
VERSION:'29.10',
|
||||
VERSION:'29.11',
|
||||
LANGUAGE:'None',
|
||||
COLLAPSE_INDEX:false,
|
||||
FILE_SUFFIX:'.html',
|
||||
@ -235,7 +236,10 @@ command or the installpkgs paramater of <code class="xref py py-class docutils l
|
||||
|
||||
|
||||
|
||||
<script type="text/javascript" src="_static/js/theme.js"></script>
|
||||
|
||||
|
||||
<script type="text/javascript" src="_static/js/theme.js"></script>
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
jQuery(function () {
|
||||
|
@ -8,7 +8,7 @@
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<title>Python Module Index — Lorax 29.10 documentation</title>
|
||||
<title>Python Module Index — Lorax 29.11 documentation</title>
|
||||
|
||||
|
||||
|
||||
@ -24,7 +24,8 @@
|
||||
|
||||
|
||||
|
||||
<link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
|
||||
|
||||
<link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
|
||||
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
|
||||
<link rel="index" title="Index" href="genindex.html" />
|
||||
<link rel="search" title="Search" href="search.html" />
|
||||
@ -59,7 +60,7 @@
|
||||
|
||||
|
||||
<div class="version">
|
||||
29.10
|
||||
29.11
|
||||
</div>
|
||||
|
||||
|
||||
@ -210,6 +211,11 @@
|
||||
<td>   
|
||||
<a href="composer.cli.html#module-composer.cli.sources"><code class="xref">composer.cli.sources</code></a></td><td>
|
||||
<em></em></td></tr>
|
||||
<tr class="cg-1">
|
||||
<td></td>
|
||||
<td>   
|
||||
<a href="composer.cli.html#module-composer.cli.status"><code class="xref">composer.cli.status</code></a></td><td>
|
||||
<em></em></td></tr>
|
||||
<tr class="cg-1">
|
||||
<td></td>
|
||||
<td>   
|
||||
@ -239,6 +245,11 @@
|
||||
<td>   
|
||||
<a href="pylorax.api.html#module-pylorax.api"><code class="xref">pylorax.api</code></a></td><td>
|
||||
<em></em></td></tr>
|
||||
<tr class="cg-2">
|
||||
<td></td>
|
||||
<td>   
|
||||
<a href="pylorax.api.html#module-pylorax.api.checkparams"><code class="xref">pylorax.api.checkparams</code></a></td><td>
|
||||
<em></em></td></tr>
|
||||
<tr class="cg-2">
|
||||
<td></td>
|
||||
<td>   
|
||||
@ -259,6 +270,16 @@
|
||||
<td>   
|
||||
<a href="pylorax.api.html#module-pylorax.api.crossdomain"><code class="xref">pylorax.api.crossdomain</code></a></td><td>
|
||||
<em></em></td></tr>
|
||||
<tr class="cg-2">
|
||||
<td></td>
|
||||
<td>   
|
||||
<a href="pylorax.api.html#module-pylorax.api.dnfbase"><code class="xref">pylorax.api.dnfbase</code></a></td><td>
|
||||
<em></em></td></tr>
|
||||
<tr class="cg-2">
|
||||
<td></td>
|
||||
<td>   
|
||||
<a href="pylorax.api.html#module-pylorax.api.errors"><code class="xref">pylorax.api.errors</code></a></td><td>
|
||||
<em></em></td></tr>
|
||||
<tr class="cg-2">
|
||||
<td></td>
|
||||
<td>   
|
||||
@ -274,11 +295,21 @@
|
||||
<td>   
|
||||
<a href="pylorax.api.html#module-pylorax.api.recipes"><code class="xref">pylorax.api.recipes</code></a></td><td>
|
||||
<em></em></td></tr>
|
||||
<tr class="cg-2">
|
||||
<td></td>
|
||||
<td>   
|
||||
<a href="pylorax.api.html#module-pylorax.api.regexes"><code class="xref">pylorax.api.regexes</code></a></td><td>
|
||||
<em></em></td></tr>
|
||||
<tr class="cg-2">
|
||||
<td></td>
|
||||
<td>   
|
||||
<a href="pylorax.api.html#module-pylorax.api.server"><code class="xref">pylorax.api.server</code></a></td><td>
|
||||
<em></em></td></tr>
|
||||
<tr class="cg-2">
|
||||
<td></td>
|
||||
<td>   
|
||||
<a href="pylorax.api.html#module-pylorax.api.timestamp"><code class="xref">pylorax.api.timestamp</code></a></td><td>
|
||||
<em></em></td></tr>
|
||||
<tr class="cg-2">
|
||||
<td></td>
|
||||
<td>   
|
||||
@ -409,7 +440,7 @@
|
||||
<script type="text/javascript">
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT:'./',
|
||||
VERSION:'29.10',
|
||||
VERSION:'29.11',
|
||||
LANGUAGE:'None',
|
||||
COLLAPSE_INDEX:false,
|
||||
FILE_SUFFIX:'.html',
|
||||
@ -423,7 +454,10 @@
|
||||
|
||||
|
||||
|
||||
<script type="text/javascript" src="_static/js/theme.js"></script>
|
||||
|
||||
|
||||
<script type="text/javascript" src="_static/js/theme.js"></script>
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
jQuery(function () {
|
||||
|
@ -8,7 +8,7 @@
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<title>pylorax.api package — Lorax 29.10 documentation</title>
|
||||
<title>pylorax.api package — Lorax 29.11 documentation</title>
|
||||
|
||||
|
||||
|
||||
@ -24,7 +24,8 @@
|
||||
|
||||
|
||||
|
||||
<link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
|
||||
|
||||
<link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
|
||||
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
|
||||
<link rel="index" title="Index" href="genindex.html" />
|
||||
<link rel="search" title="Search" href="search.html" />
|
||||
@ -57,7 +58,7 @@
|
||||
|
||||
|
||||
<div class="version">
|
||||
29.10
|
||||
29.11
|
||||
</div>
|
||||
|
||||
|
||||
@ -191,6 +192,14 @@
|
||||
<h1>pylorax.api package<a class="headerlink" href="#pylorax-api-package" title="Permalink to this headline">¶</a></h1>
|
||||
<div class="section" id="submodules">
|
||||
<h2>Submodules<a class="headerlink" href="#submodules" title="Permalink to this headline">¶</a></h2>
|
||||
</div>
|
||||
<div class="section" id="module-pylorax.api.checkparams">
|
||||
<span id="pylorax-api-checkparams-module"></span><h2>pylorax.api.checkparams module<a class="headerlink" href="#module-pylorax.api.checkparams" title="Permalink to this headline">¶</a></h2>
|
||||
<dl class="function">
|
||||
<dt id="pylorax.api.checkparams.checkparams">
|
||||
<code class="descclassname">pylorax.api.checkparams.</code><code class="descname">checkparams</code><span class="sig-paren">(</span><em>tuples</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/checkparams.html#checkparams"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.checkparams.checkparams" title="Permalink to this definition">¶</a></dt>
|
||||
<dd></dd></dl>
|
||||
|
||||
</div>
|
||||
<div class="section" id="module-pylorax.api.cmdline">
|
||||
<span id="pylorax-api-cmdline-module"></span><h2>pylorax.api.cmdline module<a class="headerlink" href="#module-pylorax.api.cmdline" title="Permalink to this headline">¶</a></h2>
|
||||
@ -461,8 +470,29 @@ with whatever options are relevant.</p>
|
||||
<dd></dd></dl>
|
||||
|
||||
</div>
|
||||
<div class="section" id="pylorax-api-dnfbase-module">
|
||||
<h2>pylorax.api.dnfbase module<a class="headerlink" href="#pylorax-api-dnfbase-module" title="Permalink to this headline">¶</a></h2>
|
||||
<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="function">
|
||||
<dt id="pylorax.api.dnfbase.get_base_object">
|
||||
<code class="descclassname">pylorax.api.dnfbase.</code><code class="descname">get_base_object</code><span class="sig-paren">(</span><em>conf</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/dnfbase.html#get_base_object"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.dnfbase.get_base_object" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Get the DNF object with settings from the config file</p>
|
||||
<table class="docutils field-list" frame="void" rules="none">
|
||||
<col class="field-name" />
|
||||
<col class="field-body" />
|
||||
<tbody valign="top">
|
||||
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>conf</strong> (<em>ComposerParser</em>) – configuration object</td>
|
||||
</tr>
|
||||
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">A DNF Base object</td>
|
||||
</tr>
|
||||
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body">dnf.Base</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</dd></dl>
|
||||
|
||||
</div>
|
||||
<div class="section" id="module-pylorax.api.errors">
|
||||
<span id="pylorax-api-errors-module"></span><h2>pylorax.api.errors module<a class="headerlink" href="#module-pylorax.api.errors" title="Permalink to this headline">¶</a></h2>
|
||||
</div>
|
||||
<div class="section" id="module-pylorax.api.projects">
|
||||
<span id="pylorax-api-projects-module"></span><h2>pylorax.api.projects module<a class="headerlink" href="#module-pylorax.api.projects" title="Permalink to this headline">¶</a></h2>
|
||||
@ -989,12 +1019,19 @@ Use queue_status() for those.</p>
|
||||
<ul class="simple">
|
||||
<li>id - The uuid of the comoposition</li>
|
||||
<li>queue_status - The final status of the composition (FINISHED or FAILED)</li>
|
||||
<li>timestamp - The time of the last status change</li>
|
||||
<li>compose_type - The type of output generated (tar, iso, etc.)</li>
|
||||
<li>blueprint - Blueprint name</li>
|
||||
<li>version - Blueprint version</li>
|
||||
<li>image_size - Size of the image, if finished. 0 otherwise.</li>
|
||||
</ul>
|
||||
<p>Various timestamps are also included in the dict. These are all Unix UTC timestamps.
|
||||
It is possible for these timestamps to not always exist, in which case they will be
|
||||
None in Python (or null in JSON). The following timestamps are included:</p>
|
||||
<ul class="simple">
|
||||
<li>job_created - When the user submitted the compose</li>
|
||||
<li>job_started - Anaconda started running</li>
|
||||
<li>job_finished - Job entered FINISHED or FAILED state</li>
|
||||
</ul>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="function">
|
||||
@ -1226,7 +1263,7 @@ and “run” has the uuids that are being built (currently limited to 1 at a ti
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">dictionary of information about the composition</p>
|
||||
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">dictionary of information about the composition or None</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first"><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#dict" title="(in Python v3.7)">dict</a></p>
|
||||
@ -2317,6 +2354,9 @@ If the commit has already been tagged it will return false.</p>
|
||||
</table>
|
||||
</dd></dl>
|
||||
|
||||
</div>
|
||||
<div class="section" id="module-pylorax.api.regexes">
|
||||
<span id="pylorax-api-regexes-module"></span><h2>pylorax.api.regexes module<a class="headerlink" href="#module-pylorax.api.regexes" title="Permalink to this headline">¶</a></h2>
|
||||
</div>
|
||||
<div class="section" id="module-pylorax.api.server">
|
||||
<span id="pylorax-api-server-module"></span><h2>pylorax.api.server module<a class="headerlink" href="#module-pylorax.api.server" title="Permalink to this headline">¶</a></h2>
|
||||
@ -2344,6 +2384,19 @@ If the commit has already been tagged it will return false.</p>
|
||||
|
||||
</dd></dl>
|
||||
|
||||
</div>
|
||||
<div class="section" id="module-pylorax.api.timestamp">
|
||||
<span id="pylorax-api-timestamp-module"></span><h2>pylorax.api.timestamp module<a class="headerlink" href="#module-pylorax.api.timestamp" title="Permalink to this headline">¶</a></h2>
|
||||
<dl class="function">
|
||||
<dt id="pylorax.api.timestamp.timestamp_dict">
|
||||
<code class="descclassname">pylorax.api.timestamp.</code><code class="descname">timestamp_dict</code><span class="sig-paren">(</span><em>destdir</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/timestamp.html#timestamp_dict"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.timestamp.timestamp_dict" title="Permalink to this definition">¶</a></dt>
|
||||
<dd></dd></dl>
|
||||
|
||||
<dl class="function">
|
||||
<dt id="pylorax.api.timestamp.write_timestamp">
|
||||
<code class="descclassname">pylorax.api.timestamp.</code><code class="descname">write_timestamp</code><span class="sig-paren">(</span><em>destdir</em>, <em>ty</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/timestamp.html#write_timestamp"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.timestamp.write_timestamp" title="Permalink to this definition">¶</a></dt>
|
||||
<dd></dd></dl>
|
||||
|
||||
</div>
|
||||
<div class="section" id="module-pylorax.api.v0">
|
||||
<span id="pylorax-api-v0-module"></span><h2>pylorax.api.v0 module<a class="headerlink" href="#module-pylorax.api.v0" title="Permalink to this headline">¶</a></h2>
|
||||
@ -3074,14 +3127,14 @@ and the build that is running.</p>
|
||||
<span class="s2">"id"</span><span class="p">:</span> <span class="s2">"45502a6d-06e8-48a5-a215-2b4174b3614b"</span><span class="p">,</span>
|
||||
<span class="s2">"blueprint"</span><span class="p">:</span> <span class="s2">"glusterfs"</span><span class="p">,</span>
|
||||
<span class="s2">"queue_status"</span><span class="p">:</span> <span class="s2">"WAITING"</span><span class="p">,</span>
|
||||
<span class="s2">"timestamp"</span><span class="p">:</span> <span class="mf">1517362647.4570868</span><span class="p">,</span>
|
||||
<span class="s2">"job_created"</span><span class="p">:</span> <span class="mf">1517362647.4570868</span><span class="p">,</span>
|
||||
<span class="s2">"version"</span><span class="p">:</span> <span class="s2">"0.0.6"</span>
|
||||
<span class="p">},</span>
|
||||
<span class="p">{</span>
|
||||
<span class="s2">"id"</span><span class="p">:</span> <span class="s2">"6d292bd0-bec7-4825-8d7d-41ef9c3e4b73"</span><span class="p">,</span>
|
||||
<span class="s2">"blueprint"</span><span class="p">:</span> <span class="s2">"kubernetes"</span><span class="p">,</span>
|
||||
<span class="s2">"queue_status"</span><span class="p">:</span> <span class="s2">"WAITING"</span><span class="p">,</span>
|
||||
<span class="s2">"timestamp"</span><span class="p">:</span> <span class="mf">1517362659.0034983</span><span class="p">,</span>
|
||||
<span class="s2">"job_created"</span><span class="p">:</span> <span class="mf">1517362659.0034983</span><span class="p">,</span>
|
||||
<span class="s2">"version"</span><span class="p">:</span> <span class="s2">"0.0.1"</span>
|
||||
<span class="p">}</span>
|
||||
<span class="p">],</span>
|
||||
@ -3090,7 +3143,8 @@ and the build that is running.</p>
|
||||
<span class="s2">"id"</span><span class="p">:</span> <span class="s2">"745712b2-96db-44c0-8014-fe925c35e795"</span><span class="p">,</span>
|
||||
<span class="s2">"blueprint"</span><span class="p">:</span> <span class="s2">"glusterfs"</span><span class="p">,</span>
|
||||
<span class="s2">"queue_status"</span><span class="p">:</span> <span class="s2">"RUNNING"</span><span class="p">,</span>
|
||||
<span class="s2">"timestamp"</span><span class="p">:</span> <span class="mf">1517362633.7965999</span><span class="p">,</span>
|
||||
<span class="s2">"job_created"</span><span class="p">:</span> <span class="mf">1517362633.7965999</span><span class="p">,</span>
|
||||
<span class="s2">"job_started"</span><span class="p">:</span> <span class="mf">1517362633.8001345</span><span class="p">,</span>
|
||||
<span class="s2">"version"</span><span class="p">:</span> <span class="s2">"0.0.6"</span>
|
||||
<span class="p">}</span>
|
||||
<span class="p">]</span>
|
||||
@ -3110,14 +3164,18 @@ and the build that is running.</p>
|
||||
<span class="s2">"id"</span><span class="p">:</span> <span class="s2">"70b84195-9817-4b8a-af92-45e380f39894"</span><span class="p">,</span>
|
||||
<span class="s2">"blueprint"</span><span class="p">:</span> <span class="s2">"glusterfs"</span><span class="p">,</span>
|
||||
<span class="s2">"queue_status"</span><span class="p">:</span> <span class="s2">"FINISHED"</span><span class="p">,</span>
|
||||
<span class="s2">"timestamp"</span><span class="p">:</span> <span class="mf">1517351003.8210032</span><span class="p">,</span>
|
||||
<span class="s2">"job_created"</span><span class="p">:</span> <span class="mf">1517351003.8210032</span><span class="p">,</span>
|
||||
<span class="s2">"job_started"</span><span class="p">:</span> <span class="mf">1517351003.8230415</span><span class="p">,</span>
|
||||
<span class="s2">"job_finished"</span><span class="p">:</span> <span class="mf">1517359234.1003145</span><span class="p">,</span>
|
||||
<span class="s2">"version"</span><span class="p">:</span> <span class="s2">"0.0.6"</span>
|
||||
<span class="p">},</span>
|
||||
<span class="p">{</span>
|
||||
<span class="s2">"id"</span><span class="p">:</span> <span class="s2">"e695affd-397f-4af9-9022-add2636e7459"</span><span class="p">,</span>
|
||||
<span class="s2">"blueprint"</span><span class="p">:</span> <span class="s2">"glusterfs"</span><span class="p">,</span>
|
||||
<span class="s2">"queue_status"</span><span class="p">:</span> <span class="s2">"FINISHED"</span><span class="p">,</span>
|
||||
<span class="s2">"timestamp"</span><span class="p">:</span> <span class="mf">1517362289.7193348</span><span class="p">,</span>
|
||||
<span class="s2">"job_created"</span><span class="p">:</span> <span class="mf">1517362289.7193348</span><span class="p">,</span>
|
||||
<span class="s2">"job_started"</span><span class="p">:</span> <span class="mf">1517362289.9751132</span><span class="p">,</span>
|
||||
<span class="s2">"job_finished"</span><span class="p">:</span> <span class="mf">1517363500.1234567</span><span class="p">,</span>
|
||||
<span class="s2">"version"</span><span class="p">:</span> <span class="s2">"0.0.6"</span>
|
||||
<span class="p">}</span>
|
||||
<span class="p">]</span>
|
||||
@ -3137,7 +3195,9 @@ and the build that is running.</p>
|
||||
<span class="s2">"id"</span><span class="p">:</span> <span class="s2">"8c8435ef-d6bd-4c68-9bf1-a2ef832e6b1a"</span><span class="p">,</span>
|
||||
<span class="s2">"blueprint"</span><span class="p">:</span> <span class="s2">"http-server"</span><span class="p">,</span>
|
||||
<span class="s2">"queue_status"</span><span class="p">:</span> <span class="s2">"FAILED"</span><span class="p">,</span>
|
||||
<span class="s2">"timestamp"</span><span class="p">:</span> <span class="mf">1517523249.9301329</span><span class="p">,</span>
|
||||
<span class="s2">"job_created"</span><span class="p">:</span> <span class="mf">1517523249.9301329</span><span class="p">,</span>
|
||||
<span class="s2">"job_started"</span><span class="p">:</span> <span class="mf">1517523249.9314211</span><span class="p">,</span>
|
||||
<span class="s2">"job_finished"</span><span class="p">:</span> <span class="mf">1517523255.5623411</span><span class="p">,</span>
|
||||
<span class="s2">"version"</span><span class="p">:</span> <span class="s2">"0.0.2"</span>
|
||||
<span class="p">}</span>
|
||||
<span class="p">]</span>
|
||||
@ -3157,14 +3217,18 @@ and the build that is running.</p>
|
||||
<span class="s2">"id"</span><span class="p">:</span> <span class="s2">"8c8435ef-d6bd-4c68-9bf1-a2ef832e6b1a"</span><span class="p">,</span>
|
||||
<span class="s2">"blueprint"</span><span class="p">:</span> <span class="s2">"http-server"</span><span class="p">,</span>
|
||||
<span class="s2">"queue_status"</span><span class="p">:</span> <span class="s2">"FINISHED"</span><span class="p">,</span>
|
||||
<span class="s2">"timestamp"</span><span class="p">:</span> <span class="mf">1517523644.2384307</span><span class="p">,</span>
|
||||
<span class="s2">"job_created"</span><span class="p">:</span> <span class="mf">1517523644.2384307</span><span class="p">,</span>
|
||||
<span class="s2">"job_started"</span><span class="p">:</span> <span class="mf">1517523644.2551234</span><span class="p">,</span>
|
||||
<span class="s2">"job_finished"</span><span class="p">:</span> <span class="mf">1517523689.9864314</span><span class="p">,</span>
|
||||
<span class="s2">"version"</span><span class="p">:</span> <span class="s2">"0.0.2"</span>
|
||||
<span class="p">},</span>
|
||||
<span class="p">{</span>
|
||||
<span class="s2">"id"</span><span class="p">:</span> <span class="s2">"45502a6d-06e8-48a5-a215-2b4174b3614b"</span><span class="p">,</span>
|
||||
<span class="s2">"blueprint"</span><span class="p">:</span> <span class="s2">"glusterfs"</span><span class="p">,</span>
|
||||
<span class="s2">"queue_status"</span><span class="p">:</span> <span class="s2">"FINISHED"</span><span class="p">,</span>
|
||||
<span class="s2">"timestamp"</span><span class="p">:</span> <span class="mf">1517363442.188399</span><span class="p">,</span>
|
||||
<span class="s2">"job_created"</span><span class="p">:</span> <span class="mf">1517363442.188399</span><span class="p">,</span>
|
||||
<span class="s2">"job_started"</span><span class="p">:</span> <span class="mf">1517363442.325324</span><span class="p">,</span>
|
||||
<span class="s2">"job_finished"</span><span class="p">:</span> <span class="mf">1517363451.653621</span><span class="p">,</span>
|
||||
<span class="s2">"version"</span><span class="p">:</span> <span class="s2">"0.0.6"</span>
|
||||
<span class="p">}</span>
|
||||
<span class="p">]</span>
|
||||
@ -3317,6 +3381,11 @@ a line boundry.</p>
|
||||
</pre></div>
|
||||
</div>
|
||||
</div></blockquote>
|
||||
<dl class="function">
|
||||
<dt id="pylorax.api.v0.blueprint_exists">
|
||||
<code class="descclassname">pylorax.api.v0.</code><code class="descname">blueprint_exists</code><span class="sig-paren">(</span><em>api</em>, <em>branch</em>, <em>blueprint_name</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/v0.html#blueprint_exists"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.v0.blueprint_exists" title="Permalink to this definition">¶</a></dt>
|
||||
<dd></dd></dl>
|
||||
|
||||
<dl class="function">
|
||||
<dt id="pylorax.api.v0.take_limits">
|
||||
<code class="descclassname">pylorax.api.v0.</code><code class="descname">take_limits</code><span class="sig-paren">(</span><em>iterable</em>, <em>offset</em>, <em>limit</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/v0.html#take_limits"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.v0.take_limits" title="Permalink to this definition">¶</a></dt>
|
||||
@ -3502,7 +3571,7 @@ a line boundry.</p>
|
||||
<script type="text/javascript">
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT:'./',
|
||||
VERSION:'29.10',
|
||||
VERSION:'29.11',
|
||||
LANGUAGE:'None',
|
||||
COLLAPSE_INDEX:false,
|
||||
FILE_SUFFIX:'.html',
|
||||
@ -3516,7 +3585,10 @@ a line boundry.</p>
|
||||
|
||||
|
||||
|
||||
<script type="text/javascript" src="_static/js/theme.js"></script>
|
||||
|
||||
|
||||
<script type="text/javascript" src="_static/js/theme.js"></script>
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
jQuery(function () {
|
||||
|
@ -8,7 +8,7 @@
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<title>pylorax package — Lorax 29.10 documentation</title>
|
||||
<title>pylorax package — Lorax 29.11 documentation</title>
|
||||
|
||||
|
||||
|
||||
@ -24,7 +24,8 @@
|
||||
|
||||
|
||||
|
||||
<link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
|
||||
|
||||
<link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
|
||||
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
|
||||
<link rel="index" title="Index" href="genindex.html" />
|
||||
<link rel="search" title="Search" href="search.html" />
|
||||
@ -58,7 +59,7 @@
|
||||
|
||||
|
||||
<div class="version">
|
||||
29.10
|
||||
29.11
|
||||
</div>
|
||||
|
||||
|
||||
@ -194,6 +195,7 @@
|
||||
<ul>
|
||||
<li class="toctree-l1"><a class="reference internal" href="pylorax.api.html">pylorax.api package</a><ul>
|
||||
<li class="toctree-l2"><a class="reference internal" href="pylorax.api.html#submodules">Submodules</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="pylorax.api.html#module-pylorax.api.checkparams">pylorax.api.checkparams module</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="pylorax.api.html#module-pylorax.api.cmdline">pylorax.api.cmdline module</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="pylorax.api.html#module-pylorax.api.compose">pylorax.api.compose module</a><ul>
|
||||
<li class="toctree-l3"><a class="reference internal" href="pylorax.api.html#adding-new-output-types">Adding New Output Types</a></li>
|
||||
@ -201,11 +203,14 @@
|
||||
</li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="pylorax.api.html#module-pylorax.api.config">pylorax.api.config module</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="pylorax.api.html#module-pylorax.api.crossdomain">pylorax.api.crossdomain module</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="pylorax.api.html#pylorax-api-dnfbase-module">pylorax.api.dnfbase module</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="pylorax.api.html#module-pylorax.api.dnfbase">pylorax.api.dnfbase module</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="pylorax.api.html#module-pylorax.api.errors">pylorax.api.errors module</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="pylorax.api.html#module-pylorax.api.projects">pylorax.api.projects module</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="pylorax.api.html#module-pylorax.api.queue">pylorax.api.queue module</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="pylorax.api.html#module-pylorax.api.recipes">pylorax.api.recipes module</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="pylorax.api.html#module-pylorax.api.regexes">pylorax.api.regexes module</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="pylorax.api.html#module-pylorax.api.server">pylorax.api.server module</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="pylorax.api.html#module-pylorax.api.timestamp">pylorax.api.timestamp module</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="pylorax.api.html#module-pylorax.api.v0">pylorax.api.v0 module</a><ul>
|
||||
<li class="toctree-l3"><a class="reference internal" href="pylorax.api.html#status-responses">Status Responses</a></li>
|
||||
<li class="toctree-l3"><a class="reference internal" href="pylorax.api.html#api-routes">API Routes</a><ul>
|
||||
@ -2273,7 +2278,7 @@ lowest numbered directory entry is returned.</p>
|
||||
<script type="text/javascript">
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT:'./',
|
||||
VERSION:'29.10',
|
||||
VERSION:'29.11',
|
||||
LANGUAGE:'None',
|
||||
COLLAPSE_INDEX:false,
|
||||
FILE_SUFFIX:'.html',
|
||||
@ -2287,7 +2292,10 @@ lowest numbered directory entry is returned.</p>
|
||||
|
||||
|
||||
|
||||
<script type="text/javascript" src="_static/js/theme.js"></script>
|
||||
|
||||
|
||||
<script type="text/javascript" src="_static/js/theme.js"></script>
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
jQuery(function () {
|
||||
|
@ -8,7 +8,7 @@
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<title>Search — Lorax 29.10 documentation</title>
|
||||
<title>Search — Lorax 29.11 documentation</title>
|
||||
|
||||
|
||||
|
||||
@ -24,7 +24,8 @@
|
||||
|
||||
|
||||
|
||||
<link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
|
||||
|
||||
<link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
|
||||
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
|
||||
<link rel="index" title="Index" href="genindex.html" />
|
||||
<link rel="search" title="Search" href="#" />
|
||||
@ -56,7 +57,7 @@
|
||||
|
||||
|
||||
<div class="version">
|
||||
29.10
|
||||
29.11
|
||||
</div>
|
||||
|
||||
|
||||
@ -197,7 +198,7 @@
|
||||
<script type="text/javascript">
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT:'./',
|
||||
VERSION:'29.10',
|
||||
VERSION:'29.11',
|
||||
LANGUAGE:'None',
|
||||
COLLAPSE_INDEX:false,
|
||||
FILE_SUFFIX:'.html',
|
||||
@ -212,7 +213,10 @@
|
||||
|
||||
|
||||
|
||||
<script type="text/javascript" src="_static/js/theme.js"></script>
|
||||
|
||||
|
||||
<script type="text/javascript" src="_static/js/theme.js"></script>
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
jQuery(function () {
|
||||
|
File diff suppressed because one or more lines are too long
@ -4,6 +4,14 @@ pylorax.api package
|
||||
Submodules
|
||||
----------
|
||||
|
||||
pylorax.api.checkparams module
|
||||
------------------------------
|
||||
|
||||
.. automodule:: pylorax.api.checkparams
|
||||
:members:
|
||||
:undoc-members:
|
||||
:show-inheritance:
|
||||
|
||||
pylorax.api.cmdline module
|
||||
--------------------------
|
||||
|
||||
@ -44,6 +52,14 @@ pylorax.api.dnfbase module
|
||||
:undoc-members:
|
||||
:show-inheritance:
|
||||
|
||||
pylorax.api.errors module
|
||||
-------------------------
|
||||
|
||||
.. automodule:: pylorax.api.errors
|
||||
:members:
|
||||
:undoc-members:
|
||||
:show-inheritance:
|
||||
|
||||
pylorax.api.projects module
|
||||
---------------------------
|
||||
|
||||
@ -68,6 +84,14 @@ pylorax.api.recipes module
|
||||
:undoc-members:
|
||||
:show-inheritance:
|
||||
|
||||
pylorax.api.regexes module
|
||||
--------------------------
|
||||
|
||||
.. automodule:: pylorax.api.regexes
|
||||
:members:
|
||||
:undoc-members:
|
||||
:show-inheritance:
|
||||
|
||||
pylorax.api.server module
|
||||
-------------------------
|
||||
|
||||
@ -76,6 +100,14 @@ pylorax.api.server module
|
||||
:undoc-members:
|
||||
:show-inheritance:
|
||||
|
||||
pylorax.api.timestamp module
|
||||
----------------------------
|
||||
|
||||
.. automodule:: pylorax.api.timestamp
|
||||
:members:
|
||||
:undoc-members:
|
||||
:show-inheritance:
|
||||
|
||||
pylorax.api.v0 module
|
||||
---------------------
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user