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:
Ganesh Nalawade 2018-06-25 15:35:39 +05:30 committed by GitHub
parent d4b9105c9c
commit b84adfd885
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 21 additions and 8 deletions

View file

@ -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: