mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-07 13:52:54 +00:00
Fix ios and vyos cliconf edit_config return type (#41896)
* Fix ios and vyos cliconf edit_config return type Modify cliconf edit_config api to return a json string with diff and response received from remote host for ios and vyos. * Doc change
This commit is contained in:
@@ -166,7 +166,8 @@ def load_config(module, commands):
|
||||
connection = get_connection(module)
|
||||
|
||||
try:
|
||||
diff, response = connection.edit_config(commands)
|
||||
return response
|
||||
resp = connection.edit_config(commands)
|
||||
resp = json.loads(resp)
|
||||
return resp.get('response')
|
||||
except ConnectionError as exc:
|
||||
module.fail_json(msg=to_text(exc))
|
||||
|
||||
@@ -133,7 +133,9 @@ def load_config(module, commands, commit=False, comment=None):
|
||||
connection = get_connection(module)
|
||||
|
||||
try:
|
||||
diff_config, resp = connection.edit_config(candidate=commands, commit=commit, diff=module._diff, comment=comment)
|
||||
resp = connection.edit_config(candidate=commands, commit=commit, diff=module._diff, comment=comment)
|
||||
resp = json.loads(resp)
|
||||
diff_config = resp.get('diff')
|
||||
except ConnectionError as exc:
|
||||
module.fail_json(msg=to_text(exc))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user