mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-07 13:52:54 +00:00
httpapi fix nxos (#40806)
* httpapi fix nxos Signed-off-by: Trishna Guha <trishnaguha17@gmail.com> * nxos_hsrp fix Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
This commit is contained in:
@@ -94,8 +94,11 @@ class Cliconf(CliconfBase):
|
||||
def get_capabilities(self):
|
||||
result = {}
|
||||
result['rpc'] = self.get_base_rpc()
|
||||
result['network_api'] = 'cliconf'
|
||||
result['device_info'] = self.get_device_info()
|
||||
if isinstance(self._connection, NetworkCli):
|
||||
result['network_api'] = 'cliconf'
|
||||
else:
|
||||
result['network_api'] = 'eapi'
|
||||
return json.dumps(result)
|
||||
|
||||
# Imported from module_utils
|
||||
|
||||
@@ -95,8 +95,11 @@ class Cliconf(CliconfBase):
|
||||
def get_capabilities(self):
|
||||
result = {}
|
||||
result['rpc'] = self.get_base_rpc()
|
||||
result['network_api'] = 'cliconf'
|
||||
result['device_info'] = self.get_device_info()
|
||||
if isinstance(self._connection, NetworkCli):
|
||||
result['network_api'] = 'cliconf'
|
||||
else:
|
||||
result['network_api'] = 'nxapi'
|
||||
return json.dumps(result)
|
||||
|
||||
# Migrated from module_utils
|
||||
|
||||
@@ -89,9 +89,13 @@ class HttpApi:
|
||||
out = to_text(exc)
|
||||
|
||||
out = to_list(out)
|
||||
if not out[0]:
|
||||
return out
|
||||
|
||||
for index, response in enumerate(out):
|
||||
if response[0] == '{':
|
||||
out[index] = json.loads(response)
|
||||
|
||||
return out
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user