python-ipmi 0.5.5__tar.gz → 0.5.7__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (76) hide show
  1. {python-ipmi-0.5.5/python_ipmi.egg-info → python_ipmi-0.5.7}/PKG-INFO +5 -3
  2. {python-ipmi-0.5.5 → python_ipmi-0.5.7}/README.rst +2 -1
  3. {python-ipmi-0.5.5 → python_ipmi-0.5.7}/pyipmi/bmc.py +15 -0
  4. {python-ipmi-0.5.5 → python_ipmi-0.5.7}/pyipmi/interfaces/ipmb.py +29 -10
  5. {python-ipmi-0.5.5 → python_ipmi-0.5.7}/pyipmi/interfaces/ipmitool.py +8 -1
  6. {python-ipmi-0.5.5 → python_ipmi-0.5.7}/pyipmi/interfaces/rmcp.py +14 -3
  7. {python-ipmi-0.5.5 → python_ipmi-0.5.7}/pyipmi/ipmitool.py +3 -0
  8. {python-ipmi-0.5.5 → python_ipmi-0.5.7}/pyipmi/msgs/bmc.py +6 -7
  9. {python-ipmi-0.5.5 → python_ipmi-0.5.7}/pyipmi/msgs/chassis.py +0 -1
  10. {python-ipmi-0.5.5 → python_ipmi-0.5.7}/pyipmi/msgs/dcmi.py +0 -2
  11. {python-ipmi-0.5.5 → python_ipmi-0.5.7}/pyipmi/msgs/event.py +0 -1
  12. {python-ipmi-0.5.5 → python_ipmi-0.5.7}/pyipmi/msgs/fru.py +0 -1
  13. {python-ipmi-0.5.5 → python_ipmi-0.5.7}/pyipmi/msgs/hpm.py +0 -1
  14. {python-ipmi-0.5.5 → python_ipmi-0.5.7}/pyipmi/msgs/lan.py +0 -1
  15. {python-ipmi-0.5.5 → python_ipmi-0.5.7}/pyipmi/msgs/message.py +1 -4
  16. {python-ipmi-0.5.5 → python_ipmi-0.5.7}/pyipmi/msgs/picmg.py +0 -2
  17. {python-ipmi-0.5.5 → python_ipmi-0.5.7}/pyipmi/msgs/registry.py +0 -1
  18. {python-ipmi-0.5.5 → python_ipmi-0.5.7}/pyipmi/msgs/sdr.py +0 -1
  19. {python-ipmi-0.5.5 → python_ipmi-0.5.7}/pyipmi/msgs/sel.py +0 -1
  20. {python-ipmi-0.5.5 → python_ipmi-0.5.7}/pyipmi/msgs/sensor.py +0 -1
  21. {python-ipmi-0.5.5 → python_ipmi-0.5.7}/pyipmi/msgs/vita.py +0 -2
  22. {python-ipmi-0.5.5 → python_ipmi-0.5.7}/pyipmi/version.py +1 -1
  23. {python-ipmi-0.5.5 → python_ipmi-0.5.7/python_ipmi.egg-info}/PKG-INFO +5 -3
  24. {python-ipmi-0.5.5 → python_ipmi-0.5.7}/setup.py +1 -1
  25. {python-ipmi-0.5.5 → python_ipmi-0.5.7}/tests/test_bmc.py +9 -1
  26. {python-ipmi-0.5.5 → python_ipmi-0.5.7}/tests/test_helper.py +1 -1
  27. {python-ipmi-0.5.5 → python_ipmi-0.5.7}/tests/test_hpm.py +1 -1
  28. {python-ipmi-0.5.5 → python_ipmi-0.5.7}/tests/test_ipmi.py +2 -1
  29. {python-ipmi-0.5.5 → python_ipmi-0.5.7}/tests/test_ipmitool.py +3 -2
  30. {python-ipmi-0.5.5 → python_ipmi-0.5.7}/tests/test_sel.py +4 -4
  31. {python-ipmi-0.5.5 → python_ipmi-0.5.7}/tests/test_sensor.py +2 -2
  32. {python-ipmi-0.5.5 → python_ipmi-0.5.7}/AUTHORS +0 -0
  33. {python-ipmi-0.5.5 → python_ipmi-0.5.7}/COPYING +0 -0
  34. {python-ipmi-0.5.5 → python_ipmi-0.5.7}/pyipmi/__init__.py +0 -0
  35. {python-ipmi-0.5.5 → python_ipmi-0.5.7}/pyipmi/chassis.py +0 -0
  36. {python-ipmi-0.5.5 → python_ipmi-0.5.7}/pyipmi/constants.py +0 -0
  37. {python-ipmi-0.5.5 → python_ipmi-0.5.7}/pyipmi/dcmi.py +0 -0
  38. {python-ipmi-0.5.5 → python_ipmi-0.5.7}/pyipmi/emulation.py +0 -0
  39. {python-ipmi-0.5.5 → python_ipmi-0.5.7}/pyipmi/errors.py +0 -0
  40. {python-ipmi-0.5.5 → python_ipmi-0.5.7}/pyipmi/event.py +0 -0
  41. {python-ipmi-0.5.5 → python_ipmi-0.5.7}/pyipmi/fields.py +0 -0
  42. {python-ipmi-0.5.5 → python_ipmi-0.5.7}/pyipmi/fru.py +0 -0
  43. {python-ipmi-0.5.5 → python_ipmi-0.5.7}/pyipmi/helper.py +0 -0
  44. {python-ipmi-0.5.5 → python_ipmi-0.5.7}/pyipmi/hpm.py +0 -0
  45. {python-ipmi-0.5.5 → python_ipmi-0.5.7}/pyipmi/interfaces/__init__.py +0 -0
  46. {python-ipmi-0.5.5 → python_ipmi-0.5.7}/pyipmi/interfaces/aardvark.py +0 -0
  47. {python-ipmi-0.5.5 → python_ipmi-0.5.7}/pyipmi/interfaces/ipmbdev.py +0 -0
  48. {python-ipmi-0.5.5 → python_ipmi-0.5.7}/pyipmi/interfaces/mock.py +0 -0
  49. {python-ipmi-0.5.5 → python_ipmi-0.5.7}/pyipmi/lan.py +0 -0
  50. {python-ipmi-0.5.5 → python_ipmi-0.5.7}/pyipmi/logger.py +0 -0
  51. {python-ipmi-0.5.5 → python_ipmi-0.5.7}/pyipmi/messaging.py +0 -0
  52. {python-ipmi-0.5.5 → python_ipmi-0.5.7}/pyipmi/msgs/__init__.py +0 -0
  53. {python-ipmi-0.5.5 → python_ipmi-0.5.7}/pyipmi/msgs/constants.py +0 -0
  54. {python-ipmi-0.5.5 → python_ipmi-0.5.7}/pyipmi/msgs/device_messaging.py +0 -0
  55. {python-ipmi-0.5.5 → python_ipmi-0.5.7}/pyipmi/msgs/session.py +0 -0
  56. {python-ipmi-0.5.5 → python_ipmi-0.5.7}/pyipmi/picmg.py +0 -0
  57. {python-ipmi-0.5.5 → python_ipmi-0.5.7}/pyipmi/sdr.py +0 -0
  58. {python-ipmi-0.5.5 → python_ipmi-0.5.7}/pyipmi/sel.py +0 -0
  59. {python-ipmi-0.5.5 → python_ipmi-0.5.7}/pyipmi/sensor.py +0 -0
  60. {python-ipmi-0.5.5 → python_ipmi-0.5.7}/pyipmi/session.py +0 -0
  61. {python-ipmi-0.5.5 → python_ipmi-0.5.7}/pyipmi/state.py +0 -0
  62. {python-ipmi-0.5.5 → python_ipmi-0.5.7}/pyipmi/utils.py +0 -0
  63. {python-ipmi-0.5.5 → python_ipmi-0.5.7}/python_ipmi.egg-info/SOURCES.txt +0 -0
  64. {python-ipmi-0.5.5 → python_ipmi-0.5.7}/python_ipmi.egg-info/dependency_links.txt +0 -0
  65. {python-ipmi-0.5.5 → python_ipmi-0.5.7}/python_ipmi.egg-info/entry_points.txt +0 -0
  66. {python-ipmi-0.5.5 → python_ipmi-0.5.7}/python_ipmi.egg-info/top_level.txt +0 -0
  67. {python-ipmi-0.5.5 → python_ipmi-0.5.7}/setup.cfg +0 -0
  68. {python-ipmi-0.5.5 → python_ipmi-0.5.7}/tests/test_chassis.py +0 -0
  69. {python-ipmi-0.5.5 → python_ipmi-0.5.7}/tests/test_device_messaging.py +0 -0
  70. {python-ipmi-0.5.5 → python_ipmi-0.5.7}/tests/test_errors.py +0 -0
  71. {python-ipmi-0.5.5 → python_ipmi-0.5.7}/tests/test_fields.py +0 -0
  72. {python-ipmi-0.5.5 → python_ipmi-0.5.7}/tests/test_fru.py +0 -0
  73. {python-ipmi-0.5.5 → python_ipmi-0.5.7}/tests/test_lan.py +0 -0
  74. {python-ipmi-0.5.5 → python_ipmi-0.5.7}/tests/test_picmg.py +0 -0
  75. {python-ipmi-0.5.5 → python_ipmi-0.5.7}/tests/test_sdr.py +0 -0
  76. {python-ipmi-0.5.5 → python_ipmi-0.5.7}/tests/test_utils.py +0 -0
@@ -1,9 +1,9 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: python-ipmi
3
- Version: 0.5.5
3
+ Version: 0.5.7
4
4
  Summary: Pure python IPMI library
5
5
  Home-page: https://github.com/kontron/python-ipmi
6
- Download-URL: https://github.com/kontron/python-ipmi/tarball/0.5.5
6
+ Download-URL: https://github.com/kontron/python-ipmi/tarball/0.5.7
7
7
  Author: Michael Walle, Heiko Thiery
8
8
  Author-email: michael.walle@kontron.com, heiko.thiery@kontron.com
9
9
  License: LGPLv2+
@@ -20,6 +20,7 @@ Classifier: Programming Language :: Python :: 3.9
20
20
  Classifier: Programming Language :: Python :: 3.10
21
21
  Classifier: Programming Language :: Python :: 3.11
22
22
  Classifier: Programming Language :: Python :: 3.12
23
+ Classifier: Programming Language :: Python :: 3.13
23
24
  Classifier: Topic :: Software Development :: Libraries :: Python Modules
24
25
  License-File: COPYING
25
26
  License-File: AUTHORS
@@ -105,6 +106,7 @@ Example with lan interface:
105
106
 
106
107
  connection.session.set_session_type_rmcp('10.0.0.1', port=623)
107
108
  connection.session.set_auth_type_user('admin', 'admin')
