mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-06-28 03:00:23 -07:00
Merge pull request #16587 from privateip/netcfg
minor bug fixes found in netcfg
This commit is contained in:
commit
7d53fd2ef2
1 changed files with 7 additions and 6 deletions
|
@ -133,7 +133,8 @@ class NetworkConfig(object):
|
||||||
|
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
if self._device_os == 'junos':
|
if self._device_os == 'junos':
|
||||||
return self.to_lines(self.expand(self.items))
|
lines = self.to_lines(self.expand(self.items))
|
||||||
|
return '\n'.join(lines)
|
||||||
return self.to_block(self.expand(self.items))
|
return self.to_block(self.expand(self.items))
|
||||||
|
|
||||||
def load(self, contents):
|
def load(self, contents):
|
||||||
|
@ -188,12 +189,12 @@ class NetworkConfig(object):
|
||||||
visited.add(o)
|
visited.add(o)
|
||||||
return expanded
|
return expanded
|
||||||
|
|
||||||
def to_lines(self, section):
|
def to_lines(self, objects):
|
||||||
lines = list()
|
lines = list()
|
||||||
for entry in section[1:]:
|
for obj in objects:
|
||||||
line = ['set']
|
line = list()
|
||||||
line.extend([p.text for p in entry.parents])
|
line.extend([p.text for p in obj.parents])
|
||||||
line.append(entry.text)
|
line.append(obj.text)
|
||||||
lines.append(' '.join(line))
|
lines.append(' '.join(line))
|
||||||
return lines
|
return lines
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue