<div dir="ltr"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><span style="color:rgb(80,0,80)">On Fri, Jul 29, 2022 at 10:55:46AM +0000, Juraj Linkeš wrote:<br></span><span style="color:rgb(80,0,80)">> The class adds logging and history records to existing pexpect methods.<br></span><span style="color:rgb(80,0,80)">><br></span><span style="color:rgb(80,0,80)">> Signed-off-by: Owen Hilyard <<a href="mailto:ohilyard@iol.unh.edu" target="_blank">ohilyard@iol.unh.edu</a>><br></span><span style="color:rgb(80,0,80)">> Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech><br></span><span style="color:rgb(80,0,80)">> ---<br></span><span style="color:rgb(80,0,80)">>  dts/framework/ssh_connection.py | 70 +++++++++++++++++++++++++++++++++<br></span><span style="color:rgb(80,0,80)">>  1 file changed, 70 insertions(+)<br></span><span style="color:rgb(80,0,80)">>  create mode 100644 dts/framework/ssh_connection.py<br></span><span style="color:rgb(80,0,80)">></span></blockquote><div dir="ltr"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><span style="color:rgb(80,0,80)"><br></span></blockquote><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">One comment inline below.</blockquote><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><br></blockquote><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">/Bruce</blockquote><div><div style="margin:5px 0px"><div id="m_193408151169465857gmail-q_939" aria-label="Show trimmed content" aria-expanded="false" style="background-color:rgb(232,234,237);border:none;clear:both;line-height:6px;outline:none;width:24px;color:rgb(80,0,80);font-size:11px;border-radius:5.5px"><blockquote><div style="background:url("https://www.gstatic.com/images/icons/material/system_gm/1x/more_horiz_black_20dp.png") 50% 50%/20px no-repeat;height:11px;opacity:0.7;width:24px"></div></blockquote></div></div></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Two questions on this function:</blockquote><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">* Is the getattr() check not equivalent to "if self.logger:"?</blockquote><div><br></div><div>It is. I missed it when looking over this code. I know that this close function can run in a context where it loses the ability to make system calls (an exit hook), but that doesn't matter for this as far as I know.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">* Why the check for a non-none logger in this function, when other</blockquote><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">  functions above always seem to call the logger directly without checking?</blockquote><div><br>"close" can be called before "init_log" if the program crashes early enough, so this is avoiding calling a function on a null object. No other function can have that issue because by the time control is returned to the user the logger is properly initalized. This is especially important because an early failure in the community lab will only be able to use logs to figure out what happened. <br> </div></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><br></blockquote><div dir="ltr"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><span style="color:rgb(80,0,80)">> +<br></span><span style="color:rgb(80,0,80)">> +        self.session.close(force)<br></span><span style="color:rgb(80,0,80)">> --</span></blockquote><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><span style="color:rgb(80,0,80)">> 2.30.2<br></span><span style="color:rgb(80,0,80)">></span></blockquote></div></div>