From 78571edb4e9d5372292e1b9eacc5b569988c6ce2 Mon Sep 17 00:00:00 2001 From: thatmattlove Date: Sat, 3 Jul 2021 21:36:22 -0700 Subject: [PATCH] Closes #151: Fix issue with Junos parsing from d1160fe --- hyperglass/execution/drivers/_construct.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/hyperglass/execution/drivers/_construct.py b/hyperglass/execution/drivers/_construct.py index c9961a23..ad3f41cc 100644 --- a/hyperglass/execution/drivers/_construct.py +++ b/hyperglass/execution/drivers/_construct.py @@ -41,7 +41,6 @@ def __init__(self, device, query_data): # Set AFIs for based on query type if self.query_data.query_type in ("bgp_route", "ping", "traceroute"): - # For IP queries, AFIs are enabled (not null/None) VRF -> AFI definitions # where the IP version matches the IP version of the target. self.afis = [ @@ -52,8 +51,7 @@ def __init__(self, device, query_data): ) if v is not None and self.query_data.query_target.version == v.version ] - - with Formatter(self.device.nos, self.query_data.query_type) as formatter: + elif self.query_data.query_type in ("bgp_aspath", "bgp_community"): # For AS Path/Community queries, AFIs are just enabled VRF -> AFI # definitions, no IP version checking is performed (since there is no IP). self.afis = [ @@ -64,6 +62,8 @@ def __init__(self, device, query_data): ) if v is not None ] + + with Formatter(self.device.nos, self.query_data.query_type) as formatter: self.target = formatter(self.query_data.query_target) def json(self, afi):