Sensor names don't have ending null bytes trimmed

Bug #1672181 reported by lf
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
pyghmi
New
Undecided
Unassigned

Bug Description

get_sensor_data() on a Command instance doesn't correctly trim null bytes on the name field:

In [11]: list(c.get_sensor_data())[0]
Out[11]:
{'states': ['Present'], 'health': 0, 'name': 'VRM 1\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00', 'imprecision': None, 'units': '', 'state_ids': [591873], 'type': 'Power Unit', 'value': None, 'unavailable': 0}

Expected behaviour:

In [11]: list(c.get_sensor_data())[0]
Out[11]:
{'states': ['Present'], 'health': 0, 'name': 'VRM 1', 'imprecision': None, 'units': '', 'state_ids': [591873], 'type': 'Power Unit', 'value': None, 'unavailable': 0}

Environment details:
HP iLO 2, pyghmi (1.0.18)

Revision history for this message
lf (l-ububtu-3) wrote :

This is a semi-non-bug because the names appear to actually *be* the names padded to 16 chars with null bytes. So if you need to get a sensor with get_sensor_reading, you need the null bytes.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.