Skip to content

Commit 6d0d40f

Browse files
printer_supply: use walrus operator for none check
This is a pure refactor. No behavior was changed. Change-Id: I43c9c7265e7c364ceceaf629c8e8db4daed3aa75
1 parent a8d0961 commit 6d0d40f

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

cmk/plugins/collection/agent_based/printer_supply.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -230,8 +230,7 @@ class CheckParams(TypedDict):
230230

231231

232232
def check_printer_supply(item: str, params: CheckParams, section: Section) -> CheckResult:
233-
supply = section.get(item)
234-
if supply is None:
233+
if (supply := section.get(item)) is None:
235234
return
236235

237236
color_info = _get_supply_color_info(item, supply.color)

0 commit comments

Comments
 (0)