From 8458b2ff64de071e7f87388df17260d6caca16ea Mon Sep 17 00:00:00 2001 From: mpenning Date: Thu, 12 Oct 2023 22:40:11 -0500 Subject: [PATCH] Remove dead code --- ciscoconfparse/ccp_util.py | 51 -------------------------------------- 1 file changed, 51 deletions(-) diff --git a/ciscoconfparse/ccp_util.py b/ciscoconfparse/ccp_util.py index 5f17cba2..c1506838 100644 --- a/ciscoconfparse/ccp_util.py +++ b/ciscoconfparse/ccp_util.py @@ -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(?P\d+)(?P[^\:^\.])?(?P\d+)?(?P[^\:^\.])?(?P\d+)?)", _intf_all) @@ -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[^\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(); @@ -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 @@ -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): #############################################################