109
+ connection.session.set_priv_level("ADMINISTRATOR")
108
110
  connection.session.establish()
109
111
 
110
112
  connection.get_device_id()
@@ -113,7 +115,7 @@ ipmitool command:
113
115
 
114
116
  .. code:: shell
115
117
 
116
- ipmitool -I lan -H 10.0.0.1 -p 623 -U "admin" -P "admin" -t 0x82 -b 0 -l 0 raw 0x06 0x01
118
+ ipmitool -I lan -H 10.0.0.1 -p 623 -L "ADMINISTRATOR" -U "admin" -P "admin" -t 0x82 -b 0 -l 0 raw 0x06 0x01
117
119
 
118
120
 
119
121
  Example with serial interface:
@@ -79,6 +79,7 @@ Example with lan interface:
79
79
 
80
80
  connection.session.set_session_type_rmcp('10.0.0.1', port=623)
81
81
  connection.session.set_auth_type_user('admin', 'admin')
82
+ connection.session.set_priv_level("ADMINISTRATOR")
82
83
  connection.session.establish()
83
84
 
84
85
  connection.get_device_id()
@@ -87,7 +88,7 @@ ipmitool command:
87
88
 
88
89
  .. code:: shell
89
90
 
90
- ipmitool -I lan -H 10.0.0.1 -p 623 -U "admin" -P "admin" -t 0x82 -b 0 -l 0 raw 0x06 0x01
91
+ ipmitool -I lan -H 10.0.0.1 -p 623 -L "ADMINISTRATOR" -U "admin" -P "admin" -t 0x82 -b 0 -l 0 raw 0x06 0x01
91
92
 
92
93
 
93
94
  Example with serial interface:
@@ -24,6 +24,9 @@ class Bmc(object):
24
24
  def get_device_id(self):
25
25
  return DeviceId(self.send_message_with_name('GetDeviceId'))
26
26
 
27
+ def get_device_guid(self):
28
+ return DeviceGuid(self.send_message_with_name('GetDeviceGuid'))
29
+
27
30
  def cold_reset(self):
28
31
  self.send_message_with_name('ColdReset')
29
32
 
@@ -121,6 +124,7 @@ class DeviceId(State):
121
124
  string += ' ipmi: %s' % self.ipmi_version
