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:
Deepak Agrawal 2018-09-12 07:50:24 +05:30 committed by GitHub
commit 81214409cf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 278 additions and 0 deletions

View file

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