From 425537861a1e84f83f4230be3d42ba059193aea0 Mon Sep 17 00:00:00 2001 From: Nathaniel Case Date: Wed, 6 Dec 2017 05:24:58 -0500 Subject: [PATCH] Fix some net_* tests (#33593) * Fix typo in net_logging/eos * This seems to be required to use eos_user in this way * Fix indentation in net_static_route/eos * Rework interface check in eos_vrf This should do the right thing. --- lib/ansible/modules/network/eos/eos_vrf.py | 2 +- test/integration/targets/net_logging/tests/eos/basic.yaml | 2 +- .../integration/targets/net_static_route/tests/eos/basic.yaml | 4 ++-- .../integration/targets/net_user/tests/eos/userprivilege.yaml | 1 + 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/lib/ansible/modules/network/eos/eos_vrf.py b/lib/ansible/modules/network/eos/eos_vrf.py index ab73451bd9a..6c4406b7533 100644 --- a/lib/ansible/modules/network/eos/eos_vrf.py +++ b/lib/ansible/modules/network/eos/eos_vrf.py @@ -237,7 +237,7 @@ def check_declarative_intent_params(want, module): for i in w['interfaces']: obj_in_have = search_obj_in_list(w['name'], have) - if obj_in_have and 'interfaces' in obj_in_have and i not in obj_in_have['interfaces']: + if obj_in_have and i not in obj_in_have.get('interfaces', []): module.fail_json(msg="Interface %s not configured on vrf %s" % (i, w['name'])) diff --git a/test/integration/targets/net_logging/tests/eos/basic.yaml b/test/integration/targets/net_logging/tests/eos/basic.yaml index 70122b4ad36..6cec56e3aae 100644 --- a/test/integration/targets/net_logging/tests/eos/basic.yaml +++ b/test/integration/targets/net_logging/tests/eos/basic.yaml @@ -84,7 +84,7 @@ net_logging: aggregate: - { dest: console, level: warnings, state: absent } - - { dest: monitor, level: debuggning, state: absent } + - { dest: monitor, level: debugging, state: absent } authorize: yes provider: "{{ cli }}" register: result diff --git a/test/integration/targets/net_static_route/tests/eos/basic.yaml b/test/integration/targets/net_static_route/tests/eos/basic.yaml index d5f5ffb9c21..0d5b07f4478 100644 --- a/test/integration/targets/net_static_route/tests/eos/basic.yaml +++ b/test/integration/targets/net_static_route/tests/eos/basic.yaml @@ -59,8 +59,8 @@ aggregate: - { address: 192.168.4.0/24, next_hop: 192.168.0.1 } - { address: 192.168.5.0/24, next_hop: 192.168.0.1 } - authorize: yes - provider: "{{ cli }}" + authorize: yes + provider: "{{ cli }}" register: result - assert: diff --git a/test/integration/targets/net_user/tests/eos/userprivilege.yaml b/test/integration/targets/net_user/tests/eos/userprivilege.yaml index 9ad6b67bbfb..07918554e48 100644 --- a/test/integration/targets/net_user/tests/eos/userprivilege.yaml +++ b/test/integration/targets/net_user/tests/eos/userprivilege.yaml @@ -2,6 +2,7 @@ - name: Set user to privilege level 15 net_user: name: netop + nopassword: yes privilege: 15 state: present authorize: yes