Skip to content

Commit

Permalink
Backport PR for fixing IOS static route TC CI failure (#56294)
Browse files Browse the repository at this point in the history
* To fix IOS static route CI failure (#56292)

* ios static failure

Signed-off-by: Sumit Jaiswal <sjaiswal@redhat.com>

* fix CI failure

Signed-off-by: Sumit Jaiswal <sjaiswal@redhat.com>
(cherry picked from commit 3fdc4ba)

* adding BP changelog

Signed-off-by: Sumit Jaiswal <sjaiswal@redhat.com>

* adding endline in changelog

Signed-off-by: Sumit Jaiswal <sjaiswal@redhat.com>
  • Loading branch information
justjais authored and abadger committed May 21, 2019
1 parent 17dacf7 commit 1e0f140
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 2 additions & 0 deletions changelogs/fragments/56292-ios-static-route-ci-failure.yaml
@@ -0,0 +1,2 @@
bugfixes:
- To fix the ios static route TC failure in CI - https://github.com/ansible/ansible/pull/56292
6 changes: 4 additions & 2 deletions lib/ansible/modules/network/ios/ios_static_route.py
Expand Up @@ -61,7 +61,6 @@
admin_distance:
description:
- Admin distance of the static route.
default: 1
tag:
description:
- Set tag of the static route.
Expand Down Expand Up @@ -149,6 +148,9 @@ def map_obj_to_commands(want, have):
del w['state']
# Try to match an existing config with the desired config
for h in have:
# To delete admin_distance param from have if not it want before comparing both fields
if not w.get('admin_distance') and h.get('admin_distance'):
del h['admin_distance']
diff = list(set(w.items()) ^ set(h.items()))
if not diff:
break
Expand Down Expand Up @@ -259,7 +261,7 @@ def main():
vrf=dict(type='str'),
interface=dict(type='str'),
name=dict(type='str', aliases=['description']),
admin_distance=dict(type='str', default='1'),
admin_distance=dict(type='str'),
track=dict(type='str'),
tag=dict(tag='str'),
state=dict(default='present', choices=['present', 'absent'])
Expand Down

0 comments on commit 1e0f140

Please sign in to comment.