From a88f473e83ad8076a11b1da1b436aaf56937ec4d Mon Sep 17 00:00:00 2001 From: Jeroen van der Heijden Date: Fri, 29 Sep 2023 13:18:02 +0200 Subject: [PATCH] removeprefix --- lib/check/idrac.py | 6 +++--- lib/version.py | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/check/idrac.py b/lib/check/idrac.py index 9e855d4..3e59b18 100644 --- a/lib/check/idrac.py +++ b/lib/check/idrac.py @@ -14,19 +14,19 @@ def do_rename(state: dict): new_state = {} if 'systemStateTableEntry' in state: new_state['systemState'] = [ - {k.lstrip('systemState'): v for k, v in item.items()} + {k.removeprefix('systemState'): v for k, v in item.items()} for item in state['systemStateTableEntry']] else: raise CheckException('missing systemStateTableEntry in SNMP result') if 'eventLogTableEntry' in state: new_state['eventLog'] = [ - {k.lstrip('eventLog'): v for k, v in item.items()} + {k.removeprefix('eventLog'): v for k, v in item.items()} for item in state['eventLogTableEntry']] if 'firmwareTableEntry' in state: new_state['firmware'] = [ - {k.lstrip('firmware'): v for k, v in item.items()} + {k.removeprefix('firmware'): v for k, v in item.items()} for item in state['firmwareTableEntry']] return new_state diff --git a/lib/version.py b/lib/version.py index 0a6f90b..7e3d4af 100644 --- a/lib/version.py +++ b/lib/version.py @@ -1,4 +1,4 @@ # Version string. Examples: # '3.0.0' # '3.0.0-alpha9' -__version__ = '3.0.0-alpha5' +__version__ = '3.0.0-alpha6'