Skip to content

Commit

Permalink
Merge pull request #431 from debmc/ipmi
Browse files Browse the repository at this point in the history
OpTestIPMI: Aide PTY tracing
  • Loading branch information
stewartsmith authored Mar 20, 2019
2 parents 04fd4e0 + ee81bb6 commit e4e3859
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions common/OpTestIPMI.py
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,7 @@ def close(self):
self.pty.send("\r")
self.pty.send('~.')
close_rc = self.pty.expect(['[terminated ipmitool]', pexpect.TIMEOUT, pexpect.EOF], timeout=10)
log.debug("CLOSE Expect Buffer ID={}".format(hex(id(self.pty))))
rc_child = self.pty.close()
self.state = IPMIConsoleState.DISCONNECTED
exitCode = signalstatus = None
Expand Down Expand Up @@ -275,10 +276,12 @@ def connect(self, logger=None):
if self.delaybeforesend:
self.pty.delaybeforesend = self.delaybeforesend
rc = self.pty.expect_exact(['[SOL Session operational. Use ~? for help]', pexpect.TIMEOUT, pexpect.EOF], timeout=10)
log.debug("rc={}".format(rc))
if rc == 0:
if self.system.SUDO_set != 1 or self.system.LOGIN_set != 1 or self.system.PS1_set !=1:
self.util.setup_term(self.system, self.pty, None, self.system.block_setup_term)
time.sleep(0.2)
log.debug("CONNECT starts Expect Buffer ID={}".format(hex(id(self.pty))))
return self.pty
if rc == 1:
self.pty.close()
Expand Down

0 comments on commit e4e3859

Please sign in to comment.