Skip to content

Commit

Permalink
ipmitool: allow cipher option as cli arg (via -o)
Browse files Browse the repository at this point in the history
  • Loading branch information
Valentin committed Jun 5, 2024
1 parent d6ea1bd commit 8d88011
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion pyipmi/interfaces/ipmitool.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def __init__(self, interface_type='lan', cipher=None):
else:
raise RuntimeError('interface type %s not supported' %
interface_type)
if cipher is not None and cipher not in range(0,255):
if cipher is not None and int(cipher) not in range(0,255):
raise RuntimeError('cipher %s not in allowed range [0-255]' %
cipher)
else:
Expand Down
3 changes: 3 additions & 0 deletions pyipmi/ipmitool.py
Original file line number Diff line number Diff line change
Expand Up @@ -488,6 +488,7 @@ def usage(toplevel=False):
Ipmitool interface options:
interface_type Set the interface type to be used (lan, lanplus, serial, open)
cipher Set the cipher to be used (0-255)
Ipmbdev interface options:
port=<path> Specify path to Linux IPMB device (/dev/ipmb-0 by default)
Expand Down Expand Up @@ -533,6 +534,8 @@ def parse_interface_options(interface_name, options):
elif interface_name == 'ipmitool':
if name == 'interface_type':
interface_options['interface_type'] = value
elif name == 'cipher':
interface_options['cipher'] = value
else:
print('Warning: unknown option %s' % name)
elif interface_name == 'ipmbdev':
Expand Down

0 comments on commit 8d88011

Please sign in to comment.