Merge pull request #16496 from privateip/stable-2.1
fixes minor issue with expanding blocks in netcfg
This commit is contained in:
commit
e826d3c7d7
1 changed files with 13 additions and 2 deletions
|
@ -227,11 +227,22 @@ class NetworkConfig(object):
|
|||
updates.extend(config)
|
||||
break
|
||||
|
||||
updates = self.expand(updates)
|
||||
|
||||
if self._device_os == 'junos':
|
||||
return updates
|
||||
|
||||
changes = list()
|
||||
for update in updates:
|
||||
if replace == 'block':
|
||||
if update.parents:
|
||||
changes.append(update.parents[-1])
|
||||
for child in update.parents[-1].children:
|
||||
changes.append(child)
|
||||
else:
|
||||
changes.append(update)
|
||||
else:
|
||||
changes.append(update)
|
||||
updates = self.expand(changes)
|
||||
|
||||
return [item.text for item in self.expand(updates)]
|
||||
|
||||
def _build_children(self, children, parents=None, offset=0):
|
||||
|
|
Loading…
Reference in a new issue