From 7b5095cbfc19072b243a1951d0e2dfcdc474f049 Mon Sep 17 00:00:00 2001 From: mpenning Date: Thu, 16 Nov 2023 17:27:28 -0600 Subject: [PATCH] Add is_switchport property --- ciscoconfparse/models_junos.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/ciscoconfparse/models_junos.py b/ciscoconfparse/models_junos.py index 3c75ea1..a8dd966 100644 --- a/ciscoconfparse/models_junos.py +++ b/ciscoconfparse/models_junos.py @@ -229,6 +229,18 @@ def is_subintf(self): return True return False + # This method is on JunosCfgLine() + @property + @logger.catch(reraise=True) + def is_switchport(self): + """Return True if this is a switchport interface""" + if self.is_intf is True: + for cobj in self.all_children: + if "family ethernet-switching" in cobj.text: + return True + return False + + # This method is on JunosCfgLine() @property @logger.catch(reraise=True)