mirror of
https://github.com/retspen/webvirtcloud
synced 2026-12-01 08:26:03 +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:
parent
1289478f79
commit
62885c74ca
1 changed files with 1 additions and 1 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue