diff options
author | Adriana Kobylak <anoo@us.ibm.com> | 2018-01-26 15:07:23 -0600 |
---|---|---|
committer | Brad Bishop <bradleyb@fuzziesquirrel.com> | 2018-02-12 23:17:41 +0000 |
commit | 24341f9d1335a7cb175cc67557f2a8bdbb89a2e8 (patch) | |
tree | 1f275b0eabac86f9f0469e6d7af4583e6f3f685c /pyipmitest/ipmi_debug.py | |
parent | a30ab9db33bb8d1c208b2b86b8e824c5c70dae54 (diff) | |
download | blackbird-skeleton-24341f9d1335a7cb175cc67557f2a8bdbb89a2e8.tar.gz blackbird-skeleton-24341f9d1335a7cb175cc67557f2a8bdbb89a2e8.zip |
pep8 fixes
Also ignore the configs/ directory since it only contains
system configuration files named <system>.py.
Change-Id: I0416239c4030ce5bc39473e65e560016cd4ffc75
Signed-off-by: Adriana Kobylak <anoo@us.ibm.com>
Diffstat (limited to 'pyipmitest/ipmi_debug.py')
-rw-r--r-- | pyipmitest/ipmi_debug.py | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/pyipmitest/ipmi_debug.py b/pyipmitest/ipmi_debug.py index d81cb2e..a8b1001 100644 --- a/pyipmitest/ipmi_debug.py +++ b/pyipmitest/ipmi_debug.py @@ -14,6 +14,7 @@ import dbus.mainloop.glib DBUS_NAME = 'org.openbmc.HostIpmi' OBJ_NAME = '/org/openbmc/HostIpmi/1' + def header(seq, netfn, lun, cmd): return ( 'seq: 0x%02x\nnetfn: 0x%02x\n\nlun: 0x%02d\ncmd: 0x%02x\n') % ( @@ -25,6 +26,7 @@ def print_request(seq, netfn, lun, cmd, data): str += 'data: [%s]' % ', '.join(['0x%02x' % x for x in data]) print str + def print_response(seq, netfn, lun, cmd, cc, data): str = header(seq, netfn, lun, cmd) str += 'cc: 0x%02x\ndata: [%s]' % ( @@ -32,9 +34,10 @@ def print_response(seq, netfn, lun, cmd, cc, data): ) print str + class IpmiDebug(dbus.service.Object): - def __init__(self,bus,name): - dbus.service.Object.__init__(self,bus,name) + def __init__(self, bus, name): + dbus.service.Object.__init__(self, bus, name) @dbus.service.signal(DBUS_NAME, "yyyyay") def ReceivedMessage(self, seq, netfn, lun, cmd, data): @@ -51,6 +54,7 @@ class IpmiDebug(dbus.service.Object): def setAttention(self): print "IPMI SMS_ATN set" + class ConsoleReader(object): def __init__(self, ipmi_obj): self.buffer = '' @@ -83,6 +87,7 @@ class ConsoleReader(object): self.seq += 1 self.ipmi_obj.ReceivedMessage(self.seq, data[0], 0, data[1], data[2:]) + def main(): dbus.mainloop.glib.DBusGMainLoop(set_as_default=True) bus = dbus.SystemBus() @@ -94,9 +99,10 @@ def main(): name = dbus.service.BusName(DBUS_NAME, bus) print ("Enter IPMI packet as hex values. First three bytes will be used" - "as netfn and cmd.\nlun will be zero.") + "as netfn and cmd.\nlun will be zero.") mainloop.run() + if __name__ == '__main__': sys.exit(main()) |