Software Development Kit (SDK) and API Discussions

Python NMSDK, non utf8 zapi reply breaking api


Question for Python nmsdk maintainers...


I have reproducible case of failing registry-get zapi, where return payload is non utf8, and python nmsdk fails as described below...

It can be reproduced inhouse, see below vsim test credentials...


Any help appreciated, the problem is somewhat critical....




This is the unix apitest for problematic case:

bash-4.1$ apitest -s -X root netapp123 registry-get registry-key options.ldap.passwd


<?xml version='1.0' encoding='utf-8' ?>

<!DOCTYPE netapp SYSTEM 'file:/etc/netapp_filer.dtd'>

<netapp version="1.0" xmlns=""><registry-get><registry-key>options.ldap.passwd</registry-key></registry-get></netapp>



<?xml version='1.0' encoding='UTF-8' ?>

<!DOCTYPE netapp SYSTEM '/na_admin/netapp_filer.dtd'>

<netapp version='1.1' xmlns=''>

<results status="passed"><registry-value>{enc}ÿ</registry-value></results></netapp>


And this is failing NMSDK 5.2.1 python unit test for reference:

>>> from NaServer import *

>>> filer=""

>>> user="root"

>>> password="netapp123"

>>> s=NaServer(filer,1,1)

>>> s.set_server_type("Filer")

>>> s.set_admin_user(user,password)

>>> s.set_transport_type("HTTPS")

>>> elem=NaElement("registry-get")

>>> elem.child_add_string("registry-key","options.ldap.passwd")

>>> output=s.invoke_elem(elem)

Traceback (most recent call last):

  File "<pyshell#39>", line 1, in <module>


  File "", line 511, in invoke_elem

    return self.parse_xml(xml_response)

  File "", line 708, in parse_xml

    p.Parse(xmlresponse, 1)

ExpatError: not well-formed (invalid token): line 4, column 46


>>> elem.sprintf()



Earn Rewards for Your Review!
GPI Review Banner
All Community Forums