From eace5464482e79fc24e29d3550297e97bda09776 Mon Sep 17 00:00:00 2001 From: Jarrod Johnon Date: Mon, 15 Sep 2014 11:35:55 -0400 Subject: [PATCH] Avoid exception on close If close is called and the remote BMC session no longer works, do not pass up worrisome trace to a caller, which is calling close() to try to make sure things are clean and here there is just some part that was already done. Change-Id: Ib0c770b57eb0f204bcde6fc786e8f064f02ece1a --- pyghmi/ipmi/console.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/pyghmi/ipmi/console.py b/pyghmi/ipmi/console.py index 0880852d..993f8507 100644 --- a/pyghmi/ipmi/console.py +++ b/pyghmi/ipmi/console.py @@ -182,8 +182,13 @@ class Console(object): """ self.ipmi_session.unregister_keepalive(self.keepaliveid) if self.activated: - self.ipmi_session.raw_command(netfn=6, command=0x49, - data=(1, 1, 0, 0, 0, 0)) + try: + self.ipmi_session.raw_command(netfn=6, command=0x49, + data=(1, 1, 0, 0, 0, 0)) + except exc.IpmiException: + # if underlying ipmi session is not working, then + # run with the implicit success + pass def send_data(self, data): if self.broken: