kontron / python-ipmi

A pure python IPMI library
GNU Lesser General Public License v2.1
187 stars 74 forks source link

Added Handeling for 'target is None' ipmitool.py #122

Closed AliSot2000 closed 2 years ago

AliSot2000 commented 2 years ago

For my purposes, I don't need anything related to target to have the library working. I'm using a very old motherboard (Supermicro X9SCM, the latest firmware is from 2010) and want to access its BMC.

The command I want to use is precisely:

ipmitool -I lan -H 192.168.1.31 -U user -P password chassis status

However I was unable to 'assemble' this command with the library in it's current form. The Library always rose an Error:

if target.routing is not None: AttributeError: 'NoneType' object has no attribute 'routing'

This is my solution to fixing this problem. If there is a solution with the current code that I was unable to find, please indicate to me and discard this pull request.

AliSot2000 commented 2 years ago

Codacy Static Code Analysis is complaining about trailing white space if I read the error correctly. I will correct the issue and open a new pull request.