Actually fix eos_facts feature detection (#43155)

This commit is contained in:
Nathaniel Case 2018-07-23 14:51:44 -04:00 committed by GitHub
commit 8a0967554f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 3 deletions

View file

@ -213,12 +213,13 @@ class Cliconf(CliconfBase):
if check_rc:
raise
out = getattr(e, 'err', e)
out = to_text(out, errors='surrogate_or_strict')
if out is not None:
try:
out = json.loads(out)
except ValueError:
out = to_text(out, errors='surrogate_or_strict').strip()
out = out.strip()
responses.append(out)
return responses