Skip to content

Commit

Permalink
Rename from _reassign_linenums() to reassign_linenums()
Browse files Browse the repository at this point in the history
  • Loading branch information
mpenning committed Oct 10, 2023
1 parent f0b8835 commit 450d652
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions ciscoconfparse/ciscoconfparse.py
Original file line number Diff line number Diff line change
Expand Up @@ -2853,8 +2853,6 @@ class ALL
retval.append(obj.re_sub(linespec, replacestr))

if self.factory and atomic:
# self.ConfigObjs._reassign_linenums()
#self.ConfigObjs._bootstrap_from_text()
self.ConfigObjs._list = self.ConfigObjs._bootstrap_obj_init_ng(self.ioscfg)

return retval
Expand Down Expand Up @@ -2943,8 +2941,6 @@ def replace_children(
pass

if self.factory and atomic:
# self.ConfigObjs._reassign_linenums()
#self.ConfigObjs._bootstrap_from_text()
self.ConfigObjs._list = self.ConfigObjs._bootstrap_obj_init_ng(self.ioscfg)
return retval

Expand Down Expand Up @@ -2979,8 +2975,6 @@ def replace_all_children(
pass

if self.factory and atomic:
# self.ConfigObjs._reassign_linenums()
#self.ConfigObjs._bootstrap_from_text()
self.ConfigObjs._list = self.ConfigObjs._bootstrap_obj_init_ng(self.ioscfg)

return retval
Expand Down Expand Up @@ -4850,7 +4844,7 @@ def insert_before(self, exist_val, new_val, atomic=False):

else:
## Just renumber lines...
self._reassign_linenums()
self.reassign_linenums()

# This method is on ConfigList()
@junos_unsupported
Expand Down Expand Up @@ -4962,7 +4956,7 @@ def insert_after(self, exist_val="", new_val="", atomic=False, new_val_indent=-1
self._list = self._bootstrap_obj_init_ng(self.ioscfg)
else:
## Just renumber lines...
self._reassign_linenums()
self.reassign_linenums()

# This method is on ConfigList()
@junos_unsupported
Expand Down Expand Up @@ -4998,7 +4992,7 @@ def insert(self, ii, val):
self._list.insert(ii, obj)

## Just renumber lines...
self._reassign_linenums()
self.reassign_linenums()

# This method is on ConfigList()
def config_hierarchy(self):
Expand Down Expand Up @@ -5378,7 +5372,7 @@ def iter_no_comments(self, begin_index=0):
yield obj

# This method is on ConfigList()
def _reassign_linenums(self):
def reassign_linenums(self):
# Call this after any insertion or deletion
for idx, obj in enumerate(self._list):
obj.linenum = idx
Expand Down

0 comments on commit 450d652

Please sign in to comment.