[prev in list] [next in list] [prev in thread] [next in thread] 

List:       asterisk-dev
Subject:    Re: [asterisk-dev] [Code Review]: Fix asttest's Asterisk version extraction
From:       "Matt Jordan" <reviewboard () asterisk ! org>
Date:       2012-01-29 3:35:02
Message-ID: 20120129033502.3590.32157 () hotblack ! digium ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


> On Jan. 28, 2012, 9:03 p.m., Russell Bryant wrote:
> > Just some minor suggestions

Thanks for a Saturday night review!


> On Jan. 28, 2012, 9:03 p.m., Russell Bryant wrote:
> > /asterisk/trunk/asttest/lib/lua/astlib.lua, line 44
> > <https://reviewboard.asterisk.org/r/1701/diff/1/?file=23798#file23798line44>
> > 
> > It looks like spaces after the commas here would be more consistent with other \
> > code

Fixed


> On Jan. 28, 2012, 9:03 p.m., Russell Bryant wrote:
> > /asterisk/trunk/lib/python/asterisk/version.py, line 79
> > <https://reviewboard.asterisk.org/r/1701/diff/1/?file=23799#file23799line79>
> > 
> > Walter also mentioned that you could mark this as a @classmethod since it doesn't \
> > use any member variables.

Whoops, missed that.  Thanks


> On Jan. 28, 2012, 9:03 p.m., Russell Bryant wrote:
> > /asterisk/trunk/lib/python/asterisk/version.py, line 83
> > <https://reviewboard.asterisk.org/r/1701/diff/1/?file=23799#file23799line83>
> > 
> > Parens aren't necessary here.

And no they're not.


- Matt


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviewboard.asterisk.org/r/1701/#review5350
-----------------------------------------------------------


On Jan. 28, 2012, 3:26 p.m., Matt Jordan wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviewboard.asterisk.org/r/1701/
> -----------------------------------------------------------
> 
> (Updated Jan. 28, 2012, 3:26 p.m.)
> 
> 
> Review request for Asterisk Developers.
> 
> 
> Summary
> -------
> 
> This patch changes how the lua-based tests determine the Asterisk version.  \
> Previously, like the version.py library, the astlib.lua library was extracting this \
> from the version.h header file.  Now it also spawns an Asterisk process with the \
> '-V' command line switch and reads the version from the output. 
> This should resolve the failing tests in trunk:
> * rfc2833_dtmf_detect
> * manager/action-events-response
> * queues/position_priority_maxlen
> * cdr/blind-transfer-accountcode
> 
> This patch also addresses Russell and Walter's last comments on version.py in \
> https://reviewboard.asterisk.org/r/1695/.  Specifically, it re-raises caught \
> OSError exceptions after logging them, and places the setting of the static \
> variable in a private method. 
> 
> Diffs
> -----
> 
> /asterisk/trunk/asttest/lib/lua/astlib.lua 3021 
> /asterisk/trunk/lib/python/asterisk/version.py 3021 
> 
> Diff: https://reviewboard.asterisk.org/r/1701/diff
> 
> 
> Testing
> -------
> 
> Ran on local development machine; all currently failing trunk tests passed.
> 
> 
> Thanks,
> 
> Matt
> 
> 


[Attachment #5 (text/html)]

<html>
 <body>
  <div style="font-family: Verdana, Arial, Helvetica, Sans-Serif;">
   <table bgcolor="#f9f3c9" width="100%" cellpadding="8" style="border: 1px #c9c399 \
solid;">  <tr>
     <td>
      This is an automatically generated e-mail. To reply, visit:
      <a href="https://reviewboard.asterisk.org/r/1701/">https://reviewboard.asterisk.org/r/1701/</a>
  </td>
    </tr>
   </table>
   <br />





<blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: \
10px;">  <p style="margin-top: 0;">On January 28th, 2012, 9:03 p.m., <b>Russell \
Bryant</b> wrote:</p>  <blockquote style="margin-left: 1em; border-left: 2px solid \
#d0d0d0; padding-left: 10px;">  <pre style="white-space: pre-wrap; white-space: \
-moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: \
break-word;">Just some minor suggestions</pre>  </blockquote>







</blockquote>

<pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: \
-pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">Thanks for a Saturday \
night review!</pre> <br />





<blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: \
10px;">  <p style="margin-top: 0;">On January 28th, 2012, 9:03 p.m., <b>Russell \
Bryant</b> wrote:</p>  <blockquote style="margin-left: 1em; border-left: 2px solid \
#d0d0d0; padding-left: 10px;">  



<table width="100%" border="0" bgcolor="white" style="border: 1px solid #C0C0C0; \
border-collapse: collapse; margin: 2px padding: 2px;">  <thead>
  <tr>
   <th colspan="4" bgcolor="#F0F0F0" style="border-bottom: 1px solid #C0C0C0; \
font-size: 9pt; padding: 4px 8px; text-align: left;">  <a \
href="https://reviewboard.asterisk.org/r/1701/diff/1/?file=23798#file23798line44" \
style="color: black; font-weight: bold; text-decoration: \
underline;">/asterisk/trunk/asttest/lib/lua/astlib.lua</a>  <span style="font-weight: \
normal;">

     (Diff revision 1)

    </span>
   </th>
  </tr>
 </thead>

 <tbody style="background-color: #e4d9cb; padding: 4px 8px; text-align: center;">
  <tr>

   <td colspan="4"><pre style="font-size: 8pt; line-height: 140%; margin: 0; \
"></pre></td>

  </tr>
 </tbody>



 
 




 <tbody>

  <tr>
    <th bgcolor="#e9eaa8" style="border-right: 1px solid #C0C0C0;" \
align="right"><font size="2">44</font></th>  <td bgcolor="#fdfebc" width="50%"><pre \
style="font-size: 8pt; line-height: 140%; margin: 0; ">		<span \
class="n">f</span><span class="p">:</span><span class="n">close</span><span \
class="p">()</span></pre></td>  <th bgcolor="#e9eaa8" style="border-left: 1px solid \
#C0C0C0; border-right: 1px solid #C0C0C0;" align="right"><font \
size="2">38</font></th>  <td bgcolor="#fdfebc" width="50%"><pre style="font-size: \
8pt; line-height: 140%; margin: 0; ">		<span class="n">version</span> <span \
class="o">=</span> <span class="nb">string.gsub</span><span class="p">(</span><span \
class="n">version</span><span class="p">,</span><span class="s2">&quot;</span><span \
class="s">Asterisk &quot;</span><span class="p">,</span><span \
class="s2">&quot;</span><span class="s">&quot;</span><span \
class="p">)</span></pre></td>  </tr>

 </tbody>

</table>

  <pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: \
-pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">It looks like spaces \
after the commas here would be more consistent with other code</pre>  </blockquote>





</blockquote>
<pre style="margin-left: 1em; white-space: pre-wrap; white-space: -moz-pre-wrap; \
white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">Fixed</pre> \
<br />

<blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: \
10px;">  <p style="margin-top: 0;">On January 28th, 2012, 9:03 p.m., <b>Russell \
Bryant</b> wrote:</p>  <blockquote style="margin-left: 1em; border-left: 2px solid \
#d0d0d0; padding-left: 10px;">  



<table width="100%" border="0" bgcolor="white" style="border: 1px solid #C0C0C0; \
border-collapse: collapse; margin: 2px padding: 2px;">  <thead>
  <tr>
   <th colspan="4" bgcolor="#F0F0F0" style="border-bottom: 1px solid #C0C0C0; \
font-size: 9pt; padding: 4px 8px; text-align: left;">  <a \
href="https://reviewboard.asterisk.org/r/1701/diff/1/?file=23799#file23799line79" \
style="color: black; font-weight: bold; text-decoration: \
underline;">/asterisk/trunk/lib/python/asterisk/version.py</a>  <span \
style="font-weight: normal;">

     (Diff revision 1)

    </span>
   </th>
  </tr>
 </thead>

 <tbody style="background-color: #e4d9cb; padding: 4px 8px; text-align: center;">
  <tr>

   <td colspan="2"><pre style="font-size: 8pt; line-height: 140%; margin: 0; \
"></pre></td>  <td colspan="2"><pre style="font-size: 8pt; line-height: 140%; margin: \
0; ">def __get_asterisk_version_from_binary(self):</pre></td>

  </tr>
 </tbody>




 
 



 <tbody>

  <tr>
    <th bgcolor="#b1ebb0" style="border-right: 1px solid #C0C0C0;" \
align="right"><font size="2"></font></th>  <td bgcolor="#c5ffc4" width="50%"><pre \
style="font-size: 8pt; line-height: 140%; margin: 0; "></pre></td>  <th \
bgcolor="#b1ebb0" style="border-left: 1px solid #C0C0C0; border-right: 1px solid \
#C0C0C0;" align="right"><font size="2">52</font></th>  <td bgcolor="#c5ffc4" \
width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">    <span \
class="k">def</span> <span class="nf">__get_asterisk_version_from_binary</span><span \
class="p">(</span><span class="bp">self</span><span class="p">):</span></pre></td>  \
</tr>

 </tbody>

</table>

  <pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: \
-pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">Walter also mentioned \
that you could mark this as a @classmethod since it doesn&#39;t use any member \
variables.</pre>  </blockquote>





</blockquote>
<pre style="margin-left: 1em; white-space: pre-wrap; white-space: -moz-pre-wrap; \
white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">Whoops, \
missed that.  Thanks</pre> <br />

<blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: \
10px;">  <p style="margin-top: 0;">On January 28th, 2012, 9:03 p.m., <b>Russell \
Bryant</b> wrote:</p>  <blockquote style="margin-left: 1em; border-left: 2px solid \
#d0d0d0; padding-left: 10px;">  



<table width="100%" border="0" bgcolor="white" style="border: 1px solid #C0C0C0; \
border-collapse: collapse; margin: 2px padding: 2px;">  <thead>
  <tr>
   <th colspan="4" bgcolor="#F0F0F0" style="border-bottom: 1px solid #C0C0C0; \
font-size: 9pt; padding: 4px 8px; text-align: left;">  <a \
href="https://reviewboard.asterisk.org/r/1701/diff/1/?file=23799#file23799line83" \
style="color: black; font-weight: bold; text-decoration: \
underline;">/asterisk/trunk/lib/python/asterisk/version.py</a>  <span \
style="font-weight: normal;">

     (Diff revision 1)

    </span>
   </th>
  </tr>
 </thead>

 <tbody style="background-color: #e4d9cb; padding: 4px 8px; text-align: center;">
  <tr>

   <td colspan="2"><pre style="font-size: 8pt; line-height: 140%; margin: 0; \
"></pre></td>  <td colspan="2"><pre style="font-size: 8pt; line-height: 140%; margin: \
0; ">def __get_asterisk_version_from_binary(self):</pre></td>

  </tr>
 </tbody>




 
 



 <tbody>

  <tr>
    <th bgcolor="#b1ebb0" style="border-right: 1px solid #C0C0C0;" \
align="right"><font size="2"></font></th>  <td bgcolor="#c5ffc4" width="50%"><pre \
style="font-size: 8pt; line-height: 140%; margin: 0; "></pre></td>  <th \
bgcolor="#b1ebb0" style="border-left: 1px solid #C0C0C0; border-right: 1px solid \
#C0C0C0;" align="right"><font size="2">56</font></th>  <td bgcolor="#c5ffc4" \
width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">        <span \
class="k">if</span> <span class="p">(</span><span \
class="n">AsteriskVersion</span><span class="o">.</span><span \
class="n">ast_version</span> <span class="o">!=</span> <span \
class="s">&quot;&quot;</span><span class="p">):</span></pre></td>  </tr>

 </tbody>

</table>

  <pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: \
-pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">Parens aren&#39;t \
necessary here.</pre>  </blockquote>





</blockquote>
<pre style="margin-left: 1em; white-space: pre-wrap; white-space: -moz-pre-wrap; \
white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">And no \
they&#39;re not.</pre> <br />




<p>- Matt</p>


<br />
<p>On January 28th, 2012, 3:26 p.m., Matt Jordan wrote:</p>






<table bgcolor="#fefadf" width="100%" cellspacing="0" cellpadding="8" \
style="background-image: \
url('https://reviewboard.asterisk.org/media/rb/images/review_request_box_top_bg.png'); \
background-position: left top; background-repeat: repeat-x; border: 1px black \
solid;">  <tr>
  <td>

<div>Review request for Asterisk Developers.</div>
<div>By Matt Jordan.</div>


<p style="color: grey;"><i>Updated Jan. 28, 2012, 3:26 p.m.</i></p>




<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Description </h1>
<table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: \
1px solid #b8b5a0">  <tr>
  <td>
   <pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: \
-moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: \
break-word;">This patch changes how the lua-based tests determine the Asterisk \
version.  Previously, like the version.py library, the astlib.lua library was \
extracting this from the version.h header file.  Now it also spawns an Asterisk \
process with the &#39;-V&#39; command line switch and reads the version from the \
output.

This should resolve the failing tests in trunk:
* rfc2833_dtmf_detect
* manager/action-events-response
* queues/position_priority_maxlen
* cdr/blind-transfer-accountcode

This patch also addresses Russell and Walter&#39;s last comments on version.py in \
https://reviewboard.asterisk.org/r/1695/.  Specifically, it re-raises caught OSError \
exceptions after logging them, and places the setting of the static variable in a \
private method.</pre>  </td>
 </tr>
</table>


<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Testing </h1>
<table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: \
1px solid #b8b5a0">  <tr>
  <td>
   <pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: \
-moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: \
break-word;">Ran on local development machine; all currently failing trunk tests \
passed.</pre>  </td>
 </tr>
</table>




<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Diffs</b> </h1>
<ul style="margin-left: 3em; padding-left: 0;">

 <li>/asterisk/trunk/asttest/lib/lua/astlib.lua <span style="color: \
grey">(3021)</span></li>

 <li>/asterisk/trunk/lib/python/asterisk/version.py <span style="color: \
grey">(3021)</span></li>

</ul>

<p><a href="https://reviewboard.asterisk.org/r/1701/diff/" style="margin-left: \
3em;">View Diff</a></p>




  </td>
 </tr>
</table>








  </div>
 </body>
</html>



--
_____________________________________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

asterisk-dev mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-dev

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic