From 41c549d0e91f214e75cf7f45fbeb10ac75abbf28 Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Fri, 3 Jan 2014 10:22:30 -0500 Subject: [PATCH] Remove callback usage from console.py In command.py, settled on coroutine structure as the sole design pattern to support. To be consistent, abolish the use of callback from console.py as well so that SOL does not needlessly act so different from command.py in the scenarios where it can act the same. Change-Id: I7a26a7c9b929ef7e63ca23c595a28baeb7f1e1b9 --- pyghmi/ipmi/console.py | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/pyghmi/ipmi/console.py b/pyghmi/ipmi/console.py index c8e12523..5ab93e11 100644 --- a/pyghmi/ipmi/console.py +++ b/pyghmi/ipmi/console.py @@ -86,13 +86,8 @@ class Console(object): # 0b11000000, -encrypt, authenticate, # disable serial/modem alerts, CTS fine # 0, 0, 0 reserved - self.ipmi_session.raw_command(netfn=0x6, command=0x48, - data=(1, 1, 192, 0, 0, 0), - callback=self._payload_activated) - - def _payload_activated(self, response): - """Check status of activate payload request - """ + response = self.ipmi_session.raw_command(netfn=0x6, command=0x48, + data=(1, 1, 192, 0, 0, 0)) if 'error' in response: self._print_data(response['error']) #given that these are specific to the command, @@ -112,9 +107,11 @@ class Console(object): elif response['code'] == 0x80: if self.force_session and not self.retriedpayload: self.retriedpayload = 1 - self.ipmi_session.raw_command(netfn=0x6, command=0x49, - data=(1, 1, 0, 0, 0, 0), - callback=self._got_session) + sessrsp = self.ipmi_session.raw_command( + netfn=0x6, + command=0x49, + data=(1, 1, 0, 0, 0, 0)) + self._got_session(sessrsp) return else: self._print_data('SOL Session active for another client\n')