Skip to content

Commit

Permalink
Remove dead code
Browse files Browse the repository at this point in the history
  • Loading branch information
mpenning committed Oct 13, 2023
1 parent f554237 commit 8458b2f
Showing 1 changed file with 0 additions and 51 deletions.
51 changes: 0 additions & 51 deletions ciscoconfparse/ccp_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -2957,7 +2957,6 @@ def __init__(self, interface_name=None):
groupdict = mm.groupdict()
self._prefix = groupdict.get("prefix", '').strip()
_intf_all = groupdict["all"].strip()
logger.info(f"Parsing {_intf_all}")

# Handle non-subinterface / non-channel interfaces...
mm = re.search(r"^(?P<all>(?P<slot>\d+)(?P<sep1>[^\:^\.])?(?P<card>\d+)?(?P<sep2>[^\:^\.])?(?P<port>\d+)?)", _intf_all)
Expand Down Expand Up @@ -3046,37 +3045,6 @@ def __init__(self, interface_name=None):
logger.critical(error)
raise ValueError(error)

######################################################################
# Detect the digit separator
######################################################################
if False:
if isinstance(self._number, str):
nn = re.search(r"^\d+(?P<digit_separator>[^\d\-\:\.])*\d*", self._number)
if nn is not None:
groupdict = nn.groupdict()
self._digit_separator = groupdict.get("digit_separator", None)
self._number_list = [int(ii) for ii in self._number.split(self._digit_separator)]
if len(self._number_list) == 1:
self._port = self._number_list[-1]
elif len(self._number_list) == 2:
self._slot = self._number_list[0]
self._port = self._number_list[1]
elif len(self._number_list) == 3:
self._slot = self._number_list[0]
self._card = self._number_list[1]
self._port = self._number_list[2]
else:
error = f"Could not parse _number_list: {self._number_list}"
logger.critical(error)
raise ValueError(error)
else:
error = f"Could not parse _number: {self._number}"
logger.critical(error)
raise ValueError(error)
else:
self._digit_separator = None
self._port = int(self._number)

def __eq__(self, other):
try:
## try / except is usually faster than isinstance();
Expand Down Expand Up @@ -3383,8 +3351,6 @@ def parse_text_list(self, text):
end_ordinal = int(raw_part.split("-")[1].strip())
else:
end_ordinal = None
if False:
end_ordinal = CiscoInterface(raw_part.strip())

##################################################################
# Reference interface is for the base starting interface instance
Expand All @@ -3396,23 +3362,6 @@ def parse_text_list(self, text):
expanded_interfaces.append(copy.deepcopy(reference_interface))
continue

if False and "-" not in raw_part:
############################################################
# Handle non-interface-range appends here...
############################################################
if isinstance(reference_interface.channel, int):
reference_interface.channel = raw_part
expanded_interfaces.append(copy.deepcopy(reference_interface))
continue
elif isinstance(reference_interface.subinterface, int):
reference_interface.subinterface = raw_part
expanded_interfaces.append(copy.deepcopy(reference_interface))
continue
else:
reference_interface.port = raw_part
expanded_interfaces.append(copy.deepcopy(reference_interface))
continue

if idx > 0:
if isinstance(reference_interface.channel, int):
#############################################################
Expand Down

0 comments on commit 8458b2f

Please sign in to comment.