Skip to content
Closed
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions cmk/base/legacy_checks/emerson_temp.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def check_emerson_temp(item, params, info):


def parse_emerson_temp(string_table: StringTable) -> StringTable:
return string_table
return [[x] for x in string_table[0]]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are many ways of doing this, obviously, but this way a test is failing that ensures we can deal with an emtpy input. I suggest to leave line 52 alone, add a comment, and do this:

def parse_...
    # we only use at most the first two lines because....
    return string_table[:2]



check_info["emerson_temp"] = LegacyCheckDefinition(
Expand All @@ -49,7 +49,7 @@ def parse_emerson_temp(string_table: StringTable) -> StringTable:
detect=startswith(".1.3.6.1.4.1.6302.2.1.1.1.0", "Emerson Network Power"),
fetch=SNMPTree(
base=".1.3.6.1.4.1.6302.2.1.2",
oids=["7"],
oids=["7.1", "7.2"],
),
service_name="Temperature %s",
discovery_function=inventory_emerson_temp,
Expand Down
Loading