mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-04-25 03:41:25 -07: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:
parent
d4b9105c9c
commit
b84adfd885
5 changed files with 21 additions and 8 deletions
|
@ -125,6 +125,7 @@ class Cliconf(CliconfBase):
|
|||
|
||||
@enable_mode
|
||||
def edit_config(self, candidate=None, commit=True, replace=False, diff=False, comment=None):
|
||||
resp = {}
|
||||
if not candidate:
|
||||
raise ValueError("must provide a candidate config to load")
|
||||
|
||||
|
@ -154,7 +155,9 @@ class Cliconf(CliconfBase):
|
|||
if diff:
|
||||
diff_config = candidate
|
||||
|
||||
return diff_config, results[1:-1]
|
||||
resp['diff'] = diff_config
|
||||
resp['response'] = results[1:-1]
|
||||
return json.dumps(resp)
|
||||
|
||||
def get(self, command=None, prompt=None, answer=None, sendonly=False):
|
||||
if not command:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue