mirror of
https://github.com/checktheroads/hyperglass
synced 2024-05-11 05:55:08 +00:00
general cleanup
This commit is contained in:
@@ -89,15 +89,15 @@ def validate_ip(value, query_type, query_vrf): # noqa: C901
|
||||
|
||||
ip_version = valid_ip.version
|
||||
|
||||
if getattr(query_vrf, f"ipv{ip_version}") is None:
|
||||
vrf_afi = getattr(query_vrf, f"ipv{ip_version}")
|
||||
|
||||
if vrf_afi is None:
|
||||
raise InputInvalid(
|
||||
params.messages.feature_not_enabled,
|
||||
feature=f"IPv{ip_version}",
|
||||
device_name=f"VRF {query_vrf.display_name}",
|
||||
)
|
||||
|
||||
vrf_afi = getattr(query_vrf, f"ipv{ip_version}")
|
||||
|
||||
for ace in [a for a in vrf_afi.access_list if a.network.version == ip_version]:
|
||||
if _member_of(valid_ip, ace.network):
|
||||
if query_type == "bgp_route" and _prefix_range(valid_ip, ace.ge, ace.le):
|
||||
|
Reference in New Issue
Block a user