Skip to content

Commit

Permalink
Return error message when available with xnm:error elements
Browse files Browse the repository at this point in the history
  • Loading branch information
shermdog committed Jul 24, 2015
1 parent 65e9ee1 commit 8f2d6d3
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/netconify/tty_netconf.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,4 +187,9 @@ def _receive(self):
as_xml = etree.XML(''.join(rxbuf))
return as_xml
except:
return etree.XML('<error-in-receive/>')
if '</xnm:error>' in rxbuf:
for x in rxbuf:
if '<message>' in x:
return etree.XML('<error-in-receive>' + x + '</error-in-receive>')
else:
return etree.XML('<error-in-receive/>')

0 comments on commit 8f2d6d3

Please sign in to comment.