fix nxos edit_config for httpapi and have uniform load_config (#41358)

* fix nxos load_config for httpapi and migrate to cliconf

Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>

* add comment

Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>

* address review comment

Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>

* address review comment

Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
This commit is contained in:
Trishna Guha 2018-06-14 22:02:12 +05:30 committed by GitHub
commit f170298332
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 12 additions and 5 deletions

View file

@ -80,8 +80,15 @@ class HttpApi:
# Migrated from module_utils
def edit_config(self, command):
resp = list()
responses = self.send_request(command, output='config')
return json.dumps(responses)
for response in to_list(responses):
if response != '{}':
resp.append(response)
if not resp:
resp = ['']
return json.dumps(resp)
def run_commands(self, commands, check_rc=True):
"""Runs list of commands on remote device and returns results