Added some log_error stuff....<br><br>Also added reslist.append(c.get_results()) to the c.run() try/except. This should grab the results for passing to the server properly if exception is raised.<br><br>Added the state of initialized to the client_info dict, so we can see status of that on web interface also.<br>
<br>Then just an extra thought to throw out there....<br><br>Do we want to provide a higher level of feedback somehow on the web side? Do we want to store the log data for reporting if they choose to use -v or --debug? To a file to upload?<br>
<br>Max<br><br><div class="gmail_quote">On Thu, Apr 22, 2010 at 4:06 PM, C. Titus Brown <span dir="ltr"><<a href="mailto:ctb@msu.edu">ctb@msu.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div class="im">On Thu, Apr 22, 2010 at 03:49:07PM -0400, Max Laite wrote:<br>
> env<br>
><br>
> Tests:<br>
> <a href="http://github.com/mlaite/pony-build/commit/3b3e53d15f0f8a83b927310507c8fb3095d813e9" target="_blank">http://github.com/mlaite/pony-build/commit/3b3e53d15f0f8a83b927310507c8fb3095d813e9</a><br>
><br>
> pony_client:<br>
> <a href="http://github.com/mlaite/pony-build/commit/150e3e1acab9cc78d13e85d181e3c705520b16a4" target="_blank">http://github.com/mlaite/pony-build/commit/150e3e1acab9cc78d13e85d181e3c705520b16a4</a><br>
<br>
</div>Hey Max,<br>
<br>
a couple of comments :)<br>
<br>
--<br>
<br>
'init_status' is not very clear as a flag name goes. Maybe 'initialized'?<br>
<br>
--<br>
<br>
How about creating a new context object of type 'Context' if context is None<br>
in the 'do' function? 'Context' does a bunch of useful stuff, and it would<br>
simplify all of your 'if' statements down to one 'if' at the beginning:<br>
<br>
if context is None:<br>
context = Context()<br>
<br>
--<br>
<br>
try/except with blanket 'except' and no reporting, e.g.<br>
<br>
try:<br>
# foo bar baz<br>
except:<br>
# cleanup with no reporting<br>
<br>
is a Bad Idea. I see a few problems with your code:<br>
<br>
- 'success' may still be set to True even if a c.run() call raises an<br>
exception.<br>
<br>
- there's no logging whatsoever; at the very least every 'except' branch<br>
should have some sort of log_error call. Right now the excepts will<br>
catch everything, including genuine programming errors, silently!<br>
<br>
--<br>
<br>
Hmm, that's enough for now...<br>
<br>
thanks,<br>
<font color="#888888">--titus<br>
</font></blockquote></div><br>