Skip to content

Commit

Permalink
Update dev docs
Browse files Browse the repository at this point in the history
  • Loading branch information
shyuep committed Dec 2, 2021
1 parent 83ef27e commit 1413c02
Show file tree
Hide file tree
Showing 38 changed files with 2,773 additions and 467 deletions.
2 changes: 1 addition & 1 deletion custodian/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
"""

__author__ = "Shyue Ping Ong, William Davidson Richards, Stephen Dacek, Xiaohui Qu, Matthew Horton, Samuel M. Blau"
__version__ = "2021.2.8"
__version__ = "2021.12.2"

from .custodian import Custodian
26 changes: 12 additions & 14 deletions docs/_modules/custodian/ansible/actions.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>custodian.ansible.actions &#8212; custodian 2021.2.8 documentation</title>
<link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" />
<link rel="stylesheet" href="../../../_static/flasky.css" type="text/css" />
<script id="documentation_options" data-url_root="../../../" src="../../../_static/documentation_options.js"></script>
<title>custodian.ansible.actions &#8212; custodian 2021.12.2 documentation</title>
<link rel="stylesheet" type="text/css" href="../../../_static/pygments.css" />
<link rel="stylesheet" type="text/css" href="../../../_static/flasky.css" />
<script data-url_root="../../../" id="documentation_options" src="../../../_static/documentation_options.js"></script>
<script src="../../../_static/jquery.js"></script>
<script src="../../../_static/underscore.js"></script>
<script src="../../../_static/doctools.js"></script>
Expand Down Expand Up @@ -36,7 +36,7 @@ <h3>Navigation</h3>
<li class="right" >
<a href="../../../py-modindex.html" title="Python Module Index"
>modules</a> |</li>
<li class="nav-item nav-item-0"><a href="../../../index.html">custodian 2021.2.8 documentation</a> &#187;</li>
<li class="nav-item nav-item-0"><a href="../../../index.html">custodian 2021.12.2 documentation</a> &#187;</li>
<li class="nav-item nav-item-1"><a href="../../index.html" accesskey="U">Module code</a> &#187;</li>
<li class="nav-item nav-item-this"><a href="">custodian.ansible.actions</a></li>
</ul>
Expand All @@ -48,9 +48,7 @@ <h3>Navigation</h3>
<div class="body" role="main">

<h1>Source code for custodian.ansible.actions</h1><div class="highlight"><pre>
<span></span><span class="c1"># coding: utf-8</span>

<span class="sd">&quot;&quot;&quot;</span>
<span></span><span class="sd">&quot;&quot;&quot;</span>
<span class="sd">This module defines various classes of supported actions. All actions are</span>
<span class="sd">implemented as static methods, but are defined using classes (as opposed to</span>
<span class="sd">modules) so that a set of well-defined actions can be namespaced easily.</span>
Expand Down Expand Up @@ -199,7 +197,7 @@ <h1>Source code for custodian.ansible.actions</h1><div class="highlight"><pre>
<span class="k">for</span> <span class="n">k</span><span class="p">,</span> <span class="n">v</span> <span class="ow">in</span> <span class="n">settings</span><span class="o">.</span><span class="n">items</span><span class="p">():</span>
<span class="p">(</span><span class="n">d</span><span class="p">,</span> <span class="n">key</span><span class="p">)</span> <span class="o">=</span> <span class="n">get_nested_dict</span><span class="p">(</span><span class="n">input_dict</span><span class="p">,</span> <span class="n">k</span><span class="p">)</span>
<span class="k">if</span> <span class="n">key</span> <span class="ow">in</span> <span class="n">d</span> <span class="ow">and</span> <span class="p">(</span><span class="ow">not</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">d</span><span class="p">[</span><span class="n">key</span><span class="p">],</span> <span class="nb">list</span><span class="p">)):</span>
<span class="k">raise</span> <span class="ne">ValueError</span><span class="p">(</span><span class="s2">&quot;Keyword </span><span class="si">{}</span><span class="s2"> does not refer to an array.&quot;</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="n">k</span><span class="p">))</span>
<span class="k">raise</span> <span class="ne">ValueError</span><span class="p">(</span><span class="sa">f</span><span class="s2">&quot;Keyword </span><span class="si">{</span><span class="n">k</span><span class="si">}</span><span class="s2"> does not refer to an array.&quot;</span><span class="p">)</span>
<span class="k">if</span> <span class="n">key</span> <span class="ow">in</span> <span class="n">d</span> <span class="ow">and</span> <span class="n">v</span> <span class="ow">not</span> <span class="ow">in</span> <span class="n">d</span><span class="p">[</span><span class="n">key</span><span class="p">]:</span>
<span class="n">d</span><span class="p">[</span><span class="n">key</span><span class="p">]</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">v</span><span class="p">)</span>
<span class="k">elif</span> <span class="n">key</span> <span class="ow">not</span> <span class="ow">in</span> <span class="n">d</span><span class="p">:</span>
Expand All @@ -217,7 +215,7 @@ <h1>Source code for custodian.ansible.actions</h1><div class="highlight"><pre>
<span class="k">for</span> <span class="n">k</span><span class="p">,</span> <span class="n">v</span> <span class="ow">in</span> <span class="n">settings</span><span class="o">.</span><span class="n">items</span><span class="p">():</span>
<span class="p">(</span><span class="n">d</span><span class="p">,</span> <span class="n">key</span><span class="p">)</span> <span class="o">=</span> <span class="n">get_nested_dict</span><span class="p">(</span><span class="n">input_dict</span><span class="p">,</span> <span class="n">k</span><span class="p">)</span>
<span class="k">if</span> <span class="n">key</span> <span class="ow">in</span> <span class="n">d</span> <span class="ow">and</span> <span class="p">(</span><span class="ow">not</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">d</span><span class="p">[</span><span class="n">key</span><span class="p">],</span> <span class="nb">list</span><span class="p">)):</span>
<span class="k">raise</span> <span class="ne">ValueError</span><span class="p">(</span><span class="s2">&quot;Keyword </span><span class="si">{}</span><span class="s2"> does not refer to an array.&quot;</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="n">k</span><span class="p">))</span>
<span class="k">raise</span> <span class="ne">ValueError</span><span class="p">(</span><span class="sa">f</span><span class="s2">&quot;Keyword </span><span class="si">{</span><span class="n">k</span><span class="si">}</span><span class="s2"> does not refer to an array.&quot;</span><span class="p">)</span>
<span class="k">if</span> <span class="n">key</span> <span class="ow">in</span> <span class="n">d</span><span class="p">:</span>
<span class="n">d</span><span class="p">[</span><span class="n">key</span><span class="p">]</span> <span class="o">=</span> <span class="p">[</span><span class="n">i</span> <span class="k">for</span> <span class="n">i</span> <span class="ow">in</span> <span class="n">d</span><span class="p">[</span><span class="n">key</span><span class="p">]</span> <span class="k">if</span> <span class="n">i</span> <span class="o">!=</span> <span class="n">v</span><span class="p">]</span></div>

Expand All @@ -232,7 +230,7 @@ <h1>Source code for custodian.ansible.actions</h1><div class="highlight"><pre>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="k">for</span> <span class="n">k</span><span class="p">,</span> <span class="n">v</span> <span class="ow">in</span> <span class="n">settings</span><span class="o">.</span><span class="n">items</span><span class="p">():</span>
<span class="k">if</span> <span class="n">k</span> <span class="ow">in</span> <span class="n">input_dict</span> <span class="ow">and</span> <span class="p">(</span><span class="ow">not</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">input_dict</span><span class="p">[</span><span class="n">k</span><span class="p">],</span> <span class="nb">list</span><span class="p">)):</span>
<span class="k">raise</span> <span class="ne">ValueError</span><span class="p">(</span><span class="s2">&quot;Keyword </span><span class="si">{}</span><span class="s2"> does not refer to an array.&quot;</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="n">k</span><span class="p">))</span>
<span class="k">raise</span> <span class="ne">ValueError</span><span class="p">(</span><span class="sa">f</span><span class="s2">&quot;Keyword </span><span class="si">{</span><span class="n">k</span><span class="si">}</span><span class="s2"> does not refer to an array.&quot;</span><span class="p">)</span>
<span class="k">for</span> <span class="n">i</span> <span class="ow">in</span> <span class="n">v</span><span class="p">:</span>
<span class="n">DictActions</span><span class="o">.</span><span class="n">pull</span><span class="p">(</span><span class="n">input_dict</span><span class="p">,</span> <span class="p">{</span><span class="n">k</span><span class="p">:</span> <span class="n">i</span><span class="p">})</span></div>

Expand All @@ -248,7 +246,7 @@ <h1>Source code for custodian.ansible.actions</h1><div class="highlight"><pre>
<span class="k">for</span> <span class="n">k</span><span class="p">,</span> <span class="n">v</span> <span class="ow">in</span> <span class="n">settings</span><span class="o">.</span><span class="n">items</span><span class="p">():</span>
<span class="p">(</span><span class="n">d</span><span class="p">,</span> <span class="n">key</span><span class="p">)</span> <span class="o">=</span> <span class="n">get_nested_dict</span><span class="p">(</span><span class="n">input_dict</span><span class="p">,</span> <span class="n">k</span><span class="p">)</span>
<span class="k">if</span> <span class="n">key</span> <span class="ow">in</span> <span class="n">d</span> <span class="ow">and</span> <span class="p">(</span><span class="ow">not</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">d</span><span class="p">[</span><span class="n">key</span><span class="p">],</span> <span class="nb">list</span><span class="p">)):</span>
<span class="k">raise</span> <span class="ne">ValueError</span><span class="p">(</span><span class="s2">&quot;Keyword </span><span class="si">{}</span><span class="s2"> does not refer to an array.&quot;</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="n">k</span><span class="p">))</span>
<span class="k">raise</span> <span class="ne">ValueError</span><span class="p">(</span><span class="sa">f</span><span class="s2">&quot;Keyword </span><span class="si">{</span><span class="n">k</span><span class="si">}</span><span class="s2"> does not refer to an array.&quot;</span><span class="p">)</span>
<span class="k">if</span> <span class="n">v</span> <span class="o">==</span> <span class="mi">1</span><span class="p">:</span>
<span class="n">d</span><span class="p">[</span><span class="n">key</span><span class="p">]</span><span class="o">.</span><span class="n">pop</span><span class="p">()</span>
<span class="k">elif</span> <span class="n">v</span> <span class="o">==</span> <span class="o">-</span><span class="mi">1</span><span class="p">:</span>
Expand Down Expand Up @@ -313,7 +311,7 @@ <h1>Source code for custodian.ansible.actions</h1><div class="highlight"><pre>
<span class="c1"># Skip file not found error.</span>
<span class="k">pass</span>
<span class="k">elif</span> <span class="n">k</span> <span class="o">==</span> <span class="s2">&quot;mode&quot;</span> <span class="ow">and</span> <span class="n">v</span> <span class="o">==</span> <span class="s2">&quot;simulated&quot;</span><span class="p">:</span>
<span class="nb">print</span><span class="p">(</span><span class="s2">&quot;Simulated removal of </span><span class="si">{}</span><span class="s2">&quot;</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="n">filename</span><span class="p">))</span></div>
<span class="nb">print</span><span class="p">(</span><span class="sa">f</span><span class="s2">&quot;Simulated removal of </span><span class="si">{</span><span class="n">filename</span><span class="si">}</span><span class="s2">&quot;</span><span class="p">)</span></div>

<div class="viewcode-block" id="FileActions.file_copy"><a class="viewcode-back" href="../../../custodian.ansible.html#custodian.ansible.actions.FileActions.file_copy">[docs]</a> <span class="nd">@staticmethod</span>
<span class="k">def</span> <span class="nf">file_copy</span><span class="p">(</span><span class="n">filename</span><span class="p">,</span> <span class="n">settings</span><span class="p">):</span>
Expand Down Expand Up @@ -360,7 +358,7 @@ <h1>Source code for custodian.ansible.actions</h1><div class="highlight"><pre>
<h3 id="searchlabel">Quick search</h3>
<div class="searchformwrapper">
<form class="search" action="../../../search.html" method="get">
<input type="text" name="q" aria-labelledby="searchlabel" />
<input type="text" name="q" aria-labelledby="searchlabel" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"/>
<input type="submit" value="Go" />
</form>
</div>
Expand Down
18 changes: 8 additions & 10 deletions docs/_modules/custodian/ansible/interpreter.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>custodian.ansible.interpreter &#8212; custodian 2021.2.8 documentation</title>
<link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" />
<link rel="stylesheet" href="../../../_static/flasky.css" type="text/css" />
<script id="documentation_options" data-url_root="../../../" src="../../../_static/documentation_options.js"></script>
<title>custodian.ansible.interpreter &#8212; custodian 2021.12.2 documentation</title>
<link rel="stylesheet" type="text/css" href="../../../_static/pygments.css" />
<link rel="stylesheet" type="text/css" href="../../../_static/flasky.css" />
<script data-url_root="../../../" id="documentation_options" src="../../../_static/documentation_options.js"></script>
<script src="../../../_static/jquery.js"></script>
<script src="../../../_static/underscore.js"></script>
<script src="../../../_static/doctools.js"></script>
Expand Down Expand Up @@ -36,7 +36,7 @@ <h3>Navigation</h3>
<li class="right" >
<a href="../../../py-modindex.html" title="Python Module Index"
>modules</a> |</li>
<li class="nav-item nav-item-0"><a href="../../../index.html">custodian 2021.2.8 documentation</a> &#187;</li>
<li class="nav-item nav-item-0"><a href="../../../index.html">custodian 2021.12.2 documentation</a> &#187;</li>
<li class="nav-item nav-item-1"><a href="../../index.html" accesskey="U">Module code</a> &#187;</li>
<li class="nav-item nav-item-this"><a href="">custodian.ansible.interpreter</a></li>
</ul>
Expand All @@ -48,9 +48,7 @@ <h3>Navigation</h3>
<div class="body" role="main">

<h1>Source code for custodian.ansible.interpreter</h1><div class="highlight"><pre>
<span></span><span class="c1"># coding: utf-8</span>

<span class="sd">&quot;&quot;&quot;</span>
<span></span><span class="sd">&quot;&quot;&quot;</span>
<span class="sd">This module implements a Modder class that performs modifications on objects</span>
<span class="sd">using support actions.</span>
<span class="sd">&quot;&quot;&quot;</span>
Expand Down Expand Up @@ -120,7 +118,7 @@ <h1>Source code for custodian.ansible.interpreter</h1><div class="highlight"><pr
<span class="k">if</span> <span class="n">action</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">supported_actions</span><span class="p">:</span>
<span class="bp">self</span><span class="o">.</span><span class="n">supported_actions</span><span class="p">[</span><span class="n">action</span><span class="p">]</span><span class="o">.</span><span class="fm">__call__</span><span class="p">(</span><span class="n">obj</span><span class="p">,</span> <span class="n">settings</span><span class="p">)</span>
<span class="k">elif</span> <span class="bp">self</span><span class="o">.</span><span class="n">strict</span><span class="p">:</span>
<span class="k">raise</span> <span class="ne">ValueError</span><span class="p">(</span><span class="s2">&quot;</span><span class="si">{}</span><span class="s2"> is not a supported action!&quot;</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="n">action</span><span class="p">))</span></div>
<span class="k">raise</span> <span class="ne">ValueError</span><span class="p">(</span><span class="sa">f</span><span class="s2">&quot;</span><span class="si">{</span><span class="n">action</span><span class="si">}</span><span class="s2"> is not a supported action!&quot;</span><span class="p">)</span></div>

<div class="viewcode-block" id="Modder.modify_object"><a class="viewcode-back" href="../../../custodian.ansible.html#custodian.ansible.interpreter.Modder.modify_object">[docs]</a> <span class="k">def</span> <span class="nf">modify_object</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">modification</span><span class="p">,</span> <span class="n">obj</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;</span>
Expand Down Expand Up @@ -158,7 +156,7 @@ <h1>Source code for custodian.ansible.interpreter</h1><div class="highlight"><pr
<h3 id="searchlabel">Quick search</h3>
<div class="searchformwrapper">
<form class="search" action="../../../search.html" method="get">
<input type="text" name="q" aria-labelledby="searchlabel" />
<input type="text" name="q" aria-labelledby="searchlabel" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"/>
<input type="submit" value="Go" />
</form>
</div>
Expand Down
Loading

0 comments on commit 1413c02

Please sign in to comment.