nxos_banner CI fix (#29134)

Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
This commit is contained in:
Trishna Guha 2017-09-08 19:33:41 +05:30 committed by GitHub
parent 497e6cf405
commit 588bddbc35
2 changed files with 9 additions and 9 deletions

View file

@ -96,7 +96,7 @@ def map_obj_to_commands(want, have, module):
commands = list() commands = list()
state = module.params['state'] state = module.params['state']
if state == 'absent' and have.get('text'): if (state == 'absent' and (have.get('text') and have.get('text') != 'User Access Verification')):
commands.append('no banner %s' % module.params['banner']) commands.append('no banner %s' % module.params['banner'])
elif state == 'present' and want.get('text') != have.get('text'): elif state == 'present' and want.get('text') != have.get('text'):

View file

@ -1,16 +1,16 @@
--- ---
- name: Setup - name: Setup
nxos_banner: nxos_banner:
banner: exec banner: motd
text: | text: |
Junk exec banner Junk motd banner
over multiple lines over multiple lines
state: present state: present
provider: "{{ connection }}" provider: "{{ connection }}"
- name: remove exec - name: remove motd
nxos_banner: &rm-exec nxos_banner: &rm-motd
banner: exec banner: motd
state: absent state: absent
provider: "{{ connection }}" provider: "{{ connection }}"
register: result register: result
@ -18,10 +18,10 @@
- assert: - assert:
that: that:
- "result.changed == true" - "result.changed == true"
- "'no banner exec' in result.commands" - "'no banner motd' in result.commands"
- name: remove exec (idempotent) - name: remove motd (idempotent)
nxos_banner: *rm-exec nxos_banner: *rm-motd
register: result register: result
- assert: - assert: