mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-24 22:00:22 -07:00
Actually fix eos_facts feature detection (#43155)
This commit is contained in:
parent
1d5f881f5c
commit
8a0967554f
3 changed files with 4 additions and 3 deletions
|
@ -239,7 +239,7 @@ class Eapi:
|
||||||
|
|
||||||
return response
|
return response
|
||||||
|
|
||||||
def run_commands(self, commands):
|
def run_commands(self, commands, check_rc=True):
|
||||||
"""Runs list of commands on remote device and returns results
|
"""Runs list of commands on remote device and returns results
|
||||||
"""
|
"""
|
||||||
output = None
|
output = None
|
||||||
|
|
|
@ -153,7 +153,7 @@ class FactsBase(object):
|
||||||
self.responses = None
|
self.responses = None
|
||||||
|
|
||||||
def populate(self):
|
def populate(self):
|
||||||
self.responses = run_commands(self.module, list(self.COMMANDS))
|
self.responses = run_commands(self.module, list(self.COMMANDS), check_rc=False)
|
||||||
|
|
||||||
|
|
||||||
class Default(FactsBase):
|
class Default(FactsBase):
|
||||||
|
|
|
@ -213,12 +213,13 @@ class Cliconf(CliconfBase):
|
||||||
if check_rc:
|
if check_rc:
|
||||||
raise
|
raise
|
||||||
out = getattr(e, 'err', e)
|
out = getattr(e, 'err', e)
|
||||||
|
out = to_text(out, errors='surrogate_or_strict')
|
||||||
|
|
||||||
if out is not None:
|
if out is not None:
|
||||||
try:
|
try:
|
||||||
out = json.loads(out)
|
out = json.loads(out)
|
||||||
except ValueError:
|
except ValueError:
|
||||||
out = to_text(out, errors='surrogate_or_strict').strip()
|
out = out.strip()
|
||||||
|
|
||||||
responses.append(out)
|
responses.append(out)
|
||||||
return responses
|
return responses
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue