Skip to content

Commit

Permalink
rename
Browse files Browse the repository at this point in the history
  • Loading branch information
joente committed Sep 29, 2023
1 parent 8c5ba44 commit 22d519f
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
17 changes: 16 additions & 1 deletion lib/check/idrac.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,21 @@ def status_list(item: dict, metric: str):
]


def do_rename(state: dict):
return {
'systemState': [
{k.lstrip('systemState'): v for k, v in item}
for item in state['systemStateTableEntry']],
'eventLog': [
{k.lstrip('eventLog'): v for k, v in item}
for item in state['eventLogTableEntry']],

'firmware': [
{k.lstrip('firmware'): v for k, v in item}
for item in state['firmwareTableEntry']],
}


async def check_idrac(
asset: Asset,
asset_config: dict,
Expand Down Expand Up @@ -77,4 +92,4 @@ async def check_idrac(
status_list(item, 'systemStatePowerUnitStatusList')
status_list(item, 'systemStateProcessorDeviceStatusList')

return state
return do_rename(state)
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
asyncsnmplib==0.1.11
libprobe==0.2.33
libprobe==0.2.35

0 comments on commit 22d519f

Please sign in to comment.