From 8597b4e3a263426a0d8d622775e8bfaf7aa9744f Mon Sep 17 00:00:00 2001 From: mpenning Date: Mon, 11 Dec 2023 15:34:59 -0600 Subject: [PATCH] Fix missed code deletion --- CHANGES.md | 6 ++++++ ciscoconfparse2/ccp_abc.py | 17 +---------------- pyproject.toml | 2 +- 3 files changed, 8 insertions(+), 17 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index d848fa0..74d0fb5 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -4,6 +4,12 @@ - Summary: - Insert something here +## Version: 0.1.8 + +- Released: 2023-12-11 +- Summary: + - Fix missed code deletion + ## Version: 0.1.7 - Released: 2023-12-11 diff --git a/ciscoconfparse2/ccp_abc.py b/ciscoconfparse2/ccp_abc.py index ea8126b..96c7b8c 100644 --- a/ciscoconfparse2/ccp_abc.py +++ b/ciscoconfparse2/ccp_abc.py @@ -215,7 +215,7 @@ def text(self): def text(self, val): is_comment = getattr(self, 'is_comment', None) if isinstance(val, str): - self._text = val + self._text = self.safe_escape_curly_braces(val) self.line_id = self.calculate_line_id() if is_comment is True: @@ -448,21 +448,6 @@ def as_diff_dict(self): } return retval - # escape braces since single braces could be misunderstood as - # f-string or string.format() delimiters... - # - # Sometimes brace escaping is not required... we need better fencing - # around safe_escape_curly_braces() - newtext = self.safe_escape_curly_braces(newtext) - - # Remove all double-spacing, except for the indent spaces... - self.line_id = self.calculate_line_id() - - if self.is_comment is True: - # VERY IMPORTANT: due to old behavior, comment parents MUST be self - # - self.parent = self - # On BaseCfgLine() @logger.catch(reraise=True) def safe_escape_curly_braces(self, text): diff --git a/pyproject.toml b/pyproject.toml index 5452709..fe02478 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -23,7 +23,7 @@ requires-python = ">=3.8.0" [tool.poetry] name = "ciscoconfparse2" -version = "0.1.7" +version = "0.1.8" description = "Parse, Audit, Query, Build, and Modify Cisco IOS-style and JunOS-style configs" license = "GPL-3.0-only" authors = [