mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-10-05 07:54:00 -07:00
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:
parent
0d885260a5
commit
f170298332
3 changed files with 12 additions and 5 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue