Update lorax 19.7.21 (lorax-composer) Documentation
This commit is contained in:
parent
5a919ed4b1
commit
c101d2c69f
@ -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: 66d7c44afa220f9e7a6f61390f7186ec
|
||||
config: 06e0a93740d8be1d7bb18b9ff5eed1aa
|
||||
tags: fbb0d17656682115ca4d033fb2f83ba1
|
||||
|
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 @@
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
|
||||
<title>composer.cli — Lorax 19.7.18 documentation</title>
|
||||
<title>composer.cli — Lorax 19.7.21 documentation</title>
|
||||
|
||||
<link rel="stylesheet" href="../../_static/default.css" type="text/css" />
|
||||
<link rel="stylesheet" href="../../_static/pygments.css" type="text/css" />
|
||||
@ -16,7 +16,7 @@
|
||||
<script type="text/javascript">
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT: '../../',
|
||||
VERSION: '19.7.18',
|
||||
VERSION: '19.7.21',
|
||||
COLLAPSE_INDEX: false,
|
||||
FILE_SUFFIX: '.html',
|
||||
HAS_SOURCE: true
|
||||
@ -25,7 +25,7 @@
|
||||
<script type="text/javascript" src="../../_static/jquery.js"></script>
|
||||
<script type="text/javascript" src="../../_static/underscore.js"></script>
|
||||
<script type="text/javascript" src="../../_static/doctools.js"></script>
|
||||
<link rel="top" title="Lorax 19.7.18 documentation" href="../../index.html" />
|
||||
<link rel="top" title="Lorax 19.7.21 documentation" href="../../index.html" />
|
||||
<link rel="up" title="Module code" href="../index.html" />
|
||||
</head>
|
||||
<body>
|
||||
@ -38,7 +38,7 @@
|
||||
<li class="right" >
|
||||
<a href="../../py-modindex.html" title="Python Module Index"
|
||||
>modules</a> |</li>
|
||||
<li><a href="../../index.html">Lorax 19.7.18 documentation</a> »</li>
|
||||
<li><a href="../../index.html">Lorax 19.7.21 documentation</a> »</li>
|
||||
<li><a href="../index.html" accesskey="U">Module code</a> »</li>
|
||||
</ul>
|
||||
</div>
|
||||
@ -75,13 +75,15 @@
|
||||
<span class="kn">from</span> <span class="nn">composer.cli.projects</span> <span class="kn">import</span> <span class="n">projects_cmd</span>
|
||||
<span class="kn">from</span> <span class="nn">composer.cli.compose</span> <span class="kn">import</span> <span class="n">compose_cmd</span>
|
||||
<span class="kn">from</span> <span class="nn">composer.cli.sources</span> <span class="kn">import</span> <span class="n">sources_cmd</span>
|
||||
<span class="kn">from</span> <span class="nn">composer.cli.status</span> <span class="kn">import</span> <span class="n">status_cmd</span>
|
||||
|
||||
<span class="n">command_map</span> <span class="o">=</span> <span class="p">{</span>
|
||||
<span class="s">"blueprints"</span><span class="p">:</span> <span class="n">blueprints_cmd</span><span class="p">,</span>
|
||||
<span class="s">"modules"</span><span class="p">:</span> <span class="n">modules_cmd</span><span class="p">,</span>
|
||||
<span class="s">"projects"</span><span class="p">:</span> <span class="n">projects_cmd</span><span class="p">,</span>
|
||||
<span class="s">"compose"</span><span class="p">:</span> <span class="n">compose_cmd</span><span class="p">,</span>
|
||||
<span class="s">"sources"</span><span class="p">:</span> <span class="n">sources_cmd</span>
|
||||
<span class="s">"sources"</span><span class="p">:</span> <span class="n">sources_cmd</span><span class="p">,</span>
|
||||
<span class="s">"status"</span><span class="p">:</span> <span class="n">status_cmd</span>
|
||||
<span class="p">}</span>
|
||||
|
||||
|
||||
@ -136,7 +138,7 @@
|
||||
<li class="right" >
|
||||
<a href="../../py-modindex.html" title="Python Module Index"
|
||||
>modules</a> |</li>
|
||||
<li><a href="../../index.html">Lorax 19.7.18 documentation</a> »</li>
|
||||
<li><a href="../../index.html">Lorax 19.7.21 documentation</a> »</li>
|
||||
<li><a href="../index.html" >Module code</a> »</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
@ -8,7 +8,7 @@
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
|
||||
<title>composer.cli.blueprints — Lorax 19.7.18 documentation</title>
|
||||
<title>composer.cli.blueprints — Lorax 19.7.21 documentation</title>
|
||||
|
||||
<link rel="stylesheet" href="../../../_static/default.css" type="text/css" />
|
||||
<link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" />
|
||||
@ -16,7 +16,7 @@
|
||||
<script type="text/javascript">
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT: '../../../',
|
||||
VERSION: '19.7.18',
|
||||
VERSION: '19.7.21',
|
||||
COLLAPSE_INDEX: false,
|
||||
FILE_SUFFIX: '.html',
|
||||
HAS_SOURCE: true
|
||||
@ -25,7 +25,7 @@
|
||||
<script type="text/javascript" src="../../../_static/jquery.js"></script>
|
||||
<script type="text/javascript" src="../../../_static/underscore.js"></script>
|
||||
<script type="text/javascript" src="../../../_static/doctools.js"></script>
|
||||
<link rel="top" title="Lorax 19.7.18 documentation" href="../../../index.html" />
|
||||
<link rel="top" title="Lorax 19.7.21 documentation" href="../../../index.html" />
|
||||
<link rel="up" title="composer.cli" href="../cli.html" />
|
||||
</head>
|
||||
<body>
|
||||
@ -38,7 +38,7 @@
|
||||
<li class="right" >
|
||||
<a href="../../../py-modindex.html" title="Python Module Index"
|
||||
>modules</a> |</li>
|
||||
<li><a href="../../../index.html">Lorax 19.7.18 documentation</a> »</li>
|
||||
<li><a href="../../../index.html">Lorax 19.7.21 documentation</a> »</li>
|
||||
<li><a href="../../index.html" >Module code</a> »</li>
|
||||
<li><a href="../cli.html" accesskey="U">composer.cli</a> »</li>
|
||||
</ul>
|
||||
@ -70,7 +70,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="s">"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="kn">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="kn">import</span> <span class="n">blueprints_help</span>
|
||||
@ -125,14 +124,15 @@
|
||||
<span class="sd"> blueprints list</span>
|
||||
<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="s">"/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="k">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">result</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">get_url_json_unlimited</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">print</span><span class="p">(</span><span class="s">"blueprints: "</span> <span class="o">+</span> <span class="s">", "</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="s">"blueprints"</span><span class="p">]]))</span>
|
||||
<span class="c"># "list" should output a plain list of identifiers, one per line.</span>
|
||||
<span class="k">print</span><span class="p">(</span><span class="s">"</span><span class="se">\n</span><span class="s">"</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="s">"blueprints"</span><span class="p">]))</span>
|
||||
|
||||
<span class="k">return</span> <span class="mi">0</span>
|
||||
<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="bp">False</span><span class="p">):</span>
|
||||
<span class="sd">"""Show the blueprints, in TOML format</span>
|
||||
@ -171,17 +171,17 @@
|
||||
<span class="sd"> blueprints changes <blueprint,...> Display the changes for each blueprint.</span>
|
||||
<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="s">"/blueprints/changes/</span><span class="si">%s</span><span class="s">"</span> <span class="o">%</span> <span class="p">(</span><span class="s">","</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="k">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">result</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">get_url_json_unlimited</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">for</span> <span class="n">blueprint</span> <span class="ow">in</span> <span class="n">result</span><span class="p">[</span><span class="s">"blueprints"</span><span class="p">]:</span>
|
||||
<span class="k">print</span><span class="p">(</span><span class="n">blueprint</span><span class="p">[</span><span class="s">"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="s">"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>
|
||||
<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>
|
||||
@ -197,8 +197,8 @@
|
||||
<span class="k">else</span><span class="p">:</span>
|
||||
<span class="k">return</span> <span class="s">""</span>
|
||||
|
||||
<span class="k">print</span> <span class="s">" "</span> <span class="o">*</span> <span class="n">indent</span> <span class="o">+</span> <span class="n">change</span><span class="p">[</span><span class="s">"timestamp"</span><span class="p">]</span> <span class="o">+</span> <span class="s">" "</span> <span class="o">+</span> <span class="n">change</span><span class="p">[</span><span class="s">"commit"</span><span class="p">]</span> <span class="o">+</span> <span class="n">revision</span><span class="p">()</span>
|
||||
<span class="k">print</span> <span class="s">" "</span> <span class="o">*</span> <span class="n">indent</span> <span class="o">+</span> <span class="n">change</span><span class="p">[</span><span class="s">"message"</span><span class="p">]</span> <span class="o">+</span> <span class="s">"</span><span class="se">\n</span><span class="s">"</span>
|
||||
<span class="k">print</span><span class="p">(</span><span class="s">" "</span> <span class="o">*</span> <span class="n">indent</span> <span class="o">+</span> <span class="n">change</span><span class="p">[</span><span class="s">"timestamp"</span><span class="p">]</span> <span class="o">+</span> <span class="s">" "</span> <span class="o">+</span> <span class="n">change</span><span class="p">[</span><span class="s">"commit"</span><span class="p">]</span> <span class="o">+</span> <span class="n">revision</span><span class="p">())</span>
|
||||
<span class="k">print</span><span class="p">(</span><span class="s">" "</span> <span class="o">*</span> <span class="n">indent</span> <span class="o">+</span> <span class="n">change</span><span class="p">[</span><span class="s">"message"</span><span class="p">]</span> <span class="o">+</span> <span class="s">"</span><span class="se">\n</span><span class="s">"</span><span class="p">)</span>
|
||||
</div>
|
||||
<div class="viewcode-block" id="blueprints_diff"><a class="viewcode-back" href="../../../composer.cli.html#composer.cli.blueprints.blueprints_diff">[docs]</a><span class="k">def</span> <span class="nf">blueprints_diff</span><span class="p">(</span><span class="n">socket_path</span><span class="p">,</span> <span class="n">api_version</span><span class="p">,</span> <span class="n">args</span><span class="p">,</span> <span class="n">show_json</span><span class="o">=</span><span class="bp">False</span><span class="p">):</span>
|
||||
<span class="sd">"""Display the differences between 2 versions of a blueprint</span>
|
||||
@ -228,21 +228,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="s">"/blueprints/diff/</span><span class="si">%s</span><span class="s">/</span><span class="si">%s</span><span class="s">/</span><span class="si">%s</span><span class="s">"</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="k">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="s">"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="s">"errors"</span><span class="p">,</span> <span class="bp">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="s">"diff"</span><span class="p">]:</span>
|
||||
<span class="k">print</span><span class="p">(</span><span class="n">prettyDiffEntry</span><span class="p">(</span><span class="n">diff</span><span class="p">))</span>
|
||||
|
||||
<span class="k">return</span> <span class="mi">0</span>
|
||||
<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>
|
||||
@ -283,11 +276,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="s">"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="s">"Module"</span><span class="p">,</span> <span class="s">"Package"</span><span class="p">]:</span>
|
||||
<span class="k">return</span> <span class="s">"</span><span class="si">%s</span><span class="s"> </span><span class="si">%s</span><span class="s">"</span> <span class="o">%</span> <span class="p">(</span><span class="n">diff</span><span class="p">[</span><span class="s">"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="s">"name"</span><span class="p">],</span> <span class="n">diff</span><span class="p">[</span><span class="s">"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="s">"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="s">"Group"</span><span class="p">]:</span>
|
||||
<span class="k">return</span> <span class="n">diff</span><span class="p">[</span><span class="s">"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="s">"name"</span><span class="p">]</span>
|
||||
<span class="k">else</span><span class="p">:</span>
|
||||
<span class="k">return</span> <span class="s">" "</span><span class="o">.</span><span class="n">join</span><span class="p">([</span><span class="n">diff</span><span class="p">[</span><span class="s">"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="s">"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="s">"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="s">"Module"</span><span class="p">,</span> <span class="s">"Package"</span><span class="p">]:</span>
|
||||
<span class="k">return</span> <span class="s">"</span><span class="si">%s</span><span class="s"> </span><span class="si">%s</span><span class="s">"</span> <span class="o">%</span> <span class="p">(</span><span class="n">diff</span><span class="p">[</span><span class="s">"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="s">"name"</span><span class="p">],</span> <span class="n">diff</span><span class="p">[</span><span class="s">"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="s">"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="s">"Group"</span><span class="p">]:</span>
|
||||
<span class="k">return</span> <span class="n">diff</span><span class="p">[</span><span class="s">"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="s">"name"</span><span class="p">]</span>
|
||||
<span class="k">else</span><span class="p">:</span>
|
||||
<span class="k">return</span> <span class="s">" "</span><span class="o">.</span><span class="n">join</span><span class="p">([</span><span class="n">diff</span><span class="p">[</span><span class="s">"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="s">"old"</span><span class="p">]])</span>
|
||||
|
||||
@ -331,7 +328,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="s">"/blueprints/delete/</span><span class="si">%s</span><span class="s">"</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>
|
||||
<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="bp">False</span><span class="p">):</span>
|
||||
<span class="sd">"""Display the packages needed to install the blueprint</span>
|
||||
@ -349,10 +346,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="s">"/blueprints/depsolve/</span><span class="si">%s</span><span class="s">"</span> <span class="o">%</span> <span class="p">(</span><span class="s">","</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="k">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="s">"blueprints"</span><span class="p">]:</span>
|
||||
<span class="k">if</span> <span class="n">blueprint</span><span class="p">[</span><span class="s">"blueprint"</span><span class="p">]</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s">"version"</span><span class="p">,</span> <span class="s">""</span><span class="p">):</span>
|
||||
@ -362,7 +358,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="s">"dependencies"</span><span class="p">]:</span>
|
||||
<span class="k">print</span><span class="p">(</span><span class="s">" "</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>
|
||||
<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="bp">False</span><span class="p">):</span>
|
||||
<span class="sd">"""Push a blueprint TOML file to the server, updating the blueprint</span>
|
||||
@ -387,7 +383,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="s">"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>
|
||||
@ -419,32 +415,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="s">"/blueprints/freeze/</span><span class="si">%s</span><span class="s">"</span> <span class="o">%</span> <span class="p">(</span><span class="s">","</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="k">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="s">"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="s">"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="s">"version"</span><span class="p">,</span> <span class="s">""</span><span class="p">):</span>
|
||||
<span class="k">print</span><span class="p">(</span><span class="s">"blueprint: </span><span class="si">%s</span><span class="s"> v</span><span class="si">%s</span><span class="s">"</span> <span class="o">%</span> <span class="p">(</span><span class="n">blueprint</span><span class="p">[</span><span class="s">"name"</span><span class="p">],</span> <span class="n">blueprint</span><span class="p">[</span><span class="s">"version"</span><span class="p">]))</span>
|
||||
<span class="k">else</span><span class="p">:</span>
|
||||
<span class="k">print</span><span class="p">(</span><span class="s">"blueprint: </span><span class="si">%s</span><span class="s">"</span> <span class="o">%</span> <span class="p">(</span><span class="n">blueprint</span><span class="p">[</span><span class="s">"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="s">"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="s">"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="s">"version"</span><span class="p">,</span> <span class="s">""</span><span class="p">):</span>
|
||||
<span class="k">print</span><span class="p">(</span><span class="s">"blueprint: </span><span class="si">%s</span><span class="s"> v</span><span class="si">%s</span><span class="s">"</span> <span class="o">%</span> <span class="p">(</span><span class="n">blueprint</span><span class="p">[</span><span class="s">"name"</span><span class="p">],</span> <span class="n">blueprint</span><span class="p">[</span><span class="s">"version"</span><span class="p">]))</span>
|
||||
<span class="k">else</span><span class="p">:</span>
|
||||
<span class="k">print</span><span class="p">(</span><span class="s">"blueprint: </span><span class="si">%s</span><span class="s">"</span> <span class="o">%</span> <span class="p">(</span><span class="n">blueprint</span><span class="p">[</span><span class="s">"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="s">"modules"</span><span class="p">]:</span>
|
||||
<span class="k">print</span><span class="p">(</span><span class="s">" </span><span class="si">%s</span><span class="s">-</span><span class="si">%s</span><span class="s">"</span> <span class="o">%</span> <span class="p">(</span><span class="n">m</span><span class="p">[</span><span class="s">"name"</span><span class="p">],</span> <span class="n">m</span><span class="p">[</span><span class="s">"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="s">"modules"</span><span class="p">]:</span>
|
||||
<span class="k">print</span><span class="p">(</span><span class="s">" </span><span class="si">%s</span><span class="s">-</span><span class="si">%s</span><span class="s">"</span> <span class="o">%</span> <span class="p">(</span><span class="n">m</span><span class="p">[</span><span class="s">"name"</span><span class="p">],</span> <span class="n">m</span><span class="p">[</span><span class="s">"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="s">"packages"</span><span class="p">]:</span>
|
||||
<span class="k">print</span><span class="p">(</span><span class="s">" </span><span class="si">%s</span><span class="s">-</span><span class="si">%s</span><span class="s">"</span> <span class="o">%</span> <span class="p">(</span><span class="n">p</span><span class="p">[</span><span class="s">"name"</span><span class="p">],</span> <span class="n">p</span><span class="p">[</span><span class="s">"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="s">"packages"</span><span class="p">]:</span>
|
||||
<span class="k">print</span><span class="p">(</span><span class="s">" </span><span class="si">%s</span><span class="s">-</span><span class="si">%s</span><span class="s">"</span> <span class="o">%</span> <span class="p">(</span><span class="n">p</span><span class="p">[</span><span class="s">"name"</span><span class="p">],</span> <span class="n">p</span><span class="p">[</span><span class="s">"version"</span><span class="p">]))</span>
|
||||
|
||||
<span class="c"># 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="s">"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="c"># 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="s">"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>
|
||||
<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="bp">False</span><span class="p">):</span>
|
||||
<span class="sd">"""Show the frozen blueprint in TOML format</span>
|
||||
@ -512,7 +500,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="s">"/blueprints/tag/</span><span class="si">%s</span><span class="s">"</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="s">""</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>
|
||||
<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="bp">False</span><span class="p">):</span>
|
||||
<span class="sd">"""Undo changes to a blueprint</span>
|
||||
@ -538,7 +526,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="s">"/blueprints/undo/</span><span class="si">%s</span><span class="s">/</span><span class="si">%s</span><span class="s">"</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="s">""</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>
|
||||
<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="bp">False</span><span class="p">):</span>
|
||||
<span class="sd">"""Push the blueprint TOML to the temporary workspace storage</span>
|
||||
@ -563,14 +551,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="s">"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="k">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="s">"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="c"># 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="s">"status"</span><span class="p">,</span> <span class="bp">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>
|
||||
@ -607,7 +588,7 @@
|
||||
<li class="right" >
|
||||
<a href="../../../py-modindex.html" title="Python Module Index"
|
||||
>modules</a> |</li>
|
||||
<li><a href="../../../index.html">Lorax 19.7.18 documentation</a> »</li>
|
||||
<li><a href="../../../index.html">Lorax 19.7.21 documentation</a> »</li>
|
||||
<li><a href="../../index.html" >Module code</a> »</li>
|
||||
<li><a href="../cli.html" >composer.cli</a> »</li>
|
||||
</ul>
|
||||
|
@ -8,7 +8,7 @@
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
|
||||
<title>composer.cli.compose — Lorax 19.7.18 documentation</title>
|
||||
<title>composer.cli.compose — Lorax 19.7.21 documentation</title>
|
||||
|
||||
<link rel="stylesheet" href="../../../_static/default.css" type="text/css" />
|
||||
<link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" />
|
||||
@ -16,7 +16,7 @@
|
||||
<script type="text/javascript">
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT: '../../../',
|
||||
VERSION: '19.7.18',
|
||||
VERSION: '19.7.21',
|
||||
COLLAPSE_INDEX: false,
|
||||
FILE_SUFFIX: '.html',
|
||||
HAS_SOURCE: true
|
||||
@ -25,7 +25,7 @@
|
||||
<script type="text/javascript" src="../../../_static/jquery.js"></script>
|
||||
<script type="text/javascript" src="../../../_static/underscore.js"></script>
|
||||
<script type="text/javascript" src="../../../_static/doctools.js"></script>
|
||||
<link rel="top" title="Lorax 19.7.18 documentation" href="../../../index.html" />
|
||||
<link rel="top" title="Lorax 19.7.21 documentation" href="../../../index.html" />
|
||||
<link rel="up" title="composer.cli" href="../cli.html" />
|
||||
</head>
|
||||
<body>
|
||||
@ -38,7 +38,7 @@
|
||||
<li class="right" >
|
||||
<a href="../../../py-modindex.html" title="Python Module Index"
|
||||
>modules</a> |</li>
|
||||
<li><a href="../../../index.html">Lorax 19.7.18 documentation</a> »</li>
|
||||
<li><a href="../../../index.html">Lorax 19.7.21 documentation</a> »</li>
|
||||
<li><a href="../../index.html" >Module code</a> »</li>
|
||||
<li><a href="../cli.html" accesskey="U">composer.cli</a> »</li>
|
||||
</ul>
|
||||
@ -69,6 +69,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="s">"composer-cli"</span><span class="p">)</span>
|
||||
|
||||
<span class="kn">from</span> <span class="nn">datetime</span> <span class="kn">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>
|
||||
|
||||
@ -87,6 +88,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="s">"list"</span><span class="p">:</span> <span class="n">compose_list</span><span class="p">,</span>
|
||||
<span class="s">"status"</span><span class="p">:</span> <span class="n">compose_status</span><span class="p">,</span>
|
||||
<span class="s">"types"</span><span class="p">:</span> <span class="n">compose_types</span><span class="p">,</span>
|
||||
<span class="s">"start"</span><span class="p">:</span> <span class="n">compose_start</span><span class="p">,</span>
|
||||
@ -99,7 +101,7 @@
|
||||
<span class="s">"logs"</span><span class="p">:</span> <span class="n">compose_logs</span><span class="p">,</span>
|
||||
<span class="s">"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="s">"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="s">"--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="s">"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="s">"--help"</span><span class="p">:</span>
|
||||
<span class="k">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>
|
||||
@ -108,6 +110,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="bp">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="s">"running"</span><span class="p">,</span> <span class="s">"waiting"</span><span class="p">,</span> <span class="s">"finished"</span><span class="p">,</span> <span class="s">"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="c"># 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="s">"running"</span> <span class="ow">in</span> <span class="n">which</span> <span class="ow">or</span> <span class="s">"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="s">"/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="s">"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="s">"run"</span><span class="p">]</span>
|
||||
<span class="k">if</span> <span class="s">"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="s">"new"</span><span class="p">]</span>
|
||||
|
||||
<span class="k">if</span> <span class="s">"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="s">"/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="s">"finished"</span><span class="p">]</span>
|
||||
|
||||
<span class="k">if</span> <span class="s">"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="s">"/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="s">"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="k">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="s">"{id} {queue_status} {blueprint} {version} {compose_type}"</span>
|
||||
<span class="k">print</span><span class="p">(</span><span class="s">"</span><span class="se">\n</span><span class="s">"</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="bp">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>
|
||||
|
||||
@ -131,7 +177,10 @@
|
||||
<span class="s">"version"</span><span class="p">:</span> <span class="n">compose</span><span class="p">[</span><span class="s">"version"</span><span class="p">],</span>
|
||||
<span class="s">"compose_type"</span><span class="p">:</span> <span class="n">compose</span><span class="p">[</span><span class="s">"compose_type"</span><span class="p">],</span>
|
||||
<span class="s">"image_size"</span><span class="p">:</span> <span class="n">compose</span><span class="p">[</span><span class="s">"image_size"</span><span class="p">],</span>
|
||||
<span class="s">"status"</span><span class="p">:</span> <span class="n">compose</span><span class="p">[</span><span class="s">"queue_status"</span><span class="p">]}</span>
|
||||
<span class="s">"status"</span><span class="p">:</span> <span class="n">compose</span><span class="p">[</span><span class="s">"queue_status"</span><span class="p">],</span>
|
||||
<span class="s">"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="s">"job_created"</span><span class="p">),</span>
|
||||
<span class="s">"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="s">"job_started"</span><span class="p">),</span>
|
||||
<span class="s">"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="s">"job_finished"</span><span class="p">)}</span>
|
||||
|
||||
<span class="c"># 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>
|
||||
@ -169,8 +218,10 @@
|
||||
<span class="k">else</span><span class="p">:</span>
|
||||
<span class="n">image_size</span> <span class="o">=</span> <span class="s">""</span>
|
||||
|
||||
<span class="k">print</span><span class="p">(</span><span class="s">"</span><span class="si">%s</span><span class="s"> </span><span class="si">%-8s</span><span class="s"> </span><span class="si">%-15s</span><span class="s"> </span><span class="si">%s</span><span class="s"> </span><span class="si">%-16s</span><span class="s"> </span><span class="si">%s</span><span class="s">"</span> <span class="o">%</span> <span class="p">(</span><span class="n">c</span><span class="p">[</span><span class="s">"id"</span><span class="p">],</span> <span class="n">c</span><span class="p">[</span><span class="s">"status"</span><span class="p">],</span> <span class="n">c</span><span class="p">[</span><span class="s">"blueprint"</span><span class="p">],</span> <span class="n">c</span><span class="p">[</span><span class="s">"version"</span><span class="p">],</span> <span class="n">c</span><span class="p">[</span><span class="s">"compose_type"</span><span class="p">],</span>
|
||||
<span class="n">image_size</span><span class="p">))</span>
|
||||
<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="s">"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="s">"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="s">"created"</span><span class="p">))</span>
|
||||
|
||||
<span class="k">print</span><span class="p">(</span><span class="s">"</span><span class="si">%s</span><span class="s"> </span><span class="si">%-8s</span><span class="s"> </span><span class="si">%s</span><span class="s"> </span><span class="si">%-15s</span><span class="s"> </span><span class="si">%s</span><span class="s"> </span><span class="si">%-16s</span><span class="s"> </span><span class="si">%s</span><span class="s">"</span> <span class="o">%</span> <span class="p">(</span><span class="n">c</span><span class="p">[</span><span class="s">"id"</span><span class="p">],</span> <span class="n">c</span><span class="p">[</span><span class="s">"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="s">"</span><span class="si">%c</span><span class="s">"</span><span class="p">),</span> <span class="n">c</span><span class="p">[</span><span class="s">"blueprint"</span><span class="p">],</span>
|
||||
<span class="n">c</span><span class="p">[</span><span class="s">"version"</span><span class="p">],</span> <span class="n">c</span><span class="p">[</span><span class="s">"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="bp">False</span><span class="p">,</span> <span class="n">testmode</span><span class="o">=</span><span class="mi">0</span><span class="p">):</span>
|
||||
@ -196,7 +247,7 @@
|
||||
<span class="k">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">print</span><span class="p">(</span><span class="s">"Compose Types: "</span> <span class="o">+</span> <span class="s">", "</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="s">"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="s">"types"</span><span class="p">]]))</span>
|
||||
<span class="k">print</span><span class="p">(</span><span class="s">"</span><span class="se">\n</span><span class="s">"</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="s">"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="s">"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="bp">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>
|
||||
@ -232,19 +283,12 @@
|
||||
<span class="n">test_url</span> <span class="o">=</span> <span class="s">""</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="s">"/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="k">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="s">"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="s">"status"</span><span class="p">]</span> <span class="o">==</span> <span class="bp">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="s">"errors"</span><span class="p">,</span> <span class="bp">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">print</span><span class="p">(</span><span class="s">"Compose </span><span class="si">%s</span><span class="s"> added to the queue"</span> <span class="o">%</span> <span class="n">result</span><span class="p">[</span><span class="s">"build_id"</span><span class="p">])</span>
|
||||
<span class="k">return</span> <span class="mi">0</span>
|
||||
<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="bp">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>
|
||||
@ -311,7 +355,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="s">"/compose/cancel/</span><span class="si">%s</span><span class="s">"</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>
|
||||
<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="bp">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>
|
||||
@ -338,19 +382,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="s">"/compose/delete/</span><span class="si">%s</span><span class="s">"</span> <span class="o">%</span> <span class="p">(</span><span class="s">","</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="k">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="c"># 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="s">"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="s">"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>
|
||||
<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_details"><a class="viewcode-back" href="../../../composer.cli.html#composer.cli.compose.compose_details">[docs]</a><span class="k">def</span> <span class="nf">compose_details</span><span class="p">(</span><span class="n">socket_path</span><span class="p">,</span> <span class="n">api_version</span><span class="p">,</span> <span class="n">args</span><span class="p">,</span> <span class="n">show_json</span><span class="o">=</span><span class="bp">False</span><span class="p">,</span> <span class="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>
|
||||
@ -376,15 +408,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="s">"/compose/info/</span><span class="si">%s</span><span class="s">"</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="k">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="s">"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="s">"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="s">"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="s">"image_size"</span><span class="p">])</span>
|
||||
@ -409,6 +435,8 @@
|
||||
<span class="k">print</span><span class="p">(</span><span class="s">"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="s">"deps"</span><span class="p">][</span><span class="s">"packages"</span><span class="p">]:</span>
|
||||
<span class="k">print</span><span class="p">(</span><span class="s">" "</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="bp">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>
|
||||
@ -433,7 +461,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="s">"/compose/metadata/</span><span class="si">%s</span><span class="s">"</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="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="k">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="bp">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>
|
||||
@ -459,7 +493,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="s">"/compose/results/</span><span class="si">%s</span><span class="s">"</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>
|
||||
<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="k">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="bp">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>
|
||||
@ -484,7 +524,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="s">"/compose/logs/</span><span class="si">%s</span><span class="s">"</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>
|
||||
<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="k">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="bp">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>
|
||||
@ -510,7 +556,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="s">"/compose/image/</span><span class="si">%s</span><span class="s">"</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="k">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>
|
||||
@ -544,7 +596,7 @@
|
||||
<li class="right" >
|
||||
<a href="../../../py-modindex.html" title="Python Module Index"
|
||||
>modules</a> |</li>
|
||||
<li><a href="../../../index.html">Lorax 19.7.18 documentation</a> »</li>
|
||||
<li><a href="../../../index.html">Lorax 19.7.21 documentation</a> »</li>
|
||||
<li><a href="../../index.html" >Module code</a> »</li>
|
||||
<li><a href="../cli.html" >composer.cli</a> »</li>
|
||||
</ul>
|
||||
|
@ -8,7 +8,7 @@
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
|
||||
<title>composer.cli.modules — Lorax 19.7.18 documentation</title>
|
||||
<title>composer.cli.modules — Lorax 19.7.21 documentation</title>
|
||||
|
||||
<link rel="stylesheet" href="../../../_static/default.css" type="text/css" />
|
||||
<link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" />
|
||||
@ -16,7 +16,7 @@
|
||||
<script type="text/javascript">
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT: '../../../',
|
||||
VERSION: '19.7.18',
|
||||
VERSION: '19.7.21',
|
||||
COLLAPSE_INDEX: false,
|
||||
FILE_SUFFIX: '.html',
|
||||
HAS_SOURCE: true
|
||||
@ -25,7 +25,7 @@
|
||||
<script type="text/javascript" src="../../../_static/jquery.js"></script>
|
||||
<script type="text/javascript" src="../../../_static/underscore.js"></script>
|
||||
<script type="text/javascript" src="../../../_static/doctools.js"></script>
|
||||
<link rel="top" title="Lorax 19.7.18 documentation" href="../../../index.html" />
|
||||
<link rel="top" title="Lorax 19.7.21 documentation" href="../../../index.html" />
|
||||
<link rel="up" title="composer.cli" href="../cli.html" />
|
||||
</head>
|
||||
<body>
|
||||
@ -38,7 +38,7 @@
|
||||
<li class="right" >
|
||||
<a href="../../../py-modindex.html" title="Python Module Index"
|
||||
>modules</a> |</li>
|
||||
<li><a href="../../../index.html">Lorax 19.7.18 documentation</a> »</li>
|
||||
<li><a href="../../../index.html">Lorax 19.7.21 documentation</a> »</li>
|
||||
<li><a href="../../index.html" >Module code</a> »</li>
|
||||
<li><a href="../cli.html" accesskey="U">composer.cli</a> »</li>
|
||||
</ul>
|
||||
@ -69,10 +69,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="s">"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="kn">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="kn">import</span> <span class="n">modules_help</span>
|
||||
<span class="kn">from</span> <span class="nn">composer.cli.utilities</span> <span class="kn">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>
|
||||
@ -90,14 +89,15 @@
|
||||
<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">opts</span><span class="o">.</span><span class="n">api_version</span><span class="p">,</span> <span class="s">"/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="k">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">result</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">get_url_json_unlimited</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="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="k">print</span><span class="p">(</span><span class="s">"Modules:</span><span class="se">\n</span><span class="s">"</span> <span class="o">+</span> <span class="s">"</span><span class="se">\n</span><span class="s">"</span><span class="o">.</span><span class="n">join</span><span class="p">([</span><span class="s">" "</span><span class="o">+</span><span class="n">r</span><span class="p">[</span><span class="s">"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="s">"modules"</span><span class="p">]]))</span>
|
||||
<span class="c"># "list" should output a plain list of identifiers, one per line.</span>
|
||||
<span class="k">print</span><span class="p">(</span><span class="s">"</span><span class="se">\n</span><span class="s">"</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="s">"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="s">"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>
|
||||
@ -131,7 +131,7 @@
|
||||
<li class="right" >
|
||||
<a href="../../../py-modindex.html" title="Python Module Index"
|
||||
>modules</a> |</li>
|
||||
<li><a href="../../../index.html">Lorax 19.7.18 documentation</a> »</li>
|
||||
<li><a href="../../../index.html">Lorax 19.7.21 documentation</a> »</li>
|
||||
<li><a href="../../index.html" >Module code</a> »</li>
|
||||
<li><a href="../cli.html" >composer.cli</a> »</li>
|
||||
</ul>
|
||||
|
@ -8,7 +8,7 @@
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
|
||||
<title>composer.cli.projects — Lorax 19.7.18 documentation</title>
|
||||
<title>composer.cli.projects — Lorax 19.7.21 documentation</title>
|
||||
|
||||
<link rel="stylesheet" href="../../../_static/default.css" type="text/css" />
|
||||
<link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" />
|
||||
@ -16,7 +16,7 @@
|
||||
<script type="text/javascript">
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT: '../../../',
|
||||
VERSION: '19.7.18',
|
||||
VERSION: '19.7.21',
|
||||
COLLAPSE_INDEX: false,
|
||||
FILE_SUFFIX: '.html',
|
||||
HAS_SOURCE: true
|
||||
@ -25,7 +25,7 @@
|
||||
<script type="text/javascript" src="../../../_static/jquery.js"></script>
|
||||
<script type="text/javascript" src="../../../_static/underscore.js"></script>
|
||||
<script type="text/javascript" src="../../../_static/doctools.js"></script>
|
||||
<link rel="top" title="Lorax 19.7.18 documentation" href="../../../index.html" />
|
||||
<link rel="top" title="Lorax 19.7.21 documentation" href="../../../index.html" />
|
||||
<link rel="up" title="composer.cli" href="../cli.html" />
|
||||
</head>
|
||||
<body>
|
||||
@ -38,7 +38,7 @@
|
||||
<li class="right" >
|
||||
<a href="../../../py-modindex.html" title="Python Module Index"
|
||||
>modules</a> |</li>
|
||||
<li><a href="../../../index.html">Lorax 19.7.18 documentation</a> »</li>
|
||||
<li><a href="../../../index.html">Lorax 19.7.21 documentation</a> »</li>
|
||||
<li><a href="../../index.html" >Module code</a> »</li>
|
||||
<li><a href="../cli.html" accesskey="U">composer.cli</a> »</li>
|
||||
</ul>
|
||||
@ -69,11 +69,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="s">"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="kn">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="kn">import</span> <span class="n">projects_help</span>
|
||||
<span class="kn">from</span> <span class="nn">composer.cli.utilities</span> <span class="kn">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>
|
||||
@ -111,17 +111,17 @@
|
||||
<span class="sd"> projects list</span>
|
||||
<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="s">"/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="k">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">result</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">get_url_json_unlimited</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">for</span> <span class="n">proj</span> <span class="ow">in</span> <span class="n">result</span><span class="p">[</span><span class="s">"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="s">"name"</span><span class="p">,</span> <span class="s">"summary"</span><span class="p">,</span> <span class="s">"homepage"</span><span class="p">,</span> <span class="s">"description"</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="s">"name"</span><span class="p">,</span> <span class="s">"summary"</span><span class="p">,</span> <span class="s">"homepage"</span><span class="p">,</span> <span class="s">"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="k">print</span><span class="p">(</span><span class="s">"</span><span class="si">%s</span><span class="s">: </span><span class="si">%s</span><span class="s">"</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="s">" "</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="k">print</span><span class="p">(</span><span class="s">"</span><span class="se">\n\n</span><span class="s">"</span><span class="p">)</span>
|
||||
|
||||
<span class="k">return</span> <span class="mi">0</span>
|
||||
<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="bp">False</span><span class="p">):</span>
|
||||
<span class="sd">"""Output info on a list of projects</span>
|
||||
@ -143,23 +143,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="s">"/projects/info/</span><span class="si">%s</span><span class="s">"</span> <span class="o">%</span> <span class="s">","</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="k">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="s">"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="s">"name"</span><span class="p">,</span> <span class="s">"summary"</span><span class="p">,</span> <span class="s">"homepage"</span><span class="p">,</span> <span class="s">"description"</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="s">"name"</span><span class="p">,</span> <span class="s">"summary"</span><span class="p">,</span> <span class="s">"homepage"</span><span class="p">,</span> <span class="s">"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="k">print</span><span class="p">(</span><span class="s">"</span><span class="si">%s</span><span class="s">: </span><span class="si">%s</span><span class="s">"</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="s">" "</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="k">print</span><span class="p">(</span><span class="s">"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="s">"builds"</span><span class="p">]:</span>
|
||||
<span class="k">print</span><span class="p">(</span><span class="s">" </span><span class="si">%s%s</span><span class="s">-</span><span class="si">%s</span><span class="s">.</span><span class="si">%s</span><span class="s"> at </span><span class="si">%s</span><span class="s"> for </span><span class="si">%s</span><span class="s">"</span> <span class="o">%</span> <span class="p">(</span><span class="s">""</span> <span class="k">if</span> <span class="ow">not</span> <span class="n">build</span><span class="p">[</span><span class="s">"epoch"</span><span class="p">]</span> <span class="k">else</span> <span class="n">build</span><span class="p">[</span><span class="s">"epoch"</span><span class="p">]</span> <span class="o">+</span> <span class="s">":"</span><span class="p">,</span>
|
||||
<span class="k">print</span><span class="p">(</span><span class="s">" </span><span class="si">%s%s</span><span class="s">-</span><span class="si">%s</span><span class="s">.</span><span class="si">%s</span><span class="s"> at </span><span class="si">%s</span><span class="s"> for </span><span class="si">%s</span><span class="s">"</span> <span class="o">%</span> <span class="p">(</span><span class="s">""</span> <span class="k">if</span> <span class="ow">not</span> <span class="n">build</span><span class="p">[</span><span class="s">"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="s">"epoch"</span><span class="p">])</span> <span class="o">+</span> <span class="s">":"</span><span class="p">,</span>
|
||||
<span class="n">build</span><span class="p">[</span><span class="s">"source"</span><span class="p">][</span><span class="s">"version"</span><span class="p">],</span>
|
||||
<span class="n">build</span><span class="p">[</span><span class="s">"release"</span><span class="p">],</span>
|
||||
<span class="n">build</span><span class="p">[</span><span class="s">"arch"</span><span class="p">],</span>
|
||||
<span class="n">build</span><span class="p">[</span><span class="s">"build_time"</span><span class="p">],</span>
|
||||
<span class="n">build</span><span class="p">[</span><span class="s">"changelog"</span><span class="p">]))</span>
|
||||
<span class="k">print</span><span class="p">(</span><span class="s">""</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>
|
||||
@ -193,7 +193,7 @@
|
||||
<li class="right" >
|
||||
<a href="../../../py-modindex.html" title="Python Module Index"
|
||||
>modules</a> |</li>
|
||||
<li><a href="../../../index.html">Lorax 19.7.18 documentation</a> »</li>
|
||||
<li><a href="../../../index.html">Lorax 19.7.21 documentation</a> »</li>
|
||||
<li><a href="../../index.html" >Module code</a> »</li>
|
||||
<li><a href="../cli.html" >composer.cli</a> »</li>
|
||||
</ul>
|
||||
|
@ -8,7 +8,7 @@
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
|
||||
<title>composer.cli.sources — Lorax 19.7.18 documentation</title>
|
||||
<title>composer.cli.sources — Lorax 19.7.21 documentation</title>
|
||||
|
||||
<link rel="stylesheet" href="../../../_static/default.css" type="text/css" />
|
||||
<link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" />
|
||||
@ -16,7 +16,7 @@
|
||||
<script type="text/javascript">
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT: '../../../',
|
||||
VERSION: '19.7.18',
|
||||
VERSION: '19.7.21',
|
||||
COLLAPSE_INDEX: false,
|
||||
FILE_SUFFIX: '.html',
|
||||
HAS_SOURCE: true
|
||||
@ -25,7 +25,7 @@
|
||||
<script type="text/javascript" src="../../../_static/jquery.js"></script>
|
||||
<script type="text/javascript" src="../../../_static/underscore.js"></script>
|
||||
<script type="text/javascript" src="../../../_static/doctools.js"></script>
|
||||
<link rel="top" title="Lorax 19.7.18 documentation" href="../../../index.html" />
|
||||
<link rel="top" title="Lorax 19.7.21 documentation" href="../../../index.html" />
|
||||
<link rel="up" title="composer.cli" href="../cli.html" />
|
||||
</head>
|
||||
<body>
|
||||
@ -38,7 +38,7 @@
|
||||
<li class="right" >
|
||||
<a href="../../../py-modindex.html" title="Python Module Index"
|
||||
>modules</a> |</li>
|
||||
<li><a href="../../../index.html">Lorax 19.7.18 documentation</a> »</li>
|
||||
<li><a href="../../../index.html">Lorax 19.7.21 documentation</a> »</li>
|
||||
<li><a href="../../index.html" >Module code</a> »</li>
|
||||
<li><a href="../cli.html" accesskey="U">composer.cli</a> »</li>
|
||||
</ul>
|
||||
@ -70,7 +70,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="s">"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="kn">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="kn">import</span> <span class="n">sources_help</span>
|
||||
@ -116,12 +115,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="s">"/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="k">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">print</span><span class="p">(</span><span class="s">"Sources: </span><span class="si">%s</span><span class="s">"</span> <span class="o">%</span> <span class="s">", "</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="s">"sources"</span><span class="p">]))</span>
|
||||
<span class="k">return</span> <span class="mi">0</span>
|
||||
<span class="c"># "list" should output a plain list of identifiers, one per line.</span>
|
||||
<span class="k">print</span><span class="p">(</span><span class="s">"</span><span class="se">\n</span><span class="s">"</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="s">"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="bp">False</span><span class="p">):</span>
|
||||
<span class="sd">"""Output info on a list of projects</span>
|
||||
@ -144,13 +144,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="s">"/projects/source/info/</span><span class="si">%s</span><span class="s">"</span> <span class="o">%</span> <span class="s">","</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">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="s">"/projects/source/info/</span><span class="si">%s</span><span class="s">?format=toml"</span> <span class="o">%</span> <span class="s">","</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="k">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>
|
||||
<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="k">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="k">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="bp">False</span><span class="p">):</span>
|
||||
<span class="sd">"""Add or change a source</span>
|
||||
@ -175,7 +180,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="s">"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>
|
||||
@ -196,7 +201,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="s">"/projects/source/delete/</span><span class="si">%s</span><span class="s">"</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>
|
||||
@ -230,7 +235,7 @@
|
||||
<li class="right" >
|
||||
<a href="../../../py-modindex.html" title="Python Module Index"
|
||||
>modules</a> |</li>
|
||||
<li><a href="../../../index.html">Lorax 19.7.18 documentation</a> »</li>
|
||||
<li><a href="../../../index.html">Lorax 19.7.21 documentation</a> »</li>
|
||||
<li><a href="../../index.html" >Module code</a> »</li>
|
||||
<li><a href="../cli.html" >composer.cli</a> »</li>
|
||||
</ul>
|
||||
|
152
lorax-composer/_modules/composer/cli/status.html
Normal file
152
lorax-composer/_modules/composer/cli/status.html
Normal file
@ -0,0 +1,152 @@
|
||||
|
||||
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
|
||||
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
|
||||
<title>composer.cli.status — Lorax 19.7.21 documentation</title>
|
||||
|
||||
<link rel="stylesheet" href="../../../_static/default.css" type="text/css" />
|
||||
<link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" />
|
||||
|
||||
<script type="text/javascript">
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT: '../../../',
|
||||
VERSION: '19.7.21',
|
||||
COLLAPSE_INDEX: false,
|
||||
FILE_SUFFIX: '.html',
|
||||
HAS_SOURCE: true
|
||||
};
|
||||
</script>
|
||||
<script type="text/javascript" src="../../../_static/jquery.js"></script>
|
||||
<script type="text/javascript" src="../../../_static/underscore.js"></script>
|
||||
<script type="text/javascript" src="../../../_static/doctools.js"></script>
|
||||
<link rel="top" title="Lorax 19.7.21 documentation" href="../../../index.html" />
|
||||
<link rel="up" title="composer.cli" href="../cli.html" />
|
||||
</head>
|
||||
<body>
|
||||
<div class="related">
|
||||
<h3>Navigation</h3>
|
||||
<ul>
|
||||
<li class="right" style="margin-right: 10px">
|
||||
<a href="../../../genindex.html" title="General Index"
|
||||
accesskey="I">index</a></li>
|
||||
<li class="right" >
|
||||
<a href="../../../py-modindex.html" title="Python Module Index"
|
||||
>modules</a> |</li>
|
||||
<li><a href="../../../index.html">Lorax 19.7.21 documentation</a> »</li>
|
||||
<li><a href="../../index.html" >Module code</a> »</li>
|
||||
<li><a href="../cli.html" accesskey="U">composer.cli</a> »</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="document">
|
||||
<div class="documentwrapper">
|
||||
<div class="bodywrapper">
|
||||
<div class="body">
|
||||
|
||||
<h1>Source code for composer.cli.status</h1><div class="highlight"><pre>
|
||||
<span class="c">#</span>
|
||||
<span class="c"># Copyright (C) 2018 Red Hat, Inc.</span>
|
||||
<span class="c">#</span>
|
||||
<span class="c"># This program is free software; you can redistribute it and/or modify</span>
|
||||
<span class="c"># it under the terms of the GNU General Public License as published by</span>
|
||||
<span class="c"># the Free Software Foundation; either version 2 of the License, or</span>
|
||||
<span class="c"># (at your option) any later version.</span>
|
||||
<span class="c">#</span>
|
||||
<span class="c"># This program is distributed in the hope that it will be useful,</span>
|
||||
<span class="c"># but WITHOUT ANY WARRANTY; without even the implied warranty of</span>
|
||||
<span class="c"># MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the</span>
|
||||
<span class="c"># GNU General Public License for more details.</span>
|
||||
<span class="c">#</span>
|
||||
<span class="c"># You should have received a copy of the GNU General Public License</span>
|
||||
<span class="c"># along with this program. If not, see <http://www.gnu.org/licenses/>.</span>
|
||||
<span class="c">#</span>
|
||||
<span class="kn">import</span> <span class="nn">logging</span>
|
||||
<span class="n">log</span> <span class="o">=</span> <span class="n">logging</span><span class="o">.</span><span class="n">getLogger</span><span class="p">(</span><span class="s">"composer-cli"</span><span class="p">)</span>
|
||||
|
||||
<span class="kn">from</span> <span class="nn">composer</span> <span class="kn">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="kn">import</span> <span class="n">status_help</span>
|
||||
<span class="kn">from</span> <span class="nn">composer.cli.utilities</span> <span class="kn">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="s">"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="s">"--help"</span><span class="p">:</span>
|
||||
<span class="k">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="s">"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="s">"Unknown status command: </span><span class="si">%s</span><span class="s">"</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="s">"/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="k">print</span><span class="p">(</span><span class="s">"API server status:"</span><span class="p">)</span>
|
||||
<span class="k">print</span><span class="p">(</span><span class="s">" Database version: "</span> <span class="o">+</span> <span class="n">result</span><span class="p">[</span><span class="s">"db_version"</span><span class="p">])</span>
|
||||
<span class="k">print</span><span class="p">(</span><span class="s">" Database supported: </span><span class="si">%s</span><span class="s">"</span> <span class="o">%</span> <span class="n">result</span><span class="p">[</span><span class="s">"db_supported"</span><span class="p">])</span>
|
||||
<span class="k">print</span><span class="p">(</span><span class="s">" Schema version: "</span> <span class="o">+</span> <span class="n">result</span><span class="p">[</span><span class="s">"schema_version"</span><span class="p">])</span>
|
||||
<span class="k">print</span><span class="p">(</span><span class="s">" API version: "</span> <span class="o">+</span> <span class="n">result</span><span class="p">[</span><span class="s">"api"</span><span class="p">])</span>
|
||||
<span class="k">print</span><span class="p">(</span><span class="s">" Backend: "</span> <span class="o">+</span> <span class="n">result</span><span class="p">[</span><span class="s">"backend"</span><span class="p">])</span>
|
||||
<span class="k">print</span><span class="p">(</span><span class="s">" Build: "</span> <span class="o">+</span> <span class="n">result</span><span class="p">[</span><span class="s">"build"</span><span class="p">])</span>
|
||||
|
||||
<span class="k">if</span> <span class="n">result</span><span class="p">[</span><span class="s">"msgs"</span><span class="p">]:</span>
|
||||
<span class="k">print</span><span class="p">(</span><span class="s">"Error messages:"</span><span class="p">)</span>
|
||||
<span class="k">print</span><span class="p">(</span><span class="s">"</span><span class="se">\n</span><span class="s">"</span><span class="o">.</span><span class="n">join</span><span class="p">([</span><span class="s">" "</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="s">"msgs"</span><span class="p">]]))</span>
|
||||
|
||||
<span class="k">return</span> <span class="n">rc</span></div>
|
||||
</pre></div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="sphinxsidebar">
|
||||
<div class="sphinxsidebarwrapper">
|
||||
<div id="searchbox" style="display: none">
|
||||
<h3>Quick search</h3>
|
||||
<form class="search" action="../../../search.html" method="get">
|
||||
<input type="text" name="q" />
|
||||
<input type="submit" value="Go" />
|
||||
<input type="hidden" name="check_keywords" value="yes" />
|
||||
<input type="hidden" name="area" value="default" />
|
||||
</form>
|
||||
<p class="searchtip" style="font-size: 90%">
|
||||
Enter search terms or a module, class or function name.
|
||||
</p>
|
||||
</div>
|
||||
<script type="text/javascript">$('#searchbox').show(0);</script>
|
||||
</div>
|
||||
</div>
|
||||
<div class="clearer"></div>
|
||||
</div>
|
||||
<div class="related">
|
||||
<h3>Navigation</h3>
|
||||
<ul>
|
||||
<li class="right" style="margin-right: 10px">
|
||||
<a href="../../../genindex.html" title="General Index"
|
||||
>index</a></li>
|
||||
<li class="right" >
|
||||
<a href="../../../py-modindex.html" title="Python Module Index"
|
||||
>modules</a> |</li>
|
||||
<li><a href="../../../index.html">Lorax 19.7.21 documentation</a> »</li>
|
||||
<li><a href="../../index.html" >Module code</a> »</li>
|
||||
<li><a href="../cli.html" >composer.cli</a> »</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="footer">
|
||||
© Copyright 2018, Red Hat, Inc..
|
||||
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.1.3.
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
@ -8,7 +8,7 @@
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
|
||||
<title>composer.cli.utilities — Lorax 19.7.18 documentation</title>
|
||||
<title>composer.cli.utilities — Lorax 19.7.21 documentation</title>
|
||||
|
||||
<link rel="stylesheet" href="../../../_static/default.css" type="text/css" />
|
||||
<link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" />
|
||||
@ -16,7 +16,7 @@
|
||||
<script type="text/javascript">
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT: '../../../',
|
||||
VERSION: '19.7.18',
|
||||
VERSION: '19.7.21',
|
||||
COLLAPSE_INDEX: false,
|
||||
FILE_SUFFIX: '.html',
|
||||
HAS_SOURCE: true
|
||||
@ -25,7 +25,7 @@
|
||||
<script type="text/javascript" src="../../../_static/jquery.js"></script>
|
||||
<script type="text/javascript" src="../../../_static/underscore.js"></script>
|
||||
<script type="text/javascript" src="../../../_static/doctools.js"></script>
|
||||
<link rel="top" title="Lorax 19.7.18 documentation" href="../../../index.html" />
|
||||
<link rel="top" title="Lorax 19.7.21 documentation" href="../../../index.html" />
|
||||
<link rel="up" title="composer.cli" href="../cli.html" />
|
||||
</head>
|
||||
<body>
|
||||
@ -38,7 +38,7 @@
|
||||
<li class="right" >
|
||||
<a href="../../../py-modindex.html" title="Python Module Index"
|
||||
>modules</a> |</li>
|
||||
<li><a href="../../../index.html">Lorax 19.7.18 documentation</a> »</li>
|
||||
<li><a href="../../../index.html">Lorax 19.7.21 documentation</a> »</li>
|
||||
<li><a href="../../index.html" >Module code</a> »</li>
|
||||
<li><a href="../cli.html" accesskey="U">composer.cli</a> »</li>
|
||||
</ul>
|
||||
@ -110,17 +110,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="k">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="s">"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="s">"status"</span><span class="p">]</span> <span class="o">==</span> <span class="bp">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>
|
||||
<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="s">"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="s">"msg"</span><span class="p">])</span>
|
||||
|
||||
<span class="c"># What's the rc? If status is present, use that</span>
|
||||
<span class="c"># If not, use length of errors</span>
|
||||
<span class="k">if</span> <span class="s">"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="s">"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="s">"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="c"># 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="s">"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>
|
||||
@ -167,7 +178,7 @@
|
||||
<li class="right" >
|
||||
<a href="../../../py-modindex.html" title="Python Module Index"
|
||||
>modules</a> |</li>
|
||||
<li><a href="../../../index.html">Lorax 19.7.18 documentation</a> »</li>
|
||||
<li><a href="../../../index.html">Lorax 19.7.21 documentation</a> »</li>
|
||||
<li><a href="../../index.html" >Module code</a> »</li>
|
||||
<li><a href="../cli.html" >composer.cli</a> »</li>
|
||||
</ul>
|
||||
|
@ -8,7 +8,7 @@
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
|
||||
<title>composer.http_client — Lorax 19.7.18 documentation</title>
|
||||
<title>composer.http_client — Lorax 19.7.21 documentation</title>
|
||||
|
||||
<link rel="stylesheet" href="../../_static/default.css" type="text/css" />
|
||||
<link rel="stylesheet" href="../../_static/pygments.css" type="text/css" />
|
||||
@ -16,7 +16,7 @@
|
||||
<script type="text/javascript">
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT: '../../',
|
||||
VERSION: '19.7.18',
|
||||
VERSION: '19.7.21',
|
||||
COLLAPSE_INDEX: false,
|
||||
FILE_SUFFIX: '.html',
|
||||
HAS_SOURCE: true
|
||||
@ -25,7 +25,7 @@
|
||||
<script type="text/javascript" src="../../_static/jquery.js"></script>
|
||||
<script type="text/javascript" src="../../_static/underscore.js"></script>
|
||||
<script type="text/javascript" src="../../_static/doctools.js"></script>
|
||||
<link rel="top" title="Lorax 19.7.18 documentation" href="../../index.html" />
|
||||
<link rel="top" title="Lorax 19.7.21 documentation" href="../../index.html" />
|
||||
<link rel="up" title="Module code" href="../index.html" />
|
||||
</head>
|
||||
<body>
|
||||
@ -38,7 +38,7 @@
|
||||
<li class="right" >
|
||||
<a href="../../py-modindex.html" title="Python Module Index"
|
||||
>modules</a> |</li>
|
||||
<li><a href="../../index.html">Lorax 19.7.18 documentation</a> »</li>
|
||||
<li><a href="../../index.html">Lorax 19.7.21 documentation</a> »</li>
|
||||
<li><a href="../index.html" accesskey="U">Module code</a> »</li>
|
||||
</ul>
|
||||
</div>
|
||||
@ -71,6 +71,7 @@
|
||||
<span class="kn">import</span> <span class="nn">os</span>
|
||||
<span class="kn">import</span> <span class="nn">sys</span>
|
||||
<span class="kn">import</span> <span class="nn">json</span>
|
||||
<span class="kn">from</span> <span class="nn">urlparse</span> <span class="kn">import</span> <span class="n">urlparse</span><span class="p">,</span> <span class="n">urlunparse</span>
|
||||
|
||||
<span class="kn">from</span> <span class="nn">composer.unix_socket</span> <span class="kn">import</span> <span class="n">UnixHTTPConnectionPool</span>
|
||||
|
||||
@ -86,6 +87,29 @@
|
||||
<span class="sd"> """</span>
|
||||
<span class="k">return</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">normpath</span><span class="p">(</span><span class="s">"/api/v</span><span class="si">%s</span><span class="s">/</span><span class="si">%s</span><span class="s">"</span> <span class="o">%</span> <span class="p">(</span><span class="n">api_version</span><span class="p">,</span> <span class="n">url</span><span class="p">))</span>
|
||||
</div>
|
||||
<div class="viewcode-block" id="append_query"><a class="viewcode-back" href="../../composer.html#composer.http_client.append_query">[docs]</a><span class="k">def</span> <span class="nf">append_query</span><span class="p">(</span><span class="n">url</span><span class="p">,</span> <span class="n">query</span><span class="p">):</span>
|
||||
<span class="sd">"""Add a query argument to a URL</span>
|
||||
|
||||
<span class="sd"> The query should be of the form "param1=what&param2=ever", i.e., no</span>
|
||||
<span class="sd"> leading '?'. The new query data will be appended to any existing</span>
|
||||
<span class="sd"> query string.</span>
|
||||
|
||||
<span class="sd"> :param url: The original URL</span>
|
||||
<span class="sd"> :type url: str</span>
|
||||
<span class="sd"> :param query: The query to append</span>
|
||||
<span class="sd"> :type query: str</span>
|
||||
<span class="sd"> :returns: The new URL with the query argument included</span>
|
||||
<span class="sd"> :rtype: str</span>
|
||||
<span class="sd"> """</span>
|
||||
|
||||
<span class="n">url_parts</span> <span class="o">=</span> <span class="n">urlparse</span><span class="p">(</span><span class="n">url</span><span class="p">)</span>
|
||||
<span class="k">if</span> <span class="n">url_parts</span><span class="o">.</span><span class="n">query</span><span class="p">:</span>
|
||||
<span class="n">new_query</span> <span class="o">=</span> <span class="n">url_parts</span><span class="o">.</span><span class="n">query</span> <span class="o">+</span> <span class="s">"&"</span> <span class="o">+</span> <span class="n">query</span>
|
||||
<span class="k">else</span><span class="p">:</span>
|
||||
<span class="n">new_query</span> <span class="o">=</span> <span class="n">query</span>
|
||||
<span class="k">return</span> <span class="n">urlunparse</span><span class="p">([</span><span class="n">url_parts</span><span class="p">[</span><span class="mi">0</span><span class="p">],</span> <span class="n">url_parts</span><span class="p">[</span><span class="mi">1</span><span class="p">],</span> <span class="n">url_parts</span><span class="p">[</span><span class="mi">2</span><span class="p">],</span>
|
||||
<span class="n">url_parts</span><span class="p">[</span><span class="mi">3</span><span class="p">],</span> <span class="n">new_query</span><span class="p">,</span> <span class="n">url_parts</span><span class="p">[</span><span class="mi">5</span><span class="p">]])</span>
|
||||
</div>
|
||||
<div class="viewcode-block" id="get_url_raw"><a class="viewcode-back" href="../../composer.html#composer.http_client.get_url_raw">[docs]</a><span class="k">def</span> <span class="nf">get_url_raw</span><span class="p">(</span><span class="n">socket_path</span><span class="p">,</span> <span class="n">url</span><span class="p">):</span>
|
||||
<span class="sd">"""Return the raw results of a GET request</span>
|
||||
|
||||
@ -101,7 +125,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="s">"utf-8"</span><span class="p">))</span>
|
||||
<span class="k">if</span> <span class="s">"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="s">"status"</span><span class="p">]</span> <span class="o">==</span> <span class="bp">False</span><span class="p">:</span>
|
||||
<span class="k">raise</span> <span class="ne">RuntimeError</span><span class="p">(</span><span class="s">", "</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="s">"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="s">"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="s">"errors"</span><span class="p">]]</span>
|
||||
<span class="k">raise</span> <span class="ne">RuntimeError</span><span class="p">(</span><span class="s">", "</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="s">'utf-8'</span><span class="p">)</span>
|
||||
</div>
|
||||
@ -119,6 +144,31 @@
|
||||
<span class="n">r</span> <span class="o">=</span> <span class="n">http</span><span class="o">.</span><span class="n">request</span><span class="p">(</span><span class="s">"GET"</span><span class="p">,</span> <span class="n">url</span><span class="p">)</span>
|
||||
<span class="k">return</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="s">'utf-8'</span><span class="p">))</span>
|
||||
</div>
|
||||
<div class="viewcode-block" id="get_url_json_unlimited"><a class="viewcode-back" href="../../composer.html#composer.http_client.get_url_json_unlimited">[docs]</a><span class="k">def</span> <span class="nf">get_url_json_unlimited</span><span class="p">(</span><span class="n">socket_path</span><span class="p">,</span> <span class="n">url</span><span class="p">):</span>
|
||||
<span class="sd">"""Return the JSON results of a GET request</span>
|
||||
|
||||
<span class="sd"> For URLs that use offset/limit arguments, this command will</span>
|
||||
<span class="sd"> fetch all results for the given request.</span>
|
||||
|
||||
<span class="sd"> :param socket_path: Path to the Unix socket to use for API communication</span>
|
||||
<span class="sd"> :type socket_path: str</span>
|
||||
<span class="sd"> :param url: URL to request</span>
|
||||
<span class="sd"> :type url: str</span>
|
||||
<span class="sd"> :returns: The json response from the server</span>
|
||||
<span class="sd"> :rtype: dict</span>
|
||||
<span class="sd"> """</span>
|
||||
<span class="n">http</span> <span class="o">=</span> <span class="n">UnixHTTPConnectionPool</span><span class="p">(</span><span class="n">socket_path</span><span class="p">)</span>
|
||||
|
||||
<span class="c"># Start with limit=0 to just get the number of objects</span>
|
||||
<span class="n">total_url</span> <span class="o">=</span> <span class="n">append_query</span><span class="p">(</span><span class="n">url</span><span class="p">,</span> <span class="s">"limit=0"</span><span class="p">)</span>
|
||||
<span class="n">r_total</span> <span class="o">=</span> <span class="n">http</span><span class="o">.</span><span class="n">request</span><span class="p">(</span><span class="s">"GET"</span><span class="p">,</span> <span class="n">total_url</span><span class="p">)</span>
|
||||
<span class="n">json_total</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_total</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="s">'utf-8'</span><span class="p">))</span>
|
||||
|
||||
<span class="c"># Add the "total" returned by limit=0 as the new limit</span>
|
||||
<span class="n">unlimited_url</span> <span class="o">=</span> <span class="n">append_query</span><span class="p">(</span><span class="n">url</span><span class="p">,</span> <span class="s">"limit=</span><span class="si">%d</span><span class="s">"</span> <span class="o">%</span> <span class="n">json_total</span><span class="p">[</span><span class="s">"total"</span><span class="p">])</span>
|
||||
<span class="n">r_unlimited</span> <span class="o">=</span> <span class="n">http</span><span class="o">.</span><span class="n">request</span><span class="p">(</span><span class="s">"GET"</span><span class="p">,</span> <span class="n">unlimited_url</span><span class="p">)</span>
|
||||
<span class="k">return</span> <span class="n">json</span><span class="o">.</span><span class="n">loads</span><span class="p">(</span><span class="n">r_unlimited</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="s">'utf-8'</span><span class="p">))</span>
|
||||
</div>
|
||||
<div class="viewcode-block" id="delete_url_json"><a class="viewcode-back" href="../../composer.html#composer.http_client.delete_url_json">[docs]</a><span class="k">def</span> <span class="nf">delete_url_json</span><span class="p">(</span><span class="n">socket_path</span><span class="p">,</span> <span class="n">url</span><span class="p">):</span>
|
||||
<span class="sd">"""Send a DELETE request to the url and return JSON response</span>
|
||||
|
||||
@ -223,7 +273,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="s">"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="s">"status"</span><span class="p">]:</span>
|
||||
<span class="k">raise</span> <span class="ne">RuntimeError</span><span class="p">(</span><span class="s">", "</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="s">"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="s">"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="s">"errors"</span><span class="p">]]</span>
|
||||
<span class="k">raise</span> <span class="ne">RuntimeError</span><span class="p">(</span><span class="s">", "</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>
|
||||
@ -283,7 +334,7 @@
|
||||
<li class="right" >
|
||||
<a href="../../py-modindex.html" title="Python Module Index"
|
||||
>modules</a> |</li>
|
||||
<li><a href="../../index.html">Lorax 19.7.18 documentation</a> »</li>
|
||||
<li><a href="../../index.html">Lorax 19.7.21 documentation</a> »</li>
|
||||
<li><a href="../index.html" >Module code</a> »</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
@ -8,7 +8,7 @@
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
|
||||
<title>composer.unix_socket — Lorax 19.7.18 documentation</title>
|
||||
<title>composer.unix_socket — Lorax 19.7.21 documentation</title>
|
||||
|
||||
<link rel="stylesheet" href="../../_static/default.css" type="text/css" />
|
||||
<link rel="stylesheet" href="../../_static/pygments.css" type="text/css" />
|
||||
@ -16,7 +16,7 @@
|
||||
<script type="text/javascript">
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT: '../../',
|
||||
VERSION: '19.7.18',
|
||||
VERSION: '19.7.21',
|
||||
COLLAPSE_INDEX: false,
|
||||
FILE_SUFFIX: '.html',
|
||||
HAS_SOURCE: true
|
||||
@ -25,7 +25,7 @@
|
||||
<script type="text/javascript" src="../../_static/jquery.js"></script>
|
||||
<script type="text/javascript" src="../../_static/underscore.js"></script>
|
||||
<script type="text/javascript" src="../../_static/doctools.js"></script>
|
||||
<link rel="top" title="Lorax 19.7.18 documentation" href="../../index.html" />
|
||||
<link rel="top" title="Lorax 19.7.21 documentation" href="../../index.html" />
|
||||
<link rel="up" title="Module code" href="../index.html" />
|
||||
</head>
|
||||
<body>
|
||||
@ -38,7 +38,7 @@
|
||||
<li class="right" >
|
||||
<a href="../../py-modindex.html" title="Python Module Index"
|
||||
>modules</a> |</li>
|
||||
<li><a href="../../index.html">Lorax 19.7.18 documentation</a> »</li>
|
||||
<li><a href="../../index.html">Lorax 19.7.21 documentation</a> »</li>
|
||||
<li><a href="../index.html" accesskey="U">Module code</a> »</li>
|
||||
</ul>
|
||||
</div>
|
||||
@ -143,7 +143,7 @@
|
||||
<li class="right" >
|
||||
<a href="../../py-modindex.html" title="Python Module Index"
|
||||
>modules</a> |</li>
|
||||
<li><a href="../../index.html">Lorax 19.7.18 documentation</a> »</li>
|
||||
<li><a href="../../index.html">Lorax 19.7.21 documentation</a> »</li>
|
||||
<li><a href="../index.html" >Module code</a> »</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
@ -8,7 +8,7 @@
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
|
||||
<title>Overview: module code — Lorax 19.7.18 documentation</title>
|
||||
<title>Overview: module code — Lorax 19.7.21 documentation</title>
|
||||
|
||||
<link rel="stylesheet" href="../_static/default.css" type="text/css" />
|
||||
<link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
|
||||
@ -16,7 +16,7 @@
|
||||
<script type="text/javascript">
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT: '../',
|
||||
VERSION: '19.7.18',
|
||||
VERSION: '19.7.21',
|
||||
COLLAPSE_INDEX: false,
|
||||
FILE_SUFFIX: '.html',
|
||||
HAS_SOURCE: true
|
||||
@ -25,7 +25,7 @@
|
||||
<script type="text/javascript" src="../_static/jquery.js"></script>
|
||||
<script type="text/javascript" src="../_static/underscore.js"></script>
|
||||
<script type="text/javascript" src="../_static/doctools.js"></script>
|
||||
<link rel="top" title="Lorax 19.7.18 documentation" href="../index.html" />
|
||||
<link rel="top" title="Lorax 19.7.21 documentation" href="../index.html" />
|
||||
</head>
|
||||
<body>
|
||||
<div class="related">
|
||||
@ -37,7 +37,7 @@
|
||||
<li class="right" >
|
||||
<a href="../py-modindex.html" title="Python Module Index"
|
||||
>modules</a> |</li>
|
||||
<li><a href="../index.html">Lorax 19.7.18 documentation</a> »</li>
|
||||
<li><a href="../index.html">Lorax 19.7.21 documentation</a> »</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
@ -53,18 +53,21 @@
|
||||
<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.html">pylorax.api</a></li>
|
||||
<ul><li><a href="pylorax/api/compose.html">pylorax.api.compose</a></li>
|
||||
<ul><li><a href="pylorax/api/checkparams.html">pylorax.api.checkparams</a></li>
|
||||
<li><a href="pylorax/api/compose.html">pylorax.api.compose</a></li>
|
||||
<li><a href="pylorax/api/config.html">pylorax.api.config</a></li>
|
||||
<li><a href="pylorax/api/crossdomain.html">pylorax.api.crossdomain</a></li>
|
||||
<li><a href="pylorax/api/projects.html">pylorax.api.projects</a></li>
|
||||
<li><a href="pylorax/api/queue.html">pylorax.api.queue</a></li>
|
||||
<li><a href="pylorax/api/recipes.html">pylorax.api.recipes</a></li>
|
||||
<li><a href="pylorax/api/server.html">pylorax.api.server</a></li>
|
||||
<li><a href="pylorax/api/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/api/yumbase.html">pylorax.api.yumbase</a></li>
|
||||
@ -115,7 +118,7 @@
|
||||
<li class="right" >
|
||||
<a href="../py-modindex.html" title="Python Module Index"
|
||||
>modules</a> |</li>
|
||||
<li><a href="../index.html">Lorax 19.7.18 documentation</a> »</li>
|
||||
<li><a href="../index.html">Lorax 19.7.21 documentation</a> »</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="footer">
|
||||
|
@ -8,7 +8,7 @@
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
|
||||
<title>pylorax — Lorax 19.7.18 documentation</title>
|
||||
<title>pylorax — Lorax 19.7.21 documentation</title>
|
||||
|
||||
<link rel="stylesheet" href="../_static/default.css" type="text/css" />
|
||||
<link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
|
||||
@ -16,7 +16,7 @@
|
||||
<script type="text/javascript">
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT: '../',
|
||||
VERSION: '19.7.18',
|
||||
VERSION: '19.7.21',
|
||||
COLLAPSE_INDEX: false,
|
||||
FILE_SUFFIX: '.html',
|
||||
HAS_SOURCE: true
|
||||
@ -25,7 +25,7 @@
|
||||
<script type="text/javascript" src="../_static/jquery.js"></script>
|
||||
<script type="text/javascript" src="../_static/underscore.js"></script>
|
||||
<script type="text/javascript" src="../_static/doctools.js"></script>
|
||||
<link rel="top" title="Lorax 19.7.18 documentation" href="../index.html" />
|
||||
<link rel="top" title="Lorax 19.7.21 documentation" href="../index.html" />
|
||||
<link rel="up" title="Module code" href="index.html" />
|
||||
</head>
|
||||
<body>
|
||||
@ -38,7 +38,7 @@
|
||||
<li class="right" >
|
||||
<a href="../py-modindex.html" title="Python Module Index"
|
||||
>modules</a> |</li>
|
||||
<li><a href="../index.html">Lorax 19.7.18 documentation</a> »</li>
|
||||
<li><a href="../index.html">Lorax 19.7.21 documentation</a> »</li>
|
||||
<li><a href="index.html" accesskey="U">Module code</a> »</li>
|
||||
</ul>
|
||||
</div>
|
||||
@ -468,7 +468,7 @@
|
||||
<li class="right" >
|
||||
<a href="../py-modindex.html" title="Python Module Index"
|
||||
>modules</a> |</li>
|
||||
<li><a href="../index.html">Lorax 19.7.18 documentation</a> »</li>
|
||||
<li><a href="../index.html">Lorax 19.7.21 documentation</a> »</li>
|
||||
<li><a href="index.html" >Module code</a> »</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
@ -8,7 +8,7 @@
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
|
||||
<title>pylorax.api — Lorax 19.7.18 documentation</title>
|
||||
<title>pylorax.api — Lorax 19.7.21 documentation</title>
|
||||
|
||||
<link rel="stylesheet" href="../../_static/default.css" type="text/css" />
|
||||
<link rel="stylesheet" href="../../_static/pygments.css" type="text/css" />
|
||||
@ -16,7 +16,7 @@
|
||||
<script type="text/javascript">
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT: '../../',
|
||||
VERSION: '19.7.18',
|
||||
VERSION: '19.7.21',
|
||||
COLLAPSE_INDEX: false,
|
||||
FILE_SUFFIX: '.html',
|
||||
HAS_SOURCE: true
|
||||
@ -25,7 +25,7 @@
|
||||
<script type="text/javascript" src="../../_static/jquery.js"></script>
|
||||
<script type="text/javascript" src="../../_static/underscore.js"></script>
|
||||
<script type="text/javascript" src="../../_static/doctools.js"></script>
|
||||
<link rel="top" title="Lorax 19.7.18 documentation" href="../../index.html" />
|
||||
<link rel="top" title="Lorax 19.7.21 documentation" href="../../index.html" />
|
||||
<link rel="up" title="pylorax" href="../pylorax.html" />
|
||||
</head>
|
||||
<body>
|
||||
@ -38,7 +38,7 @@
|
||||
<li class="right" >
|
||||
<a href="../../py-modindex.html" title="Python Module Index"
|
||||
>modules</a> |</li>
|
||||
<li><a href="../../index.html">Lorax 19.7.18 documentation</a> »</li>
|
||||
<li><a href="../../index.html">Lorax 19.7.21 documentation</a> »</li>
|
||||
<li><a href="../index.html" >Module code</a> »</li>
|
||||
<li><a href="../pylorax.html" accesskey="U">pylorax</a> »</li>
|
||||
</ul>
|
||||
@ -103,7 +103,7 @@
|
||||
<li class="right" >
|
||||
<a href="../../py-modindex.html" title="Python Module Index"
|
||||
>modules</a> |</li>
|
||||
<li><a href="../../index.html">Lorax 19.7.18 documentation</a> »</li>
|
||||
<li><a href="../../index.html">Lorax 19.7.21 documentation</a> »</li>
|
||||
<li><a href="../index.html" >Module code</a> »</li>
|
||||
<li><a href="../pylorax.html" >pylorax</a> »</li>
|
||||
</ul>
|
||||
|
142
lorax-composer/_modules/pylorax/api/checkparams.html
Normal file
142
lorax-composer/_modules/pylorax/api/checkparams.html
Normal file
@ -0,0 +1,142 @@
|
||||
|
||||
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
|
||||
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
|
||||
<title>pylorax.api.checkparams — Lorax 19.7.21 documentation</title>
|
||||
|
||||
<link rel="stylesheet" href="../../../_static/default.css" type="text/css" />
|
||||
<link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" />
|
||||
|
||||
<script type="text/javascript">
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT: '../../../',
|
||||
VERSION: '19.7.21',
|
||||
COLLAPSE_INDEX: false,
|
||||
FILE_SUFFIX: '.html',
|
||||
HAS_SOURCE: true
|
||||
};
|
||||
</script>
|
||||
<script type="text/javascript" src="../../../_static/jquery.js"></script>
|
||||
<script type="text/javascript" src="../../../_static/underscore.js"></script>
|
||||
<script type="text/javascript" src="../../../_static/doctools.js"></script>
|
||||
<link rel="top" title="Lorax 19.7.21 documentation" href="../../../index.html" />
|
||||
<link rel="up" title="pylorax.api" href="../api.html" />
|
||||
</head>
|
||||
<body>
|
||||
<div class="related">
|
||||
<h3>Navigation</h3>
|
||||
<ul>
|
||||
<li class="right" style="margin-right: 10px">
|
||||
<a href="../../../genindex.html" title="General Index"
|
||||
accesskey="I">index</a></li>
|
||||
<li class="right" >
|
||||
<a href="../../../py-modindex.html" title="Python Module Index"
|
||||
>modules</a> |</li>
|
||||
<li><a href="../../../index.html">Lorax 19.7.21 documentation</a> »</li>
|
||||
<li><a href="../../index.html" >Module code</a> »</li>
|
||||
<li><a href="../../pylorax.html" >pylorax</a> »</li>
|
||||
<li><a href="../api.html" accesskey="U">pylorax.api</a> »</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="document">
|
||||
<div class="documentwrapper">
|
||||
<div class="bodywrapper">
|
||||
<div class="body">
|
||||
|
||||
<h1>Source code for pylorax.api.checkparams</h1><div class="highlight"><pre>
|
||||
<span class="c">#</span>
|
||||
<span class="c"># Copyright (C) 2018 Red Hat, Inc.</span>
|
||||
<span class="c">#</span>
|
||||
<span class="c"># This program is free software; you can redistribute it and/or modify</span>
|
||||
<span class="c"># it under the terms of the GNU General Public License as published by</span>
|
||||
<span class="c"># the Free Software Foundation; either version 2 of the License, or</span>
|
||||
<span class="c"># (at your option) any later version.</span>
|
||||
<span class="c">#</span>
|
||||
<span class="c"># This program is distributed in the hope that it will be useful,</span>
|
||||
<span class="c"># but WITHOUT ANY WARRANTY; without even the implied warranty of</span>
|
||||
<span class="c"># MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the</span>
|
||||
<span class="c"># GNU General Public License for more details.</span>
|
||||
<span class="c">#</span>
|
||||
<span class="c"># You should have received a copy of the GNU General Public License</span>
|
||||
<span class="c"># along with this program. If not, see <http://www.gnu.org/licenses/>.</span>
|
||||
<span class="c">#</span>
|
||||
|
||||
<span class="kn">import</span> <span class="nn">logging</span>
|
||||
<span class="n">log</span> <span class="o">=</span> <span class="n">logging</span><span class="o">.</span><span class="n">getLogger</span><span class="p">(</span><span class="s">"lorax-composer"</span><span class="p">)</span>
|
||||
|
||||
<span class="kn">from</span> <span class="nn">flask</span> <span class="kn">import</span> <span class="n">jsonify</span>
|
||||
<span class="kn">from</span> <span class="nn">functools</span> <span class="kn">import</span> <span class="n">update_wrapper</span>
|
||||
|
||||
<span class="c"># A decorator for checking the parameters provided to the API route implementing</span>
|
||||
<span class="c"># functions. The tuples parameter is a list of tuples. Each tuple is the string</span>
|
||||
<span class="c"># name of a parameter ("blueprint_name", not blueprint_name), the value it's set</span>
|
||||
<span class="c"># to by flask if the caller did not provide it, and a message to be returned to</span>
|
||||
<span class="c"># the user.</span>
|
||||
<span class="c">#</span>
|
||||
<span class="c"># If the parameter is set to its default, the error message is returned. Otherwise,</span>
|
||||
<span class="c"># 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="s">"(</span><span class="si">%s</span><span class="s">) </span><span class="si">%s</span><span class="s">"</span><span class="p">,</span> <span class="n">f</span><span class="o">.</span><span class="n">__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="bp">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>
|
||||
</div>
|
||||
<div class="sphinxsidebar">
|
||||
<div class="sphinxsidebarwrapper">
|
||||
<div id="searchbox" style="display: none">
|
||||
<h3>Quick search</h3>
|
||||
<form class="search" action="../../../search.html" method="get">
|
||||
<input type="text" name="q" />
|
||||
<input type="submit" value="Go" />
|
||||
<input type="hidden" name="check_keywords" value="yes" />
|
||||
<input type="hidden" name="area" value="default" />
|
||||
</form>
|
||||
<p class="searchtip" style="font-size: 90%">
|
||||
Enter search terms or a module, class or function name.
|
||||
</p>
|
||||
</div>
|
||||
<script type="text/javascript">$('#searchbox').show(0);</script>
|
||||
</div>
|
||||
</div>
|
||||
<div class="clearer"></div>
|
||||
</div>
|
||||
<div class="related">
|
||||
<h3>Navigation</h3>
|
||||
<ul>
|
||||
<li class="right" style="margin-right: 10px">
|
||||
<a href="../../../genindex.html" title="General Index"
|
||||
>index</a></li>
|
||||
<li class="right" >
|
||||
<a href="../../../py-modindex.html" title="Python Module Index"
|
||||
>modules</a> |</li>
|
||||
<li><a href="../../../index.html">Lorax 19.7.21 documentation</a> »</li>
|
||||
<li><a href="../../index.html" >Module code</a> »</li>
|
||||
<li><a href="../../pylorax.html" >pylorax</a> »</li>
|
||||
<li><a href="../api.html" >pylorax.api</a> »</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="footer">
|
||||
© Copyright 2018, Red Hat, Inc..
|
||||
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.1.3.
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
@ -8,7 +8,7 @@
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
|
||||
<title>pylorax.api.compose — Lorax 19.7.18 documentation</title>
|
||||
<title>pylorax.api.compose — Lorax 19.7.21 documentation</title>
|
||||
|
||||
<link rel="stylesheet" href="../../../_static/default.css" type="text/css" />
|
||||
<link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" />
|
||||
@ -16,7 +16,7 @@
|
||||
<script type="text/javascript">
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT: '../../../',
|
||||
VERSION: '19.7.18',
|
||||
VERSION: '19.7.21',
|
||||
COLLAPSE_INDEX: false,
|
||||
FILE_SUFFIX: '.html',
|
||||
HAS_SOURCE: true
|
||||
@ -25,7 +25,7 @@
|
||||
<script type="text/javascript" src="../../../_static/jquery.js"></script>
|
||||
<script type="text/javascript" src="../../../_static/underscore.js"></script>
|
||||
<script type="text/javascript" src="../../../_static/doctools.js"></script>
|
||||
<link rel="top" title="Lorax 19.7.18 documentation" href="../../../index.html" />
|
||||
<link rel="top" title="Lorax 19.7.21 documentation" href="../../../index.html" />
|
||||
<link rel="up" title="pylorax.api" href="../api.html" />
|
||||
</head>
|
||||
<body>
|
||||
@ -38,7 +38,7 @@
|
||||
<li class="right" >
|
||||
<a href="../../../py-modindex.html" title="Python Module Index"
|
||||
>modules</a> |</li>
|
||||
<li><a href="../../../index.html">Lorax 19.7.18 documentation</a> »</li>
|
||||
<li><a href="../../../index.html">Lorax 19.7.21 documentation</a> »</li>
|
||||
<li><a href="../../index.html" >Module code</a> »</li>
|
||||
<li><a href="../../pylorax.html" >pylorax</a> »</li>
|
||||
<li><a href="../api.html" accesskey="U">pylorax.api</a> »</li>
|
||||
@ -99,13 +99,43 @@
|
||||
<span class="kn">from</span> <span class="nn">pykickstart.parser</span> <span class="kn">import</span> <span class="n">KickstartParser</span>
|
||||
<span class="kn">from</span> <span class="nn">pykickstart.version</span> <span class="kn">import</span> <span class="n">makeVersion</span><span class="p">,</span> <span class="n">RHEL7</span>
|
||||
|
||||
<span class="kn">from</span> <span class="nn">pylorax.api.projects</span> <span class="kn">import</span> <span class="n">projects_depsolve_with_size</span><span class="p">,</span> <span class="n">dep_nevra</span>
|
||||
<span class="kn">from</span> <span class="nn">pylorax.api.projects</span> <span class="kn">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="kn">import</span> <span class="n">ProjectsError</span>
|
||||
<span class="kn">from</span> <span class="nn">pylorax.api.recipes</span> <span class="kn">import</span> <span class="n">read_recipe_and_id</span>
|
||||
<span class="kn">from</span> <span class="nn">pylorax.api.timestamp</span> <span class="kn">import</span> <span class="n">TS_CREATED</span><span class="p">,</span> <span class="n">write_timestamp</span>
|
||||
<span class="kn">from</span> <span class="nn">pylorax.imgutils</span> <span class="kn">import</span> <span class="n">default_image_name</span>
|
||||
<span class="kn">from</span> <span class="nn">pylorax.sysutils</span> <span class="kn">import</span> <span class="n">joinpaths</span>
|
||||
|
||||
|
||||
<div class="viewcode-block" id="test_templates"><a class="viewcode-back" href="../../../pylorax.api.html#pylorax.api.compose.test_templates">[docs]</a><span class="k">def</span> <span class="nf">test_templates</span><span class="p">(</span><span class="n">yb</span><span class="p">,</span> <span class="n">share_dir</span><span class="p">):</span>
|
||||
<span class="sd">""" Try depsolving each of the the templates and report any errors</span>
|
||||
|
||||
<span class="sd"> :param yb: yum base object</span>
|
||||
<span class="sd"> :type yb: YumBase</span>
|
||||
<span class="sd"> :returns: List of template types and errors</span>
|
||||
<span class="sd"> :rtype: List of errors</span>
|
||||
|
||||
<span class="sd"> Return a list of templates and errors encountered or an empty list</span>
|
||||
<span class="sd"> """</span>
|
||||
<span class="n">template_errors</span> <span class="o">=</span> <span class="p">[]</span>
|
||||
<span class="k">for</span> <span class="n">compose_type</span> <span class="ow">in</span> <span class="n">compose_types</span><span class="p">(</span><span class="n">share_dir</span><span class="p">):</span>
|
||||
<span class="c"># Read the kickstart template for this type</span>
|
||||
<span class="n">ks_template_path</span> <span class="o">=</span> <span class="n">joinpaths</span><span class="p">(</span><span class="n">share_dir</span><span class="p">,</span> <span class="s">"composer"</span><span class="p">,</span> <span class="n">compose_type</span><span class="p">)</span> <span class="o">+</span> <span class="s">".ks"</span>
|
||||
<span class="n">ks_template</span> <span class="o">=</span> <span class="nb">open</span><span class="p">(</span><span class="n">ks_template_path</span><span class="p">,</span> <span class="s">"r"</span><span class="p">)</span><span class="o">.</span><span class="n">read</span><span class="p">()</span>
|
||||
|
||||
<span class="c"># How much space will the packages in the default template take?</span>
|
||||
<span class="n">ks_version</span> <span class="o">=</span> <span class="n">makeVersion</span><span class="p">(</span><span class="n">RHEL7</span><span class="p">)</span>
|
||||
<span class="n">ks</span> <span class="o">=</span> <span class="n">KickstartParser</span><span class="p">(</span><span class="n">ks_version</span><span class="p">,</span> <span class="n">errorsAreFatal</span><span class="o">=</span><span class="bp">False</span><span class="p">,</span> <span class="n">missingIncludeIsFatal</span><span class="o">=</span><span class="bp">False</span><span class="p">)</span>
|
||||
<span class="n">ks</span><span class="o">.</span><span class="n">readKickstartFromString</span><span class="p">(</span><span class="n">ks_template</span><span class="o">+</span><span class="s">"</span><span class="se">\n</span><span class="si">%e</span><span class="s">nd</span><span class="se">\n</span><span class="s">"</span><span class="p">)</span>
|
||||
<span class="n">pkgs</span> <span class="o">=</span> <span class="p">[(</span><span class="n">name</span><span class="p">,</span> <span class="s">"*"</span><span class="p">)</span> <span class="k">for</span> <span class="n">name</span> <span class="ow">in</span> <span class="n">ks</span><span class="o">.</span><span class="n">handler</span><span class="o">.</span><span class="n">packages</span><span class="o">.</span><span class="n">packageList</span><span class="p">]</span>
|
||||
<span class="n">grps</span> <span class="o">=</span> <span class="p">[</span><span class="n">grp</span><span class="o">.</span><span class="n">name</span> <span class="k">for</span> <span class="n">grp</span> <span class="ow">in</span> <span class="n">ks</span><span class="o">.</span><span class="n">handler</span><span class="o">.</span><span class="n">packages</span><span class="o">.</span><span class="n">groupList</span><span class="p">]</span>
|
||||
<span class="k">try</span><span class="p">:</span>
|
||||
<span class="n">_</span> <span class="o">=</span> <span class="n">projects_depsolve</span><span class="p">(</span><span class="n">yb</span><span class="p">,</span> <span class="n">pkgs</span><span class="p">,</span> <span class="n">grps</span><span class="p">)</span>
|
||||
<span class="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">template_errors</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="s">"Error depsolving </span><span class="si">%s</span><span class="s">: </span><span class="si">%s</span><span class="s">"</span> <span class="o">%</span> <span class="p">(</span><span class="n">compose_type</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">template_errors</span>
|
||||
</div>
|
||||
<div class="viewcode-block" id="repo_to_ks"><a class="viewcode-back" href="../../../pylorax.api.html#pylorax.api.compose.repo_to_ks">[docs]</a><span class="k">def</span> <span class="nf">repo_to_ks</span><span class="p">(</span><span class="n">r</span><span class="p">,</span> <span class="n">url</span><span class="o">=</span><span class="s">"url"</span><span class="p">):</span>
|
||||
<span class="sd">""" Return a kickstart line with the correct args.</span>
|
||||
|
||||
@ -289,7 +319,7 @@
|
||||
<span class="n">deps</span> <span class="o">=</span> <span class="p">[]</span>
|
||||
<span class="k">try</span><span class="p">:</span>
|
||||
<span class="k">with</span> <span class="n">yumlock</span><span class="o">.</span><span class="n">lock</span><span class="p">:</span>
|
||||
<span class="p">(</span><span class="n">installed_size</span><span class="p">,</span> <span class="n">deps</span><span class="p">)</span> <span class="o">=</span> <span class="n">projects_depsolve_with_size</span><span class="p">(</span><span class="n">yumlock</span><span class="o">.</span><span class="n">yb</span><span class="p">,</span> <span class="n">projects</span><span class="p">,</span> <span class="n">with_core</span><span class="o">=</span><span class="bp">False</span><span class="p">)</span>
|
||||
<span class="p">(</span><span class="n">installed_size</span><span class="p">,</span> <span class="n">deps</span><span class="p">)</span> <span class="o">=</span> <span class="n">projects_depsolve_with_size</span><span class="p">(</span><span class="n">yumlock</span><span class="o">.</span><span class="n">yb</span><span class="p">,</span> <span class="n">projects</span><span class="p">,</span> <span class="n">recipe</span><span class="o">.</span><span class="n">group_names</span><span class="p">,</span> <span class="n">with_core</span><span class="o">=</span><span class="bp">False</span><span class="p">)</span>
|
||||
<span class="k">except</span> <span class="n">ProjectsError</span> <span class="k">as</span> <span class="n">e</span><span class="p">:</span>
|
||||
<span class="n">log</span><span class="o">.</span><span class="n">error</span><span class="p">(</span><span class="s">"start_build depsolve: </span><span class="si">%s</span><span class="s">"</span><span class="p">,</span> <span class="nb">str</span><span class="p">(</span><span class="n">e</span><span class="p">))</span>
|
||||
<span class="k">raise</span> <span class="ne">RuntimeError</span><span class="p">(</span><span class="s">"Problem depsolving </span><span class="si">%s</span><span class="s">: </span><span class="si">%s</span><span class="s">"</span> <span class="o">%</span> <span class="p">(</span><span class="n">recipe</span><span class="p">[</span><span class="s">"name"</span><span class="p">],</span> <span class="nb">str</span><span class="p">(</span><span class="n">e</span><span class="p">)))</span>
|
||||
@ -303,9 +333,10 @@
|
||||
<span class="n">ks</span> <span class="o">=</span> <span class="n">KickstartParser</span><span class="p">(</span><span class="n">ks_version</span><span class="p">,</span> <span class="n">errorsAreFatal</span><span class="o">=</span><span class="bp">False</span><span class="p">,</span> <span class="n">missingIncludeIsFatal</span><span class="o">=</span><span class="bp">False</span><span class="p">)</span>
|
||||
<span class="n">ks</span><span class="o">.</span><span class="n">readKickstartFromString</span><span class="p">(</span><span class="n">ks_template</span><span class="o">+</span><span class="s">"</span><span class="se">\n</span><span class="si">%e</span><span class="s">nd</span><span class="se">\n</span><span class="s">"</span><span class="p">)</span>
|
||||
<span class="n">pkgs</span> <span class="o">=</span> <span class="p">[(</span><span class="n">name</span><span class="p">,</span> <span class="s">"*"</span><span class="p">)</span> <span class="k">for</span> <span class="n">name</span> <span class="ow">in</span> <span class="n">ks</span><span class="o">.</span><span class="n">handler</span><span class="o">.</span><span class="n">packages</span><span class="o">.</span><span class="n">packageList</span><span class="p">]</span>
|
||||
<span class="n">grps</span> <span class="o">=</span> <span class="p">[</span><span class="n">grp</span><span class="o">.</span><span class="n">name</span> <span class="k">for</span> <span class="n">grp</span> <span class="ow">in</span> <span class="n">ks</span><span class="o">.</span><span class="n">handler</span><span class="o">.</span><span class="n">packages</span><span class="o">.</span><span class="n">groupList</span><span class="p">]</span>
|
||||
<span class="k">try</span><span class="p">:</span>
|
||||
<span class="k">with</span> <span class="n">yumlock</span><span class="o">.</span><span class="n">lock</span><span class="p">:</span>
|
||||
<span class="p">(</span><span class="n">template_size</span><span class="p">,</span> <span class="n">_</span><span class="p">)</span> <span class="o">=</span> <span class="n">projects_depsolve_with_size</span><span class="p">(</span><span class="n">yumlock</span><span class="o">.</span><span class="n">yb</span><span class="p">,</span> <span class="n">pkgs</span><span class="p">,</span>
|
||||
<span class="p">(</span><span class="n">template_size</span><span class="p">,</span> <span class="n">_</span><span class="p">)</span> <span class="o">=</span> <span class="n">projects_depsolve_with_size</span><span class="p">(</span><span class="n">yumlock</span><span class="o">.</span><span class="n">yb</span><span class="p">,</span> <span class="n">pkgs</span><span class="p">,</span> <span class="n">grps</span><span class="p">,</span>
|
||||
<span class="n">with_core</span><span class="o">=</span><span class="ow">not</span> <span class="n">ks</span><span class="o">.</span><span class="n">handler</span><span class="o">.</span><span class="n">packages</span><span class="o">.</span><span class="n">nocore</span><span class="p">)</span>
|
||||
<span class="k">except</span> <span class="n">ProjectsError</span> <span class="k">as</span> <span class="n">e</span><span class="p">:</span>
|
||||
<span class="n">log</span><span class="o">.</span><span class="n">error</span><span class="p">(</span><span class="s">"start_build depsolve: </span><span class="si">%s</span><span class="s">"</span><span class="p">,</span> <span class="nb">str</span><span class="p">(</span><span class="n">e</span><span class="p">))</span>
|
||||
@ -361,6 +392,10 @@
|
||||
<span class="n">log</span><span class="o">.</span><span class="n">debug</span><span class="p">(</span><span class="s">"repo composer-</span><span class="si">%s</span><span class="s"> = </span><span class="si">%s</span><span class="s">"</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="s">'repo --name="composer-</span><span class="si">%s</span><span class="s">" </span><span class="si">%s</span><span class="se">\n</span><span class="s">'</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="c"># Setup the disk for booting</span>
|
||||
<span class="c"># 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="s">'clearpart --all</span><span class="se">\n</span><span class="s">'</span><span class="p">)</span>
|
||||
|
||||
<span class="c"># 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="s">'part / --fstype="ext4" --size=</span><span class="si">%d</span><span class="se">\n</span><span class="s">'</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>
|
||||
|
||||
@ -407,6 +442,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="s">"TEST"</span><span class="p">),</span> <span class="s">"w"</span><span class="p">)</span><span class="o">.</span><span class="n">write</span><span class="p">(</span><span class="s">"</span><span class="si">%s</span><span class="s">"</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="s">"Adding </span><span class="si">%s</span><span class="s"> (</span><span class="si">%s</span><span class="s"> </span><span class="si">%s</span><span class="s">) 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="s">"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="s">"queue/new/"</span><span class="p">,</span> <span class="n">build_id</span><span class="p">))</span>
|
||||
|
||||
@ -587,7 +623,7 @@
|
||||
<li class="right" >
|
||||
<a href="../../../py-modindex.html" title="Python Module Index"
|
||||
>modules</a> |</li>
|
||||
<li><a href="../../../index.html">Lorax 19.7.18 documentation</a> »</li>
|
||||
<li><a href="../../../index.html">Lorax 19.7.21 documentation</a> »</li>
|
||||
<li><a href="../../index.html" >Module code</a> »</li>
|
||||
<li><a href="../../pylorax.html" >pylorax</a> »</li>
|
||||
<li><a href="../api.html" >pylorax.api</a> »</li>
|
||||
|
@ -8,7 +8,7 @@
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
|
||||
<title>pylorax.api.config — Lorax 19.7.18 documentation</title>
|
||||
<title>pylorax.api.config — Lorax 19.7.21 documentation</title>
|
||||
|
||||
<link rel="stylesheet" href="../../../_static/default.css" type="text/css" />
|
||||
<link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" />
|
||||
@ -16,7 +16,7 @@
|
||||
<script type="text/javascript">
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT: '../../../',
|
||||
VERSION: '19.7.18',
|
||||
VERSION: '19.7.21',
|
||||
COLLAPSE_INDEX: false,
|
||||
FILE_SUFFIX: '.html',
|
||||
HAS_SOURCE: true
|
||||
@ -25,7 +25,7 @@
|
||||
<script type="text/javascript" src="../../../_static/jquery.js"></script>
|
||||
<script type="text/javascript" src="../../../_static/underscore.js"></script>
|
||||
<script type="text/javascript" src="../../../_static/doctools.js"></script>
|
||||
<link rel="top" title="Lorax 19.7.18 documentation" href="../../../index.html" />
|
||||
<link rel="top" title="Lorax 19.7.21 documentation" href="../../../index.html" />
|
||||
<link rel="up" title="pylorax.api" href="../api.html" />
|
||||
</head>
|
||||
<body>
|
||||
@ -38,7 +38,7 @@
|
||||
<li class="right" >
|
||||
<a href="../../../py-modindex.html" title="Python Module Index"
|
||||
>modules</a> |</li>
|
||||
<li><a href="../../../index.html">Lorax 19.7.18 documentation</a> »</li>
|
||||
<li><a href="../../../index.html">Lorax 19.7.21 documentation</a> »</li>
|
||||
<li><a href="../../index.html" >Module code</a> »</li>
|
||||
<li><a href="../../pylorax.html" >pylorax</a> »</li>
|
||||
<li><a href="../api.html" accesskey="U">pylorax.api</a> »</li>
|
||||
@ -197,7 +197,7 @@
|
||||
<li class="right" >
|
||||
<a href="../../../py-modindex.html" title="Python Module Index"
|
||||
>modules</a> |</li>
|
||||
<li><a href="../../../index.html">Lorax 19.7.18 documentation</a> »</li>
|
||||
<li><a href="../../../index.html">Lorax 19.7.21 documentation</a> »</li>
|
||||
<li><a href="../../index.html" >Module code</a> »</li>
|
||||
<li><a href="../../pylorax.html" >pylorax</a> »</li>
|
||||
<li><a href="../api.html" >pylorax.api</a> »</li>
|
||||
|
@ -8,7 +8,7 @@
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
|
||||
<title>pylorax.api.crossdomain — Lorax 19.7.18 documentation</title>
|
||||
<title>pylorax.api.crossdomain — Lorax 19.7.21 documentation</title>
|
||||
|
||||
<link rel="stylesheet" href="../../../_static/default.css" type="text/css" />
|
||||
<link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" />
|
||||
@ -16,7 +16,7 @@
|
||||
<script type="text/javascript">
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT: '../../../',
|
||||
VERSION: '19.7.18',
|
||||
VERSION: '19.7.21',
|
||||
COLLAPSE_INDEX: false,
|
||||
FILE_SUFFIX: '.html',
|
||||
HAS_SOURCE: true
|
||||
@ -25,7 +25,7 @@
|
||||
<script type="text/javascript" src="../../../_static/jquery.js"></script>
|
||||
<script type="text/javascript" src="../../../_static/underscore.js"></script>
|
||||
<script type="text/javascript" src="../../../_static/doctools.js"></script>
|
||||
<link rel="top" title="Lorax 19.7.18 documentation" href="../../../index.html" />
|
||||
<link rel="top" title="Lorax 19.7.21 documentation" href="../../../index.html" />
|
||||
<link rel="up" title="pylorax.api" href="../api.html" />
|
||||
</head>
|
||||
<body>
|
||||
@ -38,7 +38,7 @@
|
||||
<li class="right" >
|
||||
<a href="../../../py-modindex.html" title="Python Module Index"
|
||||
>modules</a> |</li>
|
||||
<li><a href="../../../index.html">Lorax 19.7.18 documentation</a> »</li>
|
||||
<li><a href="../../../index.html">Lorax 19.7.21 documentation</a> »</li>
|
||||
<li><a href="../../index.html" >Module code</a> »</li>
|
||||
<li><a href="../../pylorax.html" >pylorax</a> »</li>
|
||||
<li><a href="../api.html" accesskey="U">pylorax.api</a> »</li>
|
||||
@ -148,7 +148,7 @@
|
||||
<li class="right" >
|
||||
<a href="../../../py-modindex.html" title="Python Module Index"
|
||||
>modules</a> |</li>
|
||||
<li><a href="../../../index.html">Lorax 19.7.18 documentation</a> »</li>
|
||||
<li><a href="../../../index.html">Lorax 19.7.21 documentation</a> »</li>
|
||||
<li><a href="../../index.html" >Module code</a> »</li>
|
||||
<li><a href="../../pylorax.html" >pylorax</a> »</li>
|
||||
<li><a href="../api.html" >pylorax.api</a> »</li>
|
||||
|
@ -8,7 +8,7 @@
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
|
||||
<title>pylorax.api.projects — Lorax 19.7.18 documentation</title>
|
||||
<title>pylorax.api.projects — Lorax 19.7.21 documentation</title>
|
||||
|
||||
<link rel="stylesheet" href="../../../_static/default.css" type="text/css" />
|
||||
<link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" />
|
||||
@ -16,7 +16,7 @@
|
||||
<script type="text/javascript">
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT: '../../../',
|
||||
VERSION: '19.7.18',
|
||||
VERSION: '19.7.21',
|
||||
COLLAPSE_INDEX: false,
|
||||
FILE_SUFFIX: '.html',
|
||||
HAS_SOURCE: true
|
||||
@ -25,7 +25,7 @@
|
||||
<script type="text/javascript" src="../../../_static/jquery.js"></script>
|
||||
<script type="text/javascript" src="../../../_static/underscore.js"></script>
|
||||
<script type="text/javascript" src="../../../_static/doctools.js"></script>
|
||||
<link rel="top" title="Lorax 19.7.18 documentation" href="../../../index.html" />
|
||||
<link rel="top" title="Lorax 19.7.21 documentation" href="../../../index.html" />
|
||||
<link rel="up" title="pylorax.api" href="../api.html" />
|
||||
</head>
|
||||
<body>
|
||||
@ -38,7 +38,7 @@
|
||||
<li class="right" >
|
||||
<a href="../../../py-modindex.html" title="Python Module Index"
|
||||
>modules</a> |</li>
|
||||
<li><a href="../../../index.html">Lorax 19.7.18 documentation</a> »</li>
|
||||
<li><a href="../../../index.html">Lorax 19.7.21 documentation</a> »</li>
|
||||
<li><a href="../../index.html" >Module code</a> »</li>
|
||||
<li><a href="../../pylorax.html" >pylorax</a> »</li>
|
||||
<li><a href="../api.html" accesskey="U">pylorax.api</a> »</li>
|
||||
@ -242,13 +242,15 @@
|
||||
<span class="k">return</span> <span class="nb">sorted</span><span class="p">(</span><span class="nb">map</span><span class="p">(</span><span class="n">yaps_to_project_info</span><span class="p">,</span> <span class="n">ybl</span><span class="o">.</span><span class="n">available</span><span class="p">),</span> <span class="n">key</span><span class="o">=</span><span class="k">lambda</span> <span class="n">p</span><span class="p">:</span> <span class="n">p</span><span class="p">[</span><span class="s">"name"</span><span class="p">]</span><span class="o">.</span><span class="n">lower</span><span class="p">())</span>
|
||||
|
||||
</div>
|
||||
<div class="viewcode-block" id="projects_depsolve"><a class="viewcode-back" href="../../../pylorax.api.html#pylorax.api.projects.projects_depsolve">[docs]</a><span class="k">def</span> <span class="nf">projects_depsolve</span><span class="p">(</span><span class="n">yb</span><span class="p">,</span> <span class="n">projects</span><span class="p">):</span>
|
||||
<div class="viewcode-block" id="projects_depsolve"><a class="viewcode-back" href="../../../pylorax.api.html#pylorax.api.projects.projects_depsolve">[docs]</a><span class="k">def</span> <span class="nf">projects_depsolve</span><span class="p">(</span><span class="n">yb</span><span class="p">,</span> <span class="n">projects</span><span class="p">,</span> <span class="n">groups</span><span class="p">):</span>
|
||||
<span class="sd">"""Return the dependencies for a list of projects</span>
|
||||
|
||||
<span class="sd"> :param yb: yum base object</span>
|
||||
<span class="sd"> :type yb: YumBase</span>
|
||||
<span class="sd"> :param projects: The projects and version globs to find the dependencies for</span>
|
||||
<span class="sd"> :type projects: List of tuples</span>
|
||||
<span class="sd"> :param groups: The groups to include in dependency solving</span>
|
||||
<span class="sd"> :type groups: List of str</span>
|
||||
<span class="sd"> :returns: NEVRA's of the project and its dependencies</span>
|
||||
<span class="sd"> :rtype: list of dicts</span>
|
||||
<span class="sd"> :raises: ProjectsError if there was a problem installing something</span>
|
||||
@ -256,10 +258,23 @@
|
||||
<span class="k">try</span><span class="p">:</span>
|
||||
<span class="c"># This resets the transaction</span>
|
||||
<span class="n">yb</span><span class="o">.</span><span class="n">closeRpmDB</span><span class="p">()</span>
|
||||
<span class="n">install_errors</span> <span class="o">=</span> <span class="p">[]</span>
|
||||
<span class="k">for</span> <span class="n">name</span> <span class="ow">in</span> <span class="n">groups</span><span class="p">:</span>
|
||||
<span class="n">yb</span><span class="o">.</span><span class="n">selectGroup</span><span class="p">(</span><span class="n">name</span><span class="p">,</span> <span class="p">[</span><span class="s">"mandatory"</span><span class="p">,</span> <span class="s">"default"</span><span class="p">])</span>
|
||||
|
||||
<span class="k">for</span> <span class="n">name</span><span class="p">,</span> <span class="n">version</span> <span class="ow">in</span> <span class="n">projects</span><span class="p">:</span>
|
||||
<span class="k">if</span> <span class="ow">not</span> <span class="n">version</span><span class="p">:</span>
|
||||
<span class="n">version</span> <span class="o">=</span> <span class="s">"*"</span>
|
||||
<span class="n">yb</span><span class="o">.</span><span class="n">install</span><span class="p">(</span><span class="n">pattern</span><span class="o">=</span><span class="s">"</span><span class="si">%s</span><span class="s">-</span><span class="si">%s</span><span class="s">"</span> <span class="o">%</span> <span class="p">(</span><span class="n">name</span><span class="p">,</span> <span class="n">version</span><span class="p">))</span>
|
||||
<span class="n">pattern</span> <span class="o">=</span> <span class="s">"</span><span class="si">%s</span><span class="s">-</span><span class="si">%s</span><span class="s">"</span> <span class="o">%</span> <span class="p">(</span><span class="n">name</span><span class="p">,</span> <span class="n">version</span><span class="p">)</span>
|
||||
<span class="k">try</span><span class="p">:</span>
|
||||
<span class="n">yb</span><span class="o">.</span><span class="n">install</span><span class="p">(</span><span class="n">pattern</span><span class="o">=</span><span class="n">pattern</span><span class="p">)</span>
|
||||
<span class="k">except</span> <span class="n">YumBaseError</span> <span class="k">as</span> <span class="n">e</span><span class="p">:</span>
|
||||
<span class="n">install_errors</span><span class="o">.</span><span class="n">append</span><span class="p">((</span><span class="n">pattern</span><span class="p">,</span> <span class="nb">str</span><span class="p">(</span><span class="n">e</span><span class="p">)))</span>
|
||||
|
||||
<span class="c"># Were there problems installing these packages?</span>
|
||||
<span class="k">if</span> <span class="n">install_errors</span><span class="p">:</span>
|
||||
<span class="k">raise</span> <span class="n">ProjectsError</span><span class="p">(</span><span class="s">"The following package(s) had problems: </span><span class="si">%s</span><span class="s">"</span> <span class="o">%</span> <span class="s">","</span><span class="o">.</span><span class="n">join</span><span class="p">([</span><span class="s">"</span><span class="si">%s</span><span class="s"> (</span><span class="si">%s</span><span class="s">)"</span> <span class="o">%</span> <span class="p">(</span><span class="n">pattern</span><span class="p">,</span> <span class="n">err</span><span class="p">)</span> <span class="k">for</span> <span class="n">pattern</span><span class="p">,</span> <span class="n">err</span> <span class="ow">in</span> <span class="n">install_errors</span><span class="p">]))</span>
|
||||
|
||||
<span class="p">(</span><span class="n">rc</span><span class="p">,</span> <span class="n">msg</span><span class="p">)</span> <span class="o">=</span> <span class="n">yb</span><span class="o">.</span><span class="n">buildTransaction</span><span class="p">()</span>
|
||||
<span class="k">if</span> <span class="n">rc</span> <span class="ow">not</span> <span class="ow">in</span> <span class="p">[</span><span class="mi">0</span><span class="p">,</span> <span class="mi">1</span><span class="p">,</span> <span class="mi">2</span><span class="p">]:</span>
|
||||
<span class="k">raise</span> <span class="n">ProjectsError</span><span class="p">(</span><span class="s">"There was a problem depsolving </span><span class="si">%s</span><span class="s">: </span><span class="si">%s</span><span class="s">"</span> <span class="o">%</span> <span class="p">(</span><span class="n">projects</span><span class="p">,</span> <span class="n">msg</span><span class="p">))</span>
|
||||
@ -291,13 +306,15 @@
|
||||
<span class="n">installed_size</span> <span class="o">+=</span> <span class="n">p</span><span class="o">.</span><span class="n">po</span><span class="o">.</span><span class="n">installedsize</span>
|
||||
<span class="k">return</span> <span class="n">installed_size</span>
|
||||
</div>
|
||||
<div class="viewcode-block" id="projects_depsolve_with_size"><a class="viewcode-back" href="../../../pylorax.api.html#pylorax.api.projects.projects_depsolve_with_size">[docs]</a><span class="k">def</span> <span class="nf">projects_depsolve_with_size</span><span class="p">(</span><span class="n">yb</span><span class="p">,</span> <span class="n">projects</span><span class="p">,</span> <span class="n">with_core</span><span class="o">=</span><span class="bp">True</span><span class="p">):</span>
|
||||
<div class="viewcode-block" id="projects_depsolve_with_size"><a class="viewcode-back" href="../../../pylorax.api.html#pylorax.api.projects.projects_depsolve_with_size">[docs]</a><span class="k">def</span> <span class="nf">projects_depsolve_with_size</span><span class="p">(</span><span class="n">yb</span><span class="p">,</span> <span class="n">projects</span><span class="p">,</span> <span class="n">groups</span><span class="p">,</span> <span class="n">with_core</span><span class="o">=</span><span class="bp">True</span><span class="p">):</span>
|
||||
<span class="sd">"""Return the dependencies and installed size for a list of projects</span>
|
||||
|
||||
<span class="sd"> :param yb: yum base object</span>
|
||||
<span class="sd"> :type yb: YumBase</span>
|
||||
<span class="sd"> :param projects: The projects and version globs to find the dependencies for</span>
|
||||
<span class="sd"> :type projects: List of tuples</span>
|
||||
<span class="sd"> :param groups: The groups to include in dependency solving</span>
|
||||
<span class="sd"> :type groups: List of str</span>
|
||||
<span class="sd"> :returns: installed size and a list of NEVRA's of the project and its dependencies</span>
|
||||
<span class="sd"> :rtype: tuple of (int, list of dicts)</span>
|
||||
<span class="sd"> :raises: ProjectsError if there was a problem installing something</span>
|
||||
@ -305,10 +322,23 @@
|
||||
<span class="k">try</span><span class="p">:</span>
|
||||
<span class="c"># This resets the transaction</span>
|
||||
<span class="n">yb</span><span class="o">.</span><span class="n">closeRpmDB</span><span class="p">()</span>
|
||||
<span class="n">install_errors</span> <span class="o">=</span> <span class="p">[]</span>
|
||||
<span class="k">for</span> <span class="n">name</span> <span class="ow">in</span> <span class="n">groups</span><span class="p">:</span>
|
||||
<span class="n">yb</span><span class="o">.</span><span class="n">selectGroup</span><span class="p">(</span><span class="n">name</span><span class="p">,</span> <span class="p">[</span><span class="s">"mandatory"</span><span class="p">,</span> <span class="s">"default"</span><span class="p">])</span>
|
||||
|
||||
<span class="k">for</span> <span class="n">name</span><span class="p">,</span> <span class="n">version</span> <span class="ow">in</span> <span class="n">projects</span><span class="p">:</span>
|
||||
<span class="k">if</span> <span class="ow">not</span> <span class="n">version</span><span class="p">:</span>
|
||||
<span class="n">version</span> <span class="o">=</span> <span class="s">"*"</span>
|
||||
<span class="n">yb</span><span class="o">.</span><span class="n">install</span><span class="p">(</span><span class="n">pattern</span><span class="o">=</span><span class="s">"</span><span class="si">%s</span><span class="s">-</span><span class="si">%s</span><span class="s">"</span> <span class="o">%</span> <span class="p">(</span><span class="n">name</span><span class="p">,</span> <span class="n">version</span><span class="p">))</span>
|
||||
<span class="n">pattern</span> <span class="o">=</span> <span class="s">"</span><span class="si">%s</span><span class="s">-</span><span class="si">%s</span><span class="s">"</span> <span class="o">%</span> <span class="p">(</span><span class="n">name</span><span class="p">,</span> <span class="n">version</span><span class="p">)</span>
|
||||
<span class="k">try</span><span class="p">:</span>
|
||||
<span class="n">yb</span><span class="o">.</span><span class="n">install</span><span class="p">(</span><span class="n">pattern</span><span class="o">=</span><span class="n">pattern</span><span class="p">)</span>
|
||||
<span class="k">except</span> <span class="n">YumBaseError</span> <span class="k">as</span> <span class="n">e</span><span class="p">:</span>
|
||||
<span class="n">install_errors</span><span class="o">.</span><span class="n">append</span><span class="p">((</span><span class="n">pattern</span><span class="p">,</span> <span class="nb">str</span><span class="p">(</span><span class="n">e</span><span class="p">)))</span>
|
||||
|
||||
<span class="c"># Were there problems installing these packages?</span>
|
||||
<span class="k">if</span> <span class="n">install_errors</span><span class="p">:</span>
|
||||
<span class="k">raise</span> <span class="n">ProjectsError</span><span class="p">(</span><span class="s">"The following package(s) had problems: </span><span class="si">%s</span><span class="s">"</span> <span class="o">%</span> <span class="s">","</span><span class="o">.</span><span class="n">join</span><span class="p">([</span><span class="s">"</span><span class="si">%s</span><span class="s"> (</span><span class="si">%s</span><span class="s">)"</span> <span class="o">%</span> <span class="p">(</span><span class="n">pattern</span><span class="p">,</span> <span class="n">err</span><span class="p">)</span> <span class="k">for</span> <span class="n">pattern</span><span class="p">,</span> <span class="n">err</span> <span class="ow">in</span> <span class="n">install_errors</span><span class="p">]))</span>
|
||||
|
||||
<span class="k">if</span> <span class="n">with_core</span><span class="p">:</span>
|
||||
<span class="n">yb</span><span class="o">.</span><span class="n">selectGroup</span><span class="p">(</span><span class="s">"core"</span><span class="p">,</span> <span class="n">group_package_types</span><span class="o">=</span><span class="p">[</span><span class="s">'mandatory'</span><span class="p">,</span> <span class="s">'default'</span><span class="p">,</span> <span class="s">'optional'</span><span class="p">])</span>
|
||||
<span class="p">(</span><span class="n">rc</span><span class="p">,</span> <span class="n">msg</span><span class="p">)</span> <span class="o">=</span> <span class="n">yb</span><span class="o">.</span><span class="n">buildTransaction</span><span class="p">()</span>
|
||||
@ -368,7 +398,7 @@
|
||||
<span class="n">modules</span> <span class="o">=</span> <span class="nb">sorted</span><span class="p">(</span><span class="nb">map</span><span class="p">(</span><span class="n">yaps_to_project</span><span class="p">,</span> <span class="n">ybl</span><span class="o">.</span><span class="n">available</span><span class="p">),</span> <span class="n">key</span><span class="o">=</span><span class="k">lambda</span> <span class="n">p</span><span class="p">:</span> <span class="n">p</span><span class="p">[</span><span class="s">"name"</span><span class="p">]</span><span class="o">.</span><span class="n">lower</span><span class="p">())</span>
|
||||
<span class="c"># Add the dependency info to each one</span>
|
||||
<span class="k">for</span> <span class="n">module</span> <span class="ow">in</span> <span class="n">modules</span><span class="p">:</span>
|
||||
<span class="n">module</span><span class="p">[</span><span class="s">"dependencies"</span><span class="p">]</span> <span class="o">=</span> <span class="n">projects_depsolve</span><span class="p">(</span><span class="n">yb</span><span class="p">,</span> <span class="p">[(</span><span class="n">module</span><span class="p">[</span><span class="s">"name"</span><span class="p">],</span> <span class="s">"*"</span><span class="p">)])</span>
|
||||
<span class="n">module</span><span class="p">[</span><span class="s">"dependencies"</span><span class="p">]</span> <span class="o">=</span> <span class="n">projects_depsolve</span><span class="p">(</span><span class="n">yb</span><span class="p">,</span> <span class="p">[(</span><span class="n">module</span><span class="p">[</span><span class="s">"name"</span><span class="p">],</span> <span class="s">"*"</span><span class="p">)],</span> <span class="p">[])</span>
|
||||
|
||||
<span class="k">return</span> <span class="n">modules</span>
|
||||
</div>
|
||||
@ -618,7 +648,7 @@
|
||||
<li class="right" >
|
||||
<a href="../../../py-modindex.html" title="Python Module Index"
|
||||
>modules</a> |</li>
|
||||
<li><a href="../../../index.html">Lorax 19.7.18 documentation</a> »</li>
|
||||
<li><a href="../../../index.html">Lorax 19.7.21 documentation</a> »</li>
|
||||
<li><a href="../../index.html" >Module code</a> »</li>
|
||||
<li><a href="../../pylorax.html" >pylorax</a> »</li>
|
||||
<li><a href="../api.html" >pylorax.api</a> »</li>
|
||||
|
@ -8,7 +8,7 @@
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
|
||||
<title>pylorax.api.queue — Lorax 19.7.18 documentation</title>
|
||||
<title>pylorax.api.queue — Lorax 19.7.21 documentation</title>
|
||||
|
||||
<link rel="stylesheet" href="../../../_static/default.css" type="text/css" />
|
||||
<link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" />
|
||||
@ -16,7 +16,7 @@
|
||||
<script type="text/javascript">
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT: '../../../',
|
||||
VERSION: '19.7.18',
|
||||
VERSION: '19.7.21',
|
||||
COLLAPSE_INDEX: false,
|
||||
FILE_SUFFIX: '.html',
|
||||
HAS_SOURCE: true
|
||||
@ -25,7 +25,7 @@
|
||||
<script type="text/javascript" src="../../../_static/jquery.js"></script>
|
||||
<script type="text/javascript" src="../../../_static/underscore.js"></script>
|
||||
<script type="text/javascript" src="../../../_static/doctools.js"></script>
|
||||
<link rel="top" title="Lorax 19.7.18 documentation" href="../../../index.html" />
|
||||
<link rel="top" title="Lorax 19.7.21 documentation" href="../../../index.html" />
|
||||
<link rel="up" title="pylorax.api" href="../api.html" />
|
||||
</head>
|
||||
<body>
|
||||
@ -38,7 +38,7 @@
|
||||
<li class="right" >
|
||||
<a href="../../../py-modindex.html" title="Python Module Index"
|
||||
>modules</a> |</li>
|
||||
<li><a href="../../../index.html">Lorax 19.7.18 documentation</a> »</li>
|
||||
<li><a href="../../../index.html">Lorax 19.7.21 documentation</a> »</li>
|
||||
<li><a href="../../index.html" >Module code</a> »</li>
|
||||
<li><a href="../../pylorax.html" >pylorax</a> »</li>
|
||||
<li><a href="../api.html" accesskey="U">pylorax.api</a> »</li>
|
||||
@ -83,6 +83,7 @@
|
||||
|
||||
<span class="kn">from</span> <span class="nn">pylorax.api.compose</span> <span class="kn">import</span> <span class="n">move_compose_results</span>
|
||||
<span class="kn">from</span> <span class="nn">pylorax.api.recipes</span> <span class="kn">import</span> <span class="n">recipe_from_file</span>
|
||||
<span class="kn">from</span> <span class="nn">pylorax.api.timestamp</span> <span class="kn">import</span> <span class="n">TS_CREATED</span><span class="p">,</span> <span class="n">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="kn">import</span> <span class="n">DataHolder</span>
|
||||
<span class="kn">from</span> <span class="nn">pylorax.creator</span> <span class="kn">import</span> <span class="n">run_creator</span>
|
||||
<span class="kn">from</span> <span class="nn">pylorax.sysutils</span> <span class="kn">import</span> <span class="n">joinpaths</span>
|
||||
@ -159,6 +160,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="s">"Finished building </span><span class="si">%s</span><span class="s">, results are in </span><span class="si">%s</span><span class="s">"</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="s">"STATUS"</span><span class="p">),</span> <span class="s">"w"</span><span class="p">)</span><span class="o">.</span><span class="n">write</span><span class="p">(</span><span class="s">"FINISHED</span><span class="se">\n</span><span class="s">"</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="s">"traceback: </span><span class="si">%s</span><span class="s">"</span><span class="p">,</span> <span class="n">traceback</span><span class="o">.</span><span class="n">format_exc</span><span class="p">())</span>
|
||||
@ -166,6 +168,7 @@
|
||||
<span class="c"># TODO - Write the error message to an ERROR-LOG file to include with the status</span>
|
||||
<span class="c"># 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="s">"STATUS"</span><span class="p">),</span> <span class="s">"w"</span><span class="p">)</span><span class="o">.</span><span class="n">write</span><span class="p">(</span><span class="s">"FAILED</span><span class="se">\n</span><span class="s">"</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>
|
||||
@ -243,6 +246,7 @@
|
||||
<span class="n">log</span><span class="o">.</span><span class="n">debug</span><span class="p">(</span><span class="s">"cfg = </span><span class="si">%s</span><span class="s">"</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="s">"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="c"># 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>
|
||||
@ -302,15 +306,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="s">"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="s">"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="s">"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>
|
||||
@ -321,9 +331,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="s">"id"</span><span class="p">:</span> <span class="n">build_id</span><span class="p">,</span>
|
||||
<span class="s">"queue_status"</span><span class="p">:</span> <span class="n">status</span><span class="p">,</span>
|
||||
<span class="s">"timestamp"</span><span class="p">:</span> <span class="n">mtime</span><span class="p">,</span>
|
||||
<span class="s">"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="s">"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="s">"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="s">"compose_type"</span><span class="p">:</span> <span class="n">compose_type</span><span class="p">,</span>
|
||||
<span class="s">"blueprint"</span><span class="p">:</span> <span class="n">blueprint</span><span class="p">[</span><span class="s">"name"</span><span class="p">],</span>
|
||||
<span class="s">"version"</span><span class="p">:</span> <span class="n">blueprint</span><span class="p">[</span><span class="s">"version"</span><span class="p">],</span>
|
||||
@ -491,7 +505,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>
|
||||
|
||||
@ -507,7 +521,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="s">"composer"</span><span class="p">,</span> <span class="s">"lib_dir"</span><span class="p">),</span> <span class="s">"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="s">"</span><span class="si">%s</span><span class="s"> 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="bp">None</span>
|
||||
|
||||
<span class="c"># 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="s">"config.toml"</span><span class="p">)</span>
|
||||
@ -696,7 +710,7 @@
|
||||
<li class="right" >
|
||||
<a href="../../../py-modindex.html" title="Python Module Index"
|
||||
>modules</a> |</li>
|
||||
<li><a href="../../../index.html">Lorax 19.7.18 documentation</a> »</li>
|
||||
<li><a href="../../../index.html">Lorax 19.7.21 documentation</a> »</li>
|
||||
<li><a href="../../index.html" >Module code</a> »</li>
|
||||
<li><a href="../../pylorax.html" >pylorax</a> »</li>
|
||||
<li><a href="../api.html" >pylorax.api</a> »</li>
|
||||
|
@ -8,7 +8,7 @@
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
|
||||
<title>pylorax.api.recipes — Lorax 19.7.18 documentation</title>
|
||||
<title>pylorax.api.recipes — Lorax 19.7.21 documentation</title>
|
||||
|
||||
<link rel="stylesheet" href="../../../_static/default.css" type="text/css" />
|
||||
<link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" />
|
||||
@ -16,7 +16,7 @@
|
||||
<script type="text/javascript">
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT: '../../../',
|
||||
VERSION: '19.7.18',
|
||||
VERSION: '19.7.21',
|
||||
COLLAPSE_INDEX: false,
|
||||
FILE_SUFFIX: '.html',
|
||||
HAS_SOURCE: true
|
||||
@ -25,7 +25,7 @@
|
||||
<script type="text/javascript" src="../../../_static/jquery.js"></script>
|
||||
<script type="text/javascript" src="../../../_static/underscore.js"></script>
|
||||
<script type="text/javascript" src="../../../_static/doctools.js"></script>
|
||||
<link rel="top" title="Lorax 19.7.18 documentation" href="../../../index.html" />
|
||||
<link rel="top" title="Lorax 19.7.21 documentation" href="../../../index.html" />
|
||||
<link rel="up" title="pylorax.api" href="../api.html" />
|
||||
</head>
|
||||
<body>
|
||||
@ -38,7 +38,7 @@
|
||||
<li class="right" >
|
||||
<a href="../../../py-modindex.html" title="Python Module Index"
|
||||
>modules</a> |</li>
|
||||
<li><a href="../../../index.html">Lorax 19.7.18 documentation</a> »</li>
|
||||
<li><a href="../../../index.html">Lorax 19.7.21 documentation</a> »</li>
|
||||
<li><a href="../../index.html" >Module code</a> »</li>
|
||||
<li><a href="../../pylorax.html" >pylorax</a> »</li>
|
||||
<li><a href="../api.html" accesskey="U">pylorax.api</a> »</li>
|
||||
@ -100,21 +100,24 @@
|
||||
<span class="sd"> and adds a .filename property to return the recipe's filename,</span>
|
||||
<span class="sd"> and a .toml() function to return the recipe as a TOML string.</span>
|
||||
<span class="sd"> """</span>
|
||||
<span class="k">def</span> <span class="nf">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">name</span><span class="p">,</span> <span class="n">description</span><span class="p">,</span> <span class="n">version</span><span class="p">,</span> <span class="n">modules</span><span class="p">,</span> <span class="n">packages</span><span class="p">,</span> <span class="n">customizations</span><span class="o">=</span><span class="bp">None</span><span class="p">):</span>
|
||||
<span class="k">def</span> <span class="nf">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">name</span><span class="p">,</span> <span class="n">description</span><span class="p">,</span> <span class="n">version</span><span class="p">,</span> <span class="n">modules</span><span class="p">,</span> <span class="n">packages</span><span class="p">,</span> <span class="n">groups</span><span class="p">,</span> <span class="n">customizations</span><span class="o">=</span><span class="bp">None</span><span class="p">):</span>
|
||||
<span class="c"># Check that version is empty or semver compatible</span>
|
||||
<span class="k">if</span> <span class="n">version</span><span class="p">:</span>
|
||||
<span class="n">semver</span><span class="o">.</span><span class="n">Version</span><span class="p">(</span><span class="n">version</span><span class="p">)</span>
|
||||
|
||||
<span class="c"># Make sure modules and packages are listed by their case-insensitive names</span>
|
||||
<span class="c"># Make sure modules, packages, and groups are listed by their case-insensitive names</span>
|
||||
<span class="k">if</span> <span class="n">modules</span> <span class="ow">is</span> <span class="ow">not</span> <span class="bp">None</span><span class="p">:</span>
|
||||
<span class="n">modules</span> <span class="o">=</span> <span class="nb">sorted</span><span class="p">(</span><span class="n">modules</span><span class="p">,</span> <span class="n">key</span><span class="o">=</span><span class="k">lambda</span> <span class="n">m</span><span class="p">:</span> <span class="n">m</span><span class="p">[</span><span class="s">"name"</span><span class="p">]</span><span class="o">.</span><span class="n">lower</span><span class="p">())</span>
|
||||
<span class="k">if</span> <span class="n">packages</span> <span class="ow">is</span> <span class="ow">not</span> <span class="bp">None</span><span class="p">:</span>
|
||||
<span class="n">packages</span> <span class="o">=</span> <span class="nb">sorted</span><span class="p">(</span><span class="n">packages</span><span class="p">,</span> <span class="n">key</span><span class="o">=</span><span class="k">lambda</span> <span class="n">p</span><span class="p">:</span> <span class="n">p</span><span class="p">[</span><span class="s">"name"</span><span class="p">]</span><span class="o">.</span><span class="n">lower</span><span class="p">())</span>
|
||||
<span class="k">if</span> <span class="n">groups</span> <span class="ow">is</span> <span class="ow">not</span> <span class="bp">None</span><span class="p">:</span>
|
||||
<span class="n">groups</span> <span class="o">=</span> <span class="nb">sorted</span><span class="p">(</span><span class="n">groups</span><span class="p">,</span> <span class="n">key</span><span class="o">=</span><span class="k">lambda</span> <span class="n">g</span><span class="p">:</span> <span class="n">g</span><span class="p">[</span><span class="s">"name"</span><span class="p">]</span><span class="o">.</span><span class="n">lower</span><span class="p">())</span>
|
||||
<span class="nb">dict</span><span class="o">.</span><span class="n">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">name</span><span class="o">=</span><span class="n">name</span><span class="p">,</span>
|
||||
<span class="n">description</span><span class="o">=</span><span class="n">description</span><span class="p">,</span>
|
||||
<span class="n">version</span><span class="o">=</span><span class="n">version</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">packages</span><span class="o">=</span><span class="n">packages</span><span class="p">,</span>
|
||||
<span class="n">groups</span><span class="o">=</span><span class="n">groups</span><span class="p">,</span>
|
||||
<span class="n">customizations</span><span class="o">=</span><span class="n">customizations</span><span class="p">)</span>
|
||||
|
||||
<span class="c"># We don't want customizations=None to show up in the TOML so remove it</span>
|
||||
@ -142,6 +145,11 @@
|
||||
<span class="k">return</span> <span class="p">[(</span><span class="n">m</span><span class="p">[</span><span class="s">"name"</span><span class="p">],</span> <span class="n">m</span><span class="p">[</span><span class="s">"version"</span><span class="p">])</span> <span class="k">for</span> <span class="n">m</span> <span class="ow">in</span> <span class="bp">self</span><span class="p">[</span><span class="s">"modules"</span><span class="p">]</span> <span class="ow">or</span> <span class="p">[]]</span>
|
||||
</div>
|
||||
<span class="nd">@property</span>
|
||||
<div class="viewcode-block" id="Recipe.group_names"><a class="viewcode-back" href="../../../pylorax.api.html#pylorax.api.recipes.Recipe.group_names">[docs]</a> <span class="k">def</span> <span class="nf">group_names</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
|
||||
<span class="sd">"""Return the names of the groups. Groups do not have versions."""</span>
|
||||
<span class="k">return</span> <span class="nb">map</span><span class="p">(</span><span class="k">lambda</span> <span class="n">g</span><span class="p">:</span> <span class="n">g</span><span class="p">[</span><span class="s">"name"</span><span class="p">],</span> <span class="bp">self</span><span class="p">[</span><span class="s">"groups"</span><span class="p">]</span> <span class="ow">or</span> <span class="p">[])</span>
|
||||
</div>
|
||||
<span class="nd">@property</span>
|
||||
<div class="viewcode-block" id="Recipe.filename"><a class="viewcode-back" href="../../../pylorax.api.html#pylorax.api.recipes.Recipe.filename">[docs]</a> <span class="k">def</span> <span class="nf">filename</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
|
||||
<span class="sd">"""Return the Recipe's filename</span>
|
||||
|
||||
@ -197,21 +205,25 @@
|
||||
<span class="sd"> """</span>
|
||||
<span class="n">module_names</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">module_names</span>
|
||||
<span class="n">package_names</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">package_names</span>
|
||||
<span class="n">group_names</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">group_names</span>
|
||||
|
||||
<span class="n">new_modules</span> <span class="o">=</span> <span class="p">[]</span>
|
||||
<span class="n">new_packages</span> <span class="o">=</span> <span class="p">[]</span>
|
||||
<span class="n">new_groups</span> <span class="o">=</span> <span class="p">[]</span>
|
||||
<span class="k">for</span> <span class="n">dep</span> <span class="ow">in</span> <span class="n">deps</span><span class="p">:</span>
|
||||
<span class="k">if</span> <span class="n">dep</span><span class="p">[</span><span class="s">"name"</span><span class="p">]</span> <span class="ow">in</span> <span class="n">package_names</span><span class="p">:</span>
|
||||
<span class="n">new_packages</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">RecipePackage</span><span class="p">(</span><span class="n">dep</span><span class="p">[</span><span class="s">"name"</span><span class="p">],</span> <span class="n">dep_evra</span><span class="p">(</span><span class="n">dep</span><span class="p">)))</span>
|
||||
<span class="k">elif</span> <span class="n">dep</span><span class="p">[</span><span class="s">"name"</span><span class="p">]</span> <span class="ow">in</span> <span class="n">module_names</span><span class="p">:</span>
|
||||
<span class="n">new_modules</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">RecipeModule</span><span class="p">(</span><span class="n">dep</span><span class="p">[</span><span class="s">"name"</span><span class="p">],</span> <span class="n">dep_evra</span><span class="p">(</span><span class="n">dep</span><span class="p">)))</span>
|
||||
<span class="k">elif</span> <span class="n">dep</span><span class="p">[</span><span class="s">"name"</span><span class="p">]</span> <span class="ow">in</span> <span class="n">group_names</span><span class="p">:</span>
|
||||
<span class="n">new_groups</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">RecipeGroup</span><span class="p">(</span><span class="n">dep</span><span class="p">[</span><span class="s">"name"</span><span class="p">]))</span>
|
||||
<span class="k">if</span> <span class="s">"customizations"</span> <span class="ow">in</span> <span class="bp">self</span><span class="p">:</span>
|
||||
<span class="n">customizations</span> <span class="o">=</span> <span class="bp">self</span><span class="p">[</span><span class="s">"customizations"</span><span class="p">]</span>
|
||||
<span class="k">else</span><span class="p">:</span>
|
||||
<span class="n">customizations</span> <span class="o">=</span> <span class="bp">None</span>
|
||||
|
||||
<span class="k">return</span> <span class="n">Recipe</span><span class="p">(</span><span class="bp">self</span><span class="p">[</span><span class="s">"name"</span><span class="p">],</span> <span class="bp">self</span><span class="p">[</span><span class="s">"description"</span><span class="p">],</span> <span class="bp">self</span><span class="p">[</span><span class="s">"version"</span><span class="p">],</span>
|
||||
<span class="n">new_modules</span><span class="p">,</span> <span class="n">new_packages</span><span class="p">,</span> <span class="n">customizations</span><span class="p">)</span>
|
||||
<span class="n">new_modules</span><span class="p">,</span> <span class="n">new_packages</span><span class="p">,</span> <span class="n">new_groups</span><span class="p">,</span> <span class="n">customizations</span><span class="p">)</span>
|
||||
</div></div>
|
||||
<div class="viewcode-block" id="RecipeModule"><a class="viewcode-back" href="../../../pylorax.api.html#pylorax.api.recipes.RecipeModule">[docs]</a><span class="k">class</span> <span class="nc">RecipeModule</span><span class="p">(</span><span class="nb">dict</span><span class="p">):</span>
|
||||
<span class="k">def</span> <span class="nf">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">name</span><span class="p">,</span> <span class="n">version</span><span class="p">):</span>
|
||||
@ -220,6 +232,10 @@
|
||||
<div class="viewcode-block" id="RecipePackage"><a class="viewcode-back" href="../../../pylorax.api.html#pylorax.api.recipes.RecipePackage">[docs]</a><span class="k">class</span> <span class="nc">RecipePackage</span><span class="p">(</span><span class="n">RecipeModule</span><span class="p">):</span>
|
||||
<span class="k">pass</span>
|
||||
</div>
|
||||
<div class="viewcode-block" id="RecipeGroup"><a class="viewcode-back" href="../../../pylorax.api.html#pylorax.api.recipes.RecipeGroup">[docs]</a><span class="k">class</span> <span class="nc">RecipeGroup</span><span class="p">(</span><span class="nb">dict</span><span class="p">):</span>
|
||||
<span class="k">def</span> <span class="nf">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">name</span><span class="p">):</span>
|
||||
<span class="nb">dict</span><span class="o">.</span><span class="n">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">name</span><span class="o">=</span><span class="n">name</span><span class="p">)</span>
|
||||
</div>
|
||||
<div class="viewcode-block" id="recipe_from_file"><a class="viewcode-back" href="../../../pylorax.api.html#pylorax.api.recipes.recipe_from_file">[docs]</a><span class="k">def</span> <span class="nf">recipe_from_file</span><span class="p">(</span><span class="n">recipe_path</span><span class="p">):</span>
|
||||
<span class="sd">"""Return a recipe file as a Recipe object</span>
|
||||
|
||||
@ -263,6 +279,10 @@
|
||||
<span class="n">packages</span> <span class="o">=</span> <span class="p">[</span><span class="n">RecipePackage</span><span class="p">(</span><span class="n">p</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s">"name"</span><span class="p">),</span> <span class="n">p</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s">"version"</span><span class="p">))</span> <span class="k">for</span> <span class="n">p</span> <span class="ow">in</span> <span class="n">recipe_dict</span><span class="p">[</span><span class="s">"packages"</span><span class="p">]]</span>
|
||||
<span class="k">else</span><span class="p">:</span>
|
||||
<span class="n">packages</span> <span class="o">=</span> <span class="p">[]</span>
|
||||
<span class="k">if</span> <span class="n">recipe_dict</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s">"groups"</span><span class="p">):</span>
|
||||
<span class="n">groups</span> <span class="o">=</span> <span class="p">[</span><span class="n">RecipeGroup</span><span class="p">(</span><span class="n">g</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s">"name"</span><span class="p">))</span> <span class="k">for</span> <span class="n">g</span> <span class="ow">in</span> <span class="n">recipe_dict</span><span class="p">[</span><span class="s">"groups"</span><span class="p">]]</span>
|
||||
<span class="k">else</span><span class="p">:</span>
|
||||
<span class="n">groups</span> <span class="o">=</span> <span class="p">[]</span>
|
||||
<span class="n">name</span> <span class="o">=</span> <span class="n">recipe_dict</span><span class="p">[</span><span class="s">"name"</span><span class="p">]</span>
|
||||
<span class="n">description</span> <span class="o">=</span> <span class="n">recipe_dict</span><span class="p">[</span><span class="s">"description"</span><span class="p">]</span>
|
||||
<span class="n">version</span> <span class="o">=</span> <span class="n">recipe_dict</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s">"version"</span><span class="p">,</span> <span class="bp">None</span><span class="p">)</span>
|
||||
@ -270,7 +290,7 @@
|
||||
<span class="k">except</span> <span class="ne">KeyError</span> <span class="k">as</span> <span class="n">e</span><span class="p">:</span>
|
||||
<span class="k">raise</span> <span class="n">RecipeError</span><span class="p">(</span><span class="s">"There was a problem parsing the recipe: </span><span class="si">%s</span><span class="s">"</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">Recipe</span><span class="p">(</span><span class="n">name</span><span class="p">,</span> <span class="n">description</span><span class="p">,</span> <span class="n">version</span><span class="p">,</span> <span class="n">modules</span><span class="p">,</span> <span class="n">packages</span><span class="p">,</span> <span class="n">customizations</span><span class="p">)</span>
|
||||
<span class="k">return</span> <span class="n">Recipe</span><span class="p">(</span><span class="n">name</span><span class="p">,</span> <span class="n">description</span><span class="p">,</span> <span class="n">version</span><span class="p">,</span> <span class="n">modules</span><span class="p">,</span> <span class="n">packages</span><span class="p">,</span> <span class="n">groups</span><span class="p">,</span> <span class="n">customizations</span><span class="p">)</span>
|
||||
</div>
|
||||
<div class="viewcode-block" id="gfile"><a class="viewcode-back" href="../../../pylorax.api.html#pylorax.api.recipes.gfile">[docs]</a><span class="k">def</span> <span class="nf">gfile</span><span class="p">(</span><span class="n">path</span><span class="p">):</span>
|
||||
<span class="sd">"""Convert a string path to GFile for use with Git"""</span>
|
||||
@ -950,6 +970,7 @@
|
||||
|
||||
<span class="n">diffs</span><span class="o">.</span><span class="n">extend</span><span class="p">(</span><span class="n">diff_items</span><span class="p">(</span><span class="s">"Module"</span><span class="p">,</span> <span class="n">old_recipe</span><span class="p">[</span><span class="s">"modules"</span><span class="p">],</span> <span class="n">new_recipe</span><span class="p">[</span><span class="s">"modules"</span><span class="p">]))</span>
|
||||
<span class="n">diffs</span><span class="o">.</span><span class="n">extend</span><span class="p">(</span><span class="n">diff_items</span><span class="p">(</span><span class="s">"Package"</span><span class="p">,</span> <span class="n">old_recipe</span><span class="p">[</span><span class="s">"packages"</span><span class="p">],</span> <span class="n">new_recipe</span><span class="p">[</span><span class="s">"packages"</span><span class="p">]))</span>
|
||||
<span class="n">diffs</span><span class="o">.</span><span class="n">extend</span><span class="p">(</span><span class="n">diff_items</span><span class="p">(</span><span class="s">"Group"</span><span class="p">,</span> <span class="n">old_recipe</span><span class="p">[</span><span class="s">"groups"</span><span class="p">],</span> <span class="n">new_recipe</span><span class="p">[</span><span class="s">"groups"</span><span class="p">]))</span>
|
||||
|
||||
<span class="k">return</span> <span class="n">diffs</span></div>
|
||||
</pre></div>
|
||||
@ -985,7 +1006,7 @@
|
||||
<li class="right" >
|
||||
<a href="../../../py-modindex.html" title="Python Module Index"
|
||||
>modules</a> |</li>
|
||||
<li><a href="../../../index.html">Lorax 19.7.18 documentation</a> »</li>
|
||||
<li><a href="../../../index.html">Lorax 19.7.21 documentation</a> »</li>
|
||||
<li><a href="../../index.html" >Module code</a> »</li>
|
||||
<li><a href="../../pylorax.html" >pylorax</a> »</li>
|
||||
<li><a href="../api.html" >pylorax.api</a> »</li>
|
||||
|
@ -8,7 +8,7 @@
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
|
||||
<title>pylorax.api.server — Lorax 19.7.18 documentation</title>
|
||||
<title>pylorax.api.server — Lorax 19.7.21 documentation</title>
|
||||
|
||||
<link rel="stylesheet" href="../../../_static/default.css" type="text/css" />
|
||||
<link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" />
|
||||
@ -16,7 +16,7 @@
|
||||
<script type="text/javascript">
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT: '../../../',
|
||||
VERSION: '19.7.18',
|
||||
VERSION: '19.7.21',
|
||||
COLLAPSE_INDEX: false,
|
||||
FILE_SUFFIX: '.html',
|
||||
HAS_SOURCE: true
|
||||
@ -25,7 +25,7 @@
|
||||
<script type="text/javascript" src="../../../_static/jquery.js"></script>
|
||||
<script type="text/javascript" src="../../../_static/underscore.js"></script>
|
||||
<script type="text/javascript" src="../../../_static/doctools.js"></script>
|
||||
<link rel="top" title="Lorax 19.7.18 documentation" href="../../../index.html" />
|
||||
<link rel="top" title="Lorax 19.7.21 documentation" href="../../../index.html" />
|
||||
<link rel="up" title="pylorax.api" href="../api.html" />
|
||||
</head>
|
||||
<body>
|
||||
@ -38,7 +38,7 @@
|
||||
<li class="right" >
|
||||
<a href="../../../py-modindex.html" title="Python Module Index"
|
||||
>modules</a> |</li>
|
||||
<li><a href="../../../index.html">Lorax 19.7.18 documentation</a> »</li>
|
||||
<li><a href="../../../index.html">Lorax 19.7.21 documentation</a> »</li>
|
||||
<li><a href="../../index.html" >Module code</a> »</li>
|
||||
<li><a href="../../pylorax.html" >pylorax</a> »</li>
|
||||
<li><a href="../api.html" accesskey="U">pylorax.api</a> »</li>
|
||||
@ -118,14 +118,20 @@
|
||||
<span class="sd"> "db_supported": true,</span>
|
||||
<span class="sd"> "db_version": "0",</span>
|
||||
<span class="sd"> "schema_version": "0",</span>
|
||||
<span class="sd"> "backend": "lorax-composer"}</span>
|
||||
<span class="sd"> "backend": "lorax-composer",</span>
|
||||
<span class="sd"> "msgs": []}</span>
|
||||
|
||||
<span class="sd"> The 'msgs' field can be a list of strings describing startup problems or status that</span>
|
||||
<span class="sd"> should be displayed to the user. eg. if the compose templates are not depsolving properly</span>
|
||||
<span class="sd"> the errors will be in 'msgs'.</span>
|
||||
<span class="sd"> """</span>
|
||||
<span class="k">return</span> <span class="n">jsonify</span><span class="p">(</span><span class="n">backend</span><span class="o">=</span><span class="s">"lorax-composer"</span><span class="p">,</span>
|
||||
<span class="n">build</span><span class="o">=</span><span class="n">vernum</span><span class="p">,</span>
|
||||
<span class="n">api</span><span class="o">=</span><span class="s">"0"</span><span class="p">,</span>
|
||||
<span class="n">db_version</span><span class="o">=</span><span class="s">"0"</span><span class="p">,</span>
|
||||
<span class="n">schema_version</span><span class="o">=</span><span class="s">"0"</span><span class="p">,</span>
|
||||
<span class="n">db_supported</span><span class="o">=</span><span class="bp">True</span><span class="p">)</span>
|
||||
<span class="n">db_supported</span><span class="o">=</span><span class="bp">True</span><span class="p">,</span>
|
||||
<span class="n">msgs</span><span class="o">=</span><span class="n">server</span><span class="o">.</span><span class="n">config</span><span class="p">[</span><span class="s">"TEMPLATE_ERRORS"</span><span class="p">])</span>
|
||||
|
||||
<span class="n">v0_api</span><span class="p">(</span><span class="n">server</span><span class="p">)</span>
|
||||
</pre></div>
|
||||
@ -161,7 +167,7 @@
|
||||
<li class="right" >
|
||||
<a href="../../../py-modindex.html" title="Python Module Index"
|
||||
>modules</a> |</li>
|
||||
<li><a href="../../../index.html">Lorax 19.7.18 documentation</a> »</li>
|
||||
<li><a href="../../../index.html">Lorax 19.7.21 documentation</a> »</li>
|
||||
<li><a href="../../index.html" >Module code</a> »</li>
|
||||
<li><a href="../../pylorax.html" >pylorax</a> »</li>
|
||||
<li><a href="../api.html" >pylorax.api</a> »</li>
|
||||
|
149
lorax-composer/_modules/pylorax/api/timestamp.html
Normal file
149
lorax-composer/_modules/pylorax/api/timestamp.html
Normal file
@ -0,0 +1,149 @@
|
||||
|
||||
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
|
||||
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
|
||||
<title>pylorax.api.timestamp — Lorax 19.7.21 documentation</title>
|
||||
|
||||
<link rel="stylesheet" href="../../../_static/default.css" type="text/css" />
|
||||
<link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" />
|
||||
|
||||
<script type="text/javascript">
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT: '../../../',
|
||||
VERSION: '19.7.21',
|
||||
COLLAPSE_INDEX: false,
|
||||
FILE_SUFFIX: '.html',
|
||||
HAS_SOURCE: true
|
||||
};
|
||||
</script>
|
||||
<script type="text/javascript" src="../../../_static/jquery.js"></script>
|
||||
<script type="text/javascript" src="../../../_static/underscore.js"></script>
|
||||
<script type="text/javascript" src="../../../_static/doctools.js"></script>
|
||||
<link rel="top" title="Lorax 19.7.21 documentation" href="../../../index.html" />
|
||||
<link rel="up" title="pylorax.api" href="../api.html" />
|
||||
</head>
|
||||
<body>
|
||||
<div class="related">
|
||||
<h3>Navigation</h3>
|
||||
<ul>
|
||||
<li class="right" style="margin-right: 10px">
|
||||
<a href="../../../genindex.html" title="General Index"
|
||||
accesskey="I">index</a></li>
|
||||
<li class="right" >
|
||||
<a href="../../../py-modindex.html" title="Python Module Index"
|
||||
>modules</a> |</li>
|
||||
<li><a href="../../../index.html">Lorax 19.7.21 documentation</a> »</li>
|
||||
<li><a href="../../index.html" >Module code</a> »</li>
|
||||
<li><a href="../../pylorax.html" >pylorax</a> »</li>
|
||||
<li><a href="../api.html" accesskey="U">pylorax.api</a> »</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="document">
|
||||
<div class="documentwrapper">
|
||||
<div class="bodywrapper">
|
||||
<div class="body">
|
||||
|
||||
<h1>Source code for pylorax.api.timestamp</h1><div class="highlight"><pre>
|
||||
<span class="c">#</span>
|
||||
<span class="c"># Copyright (C) 2018 Red Hat, Inc.</span>
|
||||
<span class="c">#</span>
|
||||
<span class="c"># This program is free software; you can redistribute it and/or modify</span>
|
||||
<span class="c"># it under the terms of the GNU General Public License as published by</span>
|
||||
<span class="c"># the Free Software Foundation; either version 2 of the License, or</span>
|
||||
<span class="c"># (at your option) any later version.</span>
|
||||
<span class="c">#</span>
|
||||
<span class="c"># This program is distributed in the hope that it will be useful,</span>
|
||||
<span class="c"># but WITHOUT ANY WARRANTY; without even the implied warranty of</span>
|
||||
<span class="c"># MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the</span>
|
||||
<span class="c"># GNU General Public License for more details.</span>
|
||||
<span class="c">#</span>
|
||||
<span class="c"># You should have received a copy of the GNU General Public License</span>
|
||||
<span class="c"># along with this program. If not, see <http://www.gnu.org/licenses/>.</span>
|
||||
<span class="c">#</span>
|
||||
|
||||
<span class="kn">import</span> <span class="nn">pytoml</span> <span class="kn">as</span> <span class="nn">toml</span>
|
||||
<span class="kn">import</span> <span class="nn">time</span>
|
||||
|
||||
<span class="kn">from</span> <span class="nn">pylorax.sysutils</span> <span class="kn">import</span> <span class="n">joinpaths</span>
|
||||
|
||||
<span class="n">TS_CREATED</span> <span class="o">=</span> <span class="s">"created"</span>
|
||||
<span class="n">TS_STARTED</span> <span class="o">=</span> <span class="s">"started"</span>
|
||||
<span class="n">TS_FINISHED</span> <span class="o">=</span> <span class="s">"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="s">"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="s">"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="s">""</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="s">"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><span class="o">.</span><span class="n">encode</span><span class="p">(</span><span class="s">"UTF-8"</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="s">"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="s">"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="s">""</span><span class="p">)</span></div>
|
||||
</pre></div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="sphinxsidebar">
|
||||
<div class="sphinxsidebarwrapper">
|
||||
<div id="searchbox" style="display: none">
|
||||
<h3>Quick search</h3>
|
||||
<form class="search" action="../../../search.html" method="get">
|
||||
<input type="text" name="q" />
|
||||
<input type="submit" value="Go" />
|
||||
<input type="hidden" name="check_keywords" value="yes" />
|
||||
<input type="hidden" name="area" value="default" />
|
||||
</form>
|
||||
<p class="searchtip" style="font-size: 90%">
|
||||
Enter search terms or a module, class or function name.
|
||||
</p>
|
||||
</div>
|
||||
<script type="text/javascript">$('#searchbox').show(0);</script>
|
||||
</div>
|
||||
</div>
|
||||
<div class="clearer"></div>
|
||||
</div>
|
||||
<div class="related">
|
||||
<h3>Navigation</h3>
|
||||
<ul>
|
||||
<li class="right" style="margin-right: 10px">
|
||||
<a href="../../../genindex.html" title="General Index"
|
||||
>index</a></li>
|
||||
<li class="right" >
|
||||
<a href="../../../py-modindex.html" title="Python Module Index"
|
||||
>modules</a> |</li>
|
||||
<li><a href="../../../index.html">Lorax 19.7.21 documentation</a> »</li>
|
||||
<li><a href="../../index.html" >Module code</a> »</li>
|
||||
<li><a href="../../pylorax.html" >pylorax</a> »</li>
|
||||
<li><a href="../api.html" >pylorax.api</a> »</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="footer">
|
||||
© Copyright 2018, Red Hat, Inc..
|
||||
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.1.3.
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
File diff suppressed because it is too large
Load Diff
@ -8,7 +8,7 @@
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
|
||||
<title>pylorax.api.workspace — Lorax 19.7.18 documentation</title>
|
||||
<title>pylorax.api.workspace — Lorax 19.7.21 documentation</title>
|
||||
|
||||
<link rel="stylesheet" href="../../../_static/default.css" type="text/css" />
|
||||
<link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" />
|
||||
@ -16,7 +16,7 @@
|
||||
<script type="text/javascript">
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT: '../../../',
|
||||
VERSION: '19.7.18',
|
||||
VERSION: '19.7.21',
|
||||
COLLAPSE_INDEX: false,
|
||||
FILE_SUFFIX: '.html',
|
||||
HAS_SOURCE: true
|
||||
@ -25,7 +25,7 @@
|
||||
<script type="text/javascript" src="../../../_static/jquery.js"></script>
|
||||
<script type="text/javascript" src="../../../_static/underscore.js"></script>
|
||||
<script type="text/javascript" src="../../../_static/doctools.js"></script>
|
||||
<link rel="top" title="Lorax 19.7.18 documentation" href="../../../index.html" />
|
||||
<link rel="top" title="Lorax 19.7.21 documentation" href="../../../index.html" />
|
||||
<link rel="up" title="pylorax.api" href="../api.html" />
|
||||
</head>
|
||||
<body>
|
||||
@ -38,7 +38,7 @@
|
||||
<li class="right" >
|
||||
<a href="../../../py-modindex.html" title="Python Module Index"
|
||||
>modules</a> |</li>
|
||||
<li><a href="../../../index.html">Lorax 19.7.18 documentation</a> »</li>
|
||||
<li><a href="../../../index.html">Lorax 19.7.21 documentation</a> »</li>
|
||||
<li><a href="../../index.html" >Module code</a> »</li>
|
||||
<li><a href="../../pylorax.html" >pylorax</a> »</li>
|
||||
<li><a href="../api.html" accesskey="U">pylorax.api</a> »</li>
|
||||
@ -183,7 +183,7 @@
|
||||
<li class="right" >
|
||||
<a href="../../../py-modindex.html" title="Python Module Index"
|
||||
>modules</a> |</li>
|
||||
<li><a href="../../../index.html">Lorax 19.7.18 documentation</a> »</li>
|
||||
<li><a href="../../../index.html">Lorax 19.7.21 documentation</a> »</li>
|
||||
<li><a href="../../index.html" >Module code</a> »</li>
|
||||
<li><a href="../../pylorax.html" >pylorax</a> »</li>
|
||||
<li><a href="../api.html" >pylorax.api</a> »</li>
|
||||
|
@ -8,7 +8,7 @@
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
|
||||
<title>pylorax.api.yumbase — Lorax 19.7.18 documentation</title>
|
||||
<title>pylorax.api.yumbase — Lorax 19.7.21 documentation</title>
|
||||
|
||||
<link rel="stylesheet" href="../../../_static/default.css" type="text/css" />
|
||||
<link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" />
|
||||
@ -16,7 +16,7 @@
|
||||
<script type="text/javascript">
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT: '../../../',
|
||||
VERSION: '19.7.18',
|
||||
VERSION: '19.7.21',
|
||||
COLLAPSE_INDEX: false,
|
||||
FILE_SUFFIX: '.html',
|
||||
HAS_SOURCE: true
|
||||
@ -25,7 +25,7 @@
|
||||
<script type="text/javascript" src="../../../_static/jquery.js"></script>
|
||||
<script type="text/javascript" src="../../../_static/underscore.js"></script>
|
||||
<script type="text/javascript" src="../../../_static/doctools.js"></script>
|
||||
<link rel="top" title="Lorax 19.7.18 documentation" href="../../../index.html" />
|
||||
<link rel="top" title="Lorax 19.7.21 documentation" href="../../../index.html" />
|
||||
<link rel="up" title="pylorax.api" href="../api.html" />
|
||||
</head>
|
||||
<body>
|
||||
@ -38,7 +38,7 @@
|
||||
<li class="right" >
|
||||
<a href="../../../py-modindex.html" title="Python Module Index"
|
||||
>modules</a> |</li>
|
||||
<li><a href="../../../index.html">Lorax 19.7.18 documentation</a> »</li>
|
||||
<li><a href="../../../index.html">Lorax 19.7.21 documentation</a> »</li>
|
||||
<li><a href="../../index.html" >Module code</a> »</li>
|
||||
<li><a href="../../pylorax.html" >pylorax</a> »</li>
|
||||
<li><a href="../api.html" accesskey="U">pylorax.api</a> »</li>
|
||||
@ -77,6 +77,8 @@
|
||||
<span class="kn">from</span> <span class="nn">glob</span> <span class="kn">import</span> <span class="n">glob</span>
|
||||
<span class="kn">import</span> <span class="nn">os</span>
|
||||
<span class="kn">import</span> <span class="nn">yum</span>
|
||||
<span class="kn">from</span> <span class="nn">yum.Errors</span> <span class="kn">import</span> <span class="n">YumBaseError</span>
|
||||
|
||||
<span class="c"># This is a hack to short circuit yum's internal logging</span>
|
||||
<span class="n">yum</span><span class="o">.</span><span class="n">logginglevels</span><span class="o">.</span><span class="n">_added_handlers</span> <span class="o">=</span> <span class="bp">True</span>
|
||||
|
||||
@ -171,9 +173,13 @@
|
||||
<span class="k">for</span> <span class="n">r</span> <span class="ow">in</span> <span class="n">yb</span><span class="o">.</span><span class="n">repos</span><span class="o">.</span><span class="n">sort</span><span class="p">():</span>
|
||||
<span class="n">r</span><span class="o">.</span><span class="n">metadata_expire</span> <span class="o">=</span> <span class="mi">0</span>
|
||||
<span class="n">r</span><span class="o">.</span><span class="n">mdpolicy</span> <span class="o">=</span> <span class="s">"group:all"</span>
|
||||
<span class="n">yb</span><span class="o">.</span><span class="n">doRepoSetup</span><span class="p">()</span>
|
||||
<span class="n">yb</span><span class="o">.</span><span class="n">repos</span><span class="o">.</span><span class="n">doSetup</span><span class="p">()</span>
|
||||
<span class="n">yb</span><span class="o">.</span><span class="n">repos</span><span class="o">.</span><span class="n">populateSack</span><span class="p">(</span><span class="n">mdtype</span><span class="o">=</span><span class="s">'all'</span><span class="p">,</span> <span class="n">cacheonly</span><span class="o">=</span><span class="mi">1</span><span class="p">)</span></div>
|
||||
<span class="k">try</span><span class="p">:</span>
|
||||
<span class="n">yb</span><span class="o">.</span><span class="n">doRepoSetup</span><span class="p">()</span>
|
||||
<span class="n">yb</span><span class="o">.</span><span class="n">repos</span><span class="o">.</span><span class="n">doSetup</span><span class="p">()</span>
|
||||
<span class="n">yb</span><span class="o">.</span><span class="n">repos</span><span class="o">.</span><span class="n">populateSack</span><span class="p">(</span><span class="n">mdtype</span><span class="o">=</span><span class="s">'all'</span><span class="p">,</span> <span class="n">cacheonly</span><span class="o">=</span><span class="mi">0</span><span class="p">)</span>
|
||||
<span class="k">except</span> <span class="n">YumBaseError</span> <span class="k">as</span> <span class="n">e</span><span class="p">:</span>
|
||||
<span class="n">log</span><span class="o">.</span><span class="n">error</span><span class="p">(</span><span class="s">"Failed to update metadata: </span><span class="si">%s</span><span class="s">"</span><span class="p">,</span> <span class="nb">str</span><span class="p">(</span><span class="n">e</span><span class="p">))</span>
|
||||
<span class="k">raise</span> <span class="ne">RuntimeError</span><span class="p">(</span><span class="s">"Fetching metadata failed: </span><span class="si">%s</span><span class="s">"</span> <span class="o">%</span> <span class="nb">str</span><span class="p">(</span><span class="n">e</span><span class="p">))</span></div>
|
||||
</pre></div>
|
||||
|
||||
</div>
|
||||
@ -207,7 +213,7 @@
|
||||
<li class="right" >
|
||||
<a href="../../../py-modindex.html" title="Python Module Index"
|
||||
>modules</a> |</li>
|
||||
<li><a href="../../../index.html">Lorax 19.7.18 documentation</a> »</li>
|
||||
<li><a href="../../../index.html">Lorax 19.7.21 documentation</a> »</li>
|
||||
<li><a href="../../index.html" >Module code</a> »</li>
|
||||
<li><a href="../../pylorax.html" >pylorax</a> »</li>
|
||||
<li><a href="../api.html" >pylorax.api</a> »</li>
|
||||
|
@ -8,7 +8,7 @@
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
|
||||
<title>pylorax.base — Lorax 19.7.18 documentation</title>
|
||||
<title>pylorax.base — Lorax 19.7.21 documentation</title>
|
||||
|
||||
<link rel="stylesheet" href="../../_static/default.css" type="text/css" />
|
||||
<link rel="stylesheet" href="../../_static/pygments.css" type="text/css" />
|
||||
@ -16,7 +16,7 @@
|
||||
<script type="text/javascript">
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT: '../../',
|
||||
VERSION: '19.7.18',
|
||||
VERSION: '19.7.21',
|
||||
COLLAPSE_INDEX: false,
|
||||
FILE_SUFFIX: '.html',
|
||||
HAS_SOURCE: true
|
||||
@ -25,7 +25,7 @@
|
||||
<script type="text/javascript" src="../../_static/jquery.js"></script>
|
||||
<script type="text/javascript" src="../../_static/underscore.js"></script>
|
||||
<script type="text/javascript" src="../../_static/doctools.js"></script>
|
||||
<link rel="top" title="Lorax 19.7.18 documentation" href="../../index.html" />
|
||||
<link rel="top" title="Lorax 19.7.21 documentation" href="../../index.html" />
|
||||
<link rel="up" title="pylorax" href="../pylorax.html" />
|
||||
</head>
|
||||
<body>
|
||||
@ -38,7 +38,7 @@
|
||||
<li class="right" >
|
||||
<a href="../../py-modindex.html" title="Python Module Index"
|
||||
>modules</a> |</li>
|
||||
<li><a href="../../index.html">Lorax 19.7.18 documentation</a> »</li>
|
||||
<li><a href="../../index.html">Lorax 19.7.21 documentation</a> »</li>
|
||||
<li><a href="../index.html" >Module code</a> »</li>
|
||||
<li><a href="../pylorax.html" accesskey="U">pylorax</a> »</li>
|
||||
</ul>
|
||||
@ -150,7 +150,7 @@
|
||||
<li class="right" >
|
||||
<a href="../../py-modindex.html" title="Python Module Index"
|
||||
>modules</a> |</li>
|
||||
<li><a href="../../index.html">Lorax 19.7.18 documentation</a> »</li>
|
||||
<li><a href="../../index.html">Lorax 19.7.21 documentation</a> »</li>
|
||||
<li><a href="../index.html" >Module code</a> »</li>
|
||||
<li><a href="../pylorax.html" >pylorax</a> »</li>
|
||||
</ul>
|
||||
|
@ -8,7 +8,7 @@
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
|
||||
<title>pylorax.buildstamp — Lorax 19.7.18 documentation</title>
|
||||
<title>pylorax.buildstamp — Lorax 19.7.21 documentation</title>
|
||||
|
||||
<link rel="stylesheet" href="../../_static/default.css" type="text/css" />
|
||||
<link rel="stylesheet" href="../../_static/pygments.css" type="text/css" />
|
||||
@ -16,7 +16,7 @@
|
||||
<script type="text/javascript">
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT: '../../',
|
||||
VERSION: '19.7.18',
|
||||
VERSION: '19.7.21',
|
||||
COLLAPSE_INDEX: false,
|
||||
FILE_SUFFIX: '.html',
|
||||
HAS_SOURCE: true
|
||||
@ -25,7 +25,7 @@
|
||||
<script type="text/javascript" src="../../_static/jquery.js"></script>
|
||||
<script type="text/javascript" src="../../_static/underscore.js"></script>
|
||||
<script type="text/javascript" src="../../_static/doctools.js"></script>
|
||||
<link rel="top" title="Lorax 19.7.18 documentation" href="../../index.html" />
|
||||
<link rel="top" title="Lorax 19.7.21 documentation" href="../../index.html" />
|
||||
<link rel="up" title="pylorax" href="../pylorax.html" />
|
||||
</head>
|
||||
<body>
|
||||
@ -38,7 +38,7 @@
|
||||
<li class="right" >
|
||||
<a href="../../py-modindex.html" title="Python Module Index"
|
||||
>modules</a> |</li>
|
||||
<li><a href="../../index.html">Lorax 19.7.18 documentation</a> »</li>
|
||||
<li><a href="../../index.html">Lorax 19.7.21 documentation</a> »</li>
|
||||
<li><a href="../index.html" >Module code</a> »</li>
|
||||
<li><a href="../pylorax.html" accesskey="U">pylorax</a> »</li>
|
||||
</ul>
|
||||
@ -141,7 +141,7 @@
|
||||
<li class="right" >
|
||||
<a href="../../py-modindex.html" title="Python Module Index"
|
||||
>modules</a> |</li>
|
||||
<li><a href="../../index.html">Lorax 19.7.18 documentation</a> »</li>
|
||||
<li><a href="../../index.html">Lorax 19.7.21 documentation</a> »</li>
|
||||
<li><a href="../index.html" >Module code</a> »</li>
|
||||
<li><a href="../pylorax.html" >pylorax</a> »</li>
|
||||
</ul>
|
||||
|
@ -8,7 +8,7 @@
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
|
||||
<title>pylorax.creator — Lorax 19.7.18 documentation</title>
|
||||
<title>pylorax.creator — Lorax 19.7.21 documentation</title>
|
||||
|
||||
<link rel="stylesheet" href="../../_static/default.css" type="text/css" />
|
||||
<link rel="stylesheet" href="../../_static/pygments.css" type="text/css" />
|
||||
@ -16,7 +16,7 @@
|
||||
<script type="text/javascript">
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT: '../../',
|
||||
VERSION: '19.7.18',
|
||||
VERSION: '19.7.21',
|
||||
COLLAPSE_INDEX: false,
|
||||
FILE_SUFFIX: '.html',
|
||||
HAS_SOURCE: true
|
||||
@ -25,7 +25,7 @@
|
||||
<script type="text/javascript" src="../../_static/jquery.js"></script>
|
||||
<script type="text/javascript" src="../../_static/underscore.js"></script>
|
||||
<script type="text/javascript" src="../../_static/doctools.js"></script>
|
||||
<link rel="top" title="Lorax 19.7.18 documentation" href="../../index.html" />
|
||||
<link rel="top" title="Lorax 19.7.21 documentation" href="../../index.html" />
|
||||
<link rel="up" title="pylorax" href="../pylorax.html" />
|
||||
</head>
|
||||
<body>
|
||||
@ -38,7 +38,7 @@
|
||||
<li class="right" >
|
||||
<a href="../../py-modindex.html" title="Python Module Index"
|
||||
>modules</a> |</li>
|
||||
<li><a href="../../index.html">Lorax 19.7.18 documentation</a> »</li>
|
||||
<li><a href="../../index.html">Lorax 19.7.21 documentation</a> »</li>
|
||||
<li><a href="../index.html" >Module code</a> »</li>
|
||||
<li><a href="../pylorax.html" accesskey="U">pylorax</a> »</li>
|
||||
</ul>
|
||||
@ -697,7 +697,7 @@
|
||||
<li class="right" >
|
||||
<a href="../../py-modindex.html" title="Python Module Index"
|
||||
>modules</a> |</li>
|
||||
<li><a href="../../index.html">Lorax 19.7.18 documentation</a> »</li>
|
||||
<li><a href="../../index.html">Lorax 19.7.21 documentation</a> »</li>
|
||||
<li><a href="../index.html" >Module code</a> »</li>
|
||||
<li><a href="../pylorax.html" >pylorax</a> »</li>
|
||||
</ul>
|
||||
|
@ -8,7 +8,7 @@
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
|
||||
<title>pylorax.decorators — Lorax 19.7.18 documentation</title>
|
||||
<title>pylorax.decorators — Lorax 19.7.21 documentation</title>
|
||||
|
||||
<link rel="stylesheet" href="../../_static/default.css" type="text/css" />
|
||||
<link rel="stylesheet" href="../../_static/pygments.css" type="text/css" />
|
||||
@ -16,7 +16,7 @@
|
||||
<script type="text/javascript">
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT: '../../',
|
||||
VERSION: '19.7.18',
|
||||
VERSION: '19.7.21',
|
||||
COLLAPSE_INDEX: false,
|
||||
FILE_SUFFIX: '.html',
|
||||
HAS_SOURCE: true
|
||||
@ -25,7 +25,7 @@
|
||||
<script type="text/javascript" src="../../_static/jquery.js"></script>
|
||||
<script type="text/javascript" src="../../_static/underscore.js"></script>
|
||||
<script type="text/javascript" src="../../_static/doctools.js"></script>
|
||||
<link rel="top" title="Lorax 19.7.18 documentation" href="../../index.html" />
|
||||
<link rel="top" title="Lorax 19.7.21 documentation" href="../../index.html" />
|
||||
<link rel="up" title="pylorax" href="../pylorax.html" />
|
||||
</head>
|
||||
<body>
|
||||
@ -38,7 +38,7 @@
|
||||
<li class="right" >
|
||||
<a href="../../py-modindex.html" title="Python Module Index"
|
||||
>modules</a> |</li>
|
||||
<li><a href="../../index.html">Lorax 19.7.18 documentation</a> »</li>
|
||||
<li><a href="../../index.html">Lorax 19.7.21 documentation</a> »</li>
|
||||
<li><a href="../index.html" >Module code</a> »</li>
|
||||
<li><a href="../pylorax.html" accesskey="U">pylorax</a> »</li>
|
||||
</ul>
|
||||
@ -113,7 +113,7 @@
|
||||
<li class="right" >
|
||||
<a href="../../py-modindex.html" title="Python Module Index"
|
||||
>modules</a> |</li>
|
||||
<li><a href="../../index.html">Lorax 19.7.18 documentation</a> »</li>
|
||||
<li><a href="../../index.html">Lorax 19.7.21 documentation</a> »</li>
|
||||
<li><a href="../index.html" >Module code</a> »</li>
|
||||
<li><a href="../pylorax.html" >pylorax</a> »</li>
|
||||
</ul>
|
||||
|
@ -8,7 +8,7 @@
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
|
||||
<title>pylorax.discinfo — Lorax 19.7.18 documentation</title>
|
||||
<title>pylorax.discinfo — Lorax 19.7.21 documentation</title>
|
||||
|
||||
<link rel="stylesheet" href="../../_static/default.css" type="text/css" />
|
||||
<link rel="stylesheet" href="../../_static/pygments.css" type="text/css" />
|
||||
@ -16,7 +16,7 @@
|
||||
<script type="text/javascript">
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT: '../../',
|
||||
VERSION: '19.7.18',
|
||||
VERSION: '19.7.21',
|
||||
COLLAPSE_INDEX: false,
|
||||
FILE_SUFFIX: '.html',
|
||||
HAS_SOURCE: true
|
||||
@ -25,7 +25,7 @@
|
||||
<script type="text/javascript" src="../../_static/jquery.js"></script>
|
||||
<script type="text/javascript" src="../../_static/underscore.js"></script>
|
||||
<script type="text/javascript" src="../../_static/doctools.js"></script>
|
||||
<link rel="top" title="Lorax 19.7.18 documentation" href="../../index.html" />
|
||||
<link rel="top" title="Lorax 19.7.21 documentation" href="../../index.html" />
|
||||
<link rel="up" title="pylorax" href="../pylorax.html" />
|
||||
</head>
|
||||
<body>
|
||||
@ -38,7 +38,7 @@
|
||||
<li class="right" >
|
||||
<a href="../../py-modindex.html" title="Python Module Index"
|
||||
>modules</a> |</li>
|
||||
<li><a href="../../index.html">Lorax 19.7.18 documentation</a> »</li>
|
||||
<li><a href="../../index.html">Lorax 19.7.21 documentation</a> »</li>
|
||||
<li><a href="../index.html" >Module code</a> »</li>
|
||||
<li><a href="../pylorax.html" accesskey="U">pylorax</a> »</li>
|
||||
</ul>
|
||||
@ -122,7 +122,7 @@
|
||||
<li class="right" >
|
||||
<a href="../../py-modindex.html" title="Python Module Index"
|
||||
>modules</a> |</li>
|
||||
<li><a href="../../index.html">Lorax 19.7.18 documentation</a> »</li>
|
||||
<li><a href="../../index.html">Lorax 19.7.21 documentation</a> »</li>
|
||||
<li><a href="../index.html" >Module code</a> »</li>
|
||||
<li><a href="../pylorax.html" >pylorax</a> »</li>
|
||||
</ul>
|
||||
|
@ -8,7 +8,7 @@
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
|
||||
<title>pylorax.executils — Lorax 19.7.18 documentation</title>
|
||||
<title>pylorax.executils — Lorax 19.7.21 documentation</title>
|
||||
|
||||
<link rel="stylesheet" href="../../_static/default.css" type="text/css" />
|
||||
<link rel="stylesheet" href="../../_static/pygments.css" type="text/css" />
|
||||
@ -16,7 +16,7 @@
|
||||
<script type="text/javascript">
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT: '../../',
|
||||
VERSION: '19.7.18',
|
||||
VERSION: '19.7.21',
|
||||
COLLAPSE_INDEX: false,
|
||||
FILE_SUFFIX: '.html',
|
||||
HAS_SOURCE: true
|
||||
@ -25,7 +25,7 @@
|
||||
<script type="text/javascript" src="../../_static/jquery.js"></script>
|
||||
<script type="text/javascript" src="../../_static/underscore.js"></script>
|
||||
<script type="text/javascript" src="../../_static/doctools.js"></script>
|
||||
<link rel="top" title="Lorax 19.7.18 documentation" href="../../index.html" />
|
||||
<link rel="top" title="Lorax 19.7.21 documentation" href="../../index.html" />
|
||||
<link rel="up" title="pylorax" href="../pylorax.html" />
|
||||
</head>
|
||||
<body>
|
||||
@ -38,7 +38,7 @@
|
||||
<li class="right" >
|
||||
<a href="../../py-modindex.html" title="Python Module Index"
|
||||
>modules</a> |</li>
|
||||
<li><a href="../../index.html">Lorax 19.7.18 documentation</a> »</li>
|
||||
<li><a href="../../index.html">Lorax 19.7.21 documentation</a> »</li>
|
||||
<li><a href="../index.html" >Module code</a> »</li>
|
||||
<li><a href="../pylorax.html" accesskey="U">pylorax</a> »</li>
|
||||
</ul>
|
||||
@ -508,7 +508,7 @@
|
||||
<li class="right" >
|
||||
<a href="../../py-modindex.html" title="Python Module Index"
|
||||
>modules</a> |</li>
|
||||
<li><a href="../../index.html">Lorax 19.7.18 documentation</a> »</li>
|
||||
<li><a href="../../index.html">Lorax 19.7.21 documentation</a> »</li>
|
||||
<li><a href="../index.html" >Module code</a> »</li>
|
||||
<li><a href="../pylorax.html" >pylorax</a> »</li>
|
||||
</ul>
|
||||
|
@ -8,7 +8,7 @@
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
|
||||
<title>pylorax.imgutils — Lorax 19.7.18 documentation</title>
|
||||
<title>pylorax.imgutils — Lorax 19.7.21 documentation</title>
|
||||
|
||||
<link rel="stylesheet" href="../../_static/default.css" type="text/css" />
|
||||
<link rel="stylesheet" href="../../_static/pygments.css" type="text/css" />
|
||||
@ -16,7 +16,7 @@
|
||||
<script type="text/javascript">
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT: '../../',
|
||||
VERSION: '19.7.18',
|
||||
VERSION: '19.7.21',
|
||||
COLLAPSE_INDEX: false,
|
||||
FILE_SUFFIX: '.html',
|
||||
HAS_SOURCE: true
|
||||
@ -25,7 +25,7 @@
|
||||
<script type="text/javascript" src="../../_static/jquery.js"></script>
|
||||
<script type="text/javascript" src="../../_static/underscore.js"></script>
|
||||
<script type="text/javascript" src="../../_static/doctools.js"></script>
|
||||
<link rel="top" title="Lorax 19.7.18 documentation" href="../../index.html" />
|
||||
<link rel="top" title="Lorax 19.7.21 documentation" href="../../index.html" />
|
||||
<link rel="up" title="pylorax" href="../pylorax.html" />
|
||||
</head>
|
||||
<body>
|
||||
@ -38,7 +38,7 @@
|
||||
<li class="right" >
|
||||
<a href="../../py-modindex.html" title="Python Module Index"
|
||||
>modules</a> |</li>
|
||||
<li><a href="../../index.html">Lorax 19.7.18 documentation</a> »</li>
|
||||
<li><a href="../../index.html">Lorax 19.7.21 documentation</a> »</li>
|
||||
<li><a href="../index.html" >Module code</a> »</li>
|
||||
<li><a href="../pylorax.html" accesskey="U">pylorax</a> »</li>
|
||||
</ul>
|
||||
@ -569,7 +569,7 @@
|
||||
<li class="right" >
|
||||
<a href="../../py-modindex.html" title="Python Module Index"
|
||||
>modules</a> |</li>
|
||||
<li><a href="../../index.html">Lorax 19.7.18 documentation</a> »</li>
|
||||
<li><a href="../../index.html">Lorax 19.7.21 documentation</a> »</li>
|
||||
<li><a href="../index.html" >Module code</a> »</li>
|
||||
<li><a href="../pylorax.html" >pylorax</a> »</li>
|
||||
</ul>
|
||||
|
@ -8,7 +8,7 @@
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
|
||||
<title>pylorax.installer — Lorax 19.7.18 documentation</title>
|
||||
<title>pylorax.installer — Lorax 19.7.21 documentation</title>
|
||||
|
||||
<link rel="stylesheet" href="../../_static/default.css" type="text/css" />
|
||||
<link rel="stylesheet" href="../../_static/pygments.css" type="text/css" />
|
||||
@ -16,7 +16,7 @@
|
||||
<script type="text/javascript">
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT: '../../',
|
||||
VERSION: '19.7.18',
|
||||
VERSION: '19.7.21',
|
||||
COLLAPSE_INDEX: false,
|
||||
FILE_SUFFIX: '.html',
|
||||
HAS_SOURCE: true
|
||||
@ -25,7 +25,7 @@
|
||||
<script type="text/javascript" src="../../_static/jquery.js"></script>
|
||||
<script type="text/javascript" src="../../_static/underscore.js"></script>
|
||||
<script type="text/javascript" src="../../_static/doctools.js"></script>
|
||||
<link rel="top" title="Lorax 19.7.18 documentation" href="../../index.html" />
|
||||
<link rel="top" title="Lorax 19.7.21 documentation" href="../../index.html" />
|
||||
<link rel="up" title="pylorax" href="../pylorax.html" />
|
||||
</head>
|
||||
<body>
|
||||
@ -38,7 +38,7 @@
|
||||
<li class="right" >
|
||||
<a href="../../py-modindex.html" title="Python Module Index"
|
||||
>modules</a> |</li>
|
||||
<li><a href="../../index.html">Lorax 19.7.18 documentation</a> »</li>
|
||||
<li><a href="../../index.html">Lorax 19.7.21 documentation</a> »</li>
|
||||
<li><a href="../index.html" >Module code</a> »</li>
|
||||
<li><a href="../pylorax.html" accesskey="U">pylorax</a> »</li>
|
||||
</ul>
|
||||
@ -493,7 +493,7 @@
|
||||
<li class="right" >
|
||||
<a href="../../py-modindex.html" title="Python Module Index"
|
||||
>modules</a> |</li>
|
||||
<li><a href="../../index.html">Lorax 19.7.18 documentation</a> »</li>
|
||||
<li><a href="../../index.html">Lorax 19.7.21 documentation</a> »</li>
|
||||
<li><a href="../index.html" >Module code</a> »</li>
|
||||
<li><a href="../pylorax.html" >pylorax</a> »</li>
|
||||
</ul>
|
||||
|
@ -8,7 +8,7 @@
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
|
||||
<title>pylorax.logmonitor — Lorax 19.7.18 documentation</title>
|
||||
<title>pylorax.logmonitor — Lorax 19.7.21 documentation</title>
|
||||
|
||||
<link rel="stylesheet" href="../../_static/default.css" type="text/css" />
|
||||
<link rel="stylesheet" href="../../_static/pygments.css" type="text/css" />
|
||||
@ -16,7 +16,7 @@
|
||||
<script type="text/javascript">
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT: '../../',
|
||||
VERSION: '19.7.18',
|
||||
VERSION: '19.7.21',
|
||||
COLLAPSE_INDEX: false,
|
||||
FILE_SUFFIX: '.html',
|
||||
HAS_SOURCE: true
|
||||
@ -25,7 +25,7 @@
|
||||
<script type="text/javascript" src="../../_static/jquery.js"></script>
|
||||
<script type="text/javascript" src="../../_static/underscore.js"></script>
|
||||
<script type="text/javascript" src="../../_static/doctools.js"></script>
|
||||
<link rel="top" title="Lorax 19.7.18 documentation" href="../../index.html" />
|
||||
<link rel="top" title="Lorax 19.7.21 documentation" href="../../index.html" />
|
||||
<link rel="up" title="pylorax" href="../pylorax.html" />
|
||||
</head>
|
||||
<body>
|
||||
@ -38,7 +38,7 @@
|
||||
<li class="right" >
|
||||
<a href="../../py-modindex.html" title="Python Module Index"
|
||||
>modules</a> |</li>
|
||||
<li><a href="../../index.html">Lorax 19.7.18 documentation</a> »</li>
|
||||
<li><a href="../../index.html">Lorax 19.7.21 documentation</a> »</li>
|
||||
<li><a href="../index.html" >Module code</a> »</li>
|
||||
<li><a href="../pylorax.html" accesskey="U">pylorax</a> »</li>
|
||||
</ul>
|
||||
@ -206,7 +206,7 @@
|
||||
<li class="right" >
|
||||
<a href="../../py-modindex.html" title="Python Module Index"
|
||||
>modules</a> |</li>
|
||||
<li><a href="../../index.html">Lorax 19.7.18 documentation</a> »</li>
|
||||
<li><a href="../../index.html">Lorax 19.7.21 documentation</a> »</li>
|
||||
<li><a href="../index.html" >Module code</a> »</li>
|
||||
<li><a href="../pylorax.html" >pylorax</a> »</li>
|
||||
</ul>
|
||||
|
@ -8,7 +8,7 @@
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
|
||||
<title>pylorax.ltmpl — Lorax 19.7.18 documentation</title>
|
||||
<title>pylorax.ltmpl — Lorax 19.7.21 documentation</title>
|
||||
|
||||
<link rel="stylesheet" href="../../_static/default.css" type="text/css" />
|
||||
<link rel="stylesheet" href="../../_static/pygments.css" type="text/css" />
|
||||
@ -16,7 +16,7 @@
|
||||
<script type="text/javascript">
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT: '../../',
|
||||
VERSION: '19.7.18',
|
||||
VERSION: '19.7.21',
|
||||
COLLAPSE_INDEX: false,
|
||||
FILE_SUFFIX: '.html',
|
||||
HAS_SOURCE: true
|
||||
@ -25,7 +25,7 @@
|
||||
<script type="text/javascript" src="../../_static/jquery.js"></script>
|
||||
<script type="text/javascript" src="../../_static/underscore.js"></script>
|
||||
<script type="text/javascript" src="../../_static/doctools.js"></script>
|
||||
<link rel="top" title="Lorax 19.7.18 documentation" href="../../index.html" />
|
||||
<link rel="top" title="Lorax 19.7.21 documentation" href="../../index.html" />
|
||||
<link rel="up" title="pylorax" href="../pylorax.html" />
|
||||
</head>
|
||||
<body>
|
||||
@ -38,7 +38,7 @@
|
||||
<li class="right" >
|
||||
<a href="../../py-modindex.html" title="Python Module Index"
|
||||
>modules</a> |</li>
|
||||
<li><a href="../../index.html">Lorax 19.7.18 documentation</a> »</li>
|
||||
<li><a href="../../index.html">Lorax 19.7.21 documentation</a> »</li>
|
||||
<li><a href="../index.html" >Module code</a> »</li>
|
||||
<li><a href="../pylorax.html" accesskey="U">pylorax</a> »</li>
|
||||
</ul>
|
||||
@ -748,7 +748,7 @@
|
||||
<li class="right" >
|
||||
<a href="../../py-modindex.html" title="Python Module Index"
|
||||
>modules</a> |</li>
|
||||
<li><a href="../../index.html">Lorax 19.7.18 documentation</a> »</li>
|
||||
<li><a href="../../index.html">Lorax 19.7.21 documentation</a> »</li>
|
||||
<li><a href="../index.html" >Module code</a> »</li>
|
||||
<li><a href="../pylorax.html" >pylorax</a> »</li>
|
||||
</ul>
|
||||
|
@ -8,7 +8,7 @@
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
|
||||
<title>pylorax.sysutils — Lorax 19.7.18 documentation</title>
|
||||
<title>pylorax.sysutils — Lorax 19.7.21 documentation</title>
|
||||
|
||||
<link rel="stylesheet" href="../../_static/default.css" type="text/css" />
|
||||
<link rel="stylesheet" href="../../_static/pygments.css" type="text/css" />
|
||||
@ -16,7 +16,7 @@
|
||||
<script type="text/javascript">
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT: '../../',
|
||||
VERSION: '19.7.18',
|
||||
VERSION: '19.7.21',
|
||||
COLLAPSE_INDEX: false,
|
||||
FILE_SUFFIX: '.html',
|
||||
HAS_SOURCE: true
|
||||
@ -25,7 +25,7 @@
|
||||
<script type="text/javascript" src="../../_static/jquery.js"></script>
|
||||
<script type="text/javascript" src="../../_static/underscore.js"></script>
|
||||
<script type="text/javascript" src="../../_static/doctools.js"></script>
|
||||
<link rel="top" title="Lorax 19.7.18 documentation" href="../../index.html" />
|
||||
<link rel="top" title="Lorax 19.7.21 documentation" href="../../index.html" />
|
||||
<link rel="up" title="pylorax" href="../pylorax.html" />
|
||||
</head>
|
||||
<body>
|
||||
@ -38,7 +38,7 @@
|
||||
<li class="right" >
|
||||
<a href="../../py-modindex.html" title="Python Module Index"
|
||||
>modules</a> |</li>
|
||||
<li><a href="../../index.html">Lorax 19.7.18 documentation</a> »</li>
|
||||
<li><a href="../../index.html">Lorax 19.7.21 documentation</a> »</li>
|
||||
<li><a href="../index.html" >Module code</a> »</li>
|
||||
<li><a href="../pylorax.html" accesskey="U">pylorax</a> »</li>
|
||||
</ul>
|
||||
@ -191,7 +191,7 @@
|
||||
<li class="right" >
|
||||
<a href="../../py-modindex.html" title="Python Module Index"
|
||||
>modules</a> |</li>
|
||||
<li><a href="../../index.html">Lorax 19.7.18 documentation</a> »</li>
|
||||
<li><a href="../../index.html">Lorax 19.7.21 documentation</a> »</li>
|
||||
<li><a href="../index.html" >Module code</a> »</li>
|
||||
<li><a href="../pylorax.html" >pylorax</a> »</li>
|
||||
</ul>
|
||||
|
@ -8,7 +8,7 @@
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
|
||||
<title>pylorax.treebuilder — Lorax 19.7.18 documentation</title>
|
||||
<title>pylorax.treebuilder — Lorax 19.7.21 documentation</title>
|
||||
|
||||
<link rel="stylesheet" href="../../_static/default.css" type="text/css" />
|
||||
<link rel="stylesheet" href="../../_static/pygments.css" type="text/css" />
|
||||
@ -16,7 +16,7 @@
|
||||
<script type="text/javascript">
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT: '../../',
|
||||
VERSION: '19.7.18',
|
||||
VERSION: '19.7.21',
|
||||
COLLAPSE_INDEX: false,
|
||||
FILE_SUFFIX: '.html',
|
||||
HAS_SOURCE: true
|
||||
@ -25,7 +25,7 @@
|
||||
<script type="text/javascript" src="../../_static/jquery.js"></script>
|
||||
<script type="text/javascript" src="../../_static/underscore.js"></script>
|
||||
<script type="text/javascript" src="../../_static/doctools.js"></script>
|
||||
<link rel="top" title="Lorax 19.7.18 documentation" href="../../index.html" />
|
||||
<link rel="top" title="Lorax 19.7.21 documentation" href="../../index.html" />
|
||||
<link rel="up" title="pylorax" href="../pylorax.html" />
|
||||
</head>
|
||||
<body>
|
||||
@ -38,7 +38,7 @@
|
||||
<li class="right" >
|
||||
<a href="../../py-modindex.html" title="Python Module Index"
|
||||
>modules</a> |</li>
|
||||
<li><a href="../../index.html">Lorax 19.7.18 documentation</a> »</li>
|
||||
<li><a href="../../index.html">Lorax 19.7.21 documentation</a> »</li>
|
||||
<li><a href="../index.html" >Module code</a> »</li>
|
||||
<li><a href="../pylorax.html" accesskey="U">pylorax</a> »</li>
|
||||
</ul>
|
||||
@ -403,7 +403,7 @@
|
||||
<li class="right" >
|
||||
<a href="../../py-modindex.html" title="Python Module Index"
|
||||
>modules</a> |</li>
|
||||
<li><a href="../../index.html">Lorax 19.7.18 documentation</a> »</li>
|
||||
<li><a href="../../index.html">Lorax 19.7.21 documentation</a> »</li>
|
||||
<li><a href="../index.html" >Module code</a> »</li>
|
||||
<li><a href="../pylorax.html" >pylorax</a> »</li>
|
||||
</ul>
|
||||
|
@ -8,7 +8,7 @@
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
|
||||
<title>pylorax.treeinfo — Lorax 19.7.18 documentation</title>
|
||||
<title>pylorax.treeinfo — Lorax 19.7.21 documentation</title>
|
||||
|
||||
<link rel="stylesheet" href="../../_static/default.css" type="text/css" />
|
||||
<link rel="stylesheet" href="../../_static/pygments.css" type="text/css" />
|
||||
@ -16,7 +16,7 @@
|
||||
<script type="text/javascript">
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT: '../../',
|
||||
VERSION: '19.7.18',
|
||||
VERSION: '19.7.21',
|
||||
COLLAPSE_INDEX: false,
|
||||
FILE_SUFFIX: '.html',
|
||||
HAS_SOURCE: true
|
||||
@ -25,7 +25,7 @@
|
||||
<script type="text/javascript" src="../../_static/jquery.js"></script>
|
||||
<script type="text/javascript" src="../../_static/underscore.js"></script>
|
||||
<script type="text/javascript" src="../../_static/doctools.js"></script>
|
||||
<link rel="top" title="Lorax 19.7.18 documentation" href="../../index.html" />
|
||||
<link rel="top" title="Lorax 19.7.21 documentation" href="../../index.html" />
|
||||
<link rel="up" title="pylorax" href="../pylorax.html" />
|
||||
</head>
|
||||
<body>
|
||||
@ -38,7 +38,7 @@
|
||||
<li class="right" >
|
||||
<a href="../../py-modindex.html" title="Python Module Index"
|
||||
>modules</a> |</li>
|
||||
<li><a href="../../index.html">Lorax 19.7.18 documentation</a> »</li>
|
||||
<li><a href="../../index.html">Lorax 19.7.21 documentation</a> »</li>
|
||||
<li><a href="../index.html" >Module code</a> »</li>
|
||||
<li><a href="../pylorax.html" accesskey="U">pylorax</a> »</li>
|
||||
</ul>
|
||||
@ -140,7 +140,7 @@
|
||||
<li class="right" >
|
||||
<a href="../../py-modindex.html" title="Python Module Index"
|
||||
>modules</a> |</li>
|
||||
<li><a href="../../index.html">Lorax 19.7.18 documentation</a> »</li>
|
||||
<li><a href="../../index.html">Lorax 19.7.21 documentation</a> »</li>
|
||||
<li><a href="../index.html" >Module code</a> »</li>
|
||||
<li><a href="../pylorax.html" >pylorax</a> »</li>
|
||||
</ul>
|
||||
|
@ -8,7 +8,7 @@
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
|
||||
<title>pylorax.yumhelper — Lorax 19.7.18 documentation</title>
|
||||
<title>pylorax.yumhelper — Lorax 19.7.21 documentation</title>
|
||||
|
||||
<link rel="stylesheet" href="../../_static/default.css" type="text/css" />
|
||||
<link rel="stylesheet" href="../../_static/pygments.css" type="text/css" />
|
||||
@ -16,7 +16,7 @@
|
||||
<script type="text/javascript">
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT: '../../',
|
||||
VERSION: '19.7.18',
|
||||
VERSION: '19.7.21',
|
||||
COLLAPSE_INDEX: false,
|
||||
FILE_SUFFIX: '.html',
|
||||
HAS_SOURCE: true
|
||||
@ -25,7 +25,7 @@
|
||||
<script type="text/javascript" src="../../_static/jquery.js"></script>
|
||||
<script type="text/javascript" src="../../_static/underscore.js"></script>
|
||||
<script type="text/javascript" src="../../_static/doctools.js"></script>
|
||||
<link rel="top" title="Lorax 19.7.18 documentation" href="../../index.html" />
|
||||
<link rel="top" title="Lorax 19.7.21 documentation" href="../../index.html" />
|
||||
<link rel="up" title="pylorax" href="../pylorax.html" />
|
||||
</head>
|
||||
<body>
|
||||
@ -38,7 +38,7 @@
|
||||
<li class="right" >
|
||||
<a href="../../py-modindex.html" title="Python Module Index"
|
||||
>modules</a> |</li>
|
||||
<li><a href="../../index.html">Lorax 19.7.18 documentation</a> »</li>
|
||||
<li><a href="../../index.html">Lorax 19.7.21 documentation</a> »</li>
|
||||
<li><a href="../index.html" >Module code</a> »</li>
|
||||
<li><a href="../pylorax.html" accesskey="U">pylorax</a> »</li>
|
||||
</ul>
|
||||
@ -208,7 +208,7 @@
|
||||
<li class="right" >
|
||||
<a href="../../py-modindex.html" title="Python Module Index"
|
||||
>modules</a> |</li>
|
||||
<li><a href="../../index.html">Lorax 19.7.18 documentation</a> »</li>
|
||||
<li><a href="../../index.html">Lorax 19.7.21 documentation</a> »</li>
|
||||
<li><a href="../index.html" >Module code</a> »</li>
|
||||
<li><a href="../pylorax.html" >pylorax</a> »</li>
|
||||
</ul>
|
||||
|
62
lorax-composer/_sources/composer-cli.rst.txt
Normal file
62
lorax-composer/_sources/composer-cli.rst.txt
Normal file
@ -0,0 +1,62 @@
|
||||
composer-cli
|
||||
============
|
||||
|
||||
:Authors:
|
||||
Brian C. Lane <bcl@redhat.com>
|
||||
|
||||
``composer-cli`` is used to interact with the ``lorax-composer`` API server, managing blueprints, exploring available packages, and building new images.
|
||||
|
||||
It requires `lorax-composer <lorax-composer.html>`_ to be installed on the
|
||||
local system, and the user running it needs to be a member of the ``weldr``
|
||||
group. They do not need to be root, but all of the `security precautions
|
||||
<lorax-composer.html#security>`_ apply.
|
||||
|
||||
composer-cli cmdline arguments
|
||||
------------------------------
|
||||
|
||||
.. argparse::
|
||||
:ref: composer.cli.cmdline.composer_cli_parser
|
||||
:prog: composer-cli
|
||||
|
||||
Edit a Blueprint
|
||||
----------------
|
||||
|
||||
Start out by listing the available blueprints using ``composer-cli blueprints
|
||||
list``, pick one and save it to the local directory by running ``composer-cli
|
||||
blueprints save http-server``. If there are no blueprints available you can
|
||||
copy one of the examples `from the test suite
|
||||
<https://github.com/weldr/lorax/tree/master/tests/pylorax/blueprints/>`_.
|
||||
|
||||
Edit the file (it will be saved with a .toml extension) and change the
|
||||
description, add a package or module to it. Send it back to the server by
|
||||
running ``composer-cli blueprints push http-server.toml``. You can verify that it was
|
||||
saved by viewing the changelog - ``composer-cli blueprints changes http-server``.
|
||||
|
||||
Build an image
|
||||
----------------
|
||||
|
||||
Build a ``qcow2`` disk image from this blueprint by running ``composer-cli
|
||||
compose start http-server qcow2``. It will print a UUID that you can use to
|
||||
keep track of the build. You can also cancel the build if needed.
|
||||
|
||||
The available types of images is displayed by ``composer-cli compose types``.
|
||||
Currently this consists of: ext4-filesystem, live-iso, partitioned-disk, qcow2,
|
||||
tar
|
||||
|
||||
Monitor the build status
|
||||
------------------------
|
||||
|
||||
Monitor it using ``composer-cli compose status``, which will show the status of
|
||||
all the builds on the system. You can view the end of the anaconda build logs
|
||||
once it is in the ``RUNNING`` state using ``composer-cli compose log UUID``
|
||||
where UUID is the UUID returned by the start command.
|
||||
|
||||
Once the build is in the ``FINISHED`` state you can download the image.
|
||||
|
||||
Download the image
|
||||
------------------
|
||||
|
||||
Downloading the final image is done with ``composer-cli compose image UUID`` and it will
|
||||
save the qcow2 image as ``UUID-disk.qcow2`` which you can then use to boot a VM like this::
|
||||
|
||||
qemu-kvm --name test-image -m 1024 -hda ./UUID-disk.qcow2
|
78
lorax-composer/_sources/composer.cli.rst.txt
Normal file
78
lorax-composer/_sources/composer.cli.rst.txt
Normal file
@ -0,0 +1,78 @@
|
||||
composer\.cli package
|
||||
=====================
|
||||
|
||||
Submodules
|
||||
----------
|
||||
|
||||
composer\.cli\.blueprints module
|
||||
--------------------------------
|
||||
|
||||
.. automodule:: composer.cli.blueprints
|
||||
:members:
|
||||
:undoc-members:
|
||||
:show-inheritance:
|
||||
|
||||
composer\.cli\.compose module
|
||||
-----------------------------
|
||||
|
||||
.. automodule:: composer.cli.compose
|
||||
:members:
|
||||
:undoc-members:
|
||||
:show-inheritance:
|
||||
|
||||
composer\.cli\.help module
|
||||
--------------------------
|
||||
|
||||
.. automodule:: composer.cli.help
|
||||
:members:
|
||||
:undoc-members:
|
||||
:show-inheritance:
|
||||
|
||||
composer\.cli\.modules module
|
||||
-----------------------------
|
||||
|
||||
.. automodule:: composer.cli.modules
|
||||
:members:
|
||||
:undoc-members:
|
||||
:show-inheritance:
|
||||
|
||||
composer\.cli\.projects module
|
||||
------------------------------
|
||||
|
||||
.. automodule:: composer.cli.projects
|
||||
:members:
|
||||
:undoc-members:
|
||||
:show-inheritance:
|
||||
|
||||
composer\.cli\.sources module
|
||||
-----------------------------
|
||||
|
||||
.. automodule:: composer.cli.sources
|
||||
:members:
|
||||
:undoc-members:
|
||||
:show-inheritance:
|
||||
|
||||
composer\.cli\.status module
|
||||
----------------------------
|
||||
|
||||
.. automodule:: composer.cli.status
|
||||
:members:
|
||||
:undoc-members:
|
||||
:show-inheritance:
|
||||
|
||||
composer\.cli\.utilities module
|
||||
-------------------------------
|
||||
|
||||
.. automodule:: composer.cli.utilities
|
||||
:members:
|
||||
:undoc-members:
|
||||
:show-inheritance:
|
||||
|
||||
|
||||
Module contents
|
||||
---------------
|
||||
|
||||
.. automodule:: composer.cli
|
||||
:members:
|
||||
:undoc-members:
|
||||
:show-inheritance:
|
@ -57,6 +57,14 @@ cli Package
|
||||
:undoc-members:
|
||||
:show-inheritance:
|
||||
|
||||
:mod:`status` Module
|
||||
--------------------
|
||||
|
||||
.. automodule:: composer.cli.status
|
||||
:members:
|
||||
:undoc-members:
|
||||
:show-inheritance:
|
||||
|
||||
:mod:`utilities` Module
|
||||
-----------------------
|
||||
|
||||
|
37
lorax-composer/_sources/composer.rst.txt
Normal file
37
lorax-composer/_sources/composer.rst.txt
Normal file
@ -0,0 +1,37 @@
|
||||
composer package
|
||||
================
|
||||
|
||||
Subpackages
|
||||
-----------
|
||||
|
||||
.. toctree::
|
||||
|
||||
composer.cli
|
||||
|
||||
Submodules
|
||||
----------
|
||||
|
||||
composer\.http\_client module
|
||||
-----------------------------
|
||||
|
||||
.. automodule:: composer.http_client
|
||||
:members:
|
||||
:undoc-members:
|
||||
:show-inheritance:
|
||||
|
||||
composer\.unix\_socket module
|
||||
-----------------------------
|
||||
|
||||
.. automodule:: composer.unix_socket
|
||||
:members:
|
||||
:undoc-members:
|
||||
:show-inheritance:
|
||||
|
||||
|
||||
Module contents
|
||||
---------------
|
||||
|
||||
.. automodule:: composer
|
||||
:members:
|
||||
:undoc-members:
|
||||
:show-inheritance:
|
29
lorax-composer/_sources/index.rst.txt
Normal file
29
lorax-composer/_sources/index.rst.txt
Normal file
@ -0,0 +1,29 @@
|
||||
.. Lorax documentation master file, created by
|
||||
sphinx-quickstart on Wed Apr 8 13:46:00 2015.
|
||||
You can adapt this file completely to your liking, but it should at least
|
||||
contain the root `toctree` directive.
|
||||
|
||||
Welcome to Lorax's documentation!
|
||||
=================================
|
||||
|
||||
Contents:
|
||||
|
||||
.. toctree::
|
||||
:maxdepth: 1
|
||||
|
||||
intro
|
||||
lorax
|
||||
livemedia-creator
|
||||
lorax-composer
|
||||
composer-cli
|
||||
product-images
|
||||
modules
|
||||
|
||||
|
||||
Indices and tables
|
||||
==================
|
||||
|
||||
* :ref:`genindex`
|
||||
* :ref:`modindex`
|
||||
* :ref:`search`
|
||||
|
67
lorax-composer/_sources/intro.rst.txt
Normal file
67
lorax-composer/_sources/intro.rst.txt
Normal file
@ -0,0 +1,67 @@
|
||||
Introduction to Lorax
|
||||
=====================
|
||||
|
||||
I am the Lorax. I speak for the trees [and images].
|
||||
|
||||
Lorax is used to build the Anaconda Installer boot.iso, it consists of a
|
||||
library, pylorax, a set of templates, and the lorax script. Its operation
|
||||
is driven by a customized set of Mako templates that lists the packages
|
||||
to be installed, steps to execute to remove unneeded files, and creation
|
||||
of the iso for all of the supported architectures.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Before Lorax
|
||||
============
|
||||
|
||||
Tree building tools such as pungi and revisor rely on 'buildinstall' in
|
||||
anaconda/scripts/ to produce the boot images and other such control files
|
||||
in the final tree. The existing buildinstall scripts written in a mix of
|
||||
bash and Python are unmaintainable. Lorax is an attempt to replace them
|
||||
with something more flexible.
|
||||
|
||||
|
||||
EXISTING WORKFLOW:
|
||||
|
||||
pungi and other tools call scripts/buildinstall, which in turn call other
|
||||
scripts to do the image building and data generation. Here's how it
|
||||
currently looks:
|
||||
|
||||
-> buildinstall
|
||||
* process command line options
|
||||
* write temporary yum.conf to point to correct repo
|
||||
* find anaconda release RPM
|
||||
* unpack RPM, pull in those versions of upd-instroot, mk-images,
|
||||
maketreeinfo.py, makestamp.py, and buildinstall
|
||||
|
||||
-> call upd-instroot
|
||||
|
||||
-> call maketreeinfo.py
|
||||
|
||||
-> call mk-images (which figures out which mk-images.ARCH to call)
|
||||
|
||||
-> call makestamp.py
|
||||
|
||||
* clean up
|
||||
|
||||
|
||||
PROBLEMS:
|
||||
|
||||
The existing workflow presents some problems with maintaining the scripts.
|
||||
First, almost all knowledge of what goes in to the stage 1 and stage 2
|
||||
images lives in upd-instroot. The mk-images* scripts copy things from the
|
||||
root created by upd-instroot in order to build the stage 1 image, though
|
||||
it's not completely clear from reading the scripts.
|
||||
|
||||
|
||||
NEW IDEAS:
|
||||
|
||||
Create a new central driver with all information living in Python modules.
|
||||
Configuration files will provide the knowledge previously contained in the
|
||||
upd-instroot and mk-images* scripts.
|
||||
|
||||
|
||||
|
391
lorax-composer/_sources/livemedia-creator.rst.txt
Normal file
391
lorax-composer/_sources/livemedia-creator.rst.txt
Normal file
@ -0,0 +1,391 @@
|
||||
livemedia-creator
|
||||
=================
|
||||
|
||||
:Authors:
|
||||
Brian C. Lane <bcl@redhat.com>
|
||||
|
||||
livemedia-creator uses `Anaconda <https://github.com/rhinstaller/anaconda>`_,
|
||||
`kickstart <https://github.com/rhinstaller/pykickstart>`_ and `Lorax
|
||||
<https://github.com/rhinstaller/lorax>`_ to create bootable media that use the
|
||||
same install path as a normal system installation. It can be used to make live
|
||||
isos, bootable (partitioned) disk images, tarfiles, and filesystem images for
|
||||
use with virtualization and container solutions like libvirt, docker, and
|
||||
OpenStack.
|
||||
|
||||
The general idea is to use virt-install with kickstart and an Anaconda boot.iso to
|
||||
install into a disk image and then use the disk image to create the bootable
|
||||
media.
|
||||
|
||||
livemedia-creator --help will describe all of the options available. At the
|
||||
minimum you need:
|
||||
|
||||
``--make-iso`` to create a final bootable .iso or one of the other ``--make-*`` options.
|
||||
|
||||
``--iso`` to specify the Anaconda install media to use with virt-install.
|
||||
|
||||
``--ks`` to select the kickstart file describing what to install.
|
||||
|
||||
To use livemedia-creator with virtualization you will need to have virt-install installed.
|
||||
|
||||
If you are going to be using Anaconda directly, with ``--no-virt`` mode, make sure
|
||||
you have the anaconda-tui package installed.
|
||||
|
||||
Conventions used in this document:
|
||||
|
||||
``lmc`` is an abbreviation for livemedia-creator.
|
||||
|
||||
``builder`` is the system where livemedia-creator is being run
|
||||
|
||||
``image`` is the disk image being created by running livemedia-creator
|
||||
|
||||
|
||||
livemedia-creator cmdline arguments
|
||||
-----------------------------------
|
||||
|
||||
See the output from ``livemedia-creator --help`` for the commandline arguments.
|
||||
|
||||
Quickstart
|
||||
----------
|
||||
|
||||
Run this to create a bootable live iso::
|
||||
|
||||
sudo livemedia-creator --make-iso \
|
||||
--iso=/extra/iso/boot.iso --ks=./docs/rhel7-livemedia.ks
|
||||
|
||||
You can run it directly from the lorax git repo like this::
|
||||
|
||||
sudo PATH=./src/sbin/:$PATH PYTHONPATH=./src/ ./src/sbin/livemedia-creator \
|
||||
--make-iso --iso=/extra/iso/boot.iso \
|
||||
--ks=./docs/rhel7-livemedia.ks --lorax-templates=./share/
|
||||
|
||||
You can observe the installation using vnc. The logs will show what port was
|
||||
chosen, or you can use a specific port by passing it. eg. ``--vnc vnc:127.0.0.1:5``
|
||||
|
||||
This is usually a good idea when testing changes to the kickstart. lmc tries
|
||||
to monitor the logs for fatal errors, but may not catch everything.
|
||||
|
||||
|
||||
How ISO creation works
|
||||
----------------------
|
||||
|
||||
There are 2 stages, the install stage which produces a disk or filesystem image
|
||||
as its output, and the boot media creation which uses the image as its input.
|
||||
Normally you would run both stages, but it is possible to stop after the
|
||||
install stage, by using ``--image-only``, or to skip the install stage and use
|
||||
a previously created disk image by passing ``--disk-image`` or ``--fs-image``
|
||||
|
||||
When creating an iso virt-install boots using the passed Anaconda installer iso
|
||||
and installs the system based on the kickstart. The ``%post`` section of the
|
||||
kickstart is used to customize the installed system in the same way that
|
||||
current spin-kickstarts do.
|
||||
|
||||
livemedia-creator monitors the install process for problems by watching the
|
||||
install logs. They are written to the current directory or to the base
|
||||
directory specified by the --logfile command. You can also monitor the install
|
||||
by using a vnc client. This is recommended when first modifying a kickstart,
|
||||
since there are still places where Anaconda may get stuck without the log
|
||||
monitor catching it.
|
||||
|
||||
The output from this process is a partitioned disk image. kpartx can be used
|
||||
to mount and examine it when there is a problem with the install. It can also
|
||||
be booted using kvm.
|
||||
|
||||
When creating an iso the disk image's / partition is copied into a formatted
|
||||
filesystem image which is then used as the input to lorax for creation of the
|
||||
final media.
|
||||
|
||||
The final image is created by lorax, using the templates in /usr/share/lorax/live/
|
||||
or the live directory below the directory specified by ``--lorax-templates``. The
|
||||
templates are written using the Mako template system with some extra commands
|
||||
added by lorax.
|
||||
|
||||
|
||||
Kickstarts
|
||||
----------
|
||||
|
||||
The docs/ directory includes several example kickstarts, one to create a live
|
||||
desktop iso using GNOME, and another to create a minimal disk image. When
|
||||
creating your own kickstarts you should start with the minimal example, it
|
||||
includes several needed packages that are not always included by dependencies.
|
||||
|
||||
Or you can use existing spin kickstarts to create live media with a few
|
||||
changes. Here are the steps I used to convert the Fedora XFCE spin.
|
||||
|
||||
1. Flatten the xfce kickstart using ksflatten
|
||||
2. Add zerombr so you don't get the disk init dialog
|
||||
3. Add clearpart --all
|
||||
4. Add swap partition
|
||||
5. bootloader target
|
||||
6. Add shutdown to the kickstart
|
||||
7. Add network --bootproto=dhcp --activate to activate the network
|
||||
This works for F16 builds but for F15 and before you need to pass
|
||||
something on the cmdline that activate the network, like sshd:
|
||||
|
||||
``livemedia-creator --kernel-args="sshd"``
|
||||
|
||||
8. Add a root password::
|
||||
|
||||
rootpw rootme
|
||||
network --bootproto=dhcp --activate
|
||||
zerombr
|
||||
clearpart --all
|
||||
bootloader --location=mbr
|
||||
part swap --size=512
|
||||
shutdown
|
||||
|
||||
9. In the livesys script section of the %post remove the root password. This
|
||||
really depends on how the spin wants to work. You could add the live user
|
||||
that you create to the %wheel group so that sudo works if you wanted to.
|
||||
|
||||
``passwd -d root > /dev/null``
|
||||
|
||||
10. Remove /etc/fstab in %post, dracut handles mounting the rootfs
|
||||
|
||||
``cat /dev/null > /dev/fstab``
|
||||
|
||||
Do this only for live iso's, the filesystem will be mounted read only if
|
||||
there is no /etc/fstab
|
||||
|
||||
11. Don't delete initramfs files from /boot in %post
|
||||
12. When creating live iso's you need to have, at least, these packages in the %package section::
|
||||
dracut-config-generic
|
||||
dracut-live
|
||||
-dracut-config-rescue
|
||||
grub-efi
|
||||
memtest86+
|
||||
syslinux
|
||||
|
||||
One drawback to using virt-install is that it pulls the packages from the repo
|
||||
each time you run it. To speed things up you either need a local mirror of the
|
||||
packages, or you can use a caching proxy. When using a proxy you pass it to
|
||||
livemedia-creator like this:
|
||||
|
||||
``--proxy=http://proxy.yourdomain.com:3128``
|
||||
|
||||
You also need to use a specific mirror instead of mirrormanager so that the
|
||||
packages will get cached, so your kickstart url would look like:
|
||||
|
||||
``url --url="http://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/x86_64/os/"``
|
||||
|
||||
You can also add an update repo, but don't name it updates. Add --proxy to it
|
||||
as well.
|
||||
|
||||
|
||||
Anaconda image install (no-virt)
|
||||
--------------------------------
|
||||
|
||||
You can create images without using virt-install by passing ``--no-virt`` on
|
||||
the cmdline. This will use Anaconda's directory install feature to handle the
|
||||
install. There are a couple of things to keep in mind when doing this:
|
||||
|
||||
1. It will be most reliable when building images for the same release that the
|
||||
host is running. Because Anaconda has expectations about the system it is
|
||||
running under you may encounter strange bugs if you try to build newer or
|
||||
older releases.
|
||||
|
||||
2. Make sure selinux is set to permissive or disabled. It won't install
|
||||
correctly with selinux set to enforcing yet.
|
||||
|
||||
3. It may totally trash your host. So far I haven't had this happen, but the
|
||||
possibility exists that a bug in Anaconda could result in it operating on
|
||||
real devices. I recommend running it in a virt or on a system that you can
|
||||
afford to lose all data from.
|
||||
|
||||
The logs from anaconda will be placed in an ./anaconda/ directory in either
|
||||
the current directory or in the directory used for --logfile
|
||||
|
||||
Example cmdline:
|
||||
|
||||
``sudo livemedia-creator --make-iso --no-virt --ks=./rhel7-livemedia.ks``
|
||||
|
||||
.. note::
|
||||
Using no-virt to create a partitioned disk image (eg. --make-disk or
|
||||
--make-vagrant) will only create disks usable on the host platform (BIOS
|
||||
or UEFI). You can create BIOS partitioned disk images on UEFI by using
|
||||
virt.
|
||||
|
||||
|
||||
AMI Images
|
||||
----------
|
||||
|
||||
Amazon EC2 images can be created by using the --make-ami switch and an appropriate
|
||||
kickstart file. All of the work to customize the image is handled by the kickstart.
|
||||
The example currently included was modified from the cloud-kickstarts version so
|
||||
that it would work with livemedia-creator.
|
||||
|
||||
Example cmdline:
|
||||
|
||||
``sudo livemedia-creator --make-ami --iso=/path/to/boot.iso --ks=./docs/rhel7-livemedia-ec2.ks``
|
||||
|
||||
This will produce an ami-root.img file in the working directory.
|
||||
|
||||
At this time I have not tested the image with EC2. Feedback would be welcome.
|
||||
|
||||
|
||||
Appliance Creation
|
||||
------------------
|
||||
|
||||
livemedia-creator can now replace appliance-tools by using the --make-appliance
|
||||
switch. This will create the partitioned disk image and an XML file that can be
|
||||
used with virt-image to setup a virtual system.
|
||||
|
||||
The XML is generated using the Mako template from
|
||||
/usr/share/lorax/appliance/libvirt.xml You can use a different template by
|
||||
passing ``--app-template <template path>``
|
||||
|
||||
Documentation on the Mako template system can be found at the `Mako site
|
||||
<http://docs.makotemplates.org/en/latest/index.html>`_
|
||||
|
||||
The name of the final output XML is appliance.xml, this can be changed with
|
||||
``--app-file <file path>``
|
||||
|
||||
The following variables are passed to the template:
|
||||
|
||||
``disks``
|
||||
A list of disk_info about each disk.
|
||||
Each entry has the following attributes:
|
||||
|
||||
``name``
|
||||
base name of the disk image file
|
||||
|
||||
``format``
|
||||
"raw"
|
||||
|
||||
``checksum_type``
|
||||
"sha256"
|
||||
|
||||
``checksum``
|
||||
sha256 checksum of the disk image
|
||||
|
||||
``name``
|
||||
Name of appliance, from --app-name argument
|
||||
|
||||
``arch``
|
||||
Architecture
|
||||
|
||||
``memory``
|
||||
Memory in KB (from ``--ram``)
|
||||
|
||||
``vcpus``
|
||||
from ``--vcpus``
|
||||
|
||||
``networks``
|
||||
list of networks from the kickstart or []
|
||||
|
||||
``title``
|
||||
from ``--title``
|
||||
|
||||
``project``
|
||||
from ``--project``
|
||||
|
||||
``releasever``
|
||||
from ``--releasever``
|
||||
|
||||
The created image can be imported into libvirt using:
|
||||
|
||||
``virt-image appliance.xml``
|
||||
|
||||
You can also create qcow2 appliance images using ``--image-type=qcow2``, for example::
|
||||
|
||||
sudo livemedia-creator --make-appliance --iso=/path/to/boot.iso --ks=./docs/rhel7-minimal.ks \
|
||||
--image-type=qcow2 --app-file=minimal-test.xml --image-name=minimal-test.img
|
||||
|
||||
|
||||
Filesystem Image Creation
|
||||
-------------------------
|
||||
|
||||
livemedia-creator can be used to create un-partitined filesystem images using
|
||||
the ``--make-fsimage`` option. As of version 21.8 this works with both virt and
|
||||
no-virt modes of operation. Previously it was only available with no-virt.
|
||||
|
||||
Kickstarts should have a single / partition with no extra mountpoints.
|
||||
|
||||
``livemedia-creator --make-fsimage --iso=/path/to/boot.iso --ks=./docs/rhel7-minimal.ks``
|
||||
|
||||
You can name the output image with ``--image-name`` and set a label on the filesystem with ``--fs-label``
|
||||
|
||||
|
||||
TAR File Creation
|
||||
-----------------
|
||||
|
||||
The ``--make-tar`` command can be used to create a tar of the root filesystem. By
|
||||
default it is compressed using xz, but this can be changed using the
|
||||
``--compression`` and ``--compress-arg`` options. This option works with both virt and
|
||||
no-virt install methods.
|
||||
|
||||
As with ``--make-fsimage`` the kickstart should be limited to a single / partition.
|
||||
|
||||
For example::
|
||||
|
||||
livemedia-creator --make-tar --iso=/path/to/boot.iso --ks=./docs/rhel7-minimal.ks \
|
||||
--image-name=rhel7-root.tar.xz
|
||||
|
||||
|
||||
Live Image for PXE Boot
|
||||
-----------------------
|
||||
|
||||
The ``--make-pxe-live`` command will produce squashfs image containing live root
|
||||
filesystem that can be used for pxe boot. Directory with results will contain
|
||||
the live image, kernel image, initrd image and template of pxe configuration
|
||||
for the images.
|
||||
|
||||
|
||||
Atomic Live Image for PXE Boot
|
||||
------------------------------
|
||||
|
||||
The ``--make-ostree-live`` command will produce the same result as ``--make-pxe-live``
|
||||
for installations of Atomic Host. Example kickstart for such an installation
|
||||
using Atomic installer iso with local repo included in the image can be found
|
||||
in docs/rhel-atomic-pxe-live.ks.
|
||||
|
||||
The PXE images can also be created with ``--no-virt`` by using the example
|
||||
kickstart in docs/rhel-atomic-pxe-live-novirt.ks. This also works inside the
|
||||
mock environment.
|
||||
|
||||
|
||||
Debugging problems
|
||||
------------------
|
||||
|
||||
Sometimes an installation will get stuck. When using virt-install the logs will
|
||||
be written to ./virt-install.log and most of the time any problems that happen
|
||||
will be near the end of the file. lmc tries to detect common errors and will
|
||||
cancel the installation when they happen. But not everything can be caught.
|
||||
When creating a new kickstart it is helpful to use vnc so that you can monitor
|
||||
the installation as it happens, and if it gets stuck without lmc detecting the
|
||||
problem you can switch to tty1 and examine the system directly.
|
||||
|
||||
If it does get stuck the best way to cancel is to use kill -9 on the virt-install pid,
|
||||
lmc will detect that the process died and cleanup.
|
||||
|
||||
If lmc didn't handle the cleanup for some reason you can do this:
|
||||
1. ``sudo umount /tmp/lmc-XXXX`` to unmount the iso from its mountpoint.
|
||||
2. ``sudo rm -rf /tmp/lmc-XXXX``
|
||||
3. ``sudo rm /var/tmp/lmc-disk-XXXXX`` to remove the disk image.
|
||||
|
||||
Note that lmc uses the lmc- prefix for all of its temporary files and
|
||||
directories to make it easier to find and clean up leftovers.
|
||||
|
||||
The logs from the virt-install run are stored in virt-install.log, logs from
|
||||
livemedia-creator are in livemedia.log and program.log
|
||||
|
||||
You can add ``--image-only`` to skip the .iso creation and examine the resulting
|
||||
disk image. Or you can pass ``--keep-image`` to keep it around after the iso has
|
||||
been created.
|
||||
|
||||
Cleaning up aborted ``--no-virt`` installs can sometimes be accomplished by
|
||||
running the ``anaconda-cleanup`` script. As of Fedora 18 anaconda is
|
||||
multi-threaded and it can sometimes become stuck and refuse to exit. When this
|
||||
happens you can usually clean up by first killing the anaconda process then
|
||||
running ``anaconda-cleanup``.
|
||||
|
||||
|
||||
Hacking
|
||||
-------
|
||||
|
||||
Development on this will take place as part of the lorax project, and on the
|
||||
anaconda-devel-list mailing list, and `on github <https://github.com/rhinstaller/lorax>`_
|
||||
|
||||
Feedback, enhancements and bugs are welcome. You can use `bugzilla
|
||||
<https://bugzilla.redhat.com/enter_bug.cgi?product=Fedora&component=lorax>`_ to
|
||||
report bugs against the lorax component.
|
||||
|
312
lorax-composer/_sources/lorax-composer.rst.txt
Normal file
312
lorax-composer/_sources/lorax-composer.rst.txt
Normal file
@ -0,0 +1,312 @@
|
||||
lorax-composer
|
||||
==============
|
||||
|
||||
:Authors:
|
||||
Brian C. Lane <bcl@redhat.com>
|
||||
|
||||
``lorax-composer`` is an API server that allows you to build disk images using
|
||||
`Blueprints`_ to describe the package versions to be installed into the image.
|
||||
It is compatible with the Weldr project's bdcs-api REST protocol. More
|
||||
information on Weldr can be found `on the Weldr blog <http://www.weldr.io>`_.
|
||||
|
||||
Behind the scenes it uses `livemedia-creator <livemedia-creator.html>`_ and
|
||||
`Anaconda <https://anaconda-installer.readthedocs.io/en/latest/>`_ to handle the
|
||||
installation and configuration of the images.
|
||||
|
||||
Important Things To Note
|
||||
------------------------
|
||||
|
||||
* SELinux must be in Permissive mode. Anaconda requires SELinux be in permissive mode
|
||||
for image creation to work correctly. You can either edit the setting in the
|
||||
``/etc/sysconfig/selinux`` file, or run ``setenforce 0`` before starting lorax-composer.
|
||||
|
||||
* Some output types require packages from the RHEL 7 Optional repository. See the
|
||||
`Red Hat Enterprise Linux 7 documentation <https://access.redhat.com/solutions/392003>`_
|
||||
for information on how to enable it. Otherwise you will see image creation fail to
|
||||
depsolve even if the blueprint itself is correct.
|
||||
|
||||
Installation
|
||||
------------
|
||||
|
||||
The best way to install ``lorax-composer`` is to use ``sudo dnf install
|
||||
lorax-composer composer-cli``, this will setup the weldr user and install the
|
||||
systemd socket activation service. You will then need to enable it with ``sudo
|
||||
systemctl enable lorax-composer.socket && sudo systemctl start
|
||||
lorax-composer.socket``. This will leave the server off until the first request
|
||||
is made. Systemd will then launch the server and it will remain running until
|
||||
the system is rebooted.
|
||||
|
||||
Quickstart
|
||||
----------
|
||||
|
||||
1. Create a ``weldr`` user and group by running ``useradd weldr``
|
||||
2. Remove any pre-existing socket directory with ``rm -rf /run/weldr/``
|
||||
A new directory with correct permissions will be created the first time the server runs.
|
||||
3. Enable the socket activation with ``systemctl enable lorax-composer.socket
|
||||
&& sudo systemctl start lorax-composer.socket``.
|
||||
|
||||
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``
|
||||
route will be stored. If there are blueprint ``.toml`` files in the top level
|
||||
of the directory they will be imported into the blueprint git storage when
|
||||
``lorax-composer`` starts.
|
||||
|
||||
Logs
|
||||
----
|
||||
|
||||
Logs are stored under ``/var/log/lorax-composer/`` and include all console
|
||||
messages as well as extra debugging info and API requests.
|
||||
|
||||
Security
|
||||
--------
|
||||
|
||||
Some security related issues that you should be aware of before running ``lorax-composer``:
|
||||
|
||||
* One of the API server threads needs to retain root privileges in order to run Anaconda.
|
||||
* SELinux must be set to Permissive or disabled to allow ``livemedia-creator`` to run Anaconda.
|
||||
* Only allow authorized users access to the ``weldr`` group and socket.
|
||||
|
||||
Since Anaconda kickstarts are used there is the possibility that a user could
|
||||
inject commands into a blueprint that would result in the kickstart executing
|
||||
arbitrary code on the host. Only authorized users should be allowed to build
|
||||
images using ``lorax-composer``.
|
||||
|
||||
How it Works
|
||||
------------
|
||||
|
||||
The server runs as root, and as ``weldr``. Communication with it is via a unix
|
||||
domain socket (``/run/weldr/api.socket`` by default). The directory and socket
|
||||
are owned by ``root:weldr`` so that any user in the ``weldr`` group can use the API
|
||||
to control ``lorax-composer``.
|
||||
|
||||
At startup the server will check for the correct permissions and
|
||||
ownership of a pre-existing directory, or it will create a new one if it
|
||||
doesn't exist. The socket path and group owner's name can be changed from the
|
||||
cmdline by passing it the ``--socket`` and ``--group`` arguments.
|
||||
|
||||
It will then drop root privileges for the API thread and run as the ``weldr``
|
||||
user. The queue and compose thread still runs as root because it needs to be
|
||||
able to mount/umount files and run Anaconda.
|
||||
|
||||
Composing Images
|
||||
----------------
|
||||
|
||||
The `welder-web <https://github.com/weldr/welder-web/>`_ GUI project can be used to construct
|
||||
blueprints and create composes using a web browser.
|
||||
|
||||
Or use the command line with `composer-cli <composer-cli.html>`_.
|
||||
|
||||
Blueprints
|
||||
----------
|
||||
|
||||
Blueprints are simple text files in `TOML <https://github.com/toml-lang/toml>`_ format that describe
|
||||
which packages, and what versions, to install into the image. They can also define a limited set
|
||||
of customizations to make to the final image.
|
||||
|
||||
Example blueprints can be found in the ``lorax-composer`` `test suite
|
||||
<https://github.com/weldr/lorax/tree/master/tests/pylorax/blueprints/>`_, with a simple one
|
||||
looking like this::
|
||||
|
||||
name = "base"
|
||||
description = "A base system with bash"
|
||||
version = "0.0.1"
|
||||
|
||||
[[packages]]
|
||||
name = "bash"
|
||||
version = "4.4.*"
|
||||
|
||||
The ``name`` field is the name of the blueprint. It can contain spaces, but they will be converted to ``-``
|
||||
when it is written to disk. It should be short and descriptive.
|
||||
|
||||
``description`` can be a longer description of the blueprint, it is only used for display purposes.
|
||||
|
||||
``version`` is a `semver compatible <https://semver.org/>`_ version number. If
|
||||
a new blueprint is uploaded with the same ``version`` the server will
|
||||
automatically bump the PATCH level of the ``version``. If the ``version``
|
||||
doesn't match it will be used as is. eg. Uploading a blueprint with ``version``
|
||||
set to ``0.1.0`` when the existing blueprint ``version`` is ``0.0.1`` will
|
||||
result in the new blueprint being stored as ``version 0.1.0``.
|
||||
|
||||
[[packages]] and [[modules]]
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
These entries describe the package names and matching version glob to be installed into the image.
|
||||
|
||||
The names must match the names exactly, and the versions can be an exact match
|
||||
or a filesystem-like glob of the version using ``*`` wildcards and ``?``
|
||||
character matching.
|
||||
|
||||
NOTE: As of lorax-composer-29.2-1 the versions are not used for depsolving,
|
||||
that is planned for a future release. And currently there are no differences
|
||||
between ``packages`` and ``modules`` in ``lorax-composer``.
|
||||
|
||||
[[groups]]
|
||||
~~~~~~~~~~
|
||||
|
||||
These entries describe a group of packages to be installed into the image. Package groups are
|
||||
defined in the repository metadata. Each group has a descriptive name used primarily for display
|
||||
in user interfaces and an ID more commonly used in kickstart files. Here, the ID is the expected
|
||||
way of listing a group.
|
||||
|
||||
Groups have three different ways of categorizing their packages: mandatory, default, and optional.
|
||||
For purposes of blueprints, mandatory and default packages will be installed. There is no mechanism
|
||||
for selecting optional packages.
|
||||
|
||||
Customizations
|
||||
~~~~~~~~~~~~~~
|
||||
|
||||
The ``[[customizations]]`` section can be used to configure the hostname of the final image. eg.::
|
||||
|
||||
[[customizations]]
|
||||
hostname = "baseimage"
|
||||
|
||||
|
||||
[[customizations.sshkey]]
|
||||
*************************
|
||||
|
||||
Set an existing user's ssh key in the final image::
|
||||
|
||||
[[customizations.sshkey]]
|
||||
user = "root"
|
||||
key = "PUBLIC SSH KEY"
|
||||
|
||||
The key will be added to the user's authorized_keys file.
|
||||
|
||||
|
||||
[[customizations.user]]
|
||||
***********************
|
||||
|
||||
Add a user to the image, and/or set their ssh key.
|
||||
All fields for this section are optional except for the ``name``, here is a complete example::
|
||||
|
||||
[[customizations.user]]
|
||||
name = "admin"
|
||||
description = "Administrator account"
|
||||
password = "$6$CHO2$3rN8eviE2t50lmVyBYihTgVRHcaecmeCk31L..."
|
||||
key = "PUBLIC SSH KEY"
|
||||
home = "/srv/widget/"
|
||||
shell = "/usr/bin/bash"
|
||||
groups = ["widget", "users", "wheel"]
|
||||
uid = 1200
|
||||
gid = 1200
|
||||
|
||||
If the password starts with ``$6$``, ``$5$``, or ``$2b$`` it will be stored as
|
||||
an encrypted password. Otherwise it will be treated as a plain text password.
|
||||
|
||||
|
||||
[[customizations.group]]
|
||||
************************
|
||||
|
||||
Add a group to the image. ``name`` is required and ``gid`` is optional::
|
||||
|
||||
[[customizations.group]]
|
||||
name = "widget"
|
||||
gid = 1130
|
||||
|
||||
|
||||
Adding Output Types
|
||||
-------------------
|
||||
|
||||
``livemedia-creator`` supports a large number of output types, and only some of
|
||||
these are currently available via ``lorax-composer``. To add a new output type to
|
||||
lorax-composer a kickstart file needs to be added to ``./share/composer/``. The
|
||||
name of the kickstart is what will be used by the ``/compose/types`` route, and the
|
||||
``compose_type`` field of the POST to start a compose. It also needs to have
|
||||
code added to the :py:func:`pylorax.api.compose.compose_args` function. The
|
||||
``_MAP`` entry in this function defines what lorax-composer will pass to
|
||||
:py:func:`pylorax.installer.novirt_install` when it runs the compose. When the
|
||||
compose is finished the output files need to be copied out of the build
|
||||
directory (``/var/lib/lorax/composer/results/<UUID>/compose/``),
|
||||
:py:func:`pylorax.api.compose.move_compose_results` handles this for each type.
|
||||
You should move them instead of copying to save space.
|
||||
|
||||
If the new output type does not have support in livemedia-creator it should be
|
||||
added there first. This will make the output available to the widest number of
|
||||
users.
|
||||
|
||||
Example: Add partitioned disk support
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
Partitioned disk support is something that livemedia-creator already supports
|
||||
via the ``--make-disk`` cmdline argument. To add this to lorax-composer it
|
||||
needs 3 things:
|
||||
|
||||
* A ``partitioned-disk.ks`` file in ``./share/composer/``
|
||||
* A new entry in the _MAP in :py:func:`pylorax.api.compose.compose_args`
|
||||
* Add a bit of code to :py:func:`pylorax.api.compose.move_compose_results` to move the disk image from
|
||||
the compose directory to the results directory.
|
||||
|
||||
The ``partitioned-disk.ks`` is pretty similar to the example minimal kickstart
|
||||
in ``./docs/rhel7-minimal.ks``. You should remove the ``url`` and ``repo``
|
||||
commands, they will be added by the compose process. Make sure the bootloader
|
||||
packages are included in the ``%packages`` section at the end of the kickstart,
|
||||
and you will want to leave off the ``%end`` so that the compose can append the
|
||||
list of packages from the blueprint.
|
||||
|
||||
The new ``_MAP`` entry should be a copy of one of the existing entries, but with ``make_disk`` set
|
||||
to ``True``. Make sure that none of the other ``make_*`` options are ``True``. The ``image_name`` is
|
||||
what the name of the final image will be.
|
||||
|
||||
``move_compose_results()`` can be as simple as moving the output file into
|
||||
the results directory, or it could do some post-processing on it. The end of
|
||||
the function should always clean up the ``./compose/`` directory, removing any
|
||||
unneeded extra files. This is especially true for the ``live-iso`` since it produces
|
||||
the contents of the iso as well as the boot.iso itself.
|
||||
|
||||
Package Sources
|
||||
---------------
|
||||
|
||||
By default lorax-composer uses the host's configured repositories. It copies
|
||||
the ``*.repo`` files from ``/etc/yum.repos.d/`` into
|
||||
``/var/lib/lorax/composer/repos.d/`` at startup, these are immutable system
|
||||
repositories and cannot be deleted or changed. If you want to add additional
|
||||
repos you can put them into ``/var/lib/lorax/composer/repos.d/`` or use the
|
||||
``/api/v0/projects/source/*`` API routes to create them.
|
||||
|
||||
The new source can be added by doing a POST to the ``/api/v0/projects/source/new``
|
||||
route using JSON (with `Content-Type` header set to `application/json`) or TOML
|
||||
(with it set to `text/x-toml`). The format of the source looks like this (in
|
||||
TOML)::
|
||||
|
||||
name = "custom-source-1"
|
||||
url = "https://url/path/to/repository/"
|
||||
type = "yum-baseurl"
|
||||
proxy = "https://proxy-url/"
|
||||
check_ssl = true
|
||||
check_gpg = true
|
||||
gpgkey_urls = ["https://url/path/to/gpg-key"]
|
||||
|
||||
The ``proxy`` and ``gpgkey_urls`` entries are optional. All of the others are required. The supported
|
||||
types for the urls are:
|
||||
|
||||
* ``yum-baseurl`` is a URL to a yum repository.
|
||||
* ``yum-mirrorlist`` is a URL for a mirrorlist.
|
||||
* ``yum-metalink`` is a URL for a metalink.
|
||||
|
||||
If ``check_ssl`` is true the https certificates must be valid. If they are self-signed you can either set
|
||||
this to false, or add your Certificate Authority to the host system.
|
||||
|
||||
If ``check_gpg`` is true the GPG key must either be installed on the host system, or ``gpgkey_urls``
|
||||
should point to it.
|
||||
|
||||
You can edit an existing source (other than system sources), by doing a POST to the ``new`` route
|
||||
with the new version of the source. It will overwrite the previous one.
|
||||
|
||||
A list of existing sources is available from ``/api/v0/projects/source/list``, and detailed info
|
||||
on a source can be retrieved with the ``/api/v0/projects/source/info/<source-name>`` route. By default
|
||||
it returns JSON but it can also return TOML if ``?format=toml`` is added to the request.
|
||||
|
||||
Non-system sources can be deleted by doing a ``DELETE`` request to the
|
||||
``/api/v0/projects/source/delete/<source-name>`` route.
|
||||
|
||||
The documentation for the source API routes can be `found here <pylorax.api.html#api-v0-projects-source-list>`_
|
||||
|
||||
The configured sources are used for all blueprint depsolve operations, and for composing images.
|
||||
When adding additional sources you must make sure that the packages in the source do not
|
||||
conflict with any other package sources, otherwise depsolving will fail.
|
@ -34,7 +34,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
|
||||
----------
|
||||
@ -43,8 +49,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``
|
||||
@ -141,6 +152,18 @@ NOTE: As of lorax-composer-29.2-1 the versions are not used for depsolving,
|
||||
that is planned for a future release. And currently there are no differences
|
||||
between ``packages`` and ``modules`` in ``lorax-composer``.
|
||||
|
||||
[[groups]]
|
||||
~~~~~~~~~~
|
||||
|
||||
These entries describe a group of packages to be installed into the image. Package groups are
|
||||
defined in the repository metadata. Each group has a descriptive name used primarily for display
|
||||
in user interfaces and an ID more commonly used in kickstart files. Here, the ID is the expected
|
||||
way of listing a group.
|
||||
|
||||
Groups have three different ways of categorizing their packages: mandatory, default, and optional.
|
||||
For purposes of blueprints, mandatory and default packages will be installed. There is no mechanism
|
||||
for selecting optional packages.
|
||||
|
||||
Customizations
|
||||
~~~~~~~~~~~~~~
|
||||
|
||||
|
148
lorax-composer/_sources/lorax.rst.txt
Normal file
148
lorax-composer/_sources/lorax.rst.txt
Normal file
@ -0,0 +1,148 @@
|
||||
Lorax
|
||||
=====
|
||||
|
||||
:Authors:
|
||||
Brian C. Lane <bcl@redhat.com>
|
||||
|
||||
"I am the Lorax. I speak for the trees [and images]."
|
||||
|
||||
The `lorax <https://github.com/rhinstaller/lorax>`_ tool is used to create the
|
||||
`Anaconda <https://github.com/rhinstaller/anaconda>`_ installer boot.iso as
|
||||
well as the basic release tree, and .treeinfo metadata file. Its dependencies
|
||||
are fairly light-weight because it needs to be able to run in a mock chroot
|
||||
environment. It is best to run lorax from the same release as is being targeted
|
||||
because the templates may have release specific logic in them. eg. Use the
|
||||
rawhide version to build the boot.iso for rawhide, along with the rawhide
|
||||
repositories.
|
||||
|
||||
|
||||
lorax cmdline arguments
|
||||
-----------------------
|
||||
|
||||
See the output from ``lorax --help`` for the commandline arguments.
|
||||
|
||||
Quickstart
|
||||
----------
|
||||
|
||||
Run this as root to create a boot.iso in ``./results/``::
|
||||
|
||||
yum install lorax
|
||||
setenforce 0
|
||||
lorax -p RHEL -v 7 -r 7 \
|
||||
-s http://mirror.centos.org/centos-7/7/os/x86_64/ \
|
||||
-s http://mirror.centos.org/centos-7/7/updates/x86_64/ \
|
||||
./results/
|
||||
setenforce 1
|
||||
|
||||
You can add your own repos with ``-s`` and packages with higher NVRs will
|
||||
override the ones in the distribution repositories.
|
||||
|
||||
Under ``./results/`` will be the release tree files: .discinfo, .treeinfo, everything that
|
||||
goes onto the boot.iso, the pxeboot directory, and the boot.iso under ``./images/``.
|
||||
|
||||
|
||||
Running inside of mock
|
||||
----------------------
|
||||
|
||||
If you are using lorax with mock v1.3.4 or later you will need to pass
|
||||
``--old-chroot`` to mock. Mock now defaults to using systemd-nspawn which cannot
|
||||
create the needed loop device nodes. Passing ``--old-chroot`` will use the old
|
||||
system where ``/dev/loop*`` is setup for you.
|
||||
|
||||
|
||||
How it works
|
||||
------------
|
||||
|
||||
Lorax uses `yum <https://github.com/rpm-software-management/yum>`_ to install
|
||||
packages into a temporary directory, sets up configuration files, it then
|
||||
removes unneeded files to save space, and creates a squashfs filesystem of the
|
||||
files. The iso is then built using a generic initramfs and the kernel from the
|
||||
selected repositories.
|
||||
|
||||
To drive these processes Lorax uses a custom template system, based on `Mako
|
||||
templates <http://www.makotemplates.org/>`_ with the addition of custom
|
||||
commands (documented in :class:`pylorax.ltmpl.LoraxTemplateRunner`). Mako
|
||||
supports ``%if/%endif`` blocks as well as free-form python code inside ``<%
|
||||
%>`` tags and variable substitution with ``${}``. The default templates are
|
||||
shipped with lorax in ``/usr/share/lorax/`` and use the
|
||||
``.tmpl`` extension.
|
||||
|
||||
|
||||
runtime-install.tmpl
|
||||
~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
The ``runtime-install.tmpl`` template lists packages to be installed using the
|
||||
``installpkg`` command. This template is fairly simple, installing common packages and
|
||||
architecture specific packages. It must end with the ``run_pkg_transaction``
|
||||
command which tells dnf to download and install the packages.
|
||||
|
||||
|
||||
runtime-postinstall.tmpl
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
The ``runtime-postinstall.tmpl`` template is where the system configuration
|
||||
happens. The installer environment is similar to a normal running system, but
|
||||
needs some special handling. Configuration files are setup, systemd is told to
|
||||
start the anaconda.target instead of a default system target, and a number of
|
||||
unneeded services are disabled, some of which can interfere with the
|
||||
installation. A number of template commands are used here:
|
||||
|
||||
* :func:`append <pylorax.ltmpl.LoraxTemplateRunner.append>` to add text to a file.
|
||||
* :func:`chmod <pylorax.ltmpl.LoraxTemplateRunner.chmod>` changes the file's mode.
|
||||
* :func:`gconfset <pylorax.ltmpl.LoraxTemplateRunner.gconfset>` runs gconfset.
|
||||
* :func:`install <pylorax.ltmpl.LoraxTemplateRunner.install>` to install a file into the installroot.
|
||||
* :func:`mkdir <pylorax.ltmpl.LoraxTemplateRunner.mkdir>` makes a new directory.
|
||||
* :func:`move <pylorax.ltmpl.LoraxTemplateRunner.move>` to move a file into the installroot
|
||||
* :func:`replace <pylorax.ltmpl.LoraxTemplateRunner.replace>` does text substitution in a file
|
||||
* :func:`remove <pylorax.ltmpl.LoraxTemplateRunner.remove>` deletes a file
|
||||
* :func:`runcmd <pylorax.ltmpl.LoraxTemplateRunner.runcmd>` run arbitrary commands.
|
||||
* :func:`symlink <pylorax.ltmpl.LoraxTemplateRunner.symlink>` creates a symlink
|
||||
* :func:`systemctl <pylorax.ltmpl.LoraxTemplateRunner.systemctl>` runs systemctl in the installroot
|
||||
|
||||
|
||||
runtime-cleanup.tmpl
|
||||
~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
The ``runtime-cleanup.tmpl`` template is used to remove files that aren't strictly needed
|
||||
by the installation environment. In addition to the ``remove`` template command it uses:
|
||||
|
||||
* :func:`removepkg <pylorax.ltmpl.LoraxTemplateRunner.removepkg>`
|
||||
remove all of a specific package's contents. A package may be pulled in as a dependency, but
|
||||
not really used. eg. sound support.
|
||||
* :func:`removefrom <pylorax.ltmpl.LoraxTemplateRunner.removefrom>`
|
||||
Removes some files from a package. A file glob can be used, or the --allbut option to
|
||||
remove everything except a select few.
|
||||
* :func:`removekmod <pylorax.ltmpl.LoraxTemplateRunner.removekmod>`
|
||||
Removes kernel modules
|
||||
|
||||
|
||||
The squashfs filesystem
|
||||
~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
After ``runtime-*.tmpl`` templates have finished their work lorax creates an
|
||||
empty ext4 filesystem, copies the remaining files to it, and makes a squashfs
|
||||
filesystem of it. This file is the / of the boot.iso's installer environment
|
||||
and is what is in the LiveOS/squashfs.img file on the iso.
|
||||
|
||||
|
||||
iso creation
|
||||
~~~~~~~~~~~~
|
||||
|
||||
The iso creation is handled by another set of templates. The one used depends
|
||||
on the architecture that the iso is being created for. They are also stored in
|
||||
``/usr/share/lorax/`` and are named after the arch, like
|
||||
``x86.tmpl`` and ``aarch64.tmpl``. They handle creation of the tree, copying
|
||||
configuration template files, configuration variable substitution, treeinfo
|
||||
metadata (via the :func:`treeinfo <pylorax.ltmpl.LoraxTemplateRunner.treeinfo>`
|
||||
template command). Kernel and initrd are copied from the installroot to their
|
||||
final locations and then mkisofs is run to create the boot.iso
|
||||
|
||||
|
||||
Custom Templates
|
||||
----------------
|
||||
|
||||
The default set of templates and configuration files are shipped in the
|
||||
``/usr/share/lorax/`` directory. You can make a copy of them and place them
|
||||
into another directory and then select the new template directory by passing
|
||||
``--sharedir`` to lorax.
|
||||
|
8
lorax-composer/_sources/modules.rst.txt
Normal file
8
lorax-composer/_sources/modules.rst.txt
Normal file
@ -0,0 +1,8 @@
|
||||
src
|
||||
===
|
||||
|
||||
.. toctree::
|
||||
:maxdepth: 4
|
||||
|
||||
composer
|
||||
pylorax
|
27
lorax-composer/_sources/product-images.rst.txt
Normal file
27
lorax-composer/_sources/product-images.rst.txt
Normal file
@ -0,0 +1,27 @@
|
||||
Product and Updates Images
|
||||
==========================
|
||||
|
||||
Lorax now supports creation of product.img and updates.img as part of the build
|
||||
process. This is implemented using the installimg template command which will
|
||||
take the contents of a directory and create a compressed archive from it. The
|
||||
directory must be created by one of the packages installed by
|
||||
runtime-install.tmpl or by passing ``--installpkgs <pkgname>`` to lorax at
|
||||
runtime. The x86, ppc, ppc64le and aarch64 templates all look for
|
||||
/usr/share/lorax/product/ and /usr/share/lorax/updates/ directories in the
|
||||
install chroot while creating the final install tree. If there are files in
|
||||
those directories lorax will create images/product.img and/or
|
||||
images/updates.img
|
||||
|
||||
These archives are just like an anaconda updates image -- their contents are
|
||||
copied over the top of the filesystem at boot time so that you can drop in
|
||||
files to add to or replace anything on the filesystem.
|
||||
|
||||
Anaconda has several places that it looks for updates, the one for product.img
|
||||
is in /run/install/product. So for example, to add an installclass to Anaconda
|
||||
you would put your custom class here:
|
||||
|
||||
``/usr/share/lorax/product/run/install/product/pyanaconda/installclasses/custom.py``
|
||||
|
||||
If the packages containing the product/updates files are not included as part
|
||||
of normal dependencies you can add specific packages with the ``--installpkgs``
|
||||
command or the installpkgs paramater of :class:`pylorax.treebuilder.RuntimeBuilder`
|
126
lorax-composer/_sources/pylorax.api.rst.txt
Normal file
126
lorax-composer/_sources/pylorax.api.rst.txt
Normal file
@ -0,0 +1,126 @@
|
||||
pylorax\.api package
|
||||
====================
|
||||
|
||||
Submodules
|
||||
----------
|
||||
|
||||
pylorax\.api\.checkparams module
|
||||
--------------------------------
|
||||
|
||||
.. automodule:: pylorax.api.checkparams
|
||||
:members:
|
||||
:undoc-members:
|
||||
:show-inheritance:
|
||||
|
||||
pylorax\.api\.compose module
|
||||
----------------------------
|
||||
|
||||
.. automodule:: pylorax.api.compose
|
||||
:members:
|
||||
:undoc-members:
|
||||
:show-inheritance:
|
||||
|
||||
pylorax\.api\.config module
|
||||
---------------------------
|
||||
|
||||
.. automodule:: pylorax.api.config
|
||||
:members:
|
||||
:undoc-members:
|
||||
:show-inheritance:
|
||||
|
||||
pylorax\.api\.crossdomain module
|
||||
--------------------------------
|
||||
|
||||
.. automodule:: pylorax.api.crossdomain
|
||||
:members:
|
||||
:undoc-members:
|
||||
:show-inheritance:
|
||||
|
||||
pylorax\.api\.errors module
|
||||
---------------------------
|
||||
|
||||
.. automodule:: pylorax.api.errors
|
||||
:members:
|
||||
:undoc-members:
|
||||
:show-inheritance:
|
||||
|
||||
pylorax\.api\.projects module
|
||||
-----------------------------
|
||||
|
||||
.. automodule:: pylorax.api.projects
|
||||
:members:
|
||||
:undoc-members:
|
||||
:show-inheritance:
|
||||
|
||||
pylorax\.api\.queue module
|
||||
--------------------------
|
||||
|
||||
.. automodule:: pylorax.api.queue
|
||||
:members:
|
||||
:undoc-members:
|
||||
:show-inheritance:
|
||||
|
||||
pylorax\.api\.recipes module
|
||||
----------------------------
|
||||
|
||||
.. automodule:: pylorax.api.recipes
|
||||
:members:
|
||||
:undoc-members:
|
||||
:show-inheritance:
|
||||
|
||||
pylorax\.api\.regexes module
|
||||
----------------------------
|
||||
|
||||
.. automodule:: pylorax.api.regexes
|
||||
:members:
|
||||
:undoc-members:
|
||||
:show-inheritance:
|
||||
|
||||
pylorax\.api\.server module
|
||||
---------------------------
|
||||
|
||||
.. automodule:: pylorax.api.server
|
||||
:members:
|
||||
:undoc-members:
|
||||
:show-inheritance:
|
||||
|
||||
pylorax\.api\.timestamp module
|
||||
------------------------------
|
||||
|
||||
.. automodule:: pylorax.api.timestamp
|
||||
:members:
|
||||
:undoc-members:
|
||||
:show-inheritance:
|
||||
|
||||
pylorax\.api\.v0 module
|
||||
-----------------------
|
||||
|
||||
.. automodule:: pylorax.api.v0
|
||||
:members:
|
||||
:undoc-members:
|
||||
:show-inheritance:
|
||||
|
||||
pylorax\.api\.workspace module
|
||||
------------------------------
|
||||
|
||||
.. automodule:: pylorax.api.workspace
|
||||
:members:
|
||||
:undoc-members:
|
||||
:show-inheritance:
|
||||
|
||||
pylorax\.api\.yumbase module
|
||||
----------------------------
|
||||
|
||||
.. automodule:: pylorax.api.yumbase
|
||||
:members:
|
||||
:undoc-members:
|
||||
:show-inheritance:
|
||||
|
||||
|
||||
Module contents
|
||||
---------------
|
||||
|
||||
.. automodule:: pylorax.api
|
||||
:members:
|
||||
:undoc-members:
|
||||
:show-inheritance:
|
@ -9,6 +9,14 @@ api Package
|
||||
:undoc-members:
|
||||
:show-inheritance:
|
||||
|
||||
:mod:`checkparams` Module
|
||||
-------------------------
|
||||
|
||||
.. automodule:: pylorax.api.checkparams
|
||||
:members:
|
||||
:undoc-members:
|
||||
:show-inheritance:
|
||||
|
||||
:mod:`compose` Module
|
||||
---------------------
|
||||
|
||||
@ -33,6 +41,14 @@ api Package
|
||||
:undoc-members:
|
||||
:show-inheritance:
|
||||
|
||||
:mod:`errors` Module
|
||||
--------------------
|
||||
|
||||
.. automodule:: pylorax.api.errors
|
||||
:members:
|
||||
:undoc-members:
|
||||
:show-inheritance:
|
||||
|
||||
:mod:`projects` Module
|
||||
----------------------
|
||||
|
||||
@ -57,6 +73,14 @@ api Package
|
||||
:undoc-members:
|
||||
:show-inheritance:
|
||||
|
||||
:mod:`regexes` Module
|
||||
---------------------
|
||||
|
||||
.. automodule:: pylorax.api.regexes
|
||||
:members:
|
||||
:undoc-members:
|
||||
:show-inheritance:
|
||||
|
||||
:mod:`server` Module
|
||||
--------------------
|
||||
|
||||
@ -65,6 +89,14 @@ api Package
|
||||
:undoc-members:
|
||||
:show-inheritance:
|
||||
|
||||
:mod:`timestamp` Module
|
||||
-----------------------
|
||||
|
||||
.. automodule:: pylorax.api.timestamp
|
||||
:members:
|
||||
:undoc-members:
|
||||
:show-inheritance:
|
||||
|
||||
:mod:`v0` Module
|
||||
----------------
|
||||
|
||||
|
141
lorax-composer/_sources/pylorax.rst.txt
Normal file
141
lorax-composer/_sources/pylorax.rst.txt
Normal file
@ -0,0 +1,141 @@
|
||||
pylorax package
|
||||
===============
|
||||
|
||||
Subpackages
|
||||
-----------
|
||||
|
||||
.. toctree::
|
||||
|
||||
pylorax.api
|
||||
|
||||
Submodules
|
||||
----------
|
||||
|
||||
pylorax\.base module
|
||||
--------------------
|
||||
|
||||
.. automodule:: pylorax.base
|
||||
:members:
|
||||
:undoc-members:
|
||||
:show-inheritance:
|
||||
|
||||
pylorax\.buildstamp module
|
||||
--------------------------
|
||||
|
||||
.. automodule:: pylorax.buildstamp
|
||||
:members:
|
||||
:undoc-members:
|
||||
:show-inheritance:
|
||||
|
||||
pylorax\.creator module
|
||||
-----------------------
|
||||
|
||||
.. automodule:: pylorax.creator
|
||||
:members:
|
||||
:undoc-members:
|
||||
:show-inheritance:
|
||||
|
||||
pylorax\.decorators module
|
||||
--------------------------
|
||||
|
||||
.. automodule:: pylorax.decorators
|
||||
:members:
|
||||
:undoc-members:
|
||||
:show-inheritance:
|
||||
|
||||
pylorax\.discinfo module
|
||||
------------------------
|
||||
|
||||
.. automodule:: pylorax.discinfo
|
||||
:members:
|
||||
:undoc-members:
|
||||
:show-inheritance:
|
||||
|
||||
pylorax\.executils module
|
||||
-------------------------
|
||||
|
||||
.. automodule:: pylorax.executils
|
||||
:members:
|
||||
:undoc-members:
|
||||
:show-inheritance:
|
||||
|
||||
pylorax\.imgutils module
|
||||
------------------------
|
||||
|
||||
.. automodule:: pylorax.imgutils
|
||||
:members:
|
||||
:undoc-members:
|
||||
:show-inheritance:
|
||||
|
||||
pylorax\.installer module
|
||||
-------------------------
|
||||
|
||||
.. automodule:: pylorax.installer
|
||||
:members:
|
||||
:undoc-members:
|
||||
:show-inheritance:
|
||||
|
||||
pylorax\.logmonitor module
|
||||
--------------------------
|
||||
|
||||
.. automodule:: pylorax.logmonitor
|
||||
:members:
|
||||
:undoc-members:
|
||||
:show-inheritance:
|
||||
|
||||
pylorax\.ltmpl module
|
||||
---------------------
|
||||
|
||||
.. automodule:: pylorax.ltmpl
|
||||
:members:
|
||||
:undoc-members:
|
||||
:show-inheritance:
|
||||
|
||||
pylorax\.output module
|
||||
----------------------
|
||||
|
||||
.. automodule:: pylorax.output
|
||||
:members:
|
||||
:undoc-members:
|
||||
:show-inheritance:
|
||||
|
||||
pylorax\.sysutils module
|
||||
------------------------
|
||||
|
||||
.. automodule:: pylorax.sysutils
|
||||
:members:
|
||||
:undoc-members:
|
||||
:show-inheritance:
|
||||
|
||||
pylorax\.treebuilder module
|
||||
---------------------------
|
||||
|
||||
.. automodule:: pylorax.treebuilder
|
||||
:members:
|
||||
:undoc-members:
|
||||
:show-inheritance:
|
||||
|
||||
pylorax\.treeinfo module
|
||||
------------------------
|
||||
|
||||
.. automodule:: pylorax.treeinfo
|
||||
:members:
|
||||
:undoc-members:
|
||||
:show-inheritance:
|
||||
|
||||
pylorax\.yumhelper module
|
||||
-------------------------
|
||||
|
||||
.. automodule:: pylorax.yumhelper
|
||||
:members:
|
||||
:undoc-members:
|
||||
:show-inheritance:
|
||||
|
||||
|
||||
Module contents
|
||||
---------------
|
||||
|
||||
.. automodule:: pylorax
|
||||
:members:
|
||||
:undoc-members:
|
||||
:show-inheritance:
|
261
lorax-composer/_static/classic.css
Normal file
261
lorax-composer/_static/classic.css
Normal file
@ -0,0 +1,261 @@
|
||||
/*
|
||||
* classic.css_t
|
||||
* ~~~~~~~~~~~~~
|
||||
*
|
||||
* Sphinx stylesheet -- classic theme.
|
||||
*
|
||||
* :copyright: Copyright 2007-2018 by the Sphinx team, see AUTHORS.
|
||||
* :license: BSD, see LICENSE for details.
|
||||
*
|
||||
*/
|
||||
|
||||
@import url("basic.css");
|
||||
|
||||
/* -- page layout ----------------------------------------------------------- */
|
||||
|
||||
body {
|
||||
font-family: sans-serif;
|
||||
font-size: 100%;
|
||||
background-color: #11303d;
|
||||
color: #000;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
div.document {
|
||||
background-color: #1c4e63;
|
||||
}
|
||||
|
||||
div.documentwrapper {
|
||||
float: left;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
div.bodywrapper {
|
||||
margin: 0 0 0 230px;
|
||||
}
|
||||
|
||||
div.body {
|
||||
background-color: #ffffff;
|
||||
color: #000000;
|
||||
padding: 0 20px 30px 20px;
|
||||
}
|
||||
|
||||
div.footer {
|
||||
color: #ffffff;
|
||||
width: 100%;
|
||||
padding: 9px 0 9px 0;
|
||||
text-align: center;
|
||||
font-size: 75%;
|
||||
}
|
||||
|
||||
div.footer a {
|
||||
color: #ffffff;
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
div.related {
|
||||
background-color: #133f52;
|
||||
line-height: 30px;
|
||||
color: #ffffff;
|
||||
}
|
||||
|
||||
div.related a {
|
||||
color: #ffffff;
|
||||
}
|
||||
|
||||
div.sphinxsidebar {
|
||||
}
|
||||
|
||||
div.sphinxsidebar h3 {
|
||||
font-family: 'Trebuchet MS', sans-serif;
|
||||
color: #ffffff;
|
||||
font-size: 1.4em;
|
||||
font-weight: normal;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
div.sphinxsidebar h3 a {
|
||||
color: #ffffff;
|
||||
}
|
||||
|
||||
div.sphinxsidebar h4 {
|
||||
font-family: 'Trebuchet MS', sans-serif;
|
||||
color: #ffffff;
|
||||
font-size: 1.3em;
|
||||
font-weight: normal;
|
||||
margin: 5px 0 0 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
div.sphinxsidebar p {
|
||||
color: #ffffff;
|
||||
}
|
||||
|
||||
div.sphinxsidebar p.topless {
|
||||
margin: 5px 10px 10px 10px;
|
||||
}
|
||||
|
||||
div.sphinxsidebar ul {
|
||||
margin: 10px;
|
||||
padding: 0;
|
||||
color: #ffffff;
|
||||
}
|
||||
|
||||
div.sphinxsidebar a {
|
||||
color: #98dbcc;
|
||||
}
|
||||
|
||||
div.sphinxsidebar input {
|
||||
border: 1px solid #98dbcc;
|
||||
font-family: sans-serif;
|
||||
font-size: 1em;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* -- hyperlink styles ------------------------------------------------------ */
|
||||
|
||||
a {
|
||||
color: #355f7c;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
a:visited {
|
||||
color: #355f7c;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
a:hover {
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* -- body styles ----------------------------------------------------------- */
|
||||
|
||||
div.body h1,
|
||||
div.body h2,
|
||||
div.body h3,
|
||||
div.body h4,
|
||||
div.body h5,
|
||||
div.body h6 {
|
||||
font-family: 'Trebuchet MS', sans-serif;
|
||||
background-color: #f2f2f2;
|
||||
font-weight: normal;
|
||||
color: #20435c;
|
||||
border-bottom: 1px solid #ccc;
|
||||
margin: 20px -20px 10px -20px;
|
||||
padding: 3px 0 3px 10px;
|
||||
}
|
||||
|
||||
div.body h1 { margin-top: 0; font-size: 200%; }
|
||||
div.body h2 { font-size: 160%; }
|
||||
div.body h3 { font-size: 140%; }
|
||||
div.body h4 { font-size: 120%; }
|
||||
div.body h5 { font-size: 110%; }
|
||||
div.body h6 { font-size: 100%; }
|
||||
|
||||
a.headerlink {
|
||||
color: #c60f0f;
|
||||
font-size: 0.8em;
|
||||
padding: 0 4px 0 4px;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
a.headerlink:hover {
|
||||
background-color: #c60f0f;
|
||||
color: white;
|
||||
}
|
||||
|
||||
div.body p, div.body dd, div.body li, div.body blockquote {
|
||||
text-align: justify;
|
||||
line-height: 130%;
|
||||
}
|
||||
|
||||
div.admonition p.admonition-title + p {
|
||||
display: inline;
|
||||
}
|
||||
|
||||
div.admonition p {
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
|
||||
div.admonition pre {
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
|
||||
div.admonition ul, div.admonition ol {
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
|
||||
div.note {
|
||||
background-color: #eee;
|
||||
border: 1px solid #ccc;
|
||||
}
|
||||
|
||||
div.seealso {
|
||||
background-color: #ffc;
|
||||
border: 1px solid #ff6;
|
||||
}
|
||||
|
||||
div.topic {
|
||||
background-color: #eee;
|
||||
}
|
||||
|
||||
div.warning {
|
||||
background-color: #ffe4e4;
|
||||
border: 1px solid #f66;
|
||||
}
|
||||
|
||||
p.admonition-title {
|
||||
display: inline;
|
||||
}
|
||||
|
||||
p.admonition-title:after {
|
||||
content: ":";
|
||||
}
|
||||
|
||||
pre {
|
||||
padding: 5px;
|
||||
background-color: #eeffcc;
|
||||
color: #333333;
|
||||
line-height: 120%;
|
||||
border: 1px solid #ac9;
|
||||
border-left: none;
|
||||
border-right: none;
|
||||
}
|
||||
|
||||
code {
|
||||
background-color: #ecf0f3;
|
||||
padding: 0 1px 0 1px;
|
||||
font-size: 0.95em;
|
||||
}
|
||||
|
||||
th {
|
||||
background-color: #ede;
|
||||
}
|
||||
|
||||
.warning code {
|
||||
background: #efc2c2;
|
||||
}
|
||||
|
||||
.note code {
|
||||
background: #d6d6d6;
|
||||
}
|
||||
|
||||
.viewcode-back {
|
||||
font-family: sans-serif;
|
||||
}
|
||||
|
||||
div.viewcode-block:target {
|
||||
background-color: #f4debf;
|
||||
border-top: 1px solid #ac9;
|
||||
border-bottom: 1px solid #ac9;
|
||||
}
|
||||
|
||||
div.code-block-caption {
|
||||
color: #efefef;
|
||||
background-color: #1c4e63;
|
||||
}
|
10074
lorax-composer/_static/jquery-3.1.0.js
vendored
Normal file
10074
lorax-composer/_static/jquery-3.1.0.js
vendored
Normal file
File diff suppressed because it is too large
Load Diff
999
lorax-composer/_static/underscore-1.3.1.js
Normal file
999
lorax-composer/_static/underscore-1.3.1.js
Normal file
@ -0,0 +1,999 @@
|
||||
// Underscore.js 1.3.1
|
||||
// (c) 2009-2012 Jeremy Ashkenas, DocumentCloud Inc.
|
||||
// Underscore is freely distributable under the MIT license.
|
||||
// Portions of Underscore are inspired or borrowed from Prototype,
|
||||
// Oliver Steele's Functional, and John Resig's Micro-Templating.
|
||||
// For all details and documentation:
|
||||
// http://documentcloud.github.com/underscore
|
||||
|
||||
(function() {
|
||||
|
||||
// Baseline setup
|
||||
// --------------
|
||||
|
||||
// Establish the root object, `window` in the browser, or `global` on the server.
|
||||
var root = this;
|
||||
|
||||
// Save the previous value of the `_` variable.
|
||||
var previousUnderscore = root._;
|
||||
|
||||
// Establish the object that gets returned to break out of a loop iteration.
|
||||
var breaker = {};
|
||||
|
||||
// Save bytes in the minified (but not gzipped) version:
|
||||
var ArrayProto = Array.prototype, ObjProto = Object.prototype, FuncProto = Function.prototype;
|
||||
|
||||
// Create quick reference variables for speed access to core prototypes.
|
||||
var slice = ArrayProto.slice,
|
||||
unshift = ArrayProto.unshift,
|
||||
toString = ObjProto.toString,
|
||||
hasOwnProperty = ObjProto.hasOwnProperty;
|
||||
|
||||
// All **ECMAScript 5** native function implementations that we hope to use
|
||||
// are declared here.
|
||||
var
|
||||
nativeForEach = ArrayProto.forEach,
|
||||
nativeMap = ArrayProto.map,
|
||||
nativeReduce = ArrayProto.reduce,
|
||||
nativeReduceRight = ArrayProto.reduceRight,
|
||||
nativeFilter = ArrayProto.filter,
|
||||
nativeEvery = ArrayProto.every,
|
||||
nativeSome = ArrayProto.some,
|
||||
nativeIndexOf = ArrayProto.indexOf,
|
||||
nativeLastIndexOf = ArrayProto.lastIndexOf,
|
||||
nativeIsArray = Array.isArray,
|
||||
nativeKeys = Object.keys,
|
||||
nativeBind = FuncProto.bind;
|
||||
|
||||
// Create a safe reference to the Underscore object for use below.
|
||||
var _ = function(obj) { return new wrapper(obj); };
|
||||
|
||||
// Export the Underscore object for **Node.js**, with
|
||||
// backwards-compatibility for the old `require()` API. If we're in
|
||||
// the browser, add `_` as a global object via a string identifier,
|
||||
// for Closure Compiler "advanced" mode.
|
||||
if (typeof exports !== 'undefined') {
|
||||
if (typeof module !== 'undefined' && module.exports) {
|
||||
exports = module.exports = _;
|
||||
}
|
||||
exports._ = _;
|
||||
} else {
|
||||
root['_'] = _;
|
||||
}
|
||||
|
||||
// Current version.
|
||||
_.VERSION = '1.3.1';
|
||||
|
||||
// Collection Functions
|
||||
// --------------------
|
||||
|
||||
// The cornerstone, an `each` implementation, aka `forEach`.
|
||||
// Handles objects with the built-in `forEach`, arrays, and raw objects.
|
||||
// Delegates to **ECMAScript 5**'s native `forEach` if available.
|
||||
var each = _.each = _.forEach = function(obj, iterator, context) {
|
||||
if (obj == null) return;
|
||||
if (nativeForEach && obj.forEach === nativeForEach) {
|
||||
obj.forEach(iterator, context);
|
||||
} else if (obj.length === +obj.length) {
|
||||
for (var i = 0, l = obj.length; i < l; i++) {
|
||||
if (i in obj && iterator.call(context, obj[i], i, obj) === breaker) return;
|
||||
}
|
||||
} else {
|
||||
for (var key in obj) {
|
||||
if (_.has(obj, key)) {
|
||||
if (iterator.call(context, obj[key], key, obj) === breaker) return;
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
// Return the results of applying the iterator to each element.
|
||||
// Delegates to **ECMAScript 5**'s native `map` if available.
|
||||
_.map = _.collect = function(obj, iterator, context) {
|
||||
var results = [];
|
||||
if (obj == null) return results;
|
||||
if (nativeMap && obj.map === nativeMap) return obj.map(iterator, context);
|
||||
each(obj, function(value, index, list) {
|
||||
results[results.length] = iterator.call(context, value, index, list);
|
||||
});
|
||||
if (obj.length === +obj.length) results.length = obj.length;
|
||||
return results;
|
||||
};
|
||||
|
||||
// **Reduce** builds up a single result from a list of values, aka `inject`,
|
||||
// or `foldl`. Delegates to **ECMAScript 5**'s native `reduce` if available.
|
||||
_.reduce = _.foldl = _.inject = function(obj, iterator, memo, context) {
|
||||
var initial = arguments.length > 2;
|
||||
if (obj == null) obj = [];
|
||||
if (nativeReduce && obj.reduce === nativeReduce) {
|
||||
if (context) iterator = _.bind(iterator, context);
|
||||
return initial ? obj.reduce(iterator, memo) : obj.reduce(iterator);
|
||||
}
|
||||
each(obj, function(value, index, list) {
|
||||
if (!initial) {
|
||||
memo = value;
|
||||
initial = true;
|
||||
} else {
|
||||
memo = iterator.call(context, memo, value, index, list);
|
||||
}
|
||||
});
|
||||
if (!initial) throw new TypeError('Reduce of empty array with no initial value');
|
||||
return memo;
|
||||
};
|
||||
|
||||
// The right-associative version of reduce, also known as `foldr`.
|
||||
// Delegates to **ECMAScript 5**'s native `reduceRight` if available.
|
||||
_.reduceRight = _.foldr = function(obj, iterator, memo, context) {
|
||||
var initial = arguments.length > 2;
|
||||
if (obj == null) obj = [];
|
||||
if (nativeReduceRight && obj.reduceRight === nativeReduceRight) {
|
||||
if (context) iterator = _.bind(iterator, context);
|
||||
return initial ? obj.reduceRight(iterator, memo) : obj.reduceRight(iterator);
|
||||
}
|
||||
var reversed = _.toArray(obj).reverse();
|
||||
if (context && !initial) iterator = _.bind(iterator, context);
|
||||
return initial ? _.reduce(reversed, iterator, memo, context) : _.reduce(reversed, iterator);
|
||||
};
|
||||
|
||||
// Return the first value which passes a truth test. Aliased as `detect`.
|
||||
_.find = _.detect = function(obj, iterator, context) {
|
||||
var result;
|
||||
any(obj, function(value, index, list) {
|
||||
if (iterator.call(context, value, index, list)) {
|
||||
result = value;
|
||||
return true;
|
||||
}
|
||||
});
|
||||
return result;
|
||||
};
|
||||
|
||||
// Return all the elements that pass a truth test.
|
||||
// Delegates to **ECMAScript 5**'s native `filter` if available.
|
||||
// Aliased as `select`.
|
||||
_.filter = _.select = function(obj, iterator, context) {
|
||||
var results = [];
|
||||
if (obj == null) return results;
|
||||
if (nativeFilter && obj.filter === nativeFilter) return obj.filter(iterator, context);
|
||||
each(obj, function(value, index, list) {
|
||||
if (iterator.call(context, value, index, list)) results[results.length] = value;
|
||||
});
|
||||
return results;
|
||||
};
|
||||
|
||||
// Return all the elements for which a truth test fails.
|
||||
_.reject = function(obj, iterator, context) {
|
||||
var results = [];
|
||||
if (obj == null) return results;
|
||||
each(obj, function(value, index, list) {
|
||||
if (!iterator.call(context, value, index, list)) results[results.length] = value;
|
||||
});
|
||||
return results;
|
||||
};
|
||||
|
||||
// Determine whether all of the elements match a truth test.
|
||||
// Delegates to **ECMAScript 5**'s native `every` if available.
|
||||
// Aliased as `all`.
|
||||
_.every = _.all = function(obj, iterator, context) {
|
||||
var result = true;
|
||||
if (obj == null) return result;
|
||||
if (nativeEvery && obj.every === nativeEvery) return obj.every(iterator, context);
|
||||
each(obj, function(value, index, list) {
|
||||
if (!(result = result && iterator.call(context, value, index, list))) return breaker;
|
||||
});
|
||||
return result;
|
||||
};
|
||||
|
||||
// Determine if at least one element in the object matches a truth test.
|
||||
// Delegates to **ECMAScript 5**'s native `some` if available.
|
||||
// Aliased as `any`.
|
||||
var any = _.some = _.any = function(obj, iterator, context) {
|
||||
iterator || (iterator = _.identity);
|
||||
var result = false;
|
||||
if (obj == null) return result;
|
||||
if (nativeSome && obj.some === nativeSome) return obj.some(iterator, context);
|
||||
each(obj, function(value, index, list) {
|
||||
if (result || (result = iterator.call(context, value, index, list))) return breaker;
|
||||
});
|
||||
return !!result;
|
||||
};
|
||||
|
||||
// Determine if a given value is included in the array or object using `===`.
|
||||
// Aliased as `contains`.
|
||||
_.include = _.contains = function(obj, target) {
|
||||
var found = false;
|
||||
if (obj == null) return found;
|
||||
if (nativeIndexOf && obj.indexOf === nativeIndexOf) return obj.indexOf(target) != -1;
|
||||
found = any(obj, function(value) {
|
||||
return value === target;
|
||||
});
|
||||
return found;
|
||||
};
|
||||
|
||||
// Invoke a method (with arguments) on every item in a collection.
|
||||
_.invoke = function(obj, method) {
|
||||
var args = slice.call(arguments, 2);
|
||||
return _.map(obj, function(value) {
|
||||
return (_.isFunction(method) ? method || value : value[method]).apply(value, args);
|
||||
});
|
||||
};
|
||||
|
||||
// Convenience version of a common use case of `map`: fetching a property.
|
||||
_.pluck = function(obj, key) {
|
||||
return _.map(obj, function(value){ return value[key]; });
|
||||
};
|
||||
|
||||
// Return the maximum element or (element-based computation).
|
||||
_.max = function(obj, iterator, context) {
|
||||
if (!iterator && _.isArray(obj)) return Math.max.apply(Math, obj);
|
||||
if (!iterator && _.isEmpty(obj)) return -Infinity;
|
||||
var result = {computed : -Infinity};
|
||||
each(obj, function(value, index, list) {
|
||||
var computed = iterator ? iterator.call(context, value, index, list) : value;
|
||||
computed >= result.computed && (result = {value : value, computed : computed});
|
||||
});
|
||||
return result.value;
|
||||
};
|
||||
|
||||
// Return the minimum element (or element-based computation).
|
||||
_.min = function(obj, iterator, context) {
|
||||
if (!iterator && _.isArray(obj)) return Math.min.apply(Math, obj);
|
||||
if (!iterator && _.isEmpty(obj)) return Infinity;
|
||||
var result = {computed : Infinity};
|
||||
each(obj, function(value, index, list) {
|
||||
var computed = iterator ? iterator.call(context, value, index, list) : value;
|
||||
computed < result.computed && (result = {value : value, computed : computed});
|
||||
});
|
||||
return result.value;
|
||||
};
|
||||
|
||||
// Shuffle an array.
|
||||
_.shuffle = function(obj) {
|
||||
var shuffled = [], rand;
|
||||
each(obj, function(value, index, list) {
|
||||
if (index == 0) {
|
||||
shuffled[0] = value;
|
||||
} else {
|
||||
rand = Math.floor(Math.random() * (index + 1));
|
||||
shuffled[index] = shuffled[rand];
|
||||
shuffled[rand] = value;
|
||||
}
|
||||
});
|
||||
return shuffled;
|
||||
};
|
||||
|
||||
// Sort the object's values by a criterion produced by an iterator.
|
||||
_.sortBy = function(obj, iterator, context) {
|
||||
return _.pluck(_.map(obj, function(value, index, list) {
|
||||
return {
|
||||
value : value,
|
||||
criteria : iterator.call(context, value, index, list)
|
||||
};
|
||||
}).sort(function(left, right) {
|
||||
var a = left.criteria, b = right.criteria;
|
||||
return a < b ? -1 : a > b ? 1 : 0;
|
||||
}), 'value');
|
||||
};
|
||||
|
||||
// Groups the object's values by a criterion. Pass either a string attribute
|
||||
// to group by, or a function that returns the criterion.
|
||||
_.groupBy = function(obj, val) {
|
||||
var result = {};
|
||||
var iterator = _.isFunction(val) ? val : function(obj) { return obj[val]; };
|
||||
each(obj, function(value, index) {
|
||||
var key = iterator(value, index);
|
||||
(result[key] || (result[key] = [])).push(value);
|
||||
});
|
||||
return result;
|
||||
};
|
||||
|
||||
// Use a comparator function to figure out at what index an object should
|
||||
// be inserted so as to maintain order. Uses binary search.
|
||||
_.sortedIndex = function(array, obj, iterator) {
|
||||
iterator || (iterator = _.identity);
|
||||
var low = 0, high = array.length;
|
||||
while (low < high) {
|
||||
var mid = (low + high) >> 1;
|
||||
iterator(array[mid]) < iterator(obj) ? low = mid + 1 : high = mid;
|
||||
}
|
||||
return low;
|
||||
};
|
||||
|
||||
// Safely convert anything iterable into a real, live array.
|
||||
_.toArray = function(iterable) {
|
||||
if (!iterable) return [];
|
||||
if (iterable.toArray) return iterable.toArray();
|
||||
if (_.isArray(iterable)) return slice.call(iterable);
|
||||
if (_.isArguments(iterable)) return slice.call(iterable);
|
||||
return _.values(iterable);
|
||||
};
|
||||
|
||||
// Return the number of elements in an object.
|
||||
_.size = function(obj) {
|
||||
return _.toArray(obj).length;
|
||||
};
|
||||
|
||||
// Array Functions
|
||||
// ---------------
|
||||
|
||||
// Get the first element of an array. Passing **n** will return the first N
|
||||
// values in the array. Aliased as `head`. The **guard** check allows it to work
|
||||
// with `_.map`.
|
||||
_.first = _.head = function(array, n, guard) {
|
||||
return (n != null) && !guard ? slice.call(array, 0, n) : array[0];
|
||||
};
|
||||
|
||||
// Returns everything but the last entry of the array. Especcialy useful on
|
||||
// the arguments object. Passing **n** will return all the values in
|
||||
// the array, excluding the last N. The **guard** check allows it to work with
|
||||
// `_.map`.
|
||||
_.initial = function(array, n, guard) {
|
||||
return slice.call(array, 0, array.length - ((n == null) || guard ? 1 : n));
|
||||
};
|
||||
|
||||
// Get the last element of an array. Passing **n** will return the last N
|
||||
// values in the array. The **guard** check allows it to work with `_.map`.
|
||||
_.last = function(array, n, guard) {
|
||||
if ((n != null) && !guard) {
|
||||
return slice.call(array, Math.max(array.length - n, 0));
|
||||
} else {
|
||||
return array[array.length - 1];
|
||||
}
|
||||
};
|
||||
|
||||
// Returns everything but the first entry of the array. Aliased as `tail`.
|
||||
// Especially useful on the arguments object. Passing an **index** will return
|
||||
// the rest of the values in the array from that index onward. The **guard**
|
||||
// check allows it to work with `_.map`.
|
||||
_.rest = _.tail = function(array, index, guard) {
|
||||
return slice.call(array, (index == null) || guard ? 1 : index);
|
||||
};
|
||||
|
||||
// Trim out all falsy values from an array.
|
||||
_.compact = function(array) {
|
||||
return _.filter(array, function(value){ return !!value; });
|
||||
};
|
||||
|
||||
// Return a completely flattened version of an array.
|
||||
_.flatten = function(array, shallow) {
|
||||
return _.reduce(array, function(memo, value) {
|
||||
if (_.isArray(value)) return memo.concat(shallow ? value : _.flatten(value));
|
||||
memo[memo.length] = value;
|
||||
return memo;
|
||||
}, []);
|
||||
};
|
||||
|
||||
// Return a version of the array that does not contain the specified value(s).
|
||||
_.without = function(array) {
|
||||
return _.difference(array, slice.call(arguments, 1));
|
||||
};
|
||||
|
||||
// Produce a duplicate-free version of the array. If the array has already
|
||||
// been sorted, you have the option of using a faster algorithm.
|
||||
// Aliased as `unique`.
|
||||
_.uniq = _.unique = function(array, isSorted, iterator) {
|
||||
var initial = iterator ? _.map(array, iterator) : array;
|
||||
var result = [];
|
||||
_.reduce(initial, function(memo, el, i) {
|
||||
if (0 == i || (isSorted === true ? _.last(memo) != el : !_.include(memo, el))) {
|
||||
memo[memo.length] = el;
|
||||
result[result.length] = array[i];
|
||||
}
|
||||
return memo;
|
||||
}, []);
|
||||
return result;
|
||||
};
|
||||
|
||||
// Produce an array that contains the union: each distinct element from all of
|
||||
// the passed-in arrays.
|
||||
_.union = function() {
|
||||
return _.uniq(_.flatten(arguments, true));
|
||||
};
|
||||
|
||||
// Produce an array that contains every item shared between all the
|
||||
// passed-in arrays. (Aliased as "intersect" for back-compat.)
|
||||
_.intersection = _.intersect = function(array) {
|
||||
var rest = slice.call(arguments, 1);
|
||||
return _.filter(_.uniq(array), function(item) {
|
||||
return _.every(rest, function(other) {
|
||||
return _.indexOf(other, item) >= 0;
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
// Take the difference between one array and a number of other arrays.
|
||||
// Only the elements present in just the first array will remain.
|
||||
_.difference = function(array) {
|
||||
var rest = _.flatten(slice.call(arguments, 1));
|
||||
return _.filter(array, function(value){ return !_.include(rest, value); });
|
||||
};
|
||||
|
||||
// Zip together multiple lists into a single array -- elements that share
|
||||
// an index go together.
|
||||
_.zip = function() {
|
||||
var args = slice.call(arguments);
|
||||
var length = _.max(_.pluck(args, 'length'));
|
||||
var results = new Array(length);
|
||||
for (var i = 0; i < length; i++) results[i] = _.pluck(args, "" + i);
|
||||
return results;
|
||||
};
|
||||
|
||||
// If the browser doesn't supply us with indexOf (I'm looking at you, **MSIE**),
|
||||
// we need this function. Return the position of the first occurrence of an
|
||||
// item in an array, or -1 if the item is not included in the array.
|
||||
// Delegates to **ECMAScript 5**'s native `indexOf` if available.
|
||||
// If the array is large and already in sort order, pass `true`
|
||||
// for **isSorted** to use binary search.
|
||||
_.indexOf = function(array, item, isSorted) {
|
||||
if (array == null) return -1;
|
||||
var i, l;
|
||||
if (isSorted) {
|
||||
i = _.sortedIndex(array, item);
|
||||
return array[i] === item ? i : -1;
|
||||
}
|
||||
if (nativeIndexOf && array.indexOf === nativeIndexOf) return array.indexOf(item);
|
||||
for (i = 0, l = array.length; i < l; i++) if (i in array && array[i] === item) return i;
|
||||
return -1;
|
||||
};
|
||||
|
||||
// Delegates to **ECMAScript 5**'s native `lastIndexOf` if available.
|
||||
_.lastIndexOf = function(array, item) {
|
||||
if (array == null) return -1;
|
||||
if (nativeLastIndexOf && array.lastIndexOf === nativeLastIndexOf) return array.lastIndexOf(item);
|
||||
var i = array.length;
|
||||
while (i--) if (i in array && array[i] === item) return i;
|
||||
return -1;
|
||||
};
|
||||
|
||||
// Generate an integer Array containing an arithmetic progression. A port of
|
||||
// the native Python `range()` function. See
|
||||
// [the Python documentation](http://docs.python.org/library/functions.html#range).
|
||||
_.range = function(start, stop, step) {
|
||||
if (arguments.length <= 1) {
|
||||
stop = start || 0;
|
||||
start = 0;
|
||||
}
|
||||
step = arguments[2] || 1;
|
||||
|
||||
var len = Math.max(Math.ceil((stop - start) / step), 0);
|
||||
var idx = 0;
|
||||
var range = new Array(len);
|
||||
|
||||
while(idx < len) {
|
||||
range[idx++] = start;
|
||||
start += step;
|
||||
}
|
||||
|
||||
return range;
|
||||
};
|
||||
|
||||
// Function (ahem) Functions
|
||||
// ------------------
|
||||
|
||||
// Reusable constructor function for prototype setting.
|
||||
var ctor = function(){};
|
||||
|
||||
// Create a function bound to a given object (assigning `this`, and arguments,
|
||||
// optionally). Binding with arguments is also known as `curry`.
|
||||
// Delegates to **ECMAScript 5**'s native `Function.bind` if available.
|
||||
// We check for `func.bind` first, to fail fast when `func` is undefined.
|
||||
_.bind = function bind(func, context) {
|
||||
var bound, args;
|
||||
if (func.bind === nativeBind && nativeBind) return nativeBind.apply(func, slice.call(arguments, 1));
|
||||
if (!_.isFunction(func)) throw new TypeError;
|
||||
args = slice.call(arguments, 2);
|
||||
return bound = function() {
|
||||
if (!(this instanceof bound)) return func.apply(context, args.concat(slice.call(arguments)));
|
||||
ctor.prototype = func.prototype;
|
||||
var self = new ctor;
|
||||
var result = func.apply(self, args.concat(slice.call(arguments)));
|
||||
if (Object(result) === result) return result;
|
||||
return self;
|
||||
};
|
||||
};
|
||||
|
||||
// Bind all of an object's methods to that object. Useful for ensuring that
|
||||
// all callbacks defined on an object belong to it.
|
||||
_.bindAll = function(obj) {
|
||||
var funcs = slice.call(arguments, 1);
|
||||
if (funcs.length == 0) funcs = _.functions(obj);
|
||||
each(funcs, function(f) { obj[f] = _.bind(obj[f], obj); });
|
||||
return obj;
|
||||
};
|
||||
|
||||
// Memoize an expensive function by storing its results.
|
||||
_.memoize = function(func, hasher) {
|
||||
var memo = {};
|
||||
hasher || (hasher = _.identity);
|
||||
return function() {
|
||||
var key = hasher.apply(this, arguments);
|
||||
return _.has(memo, key) ? memo[key] : (memo[key] = func.apply(this, arguments));
|
||||
};
|
||||
};
|
||||
|
||||
// Delays a function for the given number of milliseconds, and then calls
|
||||
// it with the arguments supplied.
|
||||
_.delay = function(func, wait) {
|
||||
var args = slice.call(arguments, 2);
|
||||
return setTimeout(function(){ return func.apply(func, args); }, wait);
|
||||
};
|
||||
|
||||
// Defers a function, scheduling it to run after the current call stack has
|
||||
// cleared.
|
||||
_.defer = function(func) {
|
||||
return _.delay.apply(_, [func, 1].concat(slice.call(arguments, 1)));
|
||||
};
|
||||
|
||||
// Returns a function, that, when invoked, will only be triggered at most once
|
||||
// during a given window of time.
|
||||
_.throttle = function(func, wait) {
|
||||
var context, args, timeout, throttling, more;
|
||||
var whenDone = _.debounce(function(){ more = throttling = false; }, wait);
|
||||
return function() {
|
||||
context = this; args = arguments;
|
||||
var later = function() {
|
||||
timeout = null;
|
||||
if (more) func.apply(context, args);
|
||||
whenDone();
|
||||
};
|
||||
if (!timeout) timeout = setTimeout(later, wait);
|
||||
if (throttling) {
|
||||
more = true;
|
||||
} else {
|
||||
func.apply(context, args);
|
||||
}
|
||||
whenDone();
|
||||
throttling = true;
|
||||
};
|
||||
};
|
||||
|
||||
// Returns a function, that, as long as it continues to be invoked, will not
|
||||
// be triggered. The function will be called after it stops being called for
|
||||
// N milliseconds.
|
||||
_.debounce = function(func, wait) {
|
||||
var timeout;
|
||||
return function() {
|
||||
var context = this, args = arguments;
|
||||
var later = function() {
|
||||
timeout = null;
|
||||
func.apply(context, args);
|
||||
};
|
||||
clearTimeout(timeout);
|
||||
timeout = setTimeout(later, wait);
|
||||
};
|
||||
};
|
||||
|
||||
// Returns a function that will be executed at most one time, no matter how
|
||||
// often you call it. Useful for lazy initialization.
|
||||
_.once = function(func) {
|
||||
var ran = false, memo;
|
||||
return function() {
|
||||
if (ran) return memo;
|
||||
ran = true;
|
||||
return memo = func.apply(this, arguments);
|
||||
};
|
||||
};
|
||||
|
||||
// Returns the first function passed as an argument to the second,
|
||||
// allowing you to adjust arguments, run code before and after, and
|
||||
// conditionally execute the original function.
|
||||
_.wrap = function(func, wrapper) {
|
||||
return function() {
|
||||
var args = [func].concat(slice.call(arguments, 0));
|
||||
return wrapper.apply(this, args);
|
||||
};
|
||||
};
|
||||
|
||||
// Returns a function that is the composition of a list of functions, each
|
||||
// consuming the return value of the function that follows.
|
||||
_.compose = function() {
|
||||
var funcs = arguments;
|
||||
return function() {
|
||||
var args = arguments;
|
||||
for (var i = funcs.length - 1; i >= 0; i--) {
|
||||
args = [funcs[i].apply(this, args)];
|
||||
}
|
||||
return args[0];
|
||||
};
|
||||
};
|
||||
|
||||
// Returns a function that will only be executed after being called N times.
|
||||
_.after = function(times, func) {
|
||||
if (times <= 0) return func();
|
||||
return function() {
|
||||
if (--times < 1) { return func.apply(this, arguments); }
|
||||
};
|
||||
};
|
||||
|
||||
// Object Functions
|
||||
// ----------------
|
||||
|
||||
// Retrieve the names of an object's properties.
|
||||
// Delegates to **ECMAScript 5**'s native `Object.keys`
|
||||
_.keys = nativeKeys || function(obj) {
|
||||
if (obj !== Object(obj)) throw new TypeError('Invalid object');
|
||||
var keys = [];
|
||||
for (var key in obj) if (_.has(obj, key)) keys[keys.length] = key;
|
||||
return keys;
|
||||
};
|
||||
|
||||
// Retrieve the values of an object's properties.
|
||||
_.values = function(obj) {
|
||||
return _.map(obj, _.identity);
|
||||
};
|
||||
|
||||
// Return a sorted list of the function names available on the object.
|
||||
// Aliased as `methods`
|
||||
_.functions = _.methods = function(obj) {
|
||||
var names = [];
|
||||
for (var key in obj) {
|
||||
if (_.isFunction(obj[key])) names.push(key);
|
||||
}
|
||||
return names.sort();
|
||||
};
|
||||
|
||||
// Extend a given object with all the properties in passed-in object(s).
|
||||
_.extend = function(obj) {
|
||||
each(slice.call(arguments, 1), function(source) {
|
||||
for (var prop in source) {
|
||||
obj[prop] = source[prop];
|
||||
}
|
||||
});
|
||||
return obj;
|
||||
};
|
||||
|
||||
// Fill in a given object with default properties.
|
||||
_.defaults = function(obj) {
|
||||
each(slice.call(arguments, 1), function(source) {
|
||||
for (var prop in source) {
|
||||
if (obj[prop] == null) obj[prop] = source[prop];
|
||||
}
|
||||
});
|
||||
return obj;
|
||||
};
|
||||
|
||||
// Create a (shallow-cloned) duplicate of an object.
|
||||
_.clone = function(obj) {
|
||||
if (!_.isObject(obj)) return obj;
|
||||
return _.isArray(obj) ? obj.slice() : _.extend({}, obj);
|
||||
};
|
||||
|
||||
// Invokes interceptor with the obj, and then returns obj.
|
||||
// The primary purpose of this method is to "tap into" a method chain, in
|
||||
// order to perform operations on intermediate results within the chain.
|
||||
_.tap = function(obj, interceptor) {
|
||||
interceptor(obj);
|
||||
return obj;
|
||||
};
|
||||
|
||||
// Internal recursive comparison function.
|
||||
function eq(a, b, stack) {
|
||||
// Identical objects are equal. `0 === -0`, but they aren't identical.
|
||||
// See the Harmony `egal` proposal: http://wiki.ecmascript.org/doku.php?id=harmony:egal.
|
||||
if (a === b) return a !== 0 || 1 / a == 1 / b;
|
||||
// A strict comparison is necessary because `null == undefined`.
|
||||
if (a == null || b == null) return a === b;
|
||||
// Unwrap any wrapped objects.
|
||||
if (a._chain) a = a._wrapped;
|
||||
if (b._chain) b = b._wrapped;
|
||||
// Invoke a custom `isEqual` method if one is provided.
|
||||
if (a.isEqual && _.isFunction(a.isEqual)) return a.isEqual(b);
|
||||
if (b.isEqual && _.isFunction(b.isEqual)) return b.isEqual(a);
|
||||
// Compare `[[Class]]` names.
|
||||
var className = toString.call(a);
|
||||
if (className != toString.call(b)) return false;
|
||||
switch (className) {
|
||||
// Strings, numbers, dates, and booleans are compared by value.
|
||||
case '[object String]':
|
||||
// Primitives and their corresponding object wrappers are equivalent; thus, `"5"` is
|
||||
// equivalent to `new String("5")`.
|
||||
return a == String(b);
|
||||
case '[object Number]':
|
||||
// `NaN`s are equivalent, but non-reflexive. An `egal` comparison is performed for
|
||||
// other numeric values.
|
||||
return a != +a ? b != +b : (a == 0 ? 1 / a == 1 / b : a == +b);
|
||||
case '[object Date]':
|
||||
case '[object Boolean]':
|
||||
// Coerce dates and booleans to numeric primitive values. Dates are compared by their
|
||||
// millisecond representations. Note that invalid dates with millisecond representations
|
||||
// of `NaN` are not equivalent.
|
||||
return +a == +b;
|
||||
// RegExps are compared by their source patterns and flags.
|
||||
case '[object RegExp]':
|
||||
return a.source == b.source &&
|
||||
a.global == b.global &&
|
||||
a.multiline == b.multiline &&
|
||||
a.ignoreCase == b.ignoreCase;
|
||||
}
|
||||
if (typeof a != 'object' || typeof b != 'object') return false;
|
||||
// Assume equality for cyclic structures. The algorithm for detecting cyclic
|
||||
// structures is adapted from ES 5.1 section 15.12.3, abstract operation `JO`.
|
||||
var length = stack.length;
|
||||
while (length--) {
|
||||
// Linear search. Performance is inversely proportional to the number of
|
||||
// unique nested structures.
|
||||
if (stack[length] == a) return true;
|
||||
}
|
||||
// Add the first object to the stack of traversed objects.
|
||||
stack.push(a);
|
||||
var size = 0, result = true;
|
||||
// Recursively compare objects and arrays.
|
||||
if (className == '[object Array]') {
|
||||
// Compare array lengths to determine if a deep comparison is necessary.
|
||||
size = a.length;
|
||||
result = size == b.length;
|
||||
if (result) {
|
||||
// Deep compare the contents, ignoring non-numeric properties.
|
||||
while (size--) {
|
||||
// Ensure commutative equality for sparse arrays.
|
||||
if (!(result = size in a == size in b && eq(a[size], b[size], stack))) break;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// Objects with different constructors are not equivalent.
|
||||
if ('constructor' in a != 'constructor' in b || a.constructor != b.constructor) return false;
|
||||
// Deep compare objects.
|
||||
for (var key in a) {
|
||||
if (_.has(a, key)) {
|
||||
// Count the expected number of properties.
|
||||
size++;
|
||||
// Deep compare each member.
|
||||
if (!(result = _.has(b, key) && eq(a[key], b[key], stack))) break;
|
||||
}
|
||||
}
|
||||
// Ensure that both objects contain the same number of properties.
|
||||
if (result) {
|
||||
for (key in b) {
|
||||
if (_.has(b, key) && !(size--)) break;
|
||||
}
|
||||
result = !size;
|
||||
}
|
||||
}
|
||||
// Remove the first object from the stack of traversed objects.
|
||||
stack.pop();
|
||||
return result;
|
||||
}
|
||||
|
||||
// Perform a deep comparison to check if two objects are equal.
|
||||
_.isEqual = function(a, b) {
|
||||
return eq(a, b, []);
|
||||
};
|
||||
|
||||
// Is a given array, string, or object empty?
|
||||
// An "empty" object has no enumerable own-properties.
|
||||
_.isEmpty = function(obj) {
|
||||
if (_.isArray(obj) || _.isString(obj)) return obj.length === 0;
|
||||
for (var key in obj) if (_.has(obj, key)) return false;
|
||||
return true;
|
||||
};
|
||||
|
||||
// Is a given value a DOM element?
|
||||
_.isElement = function(obj) {
|
||||
return !!(obj && obj.nodeType == 1);
|
||||
};
|
||||
|
||||
// Is a given value an array?
|
||||
// Delegates to ECMA5's native Array.isArray
|
||||
_.isArray = nativeIsArray || function(obj) {
|
||||
return toString.call(obj) == '[object Array]';
|
||||
};
|
||||
|
||||
// Is a given variable an object?
|
||||
_.isObject = function(obj) {
|
||||
return obj === Object(obj);
|
||||
};
|
||||
|
||||
// Is a given variable an arguments object?
|
||||
_.isArguments = function(obj) {
|
||||
return toString.call(obj) == '[object Arguments]';
|
||||
};
|
||||
if (!_.isArguments(arguments)) {
|
||||
_.isArguments = function(obj) {
|
||||
return !!(obj && _.has(obj, 'callee'));
|
||||
};
|
||||
}
|
||||
|
||||
// Is a given value a function?
|
||||
_.isFunction = function(obj) {
|
||||
return toString.call(obj) == '[object Function]';
|
||||
};
|
||||
|
||||
// Is a given value a string?
|
||||
_.isString = function(obj) {
|
||||
return toString.call(obj) == '[object String]';
|
||||
};
|
||||
|
||||
// Is a given value a number?
|
||||
_.isNumber = function(obj) {
|
||||
return toString.call(obj) == '[object Number]';
|
||||
};
|
||||
|
||||
// Is the given value `NaN`?
|
||||
_.isNaN = function(obj) {
|
||||
// `NaN` is the only value for which `===` is not reflexive.
|
||||
return obj !== obj;
|
||||
};
|
||||
|
||||
// Is a given value a boolean?
|
||||
_.isBoolean = function(obj) {
|
||||
return obj === true || obj === false || toString.call(obj) == '[object Boolean]';
|
||||
};
|
||||
|
||||
// Is a given value a date?
|
||||
_.isDate = function(obj) {
|
||||
return toString.call(obj) == '[object Date]';
|
||||
};
|
||||
|
||||
// Is the given value a regular expression?
|
||||
_.isRegExp = function(obj) {
|
||||
return toString.call(obj) == '[object RegExp]';
|
||||
};
|
||||
|
||||
// Is a given value equal to null?
|
||||
_.isNull = function(obj) {
|
||||
return obj === null;
|
||||
};
|
||||
|
||||
// Is a given variable undefined?
|
||||
_.isUndefined = function(obj) {
|
||||
return obj === void 0;
|
||||
};
|
||||
|
||||
// Has own property?
|
||||
_.has = function(obj, key) {
|
||||
return hasOwnProperty.call(obj, key);
|
||||
};
|
||||
|
||||
// Utility Functions
|
||||
// -----------------
|
||||
|
||||
// Run Underscore.js in *noConflict* mode, returning the `_` variable to its
|
||||
// previous owner. Returns a reference to the Underscore object.
|
||||
_.noConflict = function() {
|
||||
root._ = previousUnderscore;
|
||||
return this;
|
||||
};
|
||||
|
||||
// Keep the identity function around for default iterators.
|
||||
_.identity = function(value) {
|
||||
return value;
|
||||
};
|
||||
|
||||
// Run a function **n** times.
|
||||
_.times = function (n, iterator, context) {
|
||||
for (var i = 0; i < n; i++) iterator.call(context, i);
|
||||
};
|
||||
|
||||
// Escape a string for HTML interpolation.
|
||||
_.escape = function(string) {
|
||||
return (''+string).replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>').replace(/"/g, '"').replace(/'/g, ''').replace(/\//g,'/');
|
||||
};
|
||||
|
||||
// Add your own custom functions to the Underscore object, ensuring that
|
||||
// they're correctly added to the OOP wrapper as well.
|
||||
_.mixin = function(obj) {
|
||||
each(_.functions(obj), function(name){
|
||||
addToWrapper(name, _[name] = obj[name]);
|
||||
});
|
||||
};
|
||||
|
||||
// Generate a unique integer id (unique within the entire client session).
|
||||
// Useful for temporary DOM ids.
|
||||
var idCounter = 0;
|
||||
_.uniqueId = function(prefix) {
|
||||
var id = idCounter++;
|
||||
return prefix ? prefix + id : id;
|
||||
};
|
||||
|
||||
// By default, Underscore uses ERB-style template delimiters, change the
|
||||
// following template settings to use alternative delimiters.
|
||||
_.templateSettings = {
|
||||
evaluate : /<%([\s\S]+?)%>/g,
|
||||
interpolate : /<%=([\s\S]+?)%>/g,
|
||||
escape : /<%-([\s\S]+?)%>/g
|
||||
};
|
||||
|
||||
// When customizing `templateSettings`, if you don't want to define an
|
||||
// interpolation, evaluation or escaping regex, we need one that is
|
||||
// guaranteed not to match.
|
||||
var noMatch = /.^/;
|
||||
|
||||
// Within an interpolation, evaluation, or escaping, remove HTML escaping
|
||||
// that had been previously added.
|
||||
var unescape = function(code) {
|
||||
return code.replace(/\\\\/g, '\\').replace(/\\'/g, "'");
|
||||
};
|
||||
|
||||
// JavaScript micro-templating, similar to John Resig's implementation.
|
||||
// Underscore templating handles arbitrary delimiters, preserves whitespace,
|
||||
// and correctly escapes quotes within interpolated code.
|
||||
_.template = function(str, data) {
|
||||
var c = _.templateSettings;
|
||||
var tmpl = 'var __p=[],print=function(){__p.push.apply(__p,arguments);};' +
|
||||
'with(obj||{}){__p.push(\'' +
|
||||
str.replace(/\\/g, '\\\\')
|
||||
.replace(/'/g, "\\'")
|
||||
.replace(c.escape || noMatch, function(match, code) {
|
||||
return "',_.escape(" + unescape(code) + "),'";
|
||||
})
|
||||
.replace(c.interpolate || noMatch, function(match, code) {
|
||||
return "'," + unescape(code) + ",'";
|
||||
})
|
||||
.replace(c.evaluate || noMatch, function(match, code) {
|
||||
return "');" + unescape(code).replace(/[\r\n\t]/g, ' ') + ";__p.push('";
|
||||
})
|
||||
.replace(/\r/g, '\\r')
|
||||
.replace(/\n/g, '\\n')
|
||||
.replace(/\t/g, '\\t')
|
||||
+ "');}return __p.join('');";
|
||||
var func = new Function('obj', '_', tmpl);
|
||||
if (data) return func(data, _);
|
||||
return function(data) {
|
||||
return func.call(this, data, _);
|
||||
};
|
||||
};
|
||||
|
||||
// Add a "chain" function, which will delegate to the wrapper.
|
||||
_.chain = function(obj) {
|
||||
return _(obj).chain();
|
||||
};
|
||||
|
||||
// The OOP Wrapper
|
||||
// ---------------
|
||||
|
||||
// If Underscore is called as a function, it returns a wrapped object that
|
||||
// can be used OO-style. This wrapper holds altered versions of all the
|
||||
// underscore functions. Wrapped objects may be chained.
|
||||
var wrapper = function(obj) { this._wrapped = obj; };
|
||||
|
||||
// Expose `wrapper.prototype` as `_.prototype`
|
||||
_.prototype = wrapper.prototype;
|
||||
|
||||
// Helper function to continue chaining intermediate results.
|
||||
var result = function(obj, chain) {
|
||||
return chain ? _(obj).chain() : obj;
|
||||
};
|
||||
|
||||
// A method to easily add functions to the OOP wrapper.
|
||||
var addToWrapper = function(name, func) {
|
||||
wrapper.prototype[name] = function() {
|
||||
var args = slice.call(arguments);
|
||||
unshift.call(args, this._wrapped);
|
||||
return result(func.apply(_, args), this._chain);
|
||||
};
|
||||
};
|
||||
|
||||
// Add all of the Underscore functions to the wrapper object.
|
||||
_.mixin(_);
|
||||
|
||||
// Add all mutator Array functions to the wrapper.
|
||||
each(['pop', 'push', 'reverse', 'shift', 'sort', 'splice', 'unshift'], function(name) {
|
||||
var method = ArrayProto[name];
|
||||
wrapper.prototype[name] = function() {
|
||||
var wrapped = this._wrapped;
|
||||
method.apply(wrapped, arguments);
|
||||
var length = wrapped.length;
|
||||
if ((name == 'shift' || name == 'splice') && length === 0) delete wrapped[0];
|
||||
return result(wrapped, this._chain);
|
||||
};
|
||||
});
|
||||
|
||||
// Add all accessor Array functions to the wrapper.
|
||||
each(['concat', 'join', 'slice'], function(name) {
|
||||
var method = ArrayProto[name];
|
||||
wrapper.prototype[name] = function() {
|
||||
return result(method.apply(this._wrapped, arguments), this._chain);
|
||||
};
|
||||
});
|
||||
|
||||
// Start chaining a wrapped Underscore object.
|
||||
wrapper.prototype.chain = function() {
|
||||
this._chain = true;
|
||||
return this;
|
||||
};
|
||||
|
||||
// Extracts the result from a wrapped and chained object.
|
||||
wrapper.prototype.value = function() {
|
||||
return this._wrapped;
|
||||
};
|
||||
|
||||
}).call(this);
|
@ -8,7 +8,7 @@
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
|
||||
<title>composer-cli — Lorax 19.7.18 documentation</title>
|
||||
<title>composer-cli — Lorax 19.7.21 documentation</title>
|
||||
|
||||
<link rel="stylesheet" href="_static/default.css" type="text/css" />
|
||||
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
|
||||
@ -16,7 +16,7 @@
|
||||
<script type="text/javascript">
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT: '',
|
||||
VERSION: '19.7.18',
|
||||
VERSION: '19.7.21',
|
||||
COLLAPSE_INDEX: false,
|
||||
FILE_SUFFIX: '.html',
|
||||
HAS_SOURCE: true
|
||||
@ -25,7 +25,7 @@
|
||||
<script type="text/javascript" src="_static/jquery.js"></script>
|
||||
<script type="text/javascript" src="_static/underscore.js"></script>
|
||||
<script type="text/javascript" src="_static/doctools.js"></script>
|
||||
<link rel="top" title="Lorax 19.7.18 documentation" href="index.html" />
|
||||
<link rel="top" title="Lorax 19.7.21 documentation" href="index.html" />
|
||||
<link rel="next" title="Product and Updates Images" href="product-images.html" />
|
||||
<link rel="prev" title="lorax-composer" href="lorax-composer.html" />
|
||||
</head>
|
||||
@ -45,7 +45,7 @@
|
||||
<li class="right" >
|
||||
<a href="lorax-composer.html" title="lorax-composer"
|
||||
accesskey="P">previous</a> |</li>
|
||||
<li><a href="index.html">Lorax 19.7.18 documentation</a> »</li>
|
||||
<li><a href="index.html">Lorax 19.7.21 documentation</a> »</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
@ -169,7 +169,7 @@ save the qcow2 image as <tt class="docutils literal"><span class="pre">UUID-disk
|
||||
<li class="right" >
|
||||
<a href="lorax-composer.html" title="lorax-composer"
|
||||
>previous</a> |</li>
|
||||
<li><a href="index.html">Lorax 19.7.18 documentation</a> »</li>
|
||||
<li><a href="index.html">Lorax 19.7.21 documentation</a> »</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="footer">
|
||||
|
@ -8,7 +8,7 @@
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
|
||||
<title>cli Package — Lorax 19.7.18 documentation</title>
|
||||
<title>cli Package — Lorax 19.7.21 documentation</title>
|
||||
|
||||
<link rel="stylesheet" href="_static/default.css" type="text/css" />
|
||||
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
|
||||
@ -16,7 +16,7 @@
|
||||
<script type="text/javascript">
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT: '',
|
||||
VERSION: '19.7.18',
|
||||
VERSION: '19.7.21',
|
||||
COLLAPSE_INDEX: false,
|
||||
FILE_SUFFIX: '.html',
|
||||
HAS_SOURCE: true
|
||||
@ -25,7 +25,7 @@
|
||||
<script type="text/javascript" src="_static/jquery.js"></script>
|
||||
<script type="text/javascript" src="_static/underscore.js"></script>
|
||||
<script type="text/javascript" src="_static/doctools.js"></script>
|
||||
<link rel="top" title="Lorax 19.7.18 documentation" href="index.html" />
|
||||
<link rel="top" title="Lorax 19.7.21 documentation" href="index.html" />
|
||||
<link rel="up" title="composer Package" href="composer.html" />
|
||||
<link rel="next" title="pylorax Package" href="pylorax.html" />
|
||||
<link rel="prev" title="composer Package" href="composer.html" />
|
||||
@ -46,7 +46,7 @@
|
||||
<li class="right" >
|
||||
<a href="composer.html" title="composer Package"
|
||||
accesskey="P">previous</a> |</li>
|
||||
<li><a href="index.html">Lorax 19.7.18 documentation</a> »</li>
|
||||
<li><a href="index.html">Lorax 19.7.21 documentation</a> »</li>
|
||||
<li><a href="modules.html" >src</a> »</li>
|
||||
<li><a href="composer.html" accesskey="U">composer Package</a> »</li>
|
||||
</ul>
|
||||
@ -548,6 +548,12 @@ or failed, not a running compose.</p>
|
||||
of compose that was selected.</p>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="function">
|
||||
<dt id="composer.cli.compose.compose_list">
|
||||
<tt class="descclassname">composer.cli.compose.</tt><tt class="descname">compose_list</tt><big>(</big><em>socket_path</em>, <em>api_version</em>, <em>args</em>, <em>show_json=False</em>, <em>testmode=0</em><big>)</big><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">
|
||||
<tt class="descclassname">composer.cli.compose.</tt><tt class="descname">compose_log</tt><big>(</big><em>socket_path</em>, <em>api_version</em>, <em>args</em>, <em>show_json=False</em>, <em>testmode=0</em><big>)</big><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>
|
||||
@ -902,6 +908,27 @@ include this extra information.</p>
|
||||
<p>sources list</p>
|
||||
</dd></dl>
|
||||
|
||||
</div>
|
||||
<div class="section" id="module-composer.cli.status">
|
||||
<span id="status-module"></span><h2><tt class="xref py py-mod docutils literal"><span class="pre">status</span></tt> 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">
|
||||
<tt class="descclassname">composer.cli.status.</tt><tt class="descname">status_cmd</tt><big>(</big><em>opts</em><big>)</big><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/2/library/argparse.html#argparse.Namespace" title="(in Python v2.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">int</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</dd></dl>
|
||||
|
||||
</div>
|
||||
<div class="section" id="module-composer.cli.utilities">
|
||||
<span id="utilities-module"></span><h2><tt class="xref py py-mod docutils literal"><span class="pre">utilities</span></tt> Module<a class="headerlink" href="#module-composer.cli.utilities" title="Permalink to this headline">¶</a></h2>
|
||||
@ -953,8 +980,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/2/library/stdtypes.html#dict" title="(in Python v2.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">tuple</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">
|
||||
@ -1012,6 +1045,7 @@ include this extra information.</p>
|
||||
<li><a class="reference internal" href="#module-composer.cli.modules"><tt class="docutils literal"><span class="pre">modules</span></tt> Module</a></li>
|
||||
<li><a class="reference internal" href="#module-composer.cli.projects"><tt class="docutils literal"><span class="pre">projects</span></tt> Module</a></li>
|
||||
<li><a class="reference internal" href="#module-composer.cli.sources"><tt class="docutils literal"><span class="pre">sources</span></tt> Module</a></li>
|
||||
<li><a class="reference internal" href="#module-composer.cli.status"><tt class="docutils literal"><span class="pre">status</span></tt> Module</a></li>
|
||||
<li><a class="reference internal" href="#module-composer.cli.utilities"><tt class="docutils literal"><span class="pre">utilities</span></tt> Module</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
@ -1060,7 +1094,7 @@ include this extra information.</p>
|
||||
<li class="right" >
|
||||
<a href="composer.html" title="composer Package"
|
||||
>previous</a> |</li>
|
||||
<li><a href="index.html">Lorax 19.7.18 documentation</a> »</li>
|
||||
<li><a href="index.html">Lorax 19.7.21 documentation</a> »</li>
|
||||
<li><a href="modules.html" >src</a> »</li>
|
||||
<li><a href="composer.html" >composer Package</a> »</li>
|
||||
</ul>
|
||||
|
@ -8,7 +8,7 @@
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
|
||||
<title>composer Package — Lorax 19.7.18 documentation</title>
|
||||
<title>composer Package — Lorax 19.7.21 documentation</title>
|
||||
|
||||
<link rel="stylesheet" href="_static/default.css" type="text/css" />
|
||||
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
|
||||
@ -16,7 +16,7 @@
|
||||
<script type="text/javascript">
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT: '',
|
||||
VERSION: '19.7.18',
|
||||
VERSION: '19.7.21',
|
||||
COLLAPSE_INDEX: false,
|
||||
FILE_SUFFIX: '.html',
|
||||
HAS_SOURCE: true
|
||||
@ -25,7 +25,7 @@
|
||||
<script type="text/javascript" src="_static/jquery.js"></script>
|
||||
<script type="text/javascript" src="_static/underscore.js"></script>
|
||||
<script type="text/javascript" src="_static/doctools.js"></script>
|
||||
<link rel="top" title="Lorax 19.7.18 documentation" href="index.html" />
|
||||
<link rel="top" title="Lorax 19.7.21 documentation" href="index.html" />
|
||||
<link rel="up" title="src" href="modules.html" />
|
||||
<link rel="next" title="cli Package" href="composer.cli.html" />
|
||||
<link rel="prev" title="src" href="modules.html" />
|
||||
@ -46,7 +46,7 @@
|
||||
<li class="right" >
|
||||
<a href="modules.html" title="src"
|
||||
accesskey="P">previous</a> |</li>
|
||||
<li><a href="index.html">Lorax 19.7.18 documentation</a> »</li>
|
||||
<li><a href="index.html">Lorax 19.7.21 documentation</a> »</li>
|
||||
<li><a href="modules.html" accesskey="U">src</a> »</li>
|
||||
</ul>
|
||||
</div>
|
||||
@ -87,6 +87,33 @@
|
||||
</table>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="function">
|
||||
<dt id="composer.http_client.append_query">
|
||||
<tt class="descclassname">composer.http_client.</tt><tt class="descname">append_query</tt><big>(</big><em>url</em>, <em>query</em><big>)</big><a class="reference internal" href="_modules/composer/http_client.html#append_query"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#composer.http_client.append_query" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Add a query argument to a URL</p>
|
||||
<p>The query should be of the form “param1=what&param2=ever”, i.e., no
|
||||
leading ‘?’. The new query data will be appended to any existing
|
||||
query string.</p>
|
||||
<table class="docutils field-list" frame="void" rules="none">
|
||||
<col class="field-name" />
|
||||
<col class="field-body" />
|
||||
<tbody valign="top">
|
||||
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
|
||||
<li><strong>url</strong> (<a class="reference external" href="https://docs.python.org/2/library/functions.html#str" title="(in Python v2.7)"><em>str</em></a>) – The original URL</li>
|
||||
<li><strong>query</strong> (<a class="reference external" href="https://docs.python.org/2/library/functions.html#str" title="(in Python v2.7)"><em>str</em></a>) – The query to append</li>
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">The new URL with the query argument included</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first last">str</p>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="function">
|
||||
<dt id="composer.http_client.delete_url_json">
|
||||
<tt class="descclassname">composer.http_client.</tt><tt class="descname">delete_url_json</tt><big>(</big><em>socket_path</em>, <em>url</em><big>)</big><a class="reference internal" href="_modules/composer/http_client.html#delete_url_json"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#composer.http_client.delete_url_json" title="Permalink to this definition">¶</a></dt>
|
||||
@ -173,6 +200,32 @@
|
||||
</table>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="function">
|
||||
<dt id="composer.http_client.get_url_json_unlimited">
|
||||
<tt class="descclassname">composer.http_client.</tt><tt class="descname">get_url_json_unlimited</tt><big>(</big><em>socket_path</em>, <em>url</em><big>)</big><a class="reference internal" href="_modules/composer/http_client.html#get_url_json_unlimited"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#composer.http_client.get_url_json_unlimited" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Return the JSON results of a GET request</p>
|
||||
<p>For URLs that use offset/limit arguments, this command will
|
||||
fetch all results for the given request.</p>
|
||||
<table class="docutils field-list" frame="void" rules="none">
|
||||
<col class="field-name" />
|
||||
<col class="field-body" />
|
||||
<tbody valign="top">
|
||||
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
|
||||
<li><strong>socket_path</strong> (<a class="reference external" href="https://docs.python.org/2/library/functions.html#str" title="(in Python v2.7)"><em>str</em></a>) – Path to the Unix socket to use for API communication</li>
|
||||
<li><strong>url</strong> (<a class="reference external" href="https://docs.python.org/2/library/functions.html#str" title="(in Python v2.7)"><em>str</em></a>) – URL to request</li>
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">The json response from the server</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first last">dict</p>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="function">
|
||||
<dt id="composer.http_client.get_url_raw">
|
||||
<tt class="descclassname">composer.http_client.</tt><tt class="descname">get_url_raw</tt><big>(</big><em>socket_path</em>, <em>url</em><big>)</big><a class="reference internal" href="_modules/composer/http_client.html#get_url_raw"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#composer.http_client.get_url_raw" title="Permalink to this definition">¶</a></dt>
|
||||
@ -305,6 +358,7 @@
|
||||
<li class="toctree-l2"><a class="reference internal" href="composer.cli.html#module-composer.cli.modules"><tt class="docutils literal"><span class="pre">modules</span></tt> Module</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="composer.cli.html#module-composer.cli.projects"><tt class="docutils literal"><span class="pre">projects</span></tt> Module</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="composer.cli.html#module-composer.cli.sources"><tt class="docutils literal"><span class="pre">sources</span></tt> Module</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="composer.cli.html#module-composer.cli.status"><tt class="docutils literal"><span class="pre">status</span></tt> Module</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="composer.cli.html#module-composer.cli.utilities"><tt class="docutils literal"><span class="pre">utilities</span></tt> Module</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
@ -375,7 +429,7 @@
|
||||
<li class="right" >
|
||||
<a href="modules.html" title="src"
|
||||
>previous</a> |</li>
|
||||
<li><a href="index.html">Lorax 19.7.18 documentation</a> »</li>
|
||||
<li><a href="index.html">Lorax 19.7.21 documentation</a> »</li>
|
||||
<li><a href="modules.html" >src</a> »</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
@ -10,7 +10,7 @@
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
|
||||
<title>Index — Lorax 19.7.18 documentation</title>
|
||||
<title>Index — Lorax 19.7.21 documentation</title>
|
||||
|
||||
<link rel="stylesheet" href="_static/default.css" type="text/css" />
|
||||
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
|
||||
@ -18,7 +18,7 @@
|
||||
<script type="text/javascript">
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT: '',
|
||||
VERSION: '19.7.18',
|
||||
VERSION: '19.7.21',
|
||||
COLLAPSE_INDEX: false,
|
||||
FILE_SUFFIX: '.html',
|
||||
HAS_SOURCE: true
|
||||
@ -27,7 +27,7 @@
|
||||
<script type="text/javascript" src="_static/jquery.js"></script>
|
||||
<script type="text/javascript" src="_static/underscore.js"></script>
|
||||
<script type="text/javascript" src="_static/doctools.js"></script>
|
||||
<link rel="top" title="Lorax 19.7.18 documentation" href="index.html" />
|
||||
<link rel="top" title="Lorax 19.7.21 documentation" href="index.html" />
|
||||
</head>
|
||||
<body>
|
||||
<div class="related">
|
||||
@ -39,7 +39,7 @@
|
||||
<li class="right" >
|
||||
<a href="py-modindex.html" title="Python Module Index"
|
||||
>modules</a> |</li>
|
||||
<li><a href="index.html">Lorax 19.7.18 documentation</a> »</li>
|
||||
<li><a href="index.html">Lorax 19.7.21 documentation</a> »</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
@ -97,17 +97,21 @@
|
||||
<dt><a href="pylorax.api.html#pylorax.api.projects.api_time">api_time() (in module pylorax.api.projects)</a>
|
||||
</dt>
|
||||
|
||||
</dl></td>
|
||||
<td style="width: 33%" valign="top"><dl>
|
||||
|
||||
<dt><a href="composer.html#composer.http_client.api_url">api_url() (in module composer.http_client)</a>
|
||||
</dt>
|
||||
|
||||
</dl></td>
|
||||
<td style="width: 33%" valign="top"><dl>
|
||||
|
||||
<dt><a href="pylorax.html#pylorax.ltmpl.LoraxTemplateRunner.append">append() (pylorax.ltmpl.LoraxTemplateRunner method)</a>
|
||||
</dt>
|
||||
|
||||
|
||||
<dt><a href="composer.html#composer.http_client.append_query">append_query() (in module composer.http_client)</a>
|
||||
</dt>
|
||||
|
||||
|
||||
<dt><a href="pylorax.html#pylorax.ArchData">ArchData (class in pylorax)</a>
|
||||
</dt>
|
||||
|
||||
@ -130,6 +134,10 @@
|
||||
</dt>
|
||||
|
||||
|
||||
<dt><a href="pylorax.api.html#pylorax.api.v0.blueprint_exists">blueprint_exists() (in module pylorax.api.v0)</a>
|
||||
</dt>
|
||||
|
||||
|
||||
<dt><a href="composer.cli.html#composer.cli.blueprints.blueprints_changes">blueprints_changes() (in module composer.cli.blueprints)</a>
|
||||
</dt>
|
||||
|
||||
@ -218,6 +226,10 @@
|
||||
<table style="width: 100%" class="indextable genindextable"><tr>
|
||||
<td style="width: 33%" valign="top"><dl>
|
||||
|
||||
<dt><a href="pylorax.api.html#pylorax.api.checkparams.checkparams">checkparams() (in module pylorax.api.checkparams)</a>
|
||||
</dt>
|
||||
|
||||
|
||||
<dt><a href="pylorax.html#pylorax.ltmpl.LoraxTemplateRunner.chmod">chmod() (pylorax.ltmpl.LoraxTemplateRunner method)</a>
|
||||
</dt>
|
||||
|
||||
@ -282,6 +294,10 @@
|
||||
</dt>
|
||||
|
||||
|
||||
<dt><a href="composer.cli.html#composer.cli.compose.compose_list">compose_list() (in module composer.cli.compose)</a>
|
||||
</dt>
|
||||
|
||||
|
||||
<dt><a href="composer.cli.html#composer.cli.compose.compose_log">compose_log() (in module composer.cli.compose)</a>
|
||||
</dt>
|
||||
|
||||
@ -305,6 +321,8 @@
|
||||
<dt><a href="composer.cli.html#composer.cli.compose.compose_status">compose_status() (in module composer.cli.compose)</a>
|
||||
</dt>
|
||||
|
||||
</dl></td>
|
||||
<td style="width: 33%" valign="top"><dl>
|
||||
|
||||
<dt><a href="composer.cli.html#composer.cli.compose.compose_types">compose_types() (in module composer.cli.compose)</a>
|
||||
</dt>
|
||||
@ -315,8 +333,6 @@
|
||||
</dt>
|
||||
|
||||
</dl></dd>
|
||||
</dl></td>
|
||||
<td style="width: 33%" valign="top"><dl>
|
||||
|
||||
<dt><a href="composer.html#module-composer">composer (module)</a>
|
||||
</dt>
|
||||
@ -350,6 +366,10 @@
|
||||
</dt>
|
||||
|
||||
|
||||
<dt><a href="composer.cli.html#module-composer.cli.status">composer.cli.status (module)</a>
|
||||
</dt>
|
||||
|
||||
|
||||
<dt><a href="composer.cli.html#module-composer.cli.utilities">composer.cli.utilities (module)</a>
|
||||
</dt>
|
||||
|
||||
@ -653,12 +673,12 @@
|
||||
<dt><a href="pylorax.html#pylorax.installer.IsoMountpoint.get_iso_label">get_iso_label() (pylorax.installer.IsoMountpoint method)</a>
|
||||
</dt>
|
||||
|
||||
</dl></td>
|
||||
<td style="width: 33%" valign="top"><dl>
|
||||
|
||||
<dt><a href="pylorax.html#pylorax.creator.KernelInfo.get_kernel_arch">get_kernel_arch() (pylorax.creator.KernelInfo method)</a>
|
||||
</dt>
|
||||
|
||||
</dl></td>
|
||||
<td style="width: 33%" valign="top"><dl>
|
||||
|
||||
<dt><a href="pylorax.html#pylorax.creator.KernelInfo.get_kernels">get_kernels() (pylorax.creator.KernelInfo method)</a>
|
||||
</dt>
|
||||
@ -688,6 +708,10 @@
|
||||
</dt>
|
||||
|
||||
|
||||
<dt><a href="composer.html#composer.http_client.get_url_json_unlimited">get_url_json_unlimited() (in module composer.http_client)</a>
|
||||
</dt>
|
||||
|
||||
|
||||
<dt><a href="composer.html#composer.http_client.get_url_raw">get_url_raw() (in module composer.http_client)</a>
|
||||
</dt>
|
||||
|
||||
@ -699,6 +723,10 @@
|
||||
<dt><a href="pylorax.api.html#pylorax.api.server.GitLock">GitLock (class in pylorax.api.server)</a>
|
||||
</dt>
|
||||
|
||||
|
||||
<dt><a href="pylorax.api.html#pylorax.api.recipes.Recipe.group_names">group_names (pylorax.api.recipes.Recipe attribute)</a>
|
||||
</dt>
|
||||
|
||||
</dl></td>
|
||||
</tr></table>
|
||||
|
||||
@ -1197,12 +1225,16 @@
|
||||
<dt><a href="pylorax.api.html#module-pylorax.api">pylorax.api (module)</a>
|
||||
</dt>
|
||||
|
||||
</dl></td>
|
||||
<td style="width: 33%" valign="top"><dl>
|
||||
|
||||
<dt><a href="pylorax.api.html#module-pylorax.api.checkparams">pylorax.api.checkparams (module)</a>
|
||||
</dt>
|
||||
|
||||
|
||||
<dt><a href="pylorax.api.html#module-pylorax.api.compose">pylorax.api.compose (module)</a>
|
||||
</dt>
|
||||
|
||||
</dl></td>
|
||||
<td style="width: 33%" valign="top"><dl>
|
||||
|
||||
<dt><a href="pylorax.api.html#module-pylorax.api.config">pylorax.api.config (module)</a>
|
||||
</dt>
|
||||
@ -1212,6 +1244,10 @@
|
||||
</dt>
|
||||
|
||||
|
||||
<dt><a href="pylorax.api.html#module-pylorax.api.errors">pylorax.api.errors (module)</a>
|
||||
</dt>
|
||||
|
||||
|
||||
<dt><a href="pylorax.api.html#module-pylorax.api.projects">pylorax.api.projects (module)</a>
|
||||
</dt>
|
||||
|
||||
@ -1224,10 +1260,18 @@
|
||||
</dt>
|
||||
|
||||
|
||||
<dt><a href="pylorax.api.html#module-pylorax.api.regexes">pylorax.api.regexes (module)</a>
|
||||
</dt>
|
||||
|
||||
|
||||
<dt><a href="pylorax.api.html#module-pylorax.api.server">pylorax.api.server (module)</a>
|
||||
</dt>
|
||||
|
||||
|
||||
<dt><a href="pylorax.api.html#module-pylorax.api.timestamp">pylorax.api.timestamp (module)</a>
|
||||
</dt>
|
||||
|
||||
|
||||
<dt><a href="pylorax.api.html#module-pylorax.api.v0">pylorax.api.v0 (module)</a>
|
||||
</dt>
|
||||
|
||||
@ -1372,6 +1416,10 @@
|
||||
</dt>
|
||||
|
||||
|
||||
<dt><a href="pylorax.api.html#pylorax.api.recipes.RecipeGroup">RecipeGroup (class in pylorax.api.recipes)</a>
|
||||
</dt>
|
||||
|
||||
|
||||
<dt><a href="pylorax.api.html#pylorax.api.recipes.RecipeModule">RecipeModule (class in pylorax.api.recipes)</a>
|
||||
</dt>
|
||||
|
||||
@ -1389,12 +1437,12 @@
|
||||
</dt>
|
||||
|
||||
</dl></dd>
|
||||
</dl></td>
|
||||
<td style="width: 33%" valign="top"><dl>
|
||||
|
||||
<dt><a href="pylorax.html#pylorax.ltmpl.LoraxTemplateRunner.removefrom">removefrom() (pylorax.ltmpl.LoraxTemplateRunner method)</a>
|
||||
</dt>
|
||||
|
||||
</dl></td>
|
||||
<td style="width: 33%" valign="top"><dl>
|
||||
|
||||
<dt><a href="pylorax.html#pylorax.ltmpl.LoraxTemplateRunner.removekmod">removekmod() (pylorax.ltmpl.LoraxTemplateRunner method)</a>
|
||||
</dt>
|
||||
@ -1523,12 +1571,12 @@
|
||||
<dt><a href="composer.cli.html#composer.cli.sources.sources_delete">sources_delete() (in module composer.cli.sources)</a>
|
||||
</dt>
|
||||
|
||||
</dl></td>
|
||||
<td style="width: 33%" valign="top"><dl>
|
||||
|
||||
<dt><a href="composer.cli.html#composer.cli.sources.sources_info">sources_info() (in module composer.cli.sources)</a>
|
||||
</dt>
|
||||
|
||||
</dl></td>
|
||||
<td style="width: 33%" valign="top"><dl>
|
||||
|
||||
<dt><a href="composer.cli.html#composer.cli.sources.sources_list">sources_list() (in module composer.cli.sources)</a>
|
||||
</dt>
|
||||
@ -1546,6 +1594,10 @@
|
||||
</dt>
|
||||
|
||||
|
||||
<dt><a href="composer.cli.html#composer.cli.status.status_cmd">status_cmd() (in module composer.cli.status)</a>
|
||||
</dt>
|
||||
|
||||
|
||||
<dt><a href="pylorax.html#pylorax.executils.tee.stop">stop() (pylorax.executils.tee method)</a>
|
||||
</dt>
|
||||
|
||||
@ -1580,16 +1632,24 @@
|
||||
</dt>
|
||||
|
||||
|
||||
<dt><a href="pylorax.api.html#pylorax.api.projects.tm_to_dep">tm_to_dep() (in module pylorax.api.projects)</a>
|
||||
<dt><a href="pylorax.api.html#pylorax.api.compose.test_templates">test_templates() (in module pylorax.api.compose)</a>
|
||||
</dt>
|
||||
|
||||
|
||||
<dt><a href="pylorax.api.html#pylorax.api.recipes.Recipe.toml">toml() (pylorax.api.recipes.Recipe method)</a>
|
||||
<dt><a href="pylorax.api.html#pylorax.api.timestamp.timestamp_dict">timestamp_dict() (in module pylorax.api.timestamp)</a>
|
||||
</dt>
|
||||
|
||||
|
||||
<dt><a href="pylorax.api.html#pylorax.api.projects.tm_to_dep">tm_to_dep() (in module pylorax.api.projects)</a>
|
||||
</dt>
|
||||
|
||||
</dl></td>
|
||||
<td style="width: 33%" valign="top"><dl>
|
||||
|
||||
<dt><a href="pylorax.api.html#pylorax.api.recipes.Recipe.toml">toml() (pylorax.api.recipes.Recipe method)</a>
|
||||
</dt>
|
||||
|
||||
|
||||
<dt><a href="composer.cli.html#composer.cli.utilities.toml_filename">toml_filename() (in module composer.cli.utilities)</a>
|
||||
</dt>
|
||||
|
||||
@ -1731,12 +1791,12 @@
|
||||
</dt>
|
||||
|
||||
</dl></dd>
|
||||
</dl></td>
|
||||
<td style="width: 33%" valign="top"><dl>
|
||||
|
||||
<dt><a href="pylorax.api.html#pylorax.api.recipes.write_commit">write_commit() (in module pylorax.api.recipes)</a>
|
||||
</dt>
|
||||
|
||||
</dl></td>
|
||||
<td style="width: 33%" valign="top"><dl>
|
||||
|
||||
<dt><a href="pylorax.api.html#pylorax.api.compose.write_ks_group">write_ks_group() (in module pylorax.api.compose)</a>
|
||||
</dt>
|
||||
@ -1746,6 +1806,10 @@
|
||||
</dt>
|
||||
|
||||
|
||||
<dt><a href="pylorax.api.html#pylorax.api.timestamp.write_timestamp">write_timestamp() (in module pylorax.api.timestamp)</a>
|
||||
</dt>
|
||||
|
||||
|
||||
<dt><a href="pylorax.html#pylorax.treebuilder.RuntimeBuilder.writepkglists">writepkglists() (pylorax.treebuilder.RuntimeBuilder method)</a>
|
||||
</dt>
|
||||
|
||||
@ -1816,7 +1880,7 @@
|
||||
<li class="right" >
|
||||
<a href="py-modindex.html" title="Python Module Index"
|
||||
>modules</a> |</li>
|
||||
<li><a href="index.html">Lorax 19.7.18 documentation</a> »</li>
|
||||
<li><a href="index.html">Lorax 19.7.21 documentation</a> »</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="footer">
|
||||
|
@ -8,7 +8,7 @@
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
|
||||
<title>Welcome to Lorax’s documentation! — Lorax 19.7.18 documentation</title>
|
||||
<title>Welcome to Lorax’s documentation! — Lorax 19.7.21 documentation</title>
|
||||
|
||||
<link rel="stylesheet" href="_static/default.css" type="text/css" />
|
||||
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
|
||||
@ -16,7 +16,7 @@
|
||||
<script type="text/javascript">
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT: '',
|
||||
VERSION: '19.7.18',
|
||||
VERSION: '19.7.21',
|
||||
COLLAPSE_INDEX: false,
|
||||
FILE_SUFFIX: '.html',
|
||||
HAS_SOURCE: true
|
||||
@ -25,7 +25,7 @@
|
||||
<script type="text/javascript" src="_static/jquery.js"></script>
|
||||
<script type="text/javascript" src="_static/underscore.js"></script>
|
||||
<script type="text/javascript" src="_static/doctools.js"></script>
|
||||
<link rel="top" title="Lorax 19.7.18 documentation" href="#" />
|
||||
<link rel="top" title="Lorax 19.7.21 documentation" href="#" />
|
||||
<link rel="next" title="Introduction to Lorax" href="intro.html" />
|
||||
</head>
|
||||
<body>
|
||||
@ -41,7 +41,7 @@
|
||||
<li class="right" >
|
||||
<a href="intro.html" title="Introduction to Lorax"
|
||||
accesskey="N">next</a> |</li>
|
||||
<li><a href="#">Lorax 19.7.18 documentation</a> »</li>
|
||||
<li><a href="#">Lorax 19.7.21 documentation</a> »</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
@ -126,7 +126,7 @@
|
||||
<li class="right" >
|
||||
<a href="intro.html" title="Introduction to Lorax"
|
||||
>next</a> |</li>
|
||||
<li><a href="#">Lorax 19.7.18 documentation</a> »</li>
|
||||
<li><a href="#">Lorax 19.7.21 documentation</a> »</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="footer">
|
||||
|
@ -8,7 +8,7 @@
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
|
||||
<title>Introduction to Lorax — Lorax 19.7.18 documentation</title>
|
||||
<title>Introduction to Lorax — Lorax 19.7.21 documentation</title>
|
||||
|
||||
<link rel="stylesheet" href="_static/default.css" type="text/css" />
|
||||
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
|
||||
@ -16,7 +16,7 @@
|
||||
<script type="text/javascript">
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT: '',
|
||||
VERSION: '19.7.18',
|
||||
VERSION: '19.7.21',
|
||||
COLLAPSE_INDEX: false,
|
||||
FILE_SUFFIX: '.html',
|
||||
HAS_SOURCE: true
|
||||
@ -25,7 +25,7 @@
|
||||
<script type="text/javascript" src="_static/jquery.js"></script>
|
||||
<script type="text/javascript" src="_static/underscore.js"></script>
|
||||
<script type="text/javascript" src="_static/doctools.js"></script>
|
||||
<link rel="top" title="Lorax 19.7.18 documentation" href="index.html" />
|
||||
<link rel="top" title="Lorax 19.7.21 documentation" href="index.html" />
|
||||
<link rel="next" title="Lorax" href="lorax.html" />
|
||||
<link rel="prev" title="Welcome to Lorax’s documentation!" href="index.html" />
|
||||
</head>
|
||||
@ -45,7 +45,7 @@
|
||||
<li class="right" >
|
||||
<a href="index.html" title="Welcome to Lorax’s documentation!"
|
||||
accesskey="P">previous</a> |</li>
|
||||
<li><a href="index.html">Lorax 19.7.18 documentation</a> »</li>
|
||||
<li><a href="index.html">Lorax 19.7.21 documentation</a> »</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
@ -161,7 +161,7 @@ upd-instroot and mk-images* scripts.</p>
|
||||
<li class="right" >
|
||||
<a href="index.html" title="Welcome to Lorax’s documentation!"
|
||||
>previous</a> |</li>
|
||||
<li><a href="index.html">Lorax 19.7.18 documentation</a> »</li>
|
||||
<li><a href="index.html">Lorax 19.7.21 documentation</a> »</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="footer">
|
||||
|
@ -8,7 +8,7 @@
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
|
||||
<title>livemedia-creator — Lorax 19.7.18 documentation</title>
|
||||
<title>livemedia-creator — Lorax 19.7.21 documentation</title>
|
||||
|
||||
<link rel="stylesheet" href="_static/default.css" type="text/css" />
|
||||
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
|
||||
@ -16,7 +16,7 @@
|
||||
<script type="text/javascript">
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT: '',
|
||||
VERSION: '19.7.18',
|
||||
VERSION: '19.7.21',
|
||||
COLLAPSE_INDEX: false,
|
||||
FILE_SUFFIX: '.html',
|
||||
HAS_SOURCE: true
|
||||
@ -25,7 +25,7 @@
|
||||
<script type="text/javascript" src="_static/jquery.js"></script>
|
||||
<script type="text/javascript" src="_static/underscore.js"></script>
|
||||
<script type="text/javascript" src="_static/doctools.js"></script>
|
||||
<link rel="top" title="Lorax 19.7.18 documentation" href="index.html" />
|
||||
<link rel="top" title="Lorax 19.7.21 documentation" href="index.html" />
|
||||
<link rel="next" title="lorax-composer" href="lorax-composer.html" />
|
||||
<link rel="prev" title="Lorax" href="lorax.html" />
|
||||
</head>
|
||||
@ -45,7 +45,7 @@
|
||||
<li class="right" >
|
||||
<a href="lorax.html" title="Lorax"
|
||||
accesskey="P">previous</a> |</li>
|
||||
<li><a href="index.html">Lorax 19.7.18 documentation</a> »</li>
|
||||
<li><a href="index.html">Lorax 19.7.21 documentation</a> »</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
@ -446,7 +446,7 @@ report bugs against the lorax component.</p>
|
||||
<li class="right" >
|
||||
<a href="lorax.html" title="Lorax"
|
||||
>previous</a> |</li>
|
||||
<li><a href="index.html">Lorax 19.7.18 documentation</a> »</li>
|
||||
<li><a href="index.html">Lorax 19.7.21 documentation</a> »</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="footer">
|
||||
|
@ -8,7 +8,7 @@
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
|
||||
<title>lorax-composer — Lorax 19.7.18 documentation</title>
|
||||
<title>lorax-composer — Lorax 19.7.21 documentation</title>
|
||||
|
||||
<link rel="stylesheet" href="_static/default.css" type="text/css" />
|
||||
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
|
||||
@ -16,7 +16,7 @@
|
||||
<script type="text/javascript">
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT: '',
|
||||
VERSION: '19.7.18',
|
||||
VERSION: '19.7.21',
|
||||
COLLAPSE_INDEX: false,
|
||||
FILE_SUFFIX: '.html',
|
||||
HAS_SOURCE: true
|
||||
@ -25,7 +25,7 @@
|
||||
<script type="text/javascript" src="_static/jquery.js"></script>
|
||||
<script type="text/javascript" src="_static/underscore.js"></script>
|
||||
<script type="text/javascript" src="_static/doctools.js"></script>
|
||||
<link rel="top" title="Lorax 19.7.18 documentation" href="index.html" />
|
||||
<link rel="top" title="Lorax 19.7.21 documentation" href="index.html" />
|
||||
<link rel="next" title="composer-cli" href="composer-cli.html" />
|
||||
<link rel="prev" title="livemedia-creator" href="livemedia-creator.html" />
|
||||
</head>
|
||||
@ -45,7 +45,7 @@
|
||||
<li class="right" >
|
||||
<a href="livemedia-creator.html" title="livemedia-creator"
|
||||
accesskey="P">previous</a> |</li>
|
||||
<li><a href="index.html">Lorax 19.7.18 documentation</a> »</li>
|
||||
<li><a href="index.html">Lorax 19.7.21 documentation</a> »</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
@ -91,7 +91,13 @@ systemd socket activation service. You will then need to enable it with <tt clas
|
||||
<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></tt>. 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>
|
||||
@ -100,9 +106,13 @@ the system is rebooted.</p>
|
||||
<li>Remove any pre-existing socket directory with <tt class="docutils literal"><span class="pre">rm</span> <span class="pre">-rf</span> <span class="pre">/run/weldr/</span></tt>
|
||||
A new directory with correct permissions will be created the first time the server runs.</li>
|
||||
<li>Enable the socket activation with <tt class="docutils literal"><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></tt> or run it directly with
|
||||
<tt class="docutils literal"><span class="pre">lorax-composer</span> <span class="pre">/path/to/blueprints/</span></tt></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></tt>.</li>
|
||||
</ol>
|
||||
<p>NOTE: You can also run it directly with <tt class="docutils literal"><span class="pre">lorax-composer</span> <span class="pre">/path/to/blueprints</span></tt>. However,
|
||||
<tt class="docutils literal"><span class="pre">lorax-composer</span></tt> 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 <tt class="docutils literal"><span class="pre">/path/to/blueprints/</span></tt> directory is where the blueprints’ git repo will
|
||||
be created, and all the blueprints created with the <tt class="docutils literal"><span class="pre">/api/v0/blueprints/new</span></tt>
|
||||
route will be stored. If there are blueprint <tt class="docutils literal"><span class="pre">.toml</span></tt> files in the top level
|
||||
@ -182,6 +192,16 @@ character matching.</p>
|
||||
that is planned for a future release. And currently there are no differences
|
||||
between <tt class="docutils literal"><span class="pre">packages</span></tt> and <tt class="docutils literal"><span class="pre">modules</span></tt> in <tt class="docutils literal"><span class="pre">lorax-composer</span></tt>.</p>
|
||||
</div>
|
||||
<div class="section" id="groups">
|
||||
<h3>[[groups]]<a class="headerlink" href="#groups" title="Permalink to this headline">¶</a></h3>
|
||||
<p>These entries describe a group of packages to be installed into the image. Package groups are
|
||||
defined in the repository metadata. Each group has a descriptive name used primarily for display
|
||||
in user interfaces and an ID more commonly used in kickstart files. Here, the ID is the expected
|
||||
way of listing a group.</p>
|
||||
<p>Groups have three different ways of categorizing their packages: mandatory, default, and optional.
|
||||
For purposes of blueprints, mandatory and default packages will be installed. There is no mechanism
|
||||
for selecting optional packages.</p>
|
||||
</div>
|
||||
<div class="section" id="customizations">
|
||||
<h3>Customizations<a class="headerlink" href="#customizations" title="Permalink to this headline">¶</a></h3>
|
||||
<p>The <tt class="docutils literal"><span class="pre">[[customizations]]</span></tt> section can be used to configure the hostname of the final image. eg.:</p>
|
||||
@ -337,6 +357,7 @@ conflict with any other package sources, otherwise depsolving will fail.</p>
|
||||
<li><a class="reference internal" href="#composing-images">Composing Images</a></li>
|
||||
<li><a class="reference internal" href="#blueprints">Blueprints</a><ul>
|
||||
<li><a class="reference internal" href="#packages-and-modules">[[packages]] and [[modules]]</a></li>
|
||||
<li><a class="reference internal" href="#groups">[[groups]]</a></li>
|
||||
<li><a class="reference internal" href="#customizations">Customizations</a><ul>
|
||||
<li><a class="reference internal" href="#customizations-sshkey">[[customizations.sshkey]]</a></li>
|
||||
<li><a class="reference internal" href="#customizations-user">[[customizations.user]]</a></li>
|
||||
@ -397,7 +418,7 @@ conflict with any other package sources, otherwise depsolving will fail.</p>
|
||||
<li class="right" >
|
||||
<a href="livemedia-creator.html" title="livemedia-creator"
|
||||
>previous</a> |</li>
|
||||
<li><a href="index.html">Lorax 19.7.18 documentation</a> »</li>
|
||||
<li><a href="index.html">Lorax 19.7.21 documentation</a> »</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="footer">
|
||||
|
@ -8,7 +8,7 @@
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
|
||||
<title>Lorax — Lorax 19.7.18 documentation</title>
|
||||
<title>Lorax — Lorax 19.7.21 documentation</title>
|
||||
|
||||
<link rel="stylesheet" href="_static/default.css" type="text/css" />
|
||||
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
|
||||
@ -16,7 +16,7 @@
|
||||
<script type="text/javascript">
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT: '',
|
||||
VERSION: '19.7.18',
|
||||
VERSION: '19.7.21',
|
||||
COLLAPSE_INDEX: false,
|
||||
FILE_SUFFIX: '.html',
|
||||
HAS_SOURCE: true
|
||||
@ -25,7 +25,7 @@
|
||||
<script type="text/javascript" src="_static/jquery.js"></script>
|
||||
<script type="text/javascript" src="_static/underscore.js"></script>
|
||||
<script type="text/javascript" src="_static/doctools.js"></script>
|
||||
<link rel="top" title="Lorax 19.7.18 documentation" href="index.html" />
|
||||
<link rel="top" title="Lorax 19.7.21 documentation" href="index.html" />
|
||||
<link rel="next" title="livemedia-creator" href="livemedia-creator.html" />
|
||||
<link rel="prev" title="Introduction to Lorax" href="intro.html" />
|
||||
</head>
|
||||
@ -45,7 +45,7 @@
|
||||
<li class="right" >
|
||||
<a href="intro.html" title="Introduction to Lorax"
|
||||
accesskey="P">previous</a> |</li>
|
||||
<li><a href="index.html">Lorax 19.7.18 documentation</a> »</li>
|
||||
<li><a href="index.html">Lorax 19.7.21 documentation</a> »</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
@ -254,7 +254,7 @@ into another directory and then select the new template directory by passing
|
||||
<li class="right" >
|
||||
<a href="intro.html" title="Introduction to Lorax"
|
||||
>previous</a> |</li>
|
||||
<li><a href="index.html">Lorax 19.7.18 documentation</a> »</li>
|
||||
<li><a href="index.html">Lorax 19.7.21 documentation</a> »</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="footer">
|
||||
|
@ -8,7 +8,7 @@
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
|
||||
<title>src — Lorax 19.7.18 documentation</title>
|
||||
<title>src — Lorax 19.7.21 documentation</title>
|
||||
|
||||
<link rel="stylesheet" href="_static/default.css" type="text/css" />
|
||||
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
|
||||
@ -16,7 +16,7 @@
|
||||
<script type="text/javascript">
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT: '',
|
||||
VERSION: '19.7.18',
|
||||
VERSION: '19.7.21',
|
||||
COLLAPSE_INDEX: false,
|
||||
FILE_SUFFIX: '.html',
|
||||
HAS_SOURCE: true
|
||||
@ -25,7 +25,7 @@
|
||||
<script type="text/javascript" src="_static/jquery.js"></script>
|
||||
<script type="text/javascript" src="_static/underscore.js"></script>
|
||||
<script type="text/javascript" src="_static/doctools.js"></script>
|
||||
<link rel="top" title="Lorax 19.7.18 documentation" href="index.html" />
|
||||
<link rel="top" title="Lorax 19.7.21 documentation" href="index.html" />
|
||||
<link rel="next" title="composer Package" href="composer.html" />
|
||||
<link rel="prev" title="Product and Updates Images" href="product-images.html" />
|
||||
</head>
|
||||
@ -45,7 +45,7 @@
|
||||
<li class="right" >
|
||||
<a href="product-images.html" title="Product and Updates Images"
|
||||
accesskey="P">previous</a> |</li>
|
||||
<li><a href="index.html">Lorax 19.7.18 documentation</a> »</li>
|
||||
<li><a href="index.html">Lorax 19.7.21 documentation</a> »</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
@ -71,6 +71,7 @@
|
||||
<li class="toctree-l4"><a class="reference internal" href="composer.cli.html#module-composer.cli.modules"><tt class="docutils literal"><span class="pre">modules</span></tt> Module</a></li>
|
||||
<li class="toctree-l4"><a class="reference internal" href="composer.cli.html#module-composer.cli.projects"><tt class="docutils literal"><span class="pre">projects</span></tt> Module</a></li>
|
||||
<li class="toctree-l4"><a class="reference internal" href="composer.cli.html#module-composer.cli.sources"><tt class="docutils literal"><span class="pre">sources</span></tt> Module</a></li>
|
||||
<li class="toctree-l4"><a class="reference internal" href="composer.cli.html#module-composer.cli.status"><tt class="docutils literal"><span class="pre">status</span></tt> Module</a></li>
|
||||
<li class="toctree-l4"><a class="reference internal" href="composer.cli.html#module-composer.cli.utilities"><tt class="docutils literal"><span class="pre">utilities</span></tt> Module</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
@ -98,13 +99,17 @@
|
||||
<li class="toctree-l2"><a class="reference internal" href="pylorax.html#subpackages">Subpackages</a><ul>
|
||||
<li class="toctree-l3"><a class="reference internal" href="pylorax.api.html">api Package</a><ul>
|
||||
<li class="toctree-l4"><a class="reference internal" href="pylorax.api.html#id1"><tt class="docutils literal"><span class="pre">api</span></tt> Package</a></li>
|
||||
<li class="toctree-l4"><a class="reference internal" href="pylorax.api.html#module-pylorax.api.checkparams"><tt class="docutils literal"><span class="pre">checkparams</span></tt> Module</a></li>
|
||||
<li class="toctree-l4"><a class="reference internal" href="pylorax.api.html#module-pylorax.api.compose"><tt class="docutils literal"><span class="pre">compose</span></tt> Module</a></li>
|
||||
<li class="toctree-l4"><a class="reference internal" href="pylorax.api.html#module-pylorax.api.config"><tt class="docutils literal"><span class="pre">config</span></tt> Module</a></li>
|
||||
<li class="toctree-l4"><a class="reference internal" href="pylorax.api.html#module-pylorax.api.crossdomain"><tt class="docutils literal"><span class="pre">crossdomain</span></tt> Module</a></li>
|
||||
<li class="toctree-l4"><a class="reference internal" href="pylorax.api.html#module-pylorax.api.errors"><tt class="docutils literal"><span class="pre">errors</span></tt> Module</a></li>
|
||||
<li class="toctree-l4"><a class="reference internal" href="pylorax.api.html#module-pylorax.api.projects"><tt class="docutils literal"><span class="pre">projects</span></tt> Module</a></li>
|
||||
<li class="toctree-l4"><a class="reference internal" href="pylorax.api.html#module-pylorax.api.queue"><tt class="docutils literal"><span class="pre">queue</span></tt> Module</a></li>
|
||||
<li class="toctree-l4"><a class="reference internal" href="pylorax.api.html#module-pylorax.api.recipes"><tt class="docutils literal"><span class="pre">recipes</span></tt> Module</a></li>
|
||||
<li class="toctree-l4"><a class="reference internal" href="pylorax.api.html#module-pylorax.api.regexes"><tt class="docutils literal"><span class="pre">regexes</span></tt> Module</a></li>
|
||||
<li class="toctree-l4"><a class="reference internal" href="pylorax.api.html#module-pylorax.api.server"><tt class="docutils literal"><span class="pre">server</span></tt> Module</a></li>
|
||||
<li class="toctree-l4"><a class="reference internal" href="pylorax.api.html#module-pylorax.api.timestamp"><tt class="docutils literal"><span class="pre">timestamp</span></tt> Module</a></li>
|
||||
<li class="toctree-l4"><a class="reference internal" href="pylorax.api.html#module-pylorax.api.v0"><tt class="docutils literal"><span class="pre">v0</span></tt> Module</a></li>
|
||||
<li class="toctree-l4"><a class="reference internal" href="pylorax.api.html#module-pylorax.api.workspace"><tt class="docutils literal"><span class="pre">workspace</span></tt> Module</a></li>
|
||||
<li class="toctree-l4"><a class="reference internal" href="pylorax.api.html#module-pylorax.api.yumbase"><tt class="docutils literal"><span class="pre">yumbase</span></tt> Module</a></li>
|
||||
@ -167,7 +172,7 @@
|
||||
<li class="right" >
|
||||
<a href="product-images.html" title="Product and Updates Images"
|
||||
>previous</a> |</li>
|
||||
<li><a href="index.html">Lorax 19.7.18 documentation</a> »</li>
|
||||
<li><a href="index.html">Lorax 19.7.21 documentation</a> »</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="footer">
|
||||
|
Binary file not shown.
@ -8,7 +8,7 @@
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
|
||||
<title>Product and Updates Images — Lorax 19.7.18 documentation</title>
|
||||
<title>Product and Updates Images — Lorax 19.7.21 documentation</title>
|
||||
|
||||
<link rel="stylesheet" href="_static/default.css" type="text/css" />
|
||||
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
|
||||
@ -16,7 +16,7 @@
|
||||
<script type="text/javascript">
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT: '',
|
||||
VERSION: '19.7.18',
|
||||
VERSION: '19.7.21',
|
||||
COLLAPSE_INDEX: false,
|
||||
FILE_SUFFIX: '.html',
|
||||
HAS_SOURCE: true
|
||||
@ -25,7 +25,7 @@
|
||||
<script type="text/javascript" src="_static/jquery.js"></script>
|
||||
<script type="text/javascript" src="_static/underscore.js"></script>
|
||||
<script type="text/javascript" src="_static/doctools.js"></script>
|
||||
<link rel="top" title="Lorax 19.7.18 documentation" href="index.html" />
|
||||
<link rel="top" title="Lorax 19.7.21 documentation" href="index.html" />
|
||||
<link rel="next" title="src" href="modules.html" />
|
||||
<link rel="prev" title="composer-cli" href="composer-cli.html" />
|
||||
</head>
|
||||
@ -45,7 +45,7 @@
|
||||
<li class="right" >
|
||||
<a href="composer-cli.html" title="composer-cli"
|
||||
accesskey="P">previous</a> |</li>
|
||||
<li><a href="index.html">Lorax 19.7.18 documentation</a> »</li>
|
||||
<li><a href="index.html">Lorax 19.7.21 documentation</a> »</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
@ -127,7 +127,7 @@ command or the installpkgs paramater of <a class="reference internal" href="pylo
|
||||
<li class="right" >
|
||||
<a href="composer-cli.html" title="composer-cli"
|
||||
>previous</a> |</li>
|
||||
<li><a href="index.html">Lorax 19.7.18 documentation</a> »</li>
|
||||
<li><a href="index.html">Lorax 19.7.21 documentation</a> »</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="footer">
|
||||
|
@ -8,7 +8,7 @@
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
|
||||
<title>Python Module Index — Lorax 19.7.18 documentation</title>
|
||||
<title>Python Module Index — Lorax 19.7.21 documentation</title>
|
||||
|
||||
<link rel="stylesheet" href="_static/default.css" type="text/css" />
|
||||
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
|
||||
@ -16,7 +16,7 @@
|
||||
<script type="text/javascript">
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT: '',
|
||||
VERSION: '19.7.18',
|
||||
VERSION: '19.7.21',
|
||||
COLLAPSE_INDEX: false,
|
||||
FILE_SUFFIX: '.html',
|
||||
HAS_SOURCE: true
|
||||
@ -25,7 +25,7 @@
|
||||
<script type="text/javascript" src="_static/jquery.js"></script>
|
||||
<script type="text/javascript" src="_static/underscore.js"></script>
|
||||
<script type="text/javascript" src="_static/doctools.js"></script>
|
||||
<link rel="top" title="Lorax 19.7.18 documentation" href="index.html" />
|
||||
<link rel="top" title="Lorax 19.7.21 documentation" href="index.html" />
|
||||
|
||||
|
||||
|
||||
@ -40,7 +40,7 @@
|
||||
<li class="right" >
|
||||
<a href="#" title="Python Module Index"
|
||||
>modules</a> |</li>
|
||||
<li><a href="index.html">Lorax 19.7.18 documentation</a> »</li>
|
||||
<li><a href="index.html">Lorax 19.7.21 documentation</a> »</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
@ -102,6 +102,11 @@
|
||||
<td>
|
||||
<a href="composer.cli.html#module-composer.cli.sources"><tt class="xref">composer.cli.sources</tt></a></td><td>
|
||||
<em></em></td></tr>
|
||||
<tr class="cg-1">
|
||||
<td></td>
|
||||
<td>
|
||||
<a href="composer.cli.html#module-composer.cli.status"><tt class="xref">composer.cli.status</tt></a></td><td>
|
||||
<em></em></td></tr>
|
||||
<tr class="cg-1">
|
||||
<td></td>
|
||||
<td>
|
||||
@ -131,6 +136,11 @@
|
||||
<td>
|
||||
<a href="pylorax.api.html#module-pylorax.api"><tt class="xref">pylorax.api</tt></a></td><td>
|
||||
<em></em></td></tr>
|
||||
<tr class="cg-2">
|
||||
<td></td>
|
||||
<td>
|
||||
<a href="pylorax.api.html#module-pylorax.api.checkparams"><tt class="xref">pylorax.api.checkparams</tt></a></td><td>
|
||||
<em></em></td></tr>
|
||||
<tr class="cg-2">
|
||||
<td></td>
|
||||
<td>
|
||||
@ -146,6 +156,11 @@
|
||||
<td>
|
||||
<a href="pylorax.api.html#module-pylorax.api.crossdomain"><tt class="xref">pylorax.api.crossdomain</tt></a></td><td>
|
||||
<em></em></td></tr>
|
||||
<tr class="cg-2">
|
||||
<td></td>
|
||||
<td>
|
||||
<a href="pylorax.api.html#module-pylorax.api.errors"><tt class="xref">pylorax.api.errors</tt></a></td><td>
|
||||
<em></em></td></tr>
|
||||
<tr class="cg-2">
|
||||
<td></td>
|
||||
<td>
|
||||
@ -161,11 +176,21 @@
|
||||
<td>
|
||||
<a href="pylorax.api.html#module-pylorax.api.recipes"><tt class="xref">pylorax.api.recipes</tt></a></td><td>
|
||||
<em></em></td></tr>
|
||||
<tr class="cg-2">
|
||||
<td></td>
|
||||
<td>
|
||||
<a href="pylorax.api.html#module-pylorax.api.regexes"><tt class="xref">pylorax.api.regexes</tt></a></td><td>
|
||||
<em></em></td></tr>
|
||||
<tr class="cg-2">
|
||||
<td></td>
|
||||
<td>
|
||||
<a href="pylorax.api.html#module-pylorax.api.server"><tt class="xref">pylorax.api.server</tt></a></td><td>
|
||||
<em></em></td></tr>
|
||||
<tr class="cg-2">
|
||||
<td></td>
|
||||
<td>
|
||||
<a href="pylorax.api.html#module-pylorax.api.timestamp"><tt class="xref">pylorax.api.timestamp</tt></a></td><td>
|
||||
<em></em></td></tr>
|
||||
<tr class="cg-2">
|
||||
<td></td>
|
||||
<td>
|
||||
@ -290,7 +315,7 @@
|
||||
<li class="right" >
|
||||
<a href="#" title="Python Module Index"
|
||||
>modules</a> |</li>
|
||||
<li><a href="index.html">Lorax 19.7.18 documentation</a> »</li>
|
||||
<li><a href="index.html">Lorax 19.7.21 documentation</a> »</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="footer">
|
||||
|
@ -8,7 +8,7 @@
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
|
||||
<title>api Package — Lorax 19.7.18 documentation</title>
|
||||
<title>api Package — Lorax 19.7.21 documentation</title>
|
||||
|
||||
<link rel="stylesheet" href="_static/default.css" type="text/css" />
|
||||
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
|
||||
@ -16,7 +16,7 @@
|
||||
<script type="text/javascript">
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT: '',
|
||||
VERSION: '19.7.18',
|
||||
VERSION: '19.7.21',
|
||||
COLLAPSE_INDEX: false,
|
||||
FILE_SUFFIX: '.html',
|
||||
HAS_SOURCE: true
|
||||
@ -25,7 +25,7 @@
|
||||
<script type="text/javascript" src="_static/jquery.js"></script>
|
||||
<script type="text/javascript" src="_static/underscore.js"></script>
|
||||
<script type="text/javascript" src="_static/doctools.js"></script>
|
||||
<link rel="top" title="Lorax 19.7.18 documentation" href="index.html" />
|
||||
<link rel="top" title="Lorax 19.7.21 documentation" href="index.html" />
|
||||
<link rel="up" title="pylorax Package" href="pylorax.html" />
|
||||
<link rel="prev" title="pylorax Package" href="pylorax.html" />
|
||||
</head>
|
||||
@ -42,7 +42,7 @@
|
||||
<li class="right" >
|
||||
<a href="pylorax.html" title="pylorax Package"
|
||||
accesskey="P">previous</a> |</li>
|
||||
<li><a href="index.html">Lorax 19.7.18 documentation</a> »</li>
|
||||
<li><a href="index.html">Lorax 19.7.21 documentation</a> »</li>
|
||||
<li><a href="modules.html" >src</a> »</li>
|
||||
<li><a href="pylorax.html" accesskey="U">pylorax Package</a> »</li>
|
||||
</ul>
|
||||
@ -62,6 +62,14 @@
|
||||
<tt class="descclassname">pylorax.api.</tt><tt class="descname">crossdomain</tt><big>(</big><em>origin</em>, <em>methods=None</em>, <em>headers=None</em>, <em>max_age=21600</em>, <em>attach_to_all=True</em>, <em>automatic_options=True</em><big>)</big><a class="headerlink" href="#pylorax.api.crossdomain" title="Permalink to this definition">¶</a></dt>
|
||||
<dd></dd></dl>
|
||||
|
||||
</div>
|
||||
<div class="section" id="module-pylorax.api.checkparams">
|
||||
<span id="checkparams-module"></span><h2><tt class="xref py py-mod docutils literal"><span class="pre">checkparams</span></tt> Module<a class="headerlink" href="#module-pylorax.api.checkparams" title="Permalink to this headline">¶</a></h2>
|
||||
<dl class="function">
|
||||
<dt id="pylorax.api.checkparams.checkparams">
|
||||
<tt class="descclassname">pylorax.api.checkparams.</tt><tt class="descname">checkparams</tt><big>(</big><em>tuples</em><big>)</big><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.compose">
|
||||
<span id="compose-module"></span><h2><tt class="xref py py-mod docutils literal"><span class="pre">compose</span></tt> Module<a class="headerlink" href="#module-pylorax.api.compose" title="Permalink to this headline">¶</a></h2>
|
||||
@ -175,6 +183,25 @@ Other options will be filled in by <cite>make_compose()</cite></p>
|
||||
</table>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="function">
|
||||
<dt id="pylorax.api.compose.test_templates">
|
||||
<tt class="descclassname">pylorax.api.compose.</tt><tt class="descname">test_templates</tt><big>(</big><em>yb</em>, <em>share_dir</em><big>)</big><a class="reference internal" href="_modules/pylorax/api/compose.html#test_templates"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.compose.test_templates" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Try depsolving each of the the templates and report any errors</p>
|
||||
<table class="docutils field-list" frame="void" rules="none">
|
||||
<col class="field-name" />
|
||||
<col class="field-body" />
|
||||
<tbody valign="top">
|
||||
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>yb</strong> (<em>YumBase</em>) – yum base object</td>
|
||||
</tr>
|
||||
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">List of template types and errors</td>
|
||||
</tr>
|
||||
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body">List of errors</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<p>Return a list of templates and errors encountered or an empty list</p>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="function">
|
||||
<dt id="pylorax.api.compose.write_ks_group">
|
||||
<tt class="descclassname">pylorax.api.compose.</tt><tt class="descname">write_ks_group</tt><big>(</big><em>f</em>, <em>group</em><big>)</big><a class="reference internal" href="_modules/pylorax/api/compose.html#write_ks_group"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.compose.write_ks_group" title="Permalink to this definition">¶</a></dt>
|
||||
@ -297,6 +324,9 @@ with whatever options are relevant.</p>
|
||||
<tt class="descclassname">pylorax.api.crossdomain.</tt><tt class="descname">crossdomain</tt><big>(</big><em>origin</em>, <em>methods=None</em>, <em>headers=None</em>, <em>max_age=21600</em>, <em>attach_to_all=True</em>, <em>automatic_options=True</em><big>)</big><a class="reference internal" href="_modules/pylorax/api/crossdomain.html#crossdomain"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.crossdomain.crossdomain" title="Permalink to this definition">¶</a></dt>
|
||||
<dd></dd></dl>
|
||||
|
||||
</div>
|
||||
<div class="section" id="module-pylorax.api.errors">
|
||||
<span id="errors-module"></span><h2><tt class="xref py py-mod docutils literal"><span class="pre">errors</span></tt> 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="projects-module"></span><h2><tt class="xref py py-mod docutils literal"><span class="pre">projects</span></tt> Module<a class="headerlink" href="#module-pylorax.api.projects" title="Permalink to this headline">¶</a></h2>
|
||||
@ -505,7 +535,7 @@ and sets the type to “rpm”</p>
|
||||
|
||||
<dl class="function">
|
||||
<dt id="pylorax.api.projects.projects_depsolve">
|
||||
<tt class="descclassname">pylorax.api.projects.</tt><tt class="descname">projects_depsolve</tt><big>(</big><em>yb</em>, <em>projects</em><big>)</big><a class="reference internal" href="_modules/pylorax/api/projects.html#projects_depsolve"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.projects.projects_depsolve" title="Permalink to this definition">¶</a></dt>
|
||||
<tt class="descclassname">pylorax.api.projects.</tt><tt class="descname">projects_depsolve</tt><big>(</big><em>yb</em>, <em>projects</em>, <em>groups</em><big>)</big><a class="reference internal" href="_modules/pylorax/api/projects.html#projects_depsolve"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.projects.projects_depsolve" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Return the dependencies for a list of projects</p>
|
||||
<table class="docutils field-list" frame="void" rules="none">
|
||||
<col class="field-name" />
|
||||
@ -514,6 +544,7 @@ and sets the type to “rpm”</p>
|
||||
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
|
||||
<li><strong>yb</strong> (<em>YumBase</em>) – yum base object</li>
|
||||
<li><strong>projects</strong> (<em>List of tuples</em>) – The projects and version globs to find the dependencies for</li>
|
||||
<li><strong>groups</strong> (<em>List of str</em>) – The groups to include in dependency solving</li>
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
@ -532,7 +563,7 @@ and sets the type to “rpm”</p>
|
||||
|
||||
<dl class="function">
|
||||
<dt id="pylorax.api.projects.projects_depsolve_with_size">
|
||||
<tt class="descclassname">pylorax.api.projects.</tt><tt class="descname">projects_depsolve_with_size</tt><big>(</big><em>yb</em>, <em>projects</em>, <em>with_core=True</em><big>)</big><a class="reference internal" href="_modules/pylorax/api/projects.html#projects_depsolve_with_size"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.projects.projects_depsolve_with_size" title="Permalink to this definition">¶</a></dt>
|
||||
<tt class="descclassname">pylorax.api.projects.</tt><tt class="descname">projects_depsolve_with_size</tt><big>(</big><em>yb</em>, <em>projects</em>, <em>groups</em>, <em>with_core=True</em><big>)</big><a class="reference internal" href="_modules/pylorax/api/projects.html#projects_depsolve_with_size"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.projects.projects_depsolve_with_size" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Return the dependencies and installed size for a list of projects</p>
|
||||
<table class="docutils field-list" frame="void" rules="none">
|
||||
<col class="field-name" />
|
||||
@ -541,6 +572,7 @@ and sets the type to “rpm”</p>
|
||||
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
|
||||
<li><strong>yb</strong> (<em>YumBase</em>) – yum base object</li>
|
||||
<li><strong>projects</strong> (<em>List of tuples</em>) – The projects and version globs to find the dependencies for</li>
|
||||
<li><strong>groups</strong> (<em>List of str</em>) – The groups to include in dependency solving</li>
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
@ -818,12 +850,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">
|
||||
@ -1055,7 +1094,7 @@ and “run” has the uuids that are being built (currently limited to 1
|
||||
</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">dict</p>
|
||||
@ -1182,7 +1221,7 @@ the selected data to the caller by returning the Popen stdout from the tar proce
|
||||
|
||||
<dl class="class">
|
||||
<dt id="pylorax.api.recipes.Recipe">
|
||||
<em class="property">class </em><tt class="descclassname">pylorax.api.recipes.</tt><tt class="descname">Recipe</tt><big>(</big><em>name</em>, <em>description</em>, <em>version</em>, <em>modules</em>, <em>packages</em>, <em>customizations=None</em><big>)</big><a class="reference internal" href="_modules/pylorax/api/recipes.html#Recipe"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.recipes.Recipe" title="Permalink to this definition">¶</a></dt>
|
||||
<em class="property">class </em><tt class="descclassname">pylorax.api.recipes.</tt><tt class="descname">Recipe</tt><big>(</big><em>name</em>, <em>description</em>, <em>version</em>, <em>modules</em>, <em>packages</em>, <em>groups</em>, <em>customizations=None</em><big>)</big><a class="reference internal" href="_modules/pylorax/api/recipes.html#Recipe"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.recipes.Recipe" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Bases: <a class="reference external" href="https://docs.python.org/2/library/stdtypes.html#dict" title="(in Python v2.7)"><tt class="xref py py-class docutils literal"><span class="pre">dict</span></tt></a></p>
|
||||
<p>A Recipe of package and modules</p>
|
||||
<p>This is a subclass of dict that enforces the constructor arguments
|
||||
@ -1238,6 +1277,12 @@ If they are different, check and return the new version</p>
|
||||
</table>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="attribute">
|
||||
<dt id="pylorax.api.recipes.Recipe.group_names">
|
||||
<tt class="descname">group_names</tt><a class="reference internal" href="_modules/pylorax/api/recipes.html#Recipe.group_names"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.recipes.Recipe.group_names" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Return the names of the groups. Groups do not have versions.</p>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="attribute">
|
||||
<dt id="pylorax.api.recipes.Recipe.module_names">
|
||||
<tt class="descname">module_names</tt><a class="reference internal" href="_modules/pylorax/api/recipes.html#Recipe.module_names"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.recipes.Recipe.module_names" title="Permalink to this definition">¶</a></dt>
|
||||
@ -1282,6 +1327,12 @@ If they are different, check and return the new version</p>
|
||||
<dd><p>Bases: <tt class="xref py py-class docutils literal"><span class="pre">exceptions.Exception</span></tt></p>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="class">
|
||||
<dt id="pylorax.api.recipes.RecipeGroup">
|
||||
<em class="property">class </em><tt class="descclassname">pylorax.api.recipes.</tt><tt class="descname">RecipeGroup</tt><big>(</big><em>name</em><big>)</big><a class="reference internal" href="_modules/pylorax/api/recipes.html#RecipeGroup"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.recipes.RecipeGroup" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Bases: <a class="reference external" href="https://docs.python.org/2/library/stdtypes.html#dict" title="(in Python v2.7)"><tt class="xref py py-class docutils literal"><span class="pre">dict</span></tt></a></p>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="class">
|
||||
<dt id="pylorax.api.recipes.RecipeModule">
|
||||
<em class="property">class </em><tt class="descclassname">pylorax.api.recipes.</tt><tt class="descname">RecipeModule</tt><big>(</big><em>name</em>, <em>version</em><big>)</big><a class="reference internal" href="_modules/pylorax/api/recipes.html#RecipeModule"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.recipes.RecipeModule" title="Permalink to this definition">¶</a></dt>
|
||||
@ -2134,6 +2185,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="regexes-module"></span><h2><tt class="xref py py-mod docutils literal"><span class="pre">regexes</span></tt> 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="server-module"></span><h2><tt class="xref py py-mod docutils literal"><span class="pre">server</span></tt> Module<a class="headerlink" href="#module-pylorax.api.server" title="Permalink to this headline">¶</a></h2>
|
||||
@ -2162,6 +2216,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="timestamp-module"></span><h2><tt class="xref py py-mod docutils literal"><span class="pre">timestamp</span></tt> 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">
|
||||
<tt class="descclassname">pylorax.api.timestamp.</tt><tt class="descname">timestamp_dict</tt><big>(</big><em>destdir</em><big>)</big><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">
|
||||
<tt class="descclassname">pylorax.api.timestamp.</tt><tt class="descname">write_timestamp</tt><big>(</big><em>destdir</em>, <em>ty</em><big>)</big><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="v0-module"></span><h2><tt class="xref py py-mod docutils literal"><span class="pre">v0</span></tt> Module<a class="headerlink" href="#module-pylorax.api.v0" title="Permalink to this headline">¶</a></h2>
|
||||
@ -2887,14 +2954,14 @@ and the build that is running.</p>
|
||||
<span class="s">"id"</span><span class="p">:</span> <span class="s">"45502a6d-06e8-48a5-a215-2b4174b3614b"</span><span class="p">,</span>
|
||||
<span class="s">"blueprint"</span><span class="p">:</span> <span class="s">"glusterfs"</span><span class="p">,</span>
|
||||
<span class="s">"queue_status"</span><span class="p">:</span> <span class="s">"WAITING"</span><span class="p">,</span>
|
||||
<span class="s">"timestamp"</span><span class="p">:</span> <span class="mf">1517362647.4570868</span><span class="p">,</span>
|
||||
<span class="s">"job_created"</span><span class="p">:</span> <span class="mf">1517362647.4570868</span><span class="p">,</span>
|
||||
<span class="s">"version"</span><span class="p">:</span> <span class="s">"0.0.6"</span>
|
||||
<span class="p">},</span>
|
||||
<span class="p">{</span>
|
||||
<span class="s">"id"</span><span class="p">:</span> <span class="s">"6d292bd0-bec7-4825-8d7d-41ef9c3e4b73"</span><span class="p">,</span>
|
||||
<span class="s">"blueprint"</span><span class="p">:</span> <span class="s">"kubernetes"</span><span class="p">,</span>
|
||||
<span class="s">"queue_status"</span><span class="p">:</span> <span class="s">"WAITING"</span><span class="p">,</span>
|
||||
<span class="s">"timestamp"</span><span class="p">:</span> <span class="mf">1517362659.0034983</span><span class="p">,</span>
|
||||
<span class="s">"job_created"</span><span class="p">:</span> <span class="mf">1517362659.0034983</span><span class="p">,</span>
|
||||
<span class="s">"version"</span><span class="p">:</span> <span class="s">"0.0.1"</span>
|
||||
<span class="p">}</span>
|
||||
<span class="p">],</span>
|
||||
@ -2903,7 +2970,8 @@ and the build that is running.</p>
|
||||
<span class="s">"id"</span><span class="p">:</span> <span class="s">"745712b2-96db-44c0-8014-fe925c35e795"</span><span class="p">,</span>
|
||||
<span class="s">"blueprint"</span><span class="p">:</span> <span class="s">"glusterfs"</span><span class="p">,</span>
|
||||
<span class="s">"queue_status"</span><span class="p">:</span> <span class="s">"RUNNING"</span><span class="p">,</span>
|
||||
<span class="s">"timestamp"</span><span class="p">:</span> <span class="mf">1517362633.7965999</span><span class="p">,</span>
|
||||
<span class="s">"job_created"</span><span class="p">:</span> <span class="mf">1517362633.7965999</span><span class="p">,</span>
|
||||
<span class="s">"job_started"</span><span class="p">:</span> <span class="mf">1517362633.8001345</span><span class="p">,</span>
|
||||
<span class="s">"version"</span><span class="p">:</span> <span class="s">"0.0.6"</span>
|
||||
<span class="p">}</span>
|
||||
<span class="p">]</span>
|
||||
@ -2923,14 +2991,18 @@ and the build that is running.</p>
|
||||
<span class="s">"id"</span><span class="p">:</span> <span class="s">"70b84195-9817-4b8a-af92-45e380f39894"</span><span class="p">,</span>
|
||||
<span class="s">"blueprint"</span><span class="p">:</span> <span class="s">"glusterfs"</span><span class="p">,</span>
|
||||
<span class="s">"queue_status"</span><span class="p">:</span> <span class="s">"FINISHED"</span><span class="p">,</span>
|
||||
<span class="s">"timestamp"</span><span class="p">:</span> <span class="mf">1517351003.8210032</span><span class="p">,</span>
|
||||
<span class="s">"job_created"</span><span class="p">:</span> <span class="mf">1517351003.8210032</span><span class="p">,</span>
|
||||
<span class="s">"job_started"</span><span class="p">:</span> <span class="mf">1517351003.8230415</span><span class="p">,</span>
|
||||
<span class="s">"job_finished"</span><span class="p">:</span> <span class="mf">1517359234.1003145</span><span class="p">,</span>
|
||||
<span class="s">"version"</span><span class="p">:</span> <span class="s">"0.0.6"</span>
|
||||
<span class="p">},</span>
|
||||
<span class="p">{</span>
|
||||
<span class="s">"id"</span><span class="p">:</span> <span class="s">"e695affd-397f-4af9-9022-add2636e7459"</span><span class="p">,</span>
|
||||
<span class="s">"blueprint"</span><span class="p">:</span> <span class="s">"glusterfs"</span><span class="p">,</span>
|
||||
<span class="s">"queue_status"</span><span class="p">:</span> <span class="s">"FINISHED"</span><span class="p">,</span>
|
||||
<span class="s">"timestamp"</span><span class="p">:</span> <span class="mf">1517362289.7193348</span><span class="p">,</span>
|
||||
<span class="s">"job_created"</span><span class="p">:</span> <span class="mf">1517362289.7193348</span><span class="p">,</span>
|
||||
<span class="s">"job_started"</span><span class="p">:</span> <span class="mf">1517362289.9751132</span><span class="p">,</span>
|
||||
<span class="s">"job_finished"</span><span class="p">:</span> <span class="mf">1517363500.1234567</span><span class="p">,</span>
|
||||
<span class="s">"version"</span><span class="p">:</span> <span class="s">"0.0.6"</span>
|
||||
<span class="p">}</span>
|
||||
<span class="p">]</span>
|
||||
@ -2950,7 +3022,9 @@ and the build that is running.</p>
|
||||
<span class="s">"id"</span><span class="p">:</span> <span class="s">"8c8435ef-d6bd-4c68-9bf1-a2ef832e6b1a"</span><span class="p">,</span>
|
||||
<span class="s">"blueprint"</span><span class="p">:</span> <span class="s">"http-server"</span><span class="p">,</span>
|
||||
<span class="s">"queue_status"</span><span class="p">:</span> <span class="s">"FAILED"</span><span class="p">,</span>
|
||||
<span class="s">"timestamp"</span><span class="p">:</span> <span class="mf">1517523249.9301329</span><span class="p">,</span>
|
||||
<span class="s">"job_created"</span><span class="p">:</span> <span class="mf">1517523249.9301329</span><span class="p">,</span>
|
||||
<span class="s">"job_started"</span><span class="p">:</span> <span class="mf">1517523249.9314211</span><span class="p">,</span>
|
||||
<span class="s">"job_finished"</span><span class="p">:</span> <span class="mf">1517523255.5623411</span><span class="p">,</span>
|
||||
<span class="s">"version"</span><span class="p">:</span> <span class="s">"0.0.2"</span>
|
||||
<span class="p">}</span>
|
||||
<span class="p">]</span>
|
||||
@ -2959,10 +3033,11 @@ and the build that is running.</p>
|
||||
</div>
|
||||
</div></blockquote>
|
||||
</div>
|
||||
<div class="section" id="api-v0-compose-status-uuids">
|
||||
<h4><cite>/api/v0/compose/status/<uuids></cite><a class="headerlink" href="#api-v0-compose-status-uuids" title="Permalink to this headline">¶</a></h4>
|
||||
<div class="section" id="api-v0-compose-status-uuids-blueprint-blueprint-name-status-compose-status-type-compose-type">
|
||||
<h4><cite>/api/v0/compose/status/<uuids>[?blueprint=<blueprint_name>&status=<compose_status>&type=<compose_type>]</cite><a class="headerlink" href="#api-v0-compose-status-uuids-blueprint-blueprint-name-status-compose-status-type-compose-type" title="Permalink to this headline">¶</a></h4>
|
||||
<blockquote>
|
||||
<div><p>Return the details for each of the comma-separated list of uuids.</p>
|
||||
<div><p>Return the details for each of the comma-separated list of uuids. A uuid of ‘*’ will return
|
||||
details for all composes.</p>
|
||||
<p>Example:</p>
|
||||
<div class="highlight-python"><div class="highlight"><pre><span class="p">{</span>
|
||||
<span class="s">"uuids"</span><span class="p">:</span> <span class="p">[</span>
|
||||
@ -2970,14 +3045,18 @@ and the build that is running.</p>
|
||||
<span class="s">"id"</span><span class="p">:</span> <span class="s">"8c8435ef-d6bd-4c68-9bf1-a2ef832e6b1a"</span><span class="p">,</span>
|
||||
<span class="s">"blueprint"</span><span class="p">:</span> <span class="s">"http-server"</span><span class="p">,</span>
|
||||
<span class="s">"queue_status"</span><span class="p">:</span> <span class="s">"FINISHED"</span><span class="p">,</span>
|
||||
<span class="s">"timestamp"</span><span class="p">:</span> <span class="mf">1517523644.2384307</span><span class="p">,</span>
|
||||
<span class="s">"job_created"</span><span class="p">:</span> <span class="mf">1517523644.2384307</span><span class="p">,</span>
|
||||
<span class="s">"job_started"</span><span class="p">:</span> <span class="mf">1517523644.2551234</span><span class="p">,</span>
|
||||
<span class="s">"job_finished"</span><span class="p">:</span> <span class="mf">1517523689.9864314</span><span class="p">,</span>
|
||||
<span class="s">"version"</span><span class="p">:</span> <span class="s">"0.0.2"</span>
|
||||
<span class="p">},</span>
|
||||
<span class="p">{</span>
|
||||
<span class="s">"id"</span><span class="p">:</span> <span class="s">"45502a6d-06e8-48a5-a215-2b4174b3614b"</span><span class="p">,</span>
|
||||
<span class="s">"blueprint"</span><span class="p">:</span> <span class="s">"glusterfs"</span><span class="p">,</span>
|
||||
<span class="s">"queue_status"</span><span class="p">:</span> <span class="s">"FINISHED"</span><span class="p">,</span>
|
||||
<span class="s">"timestamp"</span><span class="p">:</span> <span class="mf">1517363442.188399</span><span class="p">,</span>
|
||||
<span class="s">"job_created"</span><span class="p">:</span> <span class="mf">1517363442.188399</span><span class="p">,</span>
|
||||
<span class="s">"job_started"</span><span class="p">:</span> <span class="mf">1517363442.325324</span><span class="p">,</span>
|
||||
<span class="s">"job_finished"</span><span class="p">:</span> <span class="mf">1517363451.653621</span><span class="p">,</span>
|
||||
<span class="s">"version"</span><span class="p">:</span> <span class="s">"0.0.6"</span>
|
||||
<span class="p">}</span>
|
||||
<span class="p">]</span>
|
||||
@ -3128,6 +3207,11 @@ a line boundry.</p>
|
||||
12:59:50,784 INFO anaconda: Thread Done: AnaConfigurationThread (140629395244800)</pre>
|
||||
</div>
|
||||
</div></blockquote>
|
||||
<dl class="function">
|
||||
<dt id="pylorax.api.v0.blueprint_exists">
|
||||
<tt class="descclassname">pylorax.api.v0.</tt><tt class="descname">blueprint_exists</tt><big>(</big><em>api</em>, <em>branch</em>, <em>blueprint_name</em><big>)</big><a class="reference internal" href="_modules/pylorax/api/v0.html#blueprint_exists"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.v0.blueprint_exists" title="Permalink to this definition">¶</a></dt>
|
||||
<dd></dd></dl>
|
||||
|
||||
<dl class="function">
|
||||
<dt id="pylorax.api.v0.take_limits">
|
||||
<tt class="descclassname">pylorax.api.v0.</tt><tt class="descname">take_limits</tt><big>(</big><em>iterable</em>, <em>offset</em>, <em>limit</em><big>)</big><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>
|
||||
@ -3314,16 +3398,20 @@ a line boundry.</p>
|
||||
<ul>
|
||||
<li><a class="reference internal" href="#">api Package</a><ul>
|
||||
<li><a class="reference internal" href="#id1"><tt class="docutils literal"><span class="pre">api</span></tt> Package</a></li>
|
||||
<li><a class="reference internal" href="#module-pylorax.api.checkparams"><tt class="docutils literal"><span class="pre">checkparams</span></tt> Module</a></li>
|
||||
<li><a class="reference internal" href="#module-pylorax.api.compose"><tt class="docutils literal"><span class="pre">compose</span></tt> Module</a><ul>
|
||||
<li><a class="reference internal" href="#adding-new-output-types">Adding New Output Types</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><a class="reference internal" href="#module-pylorax.api.config"><tt class="docutils literal"><span class="pre">config</span></tt> Module</a></li>
|
||||
<li><a class="reference internal" href="#module-pylorax.api.crossdomain"><tt class="docutils literal"><span class="pre">crossdomain</span></tt> Module</a></li>
|
||||
<li><a class="reference internal" href="#module-pylorax.api.errors"><tt class="docutils literal"><span class="pre">errors</span></tt> Module</a></li>
|
||||
<li><a class="reference internal" href="#module-pylorax.api.projects"><tt class="docutils literal"><span class="pre">projects</span></tt> Module</a></li>
|
||||
<li><a class="reference internal" href="#module-pylorax.api.queue"><tt class="docutils literal"><span class="pre">queue</span></tt> Module</a></li>
|
||||
<li><a class="reference internal" href="#module-pylorax.api.recipes"><tt class="docutils literal"><span class="pre">recipes</span></tt> Module</a></li>
|
||||
<li><a class="reference internal" href="#module-pylorax.api.regexes"><tt class="docutils literal"><span class="pre">regexes</span></tt> Module</a></li>
|
||||
<li><a class="reference internal" href="#module-pylorax.api.server"><tt class="docutils literal"><span class="pre">server</span></tt> Module</a></li>
|
||||
<li><a class="reference internal" href="#module-pylorax.api.timestamp"><tt class="docutils literal"><span class="pre">timestamp</span></tt> Module</a></li>
|
||||
<li><a class="reference internal" href="#module-pylorax.api.v0"><tt class="docutils literal"><span class="pre">v0</span></tt> Module</a><ul>
|
||||
<li><a class="reference internal" href="#status-responses">Status Responses</a></li>
|
||||
<li><a class="reference internal" href="#api-routes">API Routes</a><ul>
|
||||
@ -3354,7 +3442,7 @@ a line boundry.</p>
|
||||
<li><a class="reference internal" href="#api-v0-compose-queue"><cite>/api/v0/compose/queue</cite></a></li>
|
||||
<li><a class="reference internal" href="#api-v0-compose-finished"><cite>/api/v0/compose/finished</cite></a></li>
|
||||
<li><a class="reference internal" href="#api-v0-compose-failed"><cite>/api/v0/compose/failed</cite></a></li>
|
||||
<li><a class="reference internal" href="#api-v0-compose-status-uuids"><cite>/api/v0/compose/status/<uuids></cite></a></li>
|
||||
<li><a class="reference internal" href="#api-v0-compose-status-uuids-blueprint-blueprint-name-status-compose-status-type-compose-type"><cite>/api/v0/compose/status/<uuids>[?blueprint=<blueprint_name>&status=<compose_status>&type=<compose_type>]</cite></a></li>
|
||||
<li><a class="reference internal" href="#delete-api-v0-blueprints-cancel-uuid">DELETE <cite>/api/v0/blueprints/cancel/<uuid></cite></a></li>
|
||||
<li><a class="reference internal" href="#delete-api-v0-compose-delete-uuids">DELETE <cite>/api/v0/compose/delete/<uuids></cite></a></li>
|
||||
<li><a class="reference internal" href="#api-v0-compose-info-uuid"><cite>/api/v0/compose/info/<uuid></cite></a></li>
|
||||
@ -3410,7 +3498,7 @@ a line boundry.</p>
|
||||
<li class="right" >
|
||||
<a href="pylorax.html" title="pylorax Package"
|
||||
>previous</a> |</li>
|
||||
<li><a href="index.html">Lorax 19.7.18 documentation</a> »</li>
|
||||
<li><a href="index.html">Lorax 19.7.21 documentation</a> »</li>
|
||||
<li><a href="modules.html" >src</a> »</li>
|
||||
<li><a href="pylorax.html" >pylorax Package</a> »</li>
|
||||
</ul>
|
||||
|
@ -8,7 +8,7 @@
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
|
||||
<title>pylorax Package — Lorax 19.7.18 documentation</title>
|
||||
<title>pylorax Package — Lorax 19.7.21 documentation</title>
|
||||
|
||||
<link rel="stylesheet" href="_static/default.css" type="text/css" />
|
||||
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
|
||||
@ -16,7 +16,7 @@
|
||||
<script type="text/javascript">
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT: '',
|
||||
VERSION: '19.7.18',
|
||||
VERSION: '19.7.21',
|
||||
COLLAPSE_INDEX: false,
|
||||
FILE_SUFFIX: '.html',
|
||||
HAS_SOURCE: true
|
||||
@ -25,7 +25,7 @@
|
||||
<script type="text/javascript" src="_static/jquery.js"></script>
|
||||
<script type="text/javascript" src="_static/underscore.js"></script>
|
||||
<script type="text/javascript" src="_static/doctools.js"></script>
|
||||
<link rel="top" title="Lorax 19.7.18 documentation" href="index.html" />
|
||||
<link rel="top" title="Lorax 19.7.21 documentation" href="index.html" />
|
||||
<link rel="up" title="src" href="modules.html" />
|
||||
<link rel="next" title="api Package" href="pylorax.api.html" />
|
||||
<link rel="prev" title="cli Package" href="composer.cli.html" />
|
||||
@ -46,7 +46,7 @@
|
||||
<li class="right" >
|
||||
<a href="composer.cli.html" title="cli Package"
|
||||
accesskey="P">previous</a> |</li>
|
||||
<li><a href="index.html">Lorax 19.7.18 documentation</a> »</li>
|
||||
<li><a href="index.html">Lorax 19.7.21 documentation</a> »</li>
|
||||
<li><a href="modules.html" accesskey="U">src</a> »</li>
|
||||
</ul>
|
||||
</div>
|
||||
@ -116,27 +116,27 @@
|
||||
<dd><p>Bases: <a class="reference external" href="https://docs.python.org/2/library/functions.html#object" title="(in Python v2.7)"><tt class="xref py py-class docutils literal"><span class="pre">object</span></tt></a></p>
|
||||
<dl class="method">
|
||||
<dt id="pylorax.base.BaseLoraxClass.pcritical">
|
||||
<tt class="descname">pcritical</tt><big>(</big><em>msg</em>, <em>fobj=<open file '<stdout>'</em>, <em>mode 'w' at 0x7f488c86d150></em><big>)</big><a class="reference internal" href="_modules/pylorax/base.html#BaseLoraxClass.pcritical"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.base.BaseLoraxClass.pcritical" title="Permalink to this definition">¶</a></dt>
|
||||
<tt class="descname">pcritical</tt><big>(</big><em>msg</em>, <em>fobj=<open file '<stdout>'</em>, <em>mode 'w' at 0x7fcceb01b150></em><big>)</big><a class="reference internal" href="_modules/pylorax/base.html#BaseLoraxClass.pcritical"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.base.BaseLoraxClass.pcritical" title="Permalink to this definition">¶</a></dt>
|
||||
<dd></dd></dl>
|
||||
|
||||
<dl class="method">
|
||||
<dt id="pylorax.base.BaseLoraxClass.pdebug">
|
||||
<tt class="descname">pdebug</tt><big>(</big><em>msg</em>, <em>fobj=<open file '<stdout>'</em>, <em>mode 'w' at 0x7f488c86d150></em><big>)</big><a class="reference internal" href="_modules/pylorax/base.html#BaseLoraxClass.pdebug"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.base.BaseLoraxClass.pdebug" title="Permalink to this definition">¶</a></dt>
|
||||
<tt class="descname">pdebug</tt><big>(</big><em>msg</em>, <em>fobj=<open file '<stdout>'</em>, <em>mode 'w' at 0x7fcceb01b150></em><big>)</big><a class="reference internal" href="_modules/pylorax/base.html#BaseLoraxClass.pdebug"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.base.BaseLoraxClass.pdebug" title="Permalink to this definition">¶</a></dt>
|
||||
<dd></dd></dl>
|
||||
|
||||
<dl class="method">
|
||||
<dt id="pylorax.base.BaseLoraxClass.perror">
|
||||
<tt class="descname">perror</tt><big>(</big><em>msg</em>, <em>fobj=<open file '<stdout>'</em>, <em>mode 'w' at 0x7f488c86d150></em><big>)</big><a class="reference internal" href="_modules/pylorax/base.html#BaseLoraxClass.perror"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.base.BaseLoraxClass.perror" title="Permalink to this definition">¶</a></dt>
|
||||
<tt class="descname">perror</tt><big>(</big><em>msg</em>, <em>fobj=<open file '<stdout>'</em>, <em>mode 'w' at 0x7fcceb01b150></em><big>)</big><a class="reference internal" href="_modules/pylorax/base.html#BaseLoraxClass.perror"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.base.BaseLoraxClass.perror" title="Permalink to this definition">¶</a></dt>
|
||||
<dd></dd></dl>
|
||||
|
||||
<dl class="method">
|
||||
<dt id="pylorax.base.BaseLoraxClass.pinfo">
|
||||
<tt class="descname">pinfo</tt><big>(</big><em>msg</em>, <em>fobj=<open file '<stdout>'</em>, <em>mode 'w' at 0x7f488c86d150></em><big>)</big><a class="reference internal" href="_modules/pylorax/base.html#BaseLoraxClass.pinfo"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.base.BaseLoraxClass.pinfo" title="Permalink to this definition">¶</a></dt>
|
||||
<tt class="descname">pinfo</tt><big>(</big><em>msg</em>, <em>fobj=<open file '<stdout>'</em>, <em>mode 'w' at 0x7fcceb01b150></em><big>)</big><a class="reference internal" href="_modules/pylorax/base.html#BaseLoraxClass.pinfo"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.base.BaseLoraxClass.pinfo" title="Permalink to this definition">¶</a></dt>
|
||||
<dd></dd></dl>
|
||||
|
||||
<dl class="method">
|
||||
<dt id="pylorax.base.BaseLoraxClass.pwarning">
|
||||
<tt class="descname">pwarning</tt><big>(</big><em>msg</em>, <em>fobj=<open file '<stdout>'</em>, <em>mode 'w' at 0x7f488c86d150></em><big>)</big><a class="reference internal" href="_modules/pylorax/base.html#BaseLoraxClass.pwarning"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.base.BaseLoraxClass.pwarning" title="Permalink to this definition">¶</a></dt>
|
||||
<tt class="descname">pwarning</tt><big>(</big><em>msg</em>, <em>fobj=<open file '<stdout>'</em>, <em>mode 'w' at 0x7fcceb01b150></em><big>)</big><a class="reference internal" href="_modules/pylorax/base.html#BaseLoraxClass.pwarning"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.base.BaseLoraxClass.pwarning" title="Permalink to this definition">¶</a></dt>
|
||||
<dd></dd></dl>
|
||||
|
||||
</dd></dl>
|
||||
@ -1467,16 +1467,20 @@ image is built with the filename “${prefix}-${kernel.version}.img”</
|
||||
<ul>
|
||||
<li class="toctree-l1"><a class="reference internal" href="pylorax.api.html">api Package</a><ul>
|
||||
<li class="toctree-l2"><a class="reference internal" href="pylorax.api.html#id1"><tt class="docutils literal"><span class="pre">api</span></tt> Package</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="pylorax.api.html#module-pylorax.api.checkparams"><tt class="docutils literal"><span class="pre">checkparams</span></tt> Module</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="pylorax.api.html#module-pylorax.api.compose"><tt class="docutils literal"><span class="pre">compose</span></tt> Module</a><ul>
|
||||
<li class="toctree-l3"><a class="reference internal" href="pylorax.api.html#adding-new-output-types">Adding New Output Types</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="pylorax.api.html#module-pylorax.api.config"><tt class="docutils literal"><span class="pre">config</span></tt> Module</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="pylorax.api.html#module-pylorax.api.crossdomain"><tt class="docutils literal"><span class="pre">crossdomain</span></tt> Module</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="pylorax.api.html#module-pylorax.api.errors"><tt class="docutils literal"><span class="pre">errors</span></tt> Module</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="pylorax.api.html#module-pylorax.api.projects"><tt class="docutils literal"><span class="pre">projects</span></tt> Module</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="pylorax.api.html#module-pylorax.api.queue"><tt class="docutils literal"><span class="pre">queue</span></tt> Module</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="pylorax.api.html#module-pylorax.api.recipes"><tt class="docutils literal"><span class="pre">recipes</span></tt> Module</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="pylorax.api.html#module-pylorax.api.regexes"><tt class="docutils literal"><span class="pre">regexes</span></tt> Module</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="pylorax.api.html#module-pylorax.api.server"><tt class="docutils literal"><span class="pre">server</span></tt> Module</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="pylorax.api.html#module-pylorax.api.timestamp"><tt class="docutils literal"><span class="pre">timestamp</span></tt> Module</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="pylorax.api.html#module-pylorax.api.v0"><tt class="docutils literal"><span class="pre">v0</span></tt> 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>
|
||||
@ -1507,7 +1511,7 @@ image is built with the filename “${prefix}-${kernel.version}.img”</
|
||||
<li class="toctree-l4"><a class="reference internal" href="pylorax.api.html#api-v0-compose-queue"><cite>/api/v0/compose/queue</cite></a></li>
|
||||
<li class="toctree-l4"><a class="reference internal" href="pylorax.api.html#api-v0-compose-finished"><cite>/api/v0/compose/finished</cite></a></li>
|
||||
<li class="toctree-l4"><a class="reference internal" href="pylorax.api.html#api-v0-compose-failed"><cite>/api/v0/compose/failed</cite></a></li>
|
||||
<li class="toctree-l4"><a class="reference internal" href="pylorax.api.html#api-v0-compose-status-uuids"><cite>/api/v0/compose/status/<uuids></cite></a></li>
|
||||
<li class="toctree-l4"><a class="reference internal" href="pylorax.api.html#api-v0-compose-status-uuids-blueprint-blueprint-name-status-compose-status-type-compose-type"><cite>/api/v0/compose/status/<uuids>[?blueprint=<blueprint_name>&status=<compose_status>&type=<compose_type>]</cite></a></li>
|
||||
<li class="toctree-l4"><a class="reference internal" href="pylorax.api.html#delete-api-v0-blueprints-cancel-uuid">DELETE <cite>/api/v0/blueprints/cancel/<uuid></cite></a></li>
|
||||
<li class="toctree-l4"><a class="reference internal" href="pylorax.api.html#delete-api-v0-compose-delete-uuids">DELETE <cite>/api/v0/compose/delete/<uuids></cite></a></li>
|
||||
<li class="toctree-l4"><a class="reference internal" href="pylorax.api.html#api-v0-compose-info-uuid"><cite>/api/v0/compose/info/<uuid></cite></a></li>
|
||||
@ -1604,7 +1608,7 @@ image is built with the filename “${prefix}-${kernel.version}.img”</
|
||||
<li class="right" >
|
||||
<a href="composer.cli.html" title="cli Package"
|
||||
>previous</a> |</li>
|
||||
<li><a href="index.html">Lorax 19.7.18 documentation</a> »</li>
|
||||
<li><a href="index.html">Lorax 19.7.21 documentation</a> »</li>
|
||||
<li><a href="modules.html" >src</a> »</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
@ -8,7 +8,7 @@
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
|
||||
<title>Search — Lorax 19.7.18 documentation</title>
|
||||
<title>Search — Lorax 19.7.21 documentation</title>
|
||||
|
||||
<link rel="stylesheet" href="_static/default.css" type="text/css" />
|
||||
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
|
||||
@ -16,7 +16,7 @@
|
||||
<script type="text/javascript">
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT: '',
|
||||
VERSION: '19.7.18',
|
||||
VERSION: '19.7.21',
|
||||
COLLAPSE_INDEX: false,
|
||||
FILE_SUFFIX: '.html',
|
||||
HAS_SOURCE: true
|
||||
@ -26,7 +26,7 @@
|
||||
<script type="text/javascript" src="_static/underscore.js"></script>
|
||||
<script type="text/javascript" src="_static/doctools.js"></script>
|
||||
<script type="text/javascript" src="_static/searchtools.js"></script>
|
||||
<link rel="top" title="Lorax 19.7.18 documentation" href="index.html" />
|
||||
<link rel="top" title="Lorax 19.7.21 documentation" href="index.html" />
|
||||
<script type="text/javascript">
|
||||
jQuery(function() { Search.loadIndex("searchindex.js"); });
|
||||
</script>
|
||||
@ -43,7 +43,7 @@
|
||||
<li class="right" >
|
||||
<a href="py-modindex.html" title="Python Module Index"
|
||||
>modules</a> |</li>
|
||||
<li><a href="index.html">Lorax 19.7.18 documentation</a> »</li>
|
||||
<li><a href="index.html">Lorax 19.7.21 documentation</a> »</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
@ -94,7 +94,7 @@
|
||||
<li class="right" >
|
||||
<a href="py-modindex.html" title="Python Module Index"
|
||||
>modules</a> |</li>
|
||||
<li><a href="index.html">Lorax 19.7.18 documentation</a> »</li>
|
||||
<li><a href="index.html">Lorax 19.7.21 documentation</a> »</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="footer">
|
||||
|
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue
Block a user