asa: Not all modules will have 'passwords' and 'context' keys (#54783)
* Add a check of passwords Signed-off-by: NilashishC <nilashishchakraborty8@gmail.com> * Add caution for context key as well Signed-off-by: NilashishC <nilashishchakraborty8@gmail.com> * Update lib/ansible/module_utils/network/asa/asa.py Co-Authored-By: NilashishC <nilashishchakraborty8@gmail.com> * Update lib/ansible/module_utils/network/asa/asa.py Co-Authored-By: NilashishC <nilashishchakraborty8@gmail.com>
This commit is contained in:
parent
4f0ad57934
commit
40507220b4
1 changed files with 4 additions and 2 deletions
|
@ -86,7 +86,8 @@ def get_connection(module):
|
|||
return _CONNECTION
|
||||
_CONNECTION = Connection(module._socket_path)
|
||||
|
||||
context = module.params['context']
|
||||
# Not all modules include the 'context' key.
|
||||
context = module.params.get('context')
|
||||
|
||||
if context:
|
||||
if context == 'system':
|
||||
|
@ -130,7 +131,8 @@ def run_commands(module, commands, check_rc=True):
|
|||
def get_config(module, flags=None):
|
||||
flags = [] if flags is None else flags
|
||||
|
||||
passwords = module.params['passwords']
|
||||
# Not all modules include the 'passwords' key.
|
||||
passwords = module.params.get('passwords', False)
|
||||
if passwords:
|
||||
cmd = 'more system:running-config'
|
||||
else:
|
||||
|
|
Loading…
Reference in a new issue