mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-06 21:32:49 +00:00
eos_config: Fix test issues (#56180)
* Alter tests to pass * Change diff_against to make changed work again * Add another diff_against * Expose supports_sessions across all EOS connection types * Change session warning to failure * supports_sessions needs to be a method to survive the rpc boundary * Alter tests to match
This commit is contained in:
committed by
Sumit Jaiswal
parent
a7bf728555
commit
0bead3672f
@@ -396,6 +396,10 @@ def main():
|
||||
flags = ['all'] if module.params['defaults'] else []
|
||||
connection = get_connection(module)
|
||||
|
||||
# Refuse to diff_against: session if essions are disabled
|
||||
if module.params['diff_against'] == 'session' and not connection.supports_sessions:
|
||||
module.fail_json(msg="Cannot diff against sessions when sessions are disabled. Please change diff_against to another value")
|
||||
|
||||
if module.params['backup'] or (module._diff and module.params['diff_against'] == 'running'):
|
||||
contents = get_config(module, flags=flags)
|
||||
config = NetworkConfig(indent=1, contents=contents)
|
||||
|
||||
Reference in New Issue
Block a user