1
0
Fork 0
mirror of https://github.com/retspen/webvirtcloud synced 2026-12-01 16:36:06 +00:00

refactor(vrtManager): validate_macaddr checks the type once

It tested isinstance(val, str) twice, a leftover of the Python 2 str/unicode check.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kk4h2TcUiaWmU5MUszYSea
This commit is contained in:
catborise 2026-11-08 12:16:50 +03:00
parent 1289478f79
commit 62885c74ca

View file

@ -139,7 +139,7 @@ def validate_macaddr(val):
if val is None:
return
if not (isinstance(val, str) or isinstance(val, str)):
if not isinstance(val, str):
raise ValueError("MAC address must be a string.")
form = re.match("^([0-9a-fA-F]{1,2}:){5}[0-9a-fA-F]{1,2}$", val)