File tree Expand file tree Collapse file tree 1 file changed +2
-5
lines changed Expand file tree Collapse file tree 1 file changed +2
-5
lines changed Original file line number Diff line number Diff line change 7
7
# mypy: disable-error-code=attr-defined
8
8
from __future__ import annotations
9
9
10
- from typing import TYPE_CHECKING , ClassVar , TypeVar , get_args
10
+ from typing import TYPE_CHECKING , ClassVar , get_args
11
11
12
12
from pydantic import field_validator
13
13
19
19
if TYPE_CHECKING :
20
20
from anta .models import AntaTemplate
21
21
22
- # Using a TypeVar for the SnmpUser model since mypy thinks it's a ClassVar and not a valid type when used in field validators
23
- T = TypeVar ("T" , bound = SnmpUser )
24
-
25
22
26
23
class VerifySnmpStatus (AntaTest ):
27
24
"""Verifies whether the SNMP agent is enabled in a specified VRF.
@@ -393,7 +390,7 @@ class Input(AntaTest.Input):
393
390
394
391
@field_validator ("snmp_users" )
395
392
@classmethod
396
- def validate_snmp_users (cls , snmp_users : list [T ]) -> list [T ]:
393
+ def validate_snmp_users (cls , snmp_users : list [SnmpUser ]) -> list [SnmpUser ]:
397
394
"""Validate that 'auth_type' or 'priv_type' field is provided in each SNMPv3 user."""
398
395
for user in snmp_users :
399
396
if user .version == "v3" and not (user .auth_type or user .priv_type ):
You can’t perform that action at this time.
0 commit comments