Skip to content

if-statement in build_empty_mw_link_record_array() might cause silent error #6

@cchwala

Description

@cchwala

There is a if-statement in the following lines of code which seems unnecessary and which might cause a silent error (in line 294) when a oid_dict key is TX_level or RX_level.

pySNMPdaq/pySNMPdaq.py

Lines 286 to 296 in 1714b8c

for oid_name in oid_dict:
if (oid_name != 'RX_level' and oid_name != 'TX_level'):
dtype_list.append((oid_name, np.float64))
mw_link_record = np.empty((1, ), dtype=dtype_list)
# Set all numeric entries to NaN
mw_link_record['RTT'] = np.NaN
for oid in oid_dict:
mw_link_record[oid] = np.NaN
return mw_link_record

Provided that this if-statement is not required it should be removed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions