fixes #3274
This commit is contained in:
parent
f30f4674e4
commit
bff7cb6cad
1 changed files with 8 additions and 7 deletions
|
@ -20,7 +20,7 @@ DOCUMENTATION = """
|
||||||
---
|
---
|
||||||
module: nxos_config
|
module: nxos_config
|
||||||
version_added: "2.1"
|
version_added: "2.1"
|
||||||
author: "Peter sprygada (@privateip)"
|
author: "Peter Sprygada (@privateip)"
|
||||||
short_description: Manage Cisco NXOS configuration sections
|
short_description: Manage Cisco NXOS configuration sections
|
||||||
description:
|
description:
|
||||||
- Cisco NXOS configurations use a simple block indent file sytanx
|
- Cisco NXOS configurations use a simple block indent file sytanx
|
||||||
|
@ -221,15 +221,16 @@ def main():
|
||||||
config = module.parse_config(contents)
|
config = module.parse_config(contents)
|
||||||
|
|
||||||
if parents:
|
if parents:
|
||||||
for parent in parents:
|
_config = list()
|
||||||
for item in config:
|
for item in config:
|
||||||
if item.text == parent:
|
p = [p.text for p in item.parents]
|
||||||
config = item
|
if parents == p:
|
||||||
|
_config.append(item)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
children = [c.text for c in config.children]
|
children = [c.text for c in _config.children]
|
||||||
except AttributeError:
|
except AttributeError:
|
||||||
children = [c.text for c in config]
|
children = [c.text for c in _config]
|
||||||
|
|
||||||
else:
|
else:
|
||||||
children = [c.text for c in config if not c.parents]
|
children = [c.text for c in config if not c.parents]
|
||||||
|
|
Loading…
Reference in a new issue