mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-04-25 03:41:25 -07:00
nxos cliconf plugin refactor (#43203)
* nxos cliconf plugin refactor Fixes #39056 * Refactor nxos cliconf plugin as per new api definition * Minor changes in ios, eos, vyos cliconf plugin * Change nxos httpapi plugin edit_config method to be in sync with nxos cliconf edit_config * Fix CI failure * Fix unit test failure and review comment
This commit is contained in:
parent
e215f842ba
commit
af3f510316
16 changed files with 426 additions and 245 deletions
|
@ -72,17 +72,22 @@ class HttpApi(HttpApiBase):
|
|||
return responses[0]
|
||||
return responses
|
||||
|
||||
# Migrated from module_utils
|
||||
def edit_config(self, command):
|
||||
def edit_config(self, candidate=None, commit=True, replace=None, comment=None):
|
||||
resp = list()
|
||||
responses = self.send_request(command, output='config')
|
||||
|
||||
operations = self.connection.get_device_operations()
|
||||
self.connection.check_edit_config_capabiltiy(operations, candidate, commit, replace, comment)
|
||||
if replace:
|
||||
candidate = 'config replace {0}'.format(replace)
|
||||
|
||||
responses = self.send_request(candidate, output='config')
|
||||
for response in to_list(responses):
|
||||
if response != '{}':
|
||||
resp.append(response)
|
||||
if not resp:
|
||||
resp = ['']
|
||||
|
||||
return json.dumps(resp)
|
||||
return 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