Fix ios_user issues (#44904)

* Fix ios_user issues

* Modify regex and fix unittests
This commit is contained in:
Nilashish Chakraborty 2018-08-31 11:08:46 +05:30 committed by GitHub
parent 7d81de2516
commit 0f268e70a1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 18 additions and 27 deletions

View file

@ -61,10 +61,7 @@ class TestIosUserModule(TestIosModule):
{
"command": "no username ansible", "answer": "y", "newline": False,
"prompt": "This operation will remove all username related configurations with same name",
},
'ip ssh pubkey-chain',
' no username ansible',
' exit'
}
]
result_cmd = []
@ -124,11 +121,10 @@ class TestIosUserModule(TestIosModule):
set_module_args(dict(name='ansible', sshkey='dGVzdA=='))
commands = [
'ip ssh pubkey-chain',
' no username ansible',
' username ansible',
' key-hash ssh-rsa 098F6BCD4621D373CADE4E832627B4F6',
' exit',
' exit'
'username ansible',
'key-hash ssh-rsa 098F6BCD4621D373CADE4E832627B4F6',
'exit',
'exit'
]
result = self.execute_module(changed=True, commands=commands)
self.assertEqual(result['commands'], commands)