Skip to content

Commit

Permalink
Add is_switchport property
Browse files Browse the repository at this point in the history
  • Loading branch information
mpenning committed Nov 16, 2023
1 parent 93223af commit 7b5095c
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions ciscoconfparse/models_junos.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 7b5095c

Please sign in to comment.