Revert "eos_config: Added fix for bug #54400 - support for !! in config mode (#63694)" (#66591)

This actually breaks iosxr_config, revert for now to make tests passing
again.

This reverts commit 7ddf7474d3.
pull/66601/head
Paul Belanger 5 years ago committed by GitHub
parent 5db00a05b6
commit f46af19702
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -164,6 +164,7 @@ class NetworkConfig(object):
self._indent = indent
self._items = list()
self._config_text = None
if ignore_lines:
for item in ignore_lines:
if not isinstance(item, Pattern):
@ -219,16 +220,15 @@ class NetworkConfig(object):
config = list()
indents = [0]
for linenum, line in enumerate(to_native(lines, errors='surrogate_or_strict').split('\n')):
text = entry_reg.sub('', line).strip()
cfg = ConfigLine(line)
if not text or ignore_line(text, comment_tokens):
# To accomodate !! comments in config mode
if "!!" in text:
pass
else:
continue
continue
# handle top level commands
if toplevel.match(line):
ancestors = [cfg]
@ -377,6 +377,7 @@ class NetworkConfig(object):
expanded.append(p)
expanded.append(item)
visited.add(item.line)
return expanded
def add(self, lines, parents=None):

@ -1,5 +1,4 @@
ip access-list test
!! Adding comment
10 permit ip host 192.168.0.2 host 192.168.0.1
20 permit ip host 192.168.0.1 host 192.168.0.2
!

Loading…
Cancel
Save