On Fri, Mar 22, 2013 at 7:05 AM, Robert Jacobson <span dir="ltr">&lt;<a href="mailto:Robert.C.Jacobson@nasa.gov" target="_blank">Robert.C.Jacobson@nasa.gov</a>&gt;</span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

  
    
  
  <div bgcolor="#FFFFFF" text="#000000">
    <div>On 3/22/2013 7:30 AM, Harry Hoffman
      wrote:<br>
    </div>
    <blockquote type="cite">
      <pre>Have you run &quot;cobbler validateks&quot; on the kickstart file that includes
the snippet?</pre>
    </blockquote>
    <br>
    Thanks, I didn&#39;t know about this -- However, for my particular
    example of a broken snippet, it doesn&#39;t help.  It just stops working
    with a non-helpful error message when it gets to the kickstart with
    the problem:<br>
    <br>
    <blockquote>Exception occured: &lt;type &#39;exceptions.NameError&#39;&gt;<br>
      [etc]<br>
    </blockquote>
    <br>
    <blockquote type="cite">
      <pre>Also, there&#39;s the ErrorCatcher class in cheetah (albeit not built into
cobbler) that can help with this.
</pre>
    </blockquote>
    <br>
    Thanks again!   This will probably help for some things.  Still, it
    doesn&#39;t appear to help with my example broken snippet.  At least,
    not when I did this:<br>
        #errorCatcher Echo<br>
        #if $break_me == 1<br>
        #  no #end if...<br>
    <br>
    I did notice that if  you have an undefined variable, it changes the
    behavior completely.  Without errorCatcher, the kickstart would just
    have:<br>
        $SNIPPET(&#39;snippet_with_error&#39;)<br>
    but with errorCatcher, the kickstart is printed with the undefined
    variable in it.  Maybe this isn&#39;t a good thing, because there&#39;s no
    error message anywhere I can find.  i.e. all the errorCatcher does
    in this case is make the error silent!  At least when &quot;$SNIPPET&quot; is
    present I know there&#39;s an error in it :)</div></blockquote><div><br></div><div>Cobbler injects the error catching class silently before parsing, so that&#39;s why that won&#39;t work. You could modify templar.py if you wanted, here&#39;s the patch that I added for 2.4.0:</div>
<div><br></div><div><a href="https://github.com/cobbler/cobbler/commit/60d5f0131ea2ec0fe8e109f1dab4ac8419ddb502">https://github.com/cobbler/cobbler/commit/60d5f0131ea2ec0fe8e109f1dab4ac8419ddb502</a></div><div><br></div></div>