MicroTCA-Tech-Lab / mmcterm

Terminal for the custom "serial over IPMB" protocol used by DMMC-STAMP

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Confusing error message when `ipmitool` is not installed

j-marjanovic opened this issue · comments

When using mmcterm with ipmitool backend (-i flag) and the IPMI tool is not installed, the following error message is shown:

$ mmcterm -i mch1 0x88
Traceback (most recent call last):
  File "/home/jan/.local/bin/mmcterm", line 8, in <module>
    sys.exit(main())
  File "/home/jan/.local/lib/python3.8/site-packages/mmcterm/mmcterm.py", line 456, in main
    if not conn.session_ctrl(args.channel, True):
  File "/home/jan/.local/lib/python3.8/site-packages/mmcterm/mmcterm.py", line 110, in session_ctrl
    status, _ = self.raw_cmd(IpmiCode.SOI_SESSION_CTRL, channel + enable)
  File "/home/jan/.local/lib/python3.8/site-packages/mmcterm/mmcterm.py", line 82, in raw_cmd
    raw_reply = self.conn.raw_command(0, 0x30, data)
  File "/home/jan/.local/lib/python3.8/site-packages/pyipmi/__init__.py", line 225, in raw_command
    return self.interface.send_and_receive_raw(self.target, lun, netfn,
  File "/home/jan/.local/lib/python3.8/site-packages/pyipmi/interfaces/ipmitool.py", line 143, in send_and_receive_raw
    cc, rsp = self._parse_output(output)
  File "/home/jan/.local/lib/python3.8/site-packages/pyipmi/interfaces/ipmitool.py", line 124, in _parse_output
    rsp = array('B', [
  File "/home/jan/.local/lib/python3.8/site-packages/pyipmi/interfaces/ipmitool.py", line 125, in <listcomp>
    int(value, 16) for value in hexstr.split(' ')
ValueError: invalid literal for int() with base 16: '/bin/sh:'

This message is rather confusing, ideally it would mention that the IPMI tool is not installed.

Installing the IPMI tool (sudo apt install ipmitool) fixes this issue.

It is actually a pyipmi issue, I opened a pull request.