Merge pull request #16496 from privateip/stable-2.1

fixes minor issue with expanding blocks in netcfg
This commit is contained in:
Peter Sprygada 2016-06-29 06:48:33 -07:00 committed by GitHub
commit e826d3c7d7

View file

@ -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):