<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="http://reviewboard-openlmi.rhcloud.com/r/300/">http://reviewboard-openlmi.rhcloud.com/r/300/</a>
     </td>
    </tr>
   </table>
   <br />











<div>




<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="http://reviewboard-openlmi.rhcloud.com/r/300/diff/2/?file=1931#file1931line100" style="color: black; font-weight: bold; text-decoration: underline;">src/software/openlmi/software/core/InstMethodCall.py</a>
    <span style="font-weight: normal;">

     (Diff revision 2)

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



 
 

 <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">100</font></th>
    <td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">    <span class="k">if</span> <span class="ow">not</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">job</span><span class="p">,</span> <span class="n">jobs</span><span class="o">.</span><span class="n">YumJob</span><span class="p">):</span></pre></td>
  </tr>

  <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">101</font></th>
    <td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">        <span class="k">raise</span> <span class="ne">TypeError</span><span class="p">(</span><span class="s">&quot;job must be a YumJob&quot;</span><span class="p">)</span></pre></td>
  </tr>

  <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">102</font></th>
    <td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">    <span class="k">if</span> <span class="ow">not</span> <span class="n">pre</span> <span class="ow">and</span> <span class="n">job</span><span class="o">.</span><span class="n">state</span> <span class="o">==</span> <span class="n">job</span><span class="o">.</span><span class="n">NEW</span> <span class="ow">or</span> <span class="n">job</span><span class="o">.</span><span class="n">state</span> <span class="o">==</span> <span class="n">job</span><span class="o">.</span><span class="n">RUNNING</span><span class="p">:</span></pre></td>
  </tr>

  <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">103</font></th>
    <td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">        <span class="k">raise</span> <span class="ne">ValueError</span><span class="p">(</span><span class="s">&quot;job must be finished to make a post indication&quot;</span></pre></td>
  </tr>

  <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">104</font></th>
    <td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">            <span class="s">&quot; instance&quot;</span><span class="p">)</span></pre></td>
  </tr>

 </tbody>

</table>

<pre style="margin-left: 2em; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">Raising TypeError and ValueError is nice and clean, still, what the caller does with these exceptions? IMHO they are translated to CIMError anyway.

And what &quot;job must be a YumJob&quot; tells the user? IMHO these check could be simple assert().

Feel free to keep the code like it is, it is correct and nice, I&#39;m just wondering.</pre>
</div>
<br />



<p>- Jan</p>


<br />
<p>On May 2nd, 2013, 3:02 p.m. CEST, Michal Minar wrote:</p>








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

<div>Review request for OpenLMI Developers.</div>
<div>By Michal Minar.</div>


<p style="color: grey;"><i>Updated May 2, 2013, 3:02 p.m.</i></p>









<div style="margin-top: 1.5em;">
 <b style="color: #575012; font-size: 10pt;">Repository: </b>
openlmi-providers
</div>


<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;">support for method parameters and pre/post indications

Added input and output parameters to LMI_SoftwareInstallationJob.
Added PreCallIndication and PostCallIndication properties to
LMI_SoftwareMethodResult containg CIM_InstMethodCall indication
instances - that are rather useless but mandatory by Job Control
Profile.
</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>src/software/openlmi/software/yumdb/jobs.py <span style="color: grey">(84fd3ed5f7333d74528fe1b4757844c070906aa8)</span></li>

 <li>src/software/openlmi/software/yumdb/__init__.py <span style="color: grey">(04f21918cdce7aae0e7c474992b53a472bf09ec0)</span></li>

 <li>src/software/openlmi/software/core/MethodResult.py <span style="color: grey">(723edbba967205f1e5231981fa22559adfcb9c03)</span></li>

 <li>src/software/openlmi/software/core/InstallationService.py <span style="color: grey">(acc7ca60392f17ba930c74a8b7f07d064ab3b1da)</span></li>

 <li>src/software/openlmi/software/core/InstallationJob.py <span style="color: grey">(7b06be2acbab2df92125290759b6552063171f3f)</span></li>

 <li>src/software/openlmi/software/core/InstMethodCall.py <span style="color: grey">(PRE-CREATION)</span></li>

 <li>src/software/openlmi/software/core/Error.py <span style="color: grey">(210c00ef912aca7453437b3eb93f68449684c273)</span></li>

 <li>src/software/openlmi/software/LMI_SoftwareInstallationService.py <span style="color: grey">(f1e0ea71ec1d132c91ad49d86b3dcf9d5d4be139)</span></li>

</ul>

<p><a href="http://reviewboard-openlmi.rhcloud.com/r/300/diff/" style="margin-left: 3em;">View Diff</a></p>







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








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