Netconf bytes fixes (#41607)

* Solve some bytes issues on iosxr

* Solve some bytes issues in junos

* Do the correct thing with tostring based on lxml or not
This commit is contained in:
Nathaniel Case 2018-06-22 11:50:44 -04:00 committed by GitHub
commit 9aa8c652ba
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
23 changed files with 54 additions and 113 deletions

View file

@ -109,7 +109,7 @@ class NetconfConnection(Connection):
def transform_reply():
reply = '''<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
return b'''<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" indent="no"/>
<xsl:template match="/|comment()|processing-instruction()">
@ -131,10 +131,6 @@ def transform_reply():
</xsl:template>
</xsl:stylesheet>
'''
if sys.version < '3':
return reply
else:
return reply.encode('UTF-8')
# Note: Workaround for ncclient 0.5.3