eos_l2_interface handle "Interface does not exist" (#56787)

* Quick and dirty attempt to handle eapi error

* Well this should probably change

* Hopefully this works correctly?

* Fix check_rc handling with httpapi

* Add tests that should hopefully cover the error

* Fix warnings

* Improve tests
This commit is contained in:
Nathaniel Case
2019-05-23 07:32:47 -04:00
committed by Nilashish Chakraborty
parent 5005c353ef
commit cebb363fcc
4 changed files with 78 additions and 7 deletions

View File

@@ -449,10 +449,10 @@ class HttpApi:
def run_queue(queue, output):
try:
response = to_list(self._connection.send_request(queue, output=output))
except Exception as exc:
except ConnectionError as exc:
if check_rc:
raise
return to_text(exc)
return to_list(to_text(exc))
if output == 'json':
response = [json.loads(item) for item in response]