122
125
  string += ' manufacturer: %d' % self.manufacturer_id
123
126
  string += ' product: %d' % self.product_id
127
+ string += ' functions: %s' % ','.join(self.supported_functions)
124
128
  return string
125
129
 
126
130
  def supports_function(self, name):
@@ -164,3 +168,14 @@ class DeviceId(State):
164
168
  self.aux = None
165
169
  if rsp.auxiliary is not None:
166
170
  self.aux = list(rsp.auxiliary)
171
+
172
+
173
+ class DeviceGuid(State):
174
+ def __str__(self):
175
+ return 'Device GUID: %s' % self.device_guid_string
176
+
177
+ def _from_response(self, rsp):
178
+ self.device_guid = rsp.device_guid
179
+ self.device_guid_string = \
180
+ '%02x%02x%02x%02x-%02x%02x-%02x%02x-%02x%02x-' \
181
+ '%02x%02x%02x%02x%02x%02x' % tuple(reversed(self.device_guid))
@@ -45,10 +45,6 @@ class IpmbHeader(object):
45
45
  *-------*--------------*----------*-------*---------------*-------*
46
46
  """
47
47
 
48
- def __init__(self, data=None):
49
- if data:
50
- self.decode(data)
51
-
52
48
  rs_sa = None
53
49
  rs_lun = None
54
50
  rq_sa = None
@@ -58,6 +54,17 @@ class IpmbHeader(object):
58
54
  cmdid = None
59
55
  checksum = None
60
56
 
57
+ def __init__(self, data=None):
58
+ if data:
59
+ self.decode(data)
60
+
61
+ def __str__(self):
62
+ return f'rs_sa=0x{self.rs_sa:02x}, rs_lun={self.rs_lun}, ' \
63
+ f'rq_sa=0x{self.rq_sa:02x}, rq_lun={self.rq_lun}, ' \
64
+ f'rq_seq={self.rq_seq}, ' \
65
+ f'netfn=0x{self.netfn:02x}, ' \
66
+ f'cmdid=0x{self.cmdid:02x}'
67
+
61
68
 
62
69
  class IpmbHeaderReq(IpmbHeader):
63
70
  """Representation of the IPMI request message header."""
@@ -214,7 +221,8 @@ def decode_bridged_message(rx_data):
214
221
  return rx_data
215
222
 
216
223
 
217
- def rx_filter(header, data):
224
+ def rx_filter(header, data, rq_sa=False, rs_sa=False, rq_lun=False,
225
+ rs_lun=True, rq_seq=True):
218
226
  """Check if the message in rx_data matches to the information in header.
219
227
 
220
228
  The following checks are done:
@@ -234,15 +242,26 @@ def rx_filter(header, data):
234
242
  checks = [
235
243
  (checksum(data[0:3]), 0, 'Header checksum failed'),
236
244
  (checksum(data[3:]), 0, 'payload checksum failed'),
237
- # rsp_header.rq_sa, header.rq_sa, 'slave address mismatch'),
238
245
  (rsp_header.netfn, header.netfn | 1, 'NetFn mismatch'),
239
- # rsp_header.rs_sa, header.rs_sa, 'target address mismatch'),
240
- # rsp_header.rq_lun, header.rq_lun, 'request LUN mismatch'),
241
- (rsp_header.rs_lun, header.rs_lun, 'responder LUN mismatch'),
242
- (rsp_header.rq_seq, header.rq_seq, 'sequence number mismatch'),
243
246
  (rsp_header.cmdid, header.cmdid, 'command id mismatch'),
244
247
  ]
245
248
 
249
+ # optional checks
250
+ if rq_sa:
251
+ checks.append((rsp_header.rq_sa, header.rq_sa, 'slave address mismatch'))
252
+
253
+ if rs_sa:
254
+ checks.append((rsp_header.rs_sa, header.rs_sa, 'target address mismatch'))
255
+
256
+ if rq_lun:
257
+ checks.append((rsp_header.rq_lun, header.rq_lun, 'request LUN mismatch'))
258
+
259
+ if rs_lun:
260
+ checks.append((rsp_header.rs_lun, header.rs_lun, 'responder LUN mismatch'))
261
+
262
+ if rq_seq:
263
+ checks.append((rsp_header.rq_seq, header.rq_seq, 'sequence number mismatch'))
264
+
246
265
  match = True
247
266
 
248
267
  for left, right, msg in checks:
@@ -42,12 +42,17 @@ class Ipmitool(object):
42
42
  IPMITOOL_PATH = 'ipmitool'
43
43
  supported_interfaces = ['lan', 'lanplus', 'serial-terminal', 'open']
44
44
 
45
- def __init__(self, interface_type='lan'):
45
+ def __init__(self, interface_type='lan', cipher=None):
46
46
  if interface_type in self.supported_interfaces:
47
47
  self._interface_type = interface_type
48
48
  else:
49
49
  raise RuntimeError('interface type %s not supported' %
50
50
  interface_type)
51
+ if cipher is not None and int(cipher) not in range(0, 255):
52
+ raise RuntimeError('cipher %s not in allowed range [0-255]' %
53
+ cipher)
54
+ else:
55
+ self._cipher = cipher
51
56
 
52
57
  self.re_completion_code = re.compile(
53
58
  r"Unable to send RAW command \(.*rsp=(0x[0-9a-f]+)\)")
@@ -233,6 +238,8 @@ class Ipmitool(object):
233
238
 
234
239
  cmd += self._build_ipmitool_priv_level(self._session.priv_level)
235
240
 
241
+ if self._cipher:
242
+ cmd += (' -C %s' % self._cipher)
236
243
  if self._session.auth_type == Session.AUTH_TYPE_NONE:
237
244
  cmd += ' -P ""'
238
245
  elif self._session.auth_type == Session.AUTH_TYPE_PASSWORD:
@@ -380,6 +380,16 @@ class Rmcp(object):
380
380
  interface="rmcp",
381
381
  quirks_cfg={'rmcp_ignore_sdu_length': True}
382
382
  )
383
+
384
+ - `rmcp_ignore_rq_seq: bool` wheater or not to verify the req_seq field
385
+ for rx_filter. The default value is `False`.
386
+
387
+ Example:
388
+
389
+ interfaces.create_interface(
390
+ interface="rmcp",
391
+ quirks_cfg={'rmcp_ignore_rq_seq': True}
392
+ )
383
393
  """
384
394
  self.host = None
385
395
  self.port = None
@@ -396,6 +406,7 @@ class Rmcp(object):
396
406
  self.transaction_lock = threading.Lock()
397
407
  self.quirks_cfg = quirks_cfg
398
408
  self.ignore_sdu_length = quirks_cfg.get('rmcp_ignore_sdu_length', False)
409
+ self.ignore_rq_seq = quirks_cfg.get('rmcp_ignore_rq_seq', False)
399
410
 
400
411
  def _send_rmcp_msg(self, sdu, class_of_msg):
401
412
  rmcp = RmcpMsg(class_of_msg)
@@ -476,8 +487,7 @@ class Rmcp(object):
476
487
  req = create_request_by_name('ActivateSession')
477
488
  req.target = self.host_target
478
489
  req.authentication.type = session.auth_type
479
- req.privilege_level.maximum_requested =\
480
- Session.PRIV_LEVEL_ADMINISTRATOR
490
+ req.privilege_level.maximum_requested = session.priv_level
481
491
  req.challenge_string = challenge
482
492
  req.session_id = self._session.sid
483
493
  req.initial_outbound_sequence_number = random.randrange(1, 0xffffffff)
@@ -610,7 +620,8 @@ class Rmcp(object):
610
620
  # it's not really a retry
611
621
  continue
612
622
 
613
- received = rx_filter(header, rx_data)
623
+ received = rx_filter(header, rx_data,
624
+ rq_seq=not self.ignore_rq_seq)
614
625
 
615
626
  if not received:
616
627
  self._q.put(rx_data)
@@ -488,6 +488,7 @@ Aardvark interface options:
488
488
 
489
489
  Ipmitool interface options:
490
490
  interface_type Set the interface type to be used (lan, lanplus, serial, open)
491
+ cipher Set the cipher to be used (0-255)
491
492
 
492
493
  Ipmbdev interface options:
493
494
  port=<path> Specify path to Linux IPMB device (/dev/ipmb-0 by default)
@@ -533,6 +534,8 @@ def parse_interface_options(interface_name, options):
533
534
  elif interface_name == 'ipmitool':
534
535
  if name == 'interface_type':
535
536
  interface_options['interface_type'] = value
537
+ elif name == 'cipher':
538
+ interface_options['cipher'] = value
536
539
  else:
537
540
  print('Warning: unknown option %s' % name)
538
541
  elif interface_name == 'ipmbdev':
@@ -14,9 +14,6 @@
14
14
  # License along with this library; if not, write to the Free Software
15
15
  # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
16
16
 
17
- from __future__ import absolute_import
18
-
19
-
20
17
  from . import constants
21
18
  from . import register_message_class
22
19
  from . import Message
@@ -174,17 +171,19 @@ class GetAcpiPowerStateRsp(Message):
174
171
 
175
172
 
176
173
  @register_message_class
177
- class GetDeviceGuideReq(Message):
174
+ class GetDeviceGuidReq(Message):
178
175
  __cmdid__ = constants.CMDID_GET_DEVICE_GUID
179
176
  __netfn__ = constants.NETFN_APP
180
- __not_implemented__ = True
181
177
 
182
178
 
183
179
  @register_message_class
184
- class GetDeviceGuideRsp(Message):
180
+ class GetDeviceGuidRsp(Message):
185
181
  __cmdid__ = constants.CMDID_GET_DEVICE_GUID
186
182
  __netfn__ = constants.NETFN_APP | 1
187
- __not_implemented__ = True
183
+ __fields__ = (
184
+ CompletionCode(),
185
+ ByteArray('device_guid', 16),
186
+ )
188
187
 
189
188
 
190
189
  @register_message_class
@@ -1,4 +1,3 @@
1
- from __future__ import absolute_import
2
1
  # Copyright (c) 2014 Kontron Europe GmbH
3
2
  #
4
3
  # This library is free software; you can redistribute it and/or
@@ -14,8 +14,6 @@
14
14
  # License along with this library; if not, write to the Free Software
15
15
  # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
16
16
 
17
- from __future__ import absolute_import
18
-
19
17
 
20
18
  from . import constants
21
19
  from . import register_message_class
@@ -1,4 +1,3 @@
1
- from __future__ import absolute_import
2
1
  # Copyright (c) 2014 Kontron Europe GmbH
3
2
  #
4
3
  # This library is free software; you can redistribute it and/or
@@ -1,4 +1,3 @@
1
- from __future__ import absolute_import
2
1
  # Copyright (c) 2014 Kontron Europe GmbH
3
2
  #
4
3
  # This library is free software; you can redistribute it and/or
@@ -1,4 +1,3 @@
1
- from __future__ import absolute_import
2
1
  # Copyright (c) 2014 Kontron Europe GmbH
3
2
  #
4
3
  # This library is free software; you can redistribute it and/or
@@ -1,4 +1,3 @@
1
- from __future__ import absolute_import
2
1
  # Copyright (c) 2014 Kontron Europe GmbH
3
2
  #
4
3
  # This library is free software; you can redistribute it and/or
@@ -14,9 +14,6 @@
14
14
  # License along with this library; if not, write to the Free Software
15
15
  # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
16
16
 
17
-
18
- from __future__ import absolute_import
19
-
20
17
  from array import array
21
18
 
22
19
  from . import constants
@@ -73,7 +70,7 @@ class ByteArray(BaseField):
73
70
  if self.default is not None:
74
71
  return array('B', self.default)
75
72
  else:
76
- return array('B', self.length * '\x00')
73
+ return array('B', self.length * b'\x00')
77
74
 
78
75
 
79
76
  class VariableByteArray(ByteArray):
@@ -14,8 +14,6 @@
14
14
  # License along with this library; if not, write to the Free Software
15
15
  # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
16
16
 
17
- from __future__ import absolute_import
18
-
19
17
  from . import constants
20
18
  from . import register_message_class
21
19
  from . import Message
@@ -14,7 +14,6 @@
14
14
  # License along with this library; if not, write to the Free Software
15
15
  # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
16
16
 
17
-
18
17
  from functools import partial
19
18
  from ..errors import DescriptionError
20
19
 
@@ -13,7 +13,6 @@
13
13
  # You should have received a copy of the GNU Lesser General Public
14
14
  # License along with this library; if not, write to the Free Software
15
15
  # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
16
- from __future__ import absolute_import
17
16
 
18
17
  from . import constants
19
18
  from . import register_message_class
@@ -1,4 +1,3 @@
1
- from __future__ import absolute_import
2
1
  # Copyright (c) 2014 Kontron Europe GmbH
3
2
  #
4
3
  # This library is free software; you can redistribute it and/or
@@ -1,4 +1,3 @@
1
- from __future__ import absolute_import
2
1
  # Copyright (c) 2014 Kontron Europe GmbH
3
2
  #
4
3
  # This library is free software; you can redistribute it and/or
@@ -14,8 +14,6 @@
14
14
  # License along with this library; if not, write to the Free Software
15
15
  # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
16
16
 
17
- from __future__ import absolute_import
18
-
19
17
  from . import constants
20
18
  from . import register_message_class
21
19
  from . import Message
@@ -1,2 +1,2 @@
1
1
  # This file was autogenerated by setup.py
2
- __version__ = '0.5.5'
2
+ __version__ = '0.5.7'
@@ -1,9 +1,9 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: python-ipmi
3
- Version: 0.5.5
3
+ Version: 0.5.7
4
4
  Summary: Pure python IPMI library
5
5
  Home-page: https://github.com/kontron/python-ipmi
6
- Download-URL: https://github.com/kontron/python-ipmi/tarball/0.5.5
6
+ Download-URL: https://github.com/kontron/python-ipmi/tarball/0.5.7
7
7
  Author: Michael Walle, Heiko Thiery
8
8
  Author-email: michael.walle@kontron.com, heiko.thiery@kontron.com
9
9
  License: LGPLv2+
@@ -20,6 +20,7 @@ Classifier: Programming Language :: Python :: 3.9
20
20
  Classifier: Programming Language :: Python :: 3.10
21
21
  Classifier: Programming Language :: Python :: 3.11
22
22
  Classifier: Programming Language :: Python :: 3.12
23
+ Classifier: Programming Language :: Python :: 3.13
23
24
  Classifier: Topic :: Software Development :: Libraries :: Python Modules
24
25
  License-File: COPYING
25
26
  License-File: AUTHORS
@@ -105,6 +106,7 @@ Example with lan interface:
105
106
 
106
107
  connection.session.set_session_type_rmcp('10.0.0.1', port=623)
107
108
  connection.session.set_auth_type_user('admin', 'admin')
109
+ connection.session.set_priv_level("ADMINISTRATOR")
108
110
  connection.session.establish()
109
111
 
110
112
  connection.get_device_id()
@@ -113,7 +115,7 @@ ipmitool command:
113
115
 
114
116
  .. code:: shell
115
117
 
116
- ipmitool -I lan -H 10.0.0.1 -p 623 -U "admin" -P "admin" -t 0x82 -b 0 -l 0 raw 0x06 0x01
118
+ ipmitool -I lan -H 10.0.0.1 -p 623 -L "ADMINISTRATOR" -U "admin" -P "admin" -t 0x82 -b 0 -l 0 raw 0x06 0x01
117
119
 
118
120
 
119
121
  Example with serial interface:
@@ -62,6 +62,7 @@ setup(name=name,
62
62
  'Programming Language :: Python :: 3.10',
63
63
  'Programming Language :: Python :: 3.11',
64
64
  'Programming Language :: Python :: 3.12',
65
+ 'Programming Language :: Python :: 3.13',
65
66
  'Topic :: Software Development :: Libraries :: Python Modules',
66
67
  ],
67
68
  entry_points={
@@ -72,7 +73,6 @@ setup(name=name,
72
73
  test_suite='tests',
73
74
  tests_require=[
74
75
  'pytest',
75
- 'mock',
76
76
  ],
77
77
  install_requires=[
78
78
  ],
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env python
2
2
  # -*- coding: utf-8 -*-
3
3
 
4
- from pyipmi.bmc import DeviceId, Watchdog
4
+ from pyipmi.bmc import DeviceId, DeviceGuid, Watchdog
5
5
  import pyipmi.msgs.bmc
6
6
  from pyipmi.msgs import decode_message
7
7
 
@@ -47,3 +47,11 @@ def test_deviceid_object_with_aux():
47
47
 
48
48
  device_id = DeviceId(msg)
49
49
  assert device_id.aux == [1, 2, 3, 4]
50
+
51
+
52
+ def test_deviceguid_object():
53
+ m = pyipmi.msgs.bmc.GetDeviceGuidRsp()
54
+ decode_message(m, b'\x00\xff\xee\xdd\xcc\xbb\xaa'
55
+ b'\x99\x88\x77\x66\x55\x44\x33\x22\x11\x00')
56
+ guid = DeviceGuid(m)
57
+ assert guid.device_guid_string == '00112233-4455-6677-8899-aabbccddeeff'
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env python
2
2
  # -*- coding: utf-8 -*-
3
3
 
4
- from mock import MagicMock, call
4
+ from unittest.mock import MagicMock, call
5
5
 
6
6
  from pyipmi.helper import clear_repository_helper
7
7
  from pyipmi.msgs.constants import (REPOSITORY_ERASURE_COMPLETED,
@@ -17,7 +17,7 @@ from pyipmi.hpm import (ComponentProperty, ComponentPropertyDescriptionString,
17
17
  PROPERTY_DEFERRED_VERSION)
18
18
 
19
19
 
20
- class TestComponentProperty(object):
20
+ class TestComponentProperty:
21
21
  def test_general(self):
22
22
  prop = ComponentProperty().from_data(PROPERTY_GENERAL_PROPERTIES, b'\xaa')
23
23
  assert type(prop) is ComponentPropertyGeneral
@@ -1,8 +1,9 @@
1
1
  #!/usr/bin/env python
2
2
  # -*- coding: utf-8 -*-
3
3
 
4
+ from unittest.mock import MagicMock
5
+
4
6
  import pytest
5
- from mock import MagicMock
6
7
 
7
8
  from pyipmi import interfaces, create_connection, Target, Routing
8
9
  from pyipmi.errors import CompletionCodeError, RetryError
@@ -3,7 +3,7 @@
3
3
  from pyipmi.ipmitool import parse_interface_options
4
4
 
5
5
 
6
- class TestParseInterfaceOptions(object):
6
+ class TestParseInterfaceOptions:
7
7
  def test_options_aardvark(self):
8
8
  options = parse_interface_options('aardvark', 'serial=1234')
9
9
  assert options['serial_number'] == '1234'
@@ -27,8 +27,9 @@ class TestParseInterfaceOptions(object):
27
27
  assert options['enable_fastmode'] is False
28
28
 
29
29
  def test_options_ipmitool(self):
30
- options = parse_interface_options('ipmitool', 'interface_type=abcd')
30
+ options = parse_interface_options('ipmitool', 'interface_type=abcd,cipher=55')
31
31
  assert options['interface_type'] == 'abcd'
32
+ assert options['cipher'] == '55'
32
33
 
33
34
  def test_options_ipmbdev(self):
34
35
  options = parse_interface_options('ipmbdev', 'port=/dev/ipmb0')
@@ -1,14 +1,14 @@
1
1
  #!/usr/bin/env python
2
2
  # -*- coding: utf-8 -*-
3
3
 
4
- from mock import MagicMock
4
+ from unittest.mock import MagicMock
5
5
 
6
6
  from pyipmi import interfaces, create_connection
7
7
  from pyipmi.msgs.registry import create_response_by_name
8
8
  from pyipmi.sel import SelEntry, SelInfo
9
9
 
10
10
 
11
- class TestSel(object):
11
+ class TestSel:
12
12
 
13
13
  def test_get_sel_entries(self):
14
14
  rsps = list()
@@ -36,7 +36,7 @@ class TestSel(object):
36
36
  assert len(entries) == 2
37
37
 
38
38
 
39
- class TestSelInfo(object):
39
+ class TestSelInfo:
40
40
  rsp = create_response_by_name('GetSelInfo')
41
41
  rsp.version = 1
42
42
  rsp.entries = 1023
@@ -108,7 +108,7 @@ class TestSelInfo(object):
108
108
  assert 'overflow_flag' in info.operation_support
109
109
 
110
110
 
111
- class TestSelEnty(object):
111
+ class TestSelEnty:
112
112
 
113
113
  def test_from_data(self):
114
114
  data = [0xff, 0x03, 0x02, 0xf7, 0x61, 0xef, 0x52, 0x7e,
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env python
2
2
  # -*- coding: utf-8 -*-
3
3
 
4
- from mock import MagicMock
4
+ from unittest.mock import MagicMock
5
5
 
6
6
  from pyipmi import interfaces, create_connection
7
7
  from pyipmi.msgs.sensor import (SetSensorThresholdsRsp, GetSensorThresholdsRsp,
@@ -10,7 +10,7 @@ from pyipmi.sensor import (EVENT_READING_TYPE_SENSOR_SPECIFIC,
10
10
  SENSOR_TYPE_MODULE_HOT_SWAP)
11
11
 
12
12
 
13
- class TestSensor(object):
13
+ class TestSensor:
14
14
 
15
15
  def setup_method(self):
16
16
  self.mock_send_recv = MagicMock()
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes