multiple fixes nxos (#32903)

Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
This commit is contained in:
Trishna Guha
2017-11-14 15:23:11 +00:00
committed by GitHub
parent 177a4fb3ec
commit 3ee2501c83
5 changed files with 14 additions and 13 deletions

View File

@@ -21,8 +21,8 @@
local_file: "./nxos.yaml"
file_system: "bootflash:"
provider: "{{ cli }}"
username: "{{ nxos_cli_user | default('admin') }}"
password: "{{ nxos_cli_pass | default('admin') }}"
username: "{{ ansible_ssh_user }}"
password: "{{ ansible_ssh_pass }}"
host: "{{ ansible_host }}"
register: result
@@ -48,8 +48,8 @@
remote_file: "nxos.yaml"
file_system: "bootflash:"
provider: "{{ cli }}"
username: "{{ nxos_cli_user | default('admin') }}"
password: "{{ nxos_cli_pass | default('admin') }}"
username: "{{ ansible_ssh_user }}"
password: "{{ ansible_ssh_pass }}"
host: "{{ ansible_host }}"
register: result

View File

@@ -23,8 +23,8 @@
local_file: "./nxos.yaml"
file_system: "bootflash:"
provider: "{{ nxapi }}"
username: "{{ nxos_nxapi_user | default('admin') }}"
password: "{{ nxos_nxapi_pass | default('admin') }}"
username: "{{ ansible_ssh_user }}"
password: "{{ ansible_ssh_pass }}"
host: "{{ ansible_host }}"
register: result
@@ -51,8 +51,8 @@
remote_file: "nxos.yaml"
file_system: "bootflash:"
provider: "{{ nxapi }}"
username: "{{ nxos_nxapi_user | default('admin') }}"
password: "{{ nxos_nxapi_pass | default('admin') }}"
username: "{{ ansible_ssh_user }}"
password: "{{ ansible_ssh_pass }}"
host: "{{ ansible_host }}"
register: result

View File

@@ -62,14 +62,12 @@ class TestNxosInterfaceModule(TestNxosModule):
def test_nxos_interface_up(self):
set_module_args(dict(interface='loopback0'))
result = self.execute_module(changed=True)
self.assertIn('interface loopback0', result['commands'])
self.assertIn('no shutdown', result['commands'])
self.assertEqual(result['commands'], ['interface loopback0', 'no shutdown'])
def test_nxos_interface_down(self):
set_module_args(dict(interface='loopback0', admin_state='down'))
result = self.execute_module(changed=True)
self.assertIn('interface loopback0', result['commands'])
self.assertIn('shutdown', result['commands'])
self.assertEqual(result['commands'], ['interface loopback0', 'shutdown'])
def test_nxos_interface_delete(self):
set_module_args(dict(interface='loopback0', state='absent'))