mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-24 22:00:22 -07:00
asa_config/ios_config: diff strict does not work with multiple parents (#45150)
* multiple parents issues in diff * Integration tests for missing functionality * add testcase for other platforms. vnxos does not support qos so need to find a command chain on v-nxos for multiple parets. junos uses on-device diff so should not need this. * Fix for issue when any candidate parent did not meet the exact line in running-config * DCI runs eos_config without become flag
This commit is contained in:
parent
004621ef8e
commit
81214409cf
5 changed files with 278 additions and 0 deletions
|
@ -296,6 +296,14 @@ class NetworkConfig(object):
|
|||
|
||||
def _diff_strict(self, other):
|
||||
updates = list()
|
||||
# block extracted from other does not have all parents
|
||||
# but the last one. In case of multiple parents we need
|
||||
# to add additional parents.
|
||||
if other and isinstance(other, list) and len(other) > 0:
|
||||
start_other = other[0]
|
||||
if start_other.parents:
|
||||
for parent in start_other.parents:
|
||||
other.insert(0, ConfigLine(parent))
|
||||
for index, line in enumerate(self.items):
|
||||
try:
|
||||
if str(line).strip() != str(other[index]).strip():
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue