186 lines
8.3 KiB
HTML
186 lines
8.3 KiB
HTML
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
<html lang='en' xml:lang='en' xmlns='http://www.w3.org/1999/xhtml'>
|
|
<head>
|
|
<title>lib/astute/rpuppet.rb</title>
|
|
<link href="./assets/0.2.3/screen.css" media="all" rel="stylesheet" type="text/css" />
|
|
<link href="./assets/0.2.3/print.css" media="print" rel="stylesheet" type="text/css" />
|
|
<meta http-equiv="Content-type" content="text/html;charset=UTF-8" />
|
|
<script type="text/javascript" src="./assets/0.2.3/rcov.js"></script>
|
|
</head>
|
|
<body>
|
|
<h1>Astute C0 Coverage Information - Simploco - RCov</h1>
|
|
<h2>lib/astute/rpuppet.rb</h2>
|
|
|
|
<div class="report_table_wrapper">
|
|
<table class='report' id='report_table'>
|
|
<thead>
|
|
<tr>
|
|
<th class="left_align">Name</th>
|
|
<th class="right_align">Total Lines</th>
|
|
<th class="right_align">Lines of Code</th>
|
|
<th class="left_align">Total Coverage</th>
|
|
<th class="left_align">Code Coverage</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td class="left_align"><a href="lib-astute-rpuppet_rb.html">lib/astute/rpuppet.rb</a></td>
|
|
<td class='right_align'><tt>42</tt></td>
|
|
<td class='right_align'><tt>17</tt></td>
|
|
<td class="left_align"><div class="percent_graph_legend"><tt class=''>71.43%</tt></div>
|
|
<div class="percent_graph">
|
|
<div class="covered" style="width:71px"></div>
|
|
<div class="uncovered" style="width:29px"></div>
|
|
</div></td>
|
|
<td class="left_align"><div class="percent_graph_legend"><tt class=''>29.41%</tt></div>
|
|
<div class="percent_graph">
|
|
<div class="covered" style="width:29px"></div>
|
|
<div class="uncovered" style="width:71px"></div>
|
|
</div></td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
|
|
<h3>Key</h3>
|
|
|
|
<div class="key"><pre><span class='marked'>Code reported as executed by Ruby looks like this...</span><span class='marked1'>and this: this line is also marked as covered.</span><span class='inferred'>Lines considered as run by rcov, but not reported by Ruby, look like this,</span><span class='inferred1'>and this: these lines were inferred by rcov (using simple heuristics).</span><span class='uncovered'>Finally, here's a line marked as not executed.</span></pre></div>
|
|
|
|
<h3>Coverage Details</h3>
|
|
|
|
<table class="details">
|
|
<tbody>
|
|
<tr class="inferred">
|
|
<td><pre><a name="line2">2</a> # Copyright 2013 Mirantis, Inc.</pre></td>
|
|
</tr>
|
|
<tr class="inferred">
|
|
<td><pre><a name="line3">3</a> #</pre></td>
|
|
</tr>
|
|
<tr class="inferred">
|
|
<td><pre><a name="line4">4</a> # Licensed under the Apache License, Version 2.0 (the "License"); you may</pre></td>
|
|
</tr>
|
|
<tr class="inferred">
|
|
<td><pre><a name="line5">5</a> # not use this file except in compliance with the License. You may obtain</pre></td>
|
|
</tr>
|
|
<tr class="inferred">
|
|
<td><pre><a name="line6">6</a> # a copy of the License at</pre></td>
|
|
</tr>
|
|
<tr class="inferred">
|
|
<td><pre><a name="line7">7</a> #</pre></td>
|
|
</tr>
|
|
<tr class="inferred">
|
|
<td><pre><a name="line8">8</a> # http://www.apache.org/licenses/LICENSE-2.0</pre></td>
|
|
</tr>
|
|
<tr class="inferred">
|
|
<td><pre><a name="line9">9</a> #</pre></td>
|
|
</tr>
|
|
<tr class="inferred">
|
|
<td><pre><a name="line10">10</a> # Unless required by applicable law or agreed to in writing, software</pre></td>
|
|
</tr>
|
|
<tr class="inferred">
|
|
<td><pre><a name="line11">11</a> # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT</pre></td>
|
|
</tr>
|
|
<tr class="inferred">
|
|
<td><pre><a name="line12">12</a> # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the</pre></td>
|
|
</tr>
|
|
<tr class="inferred">
|
|
<td><pre><a name="line13">13</a> # License for the specific language governing permissions and limitations</pre></td>
|
|
</tr>
|
|
<tr class="inferred">
|
|
<td><pre><a name="line14">14</a> # under the License.</pre></td>
|
|
</tr>
|
|
<tr class="inferred">
|
|
<td><pre><a name="line15">15</a> </pre></td>
|
|
</tr>
|
|
<tr class="inferred">
|
|
<td><pre><a name="line16">16</a> </pre></td>
|
|
</tr>
|
|
<tr class="marked">
|
|
<td><pre><a name="line17">17</a> require 'json'</pre></td>
|
|
</tr>
|
|
<tr class="marked">
|
|
<td><pre><a name="line18">18</a> require 'timeout'</pre></td>
|
|
</tr>
|
|
<tr class="inferred">
|
|
<td><pre><a name="line19">19</a> </pre></td>
|
|
</tr>
|
|
<tr class="marked">
|
|
<td><pre><a name="line20">20</a> module Astute</pre></td>
|
|
</tr>
|
|
<tr class="marked">
|
|
<td><pre><a name="line21">21</a> module RpuppetDeployer</pre></td>
|
|
</tr>
|
|
<tr class="marked">
|
|
<td><pre><a name="line22">22</a> def self.rpuppet_deploy(ctx, nodes, parameters, classes, env="production")</pre></td>
|
|
</tr>
|
|
<tr class="uncovered">
|
|
<td><pre><a name="line23">23</a> if nodes.empty?</pre></td>
|
|
</tr>
|
|
<tr class="uncovered">
|
|
<td><pre><a name="line24">24</a> Astute.logger.info "#{ctx.task_id}: Nodes to deploy are not provided. Do nothing."</pre></td>
|
|
</tr>
|
|
<tr class="uncovered">
|
|
<td><pre><a name="line25">25</a> return false</pre></td>
|
|
</tr>
|
|
<tr class="inferred">
|
|
<td><pre><a name="line26">26</a> end</pre></td>
|
|
</tr>
|
|
<tr class="uncovered">
|
|
<td><pre><a name="line27">27</a> uids = nodes.map {|n| n['uid']}</pre></td>
|
|
</tr>
|
|
<tr class="uncovered">
|
|
<td><pre><a name="line28">28</a> data = {</pre></td>
|
|
</tr>
|
|
<tr class="inferred">
|
|
<td><pre><a name="line29">29</a> "parameters" => parameters,</pre></td>
|
|
</tr>
|
|
<tr class="inferred">
|
|
<td><pre><a name="line30">30</a> "classes" => classes,</pre></td>
|
|
</tr>
|
|
<tr class="inferred">
|
|
<td><pre><a name="line31">31</a> "environment" => env</pre></td>
|
|
</tr>
|
|
<tr class="inferred">
|
|
<td><pre><a name="line32">32</a> }</pre></td>
|
|
</tr>
|
|
<tr class="uncovered">
|
|
<td><pre><a name="line33">33</a> Astute.logger.debug "Waiting for puppet to finish deployment on all nodes (timeout = #{Astute.config.PUPPET_TIMEOUT} sec)..."</pre></td>
|
|
</tr>
|
|
<tr class="uncovered">
|
|
<td><pre><a name="line34">34</a> time_before = Time.now</pre></td>
|
|
</tr>
|
|
<tr class="uncovered">
|
|
<td><pre><a name="line35">35</a> Timeout::timeout(Astute.config.PUPPET_TIMEOUT) do</pre></td>
|
|
</tr>
|
|
<tr class="uncovered">
|
|
<td><pre><a name="line36">36</a> rpuppet = MClient.new(ctx, "rpuppet", uids)</pre></td>
|
|
</tr>
|
|
<tr class="uncovered">
|
|
<td><pre><a name="line37">37</a> rpuppet.run(:data => data.to_json)</pre></td>
|
|
</tr>
|
|
<tr class="inferred">
|
|
<td><pre><a name="line38">38</a> end</pre></td>
|
|
</tr>
|
|
<tr class="uncovered">
|
|
<td><pre><a name="line39">39</a> time_spent = Time.now - time_before</pre></td>
|
|
</tr>
|
|
<tr class="uncovered">
|
|
<td><pre><a name="line40">40</a> Astute.logger.info "#{ctx.task_id}: Spent #{time_spent} seconds on puppet run for following nodes(uids): #{nodes.map {|n| n['uid']}.join(',')}"</pre></td>
|
|
</tr>
|
|
<tr class="inferred">
|
|
<td><pre><a name="line41">41</a> end</pre></td>
|
|
</tr>
|
|
<tr class="inferred">
|
|
<td><pre><a name="line42">42</a> end</pre></td>
|
|
</tr>
|
|
<tr class="inferred">
|
|
<td><pre><a name="line43">43</a> end</pre></td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
|
|
<p>Generated on 2013-07-19 12:05:31 +0400 with <a href="https://github.com/fguillen/simplecov-rcov">SimpleCov-RCov 0.2.3</a></p>
|
|
|
|
</body>
|
|
</html>
|