[Engine-devel] about ovirt-engine-sdk

leaboy@126 wlbleaboy at 126.com
Thu May 2 02:52:33 UTC 2013


Hi,all

         How can I use overt-engine-sdk in the python environment below
python2.7,

For example, when I use it in python 2.6.5 like thus:

 

percy at percy-desktop:~/thtf-client$ python --version

Python 2.6.5

percy at percy-desktop:~/thtf-client$ python

Python 2.6.5 (r265:79063, Oct  1 2012, 22:04:36) 

[GCC 4.4.3] on linux2

Type "help", "copyright", "credits" or "license" for more information.

>>> from ovirtsdk.api import API

>>> from ovirtsdk.xml import params

>>> api = API('http://192.168.1.181', 'admin at internal', '111111', None,
None, '~/.spicec/ca.crt', None, None, True)

Traceback (most recent call last):

  File "<stdin>", line 1, in <module>

  File "ovirtsdk/api.py", line 107, in __init__

    url='/api')

  File "ovirtsdk/infrastructure/proxy.py", line 129, in request

    last=last)

  File "ovirtsdk/infrastructure/proxy.py", line 171, in __doRequest

    return params.parseString(response_body) if response_body is not None
and response_body is not '' \

  File "ovirtsdk/xml/params.py", line 21229, in parseString

    rootObj.build(rootNode)

  File "ovirtsdk/xml/params.py", line 20304, in build

    self.buildAttributes(node, node.attrib, [])

  File "ovirtsdk/xml/params.py", line 20309, in buildAttributes

    super(API, self).buildAttributes(node, attrs, already_processed)

  File "ovirtsdk/xml/params.py", line 4160, in buildAttributes

    value = find_attr_value_('xsi:type', node)

  File "ovirtsdk/xml/params.py", line 316, in find_attr_value_

    namespace = node.nsmap.get(prefix)

AttributeError: nsmap

>>> 

 

 

But, when I use it in python 2.7.3, it's ok

 

leaboy at leaboy:~/workspace/thtf-client$ python --version

Python 2.7.3

leaboy at leaboy:~/workspace/thtf-client$ python

Python 2.7.3 (default, Aug  1 2012, 05:16:07) 

[GCC 4.6.3] on linux2

Type "help", "copyright", "credits" or "license" for more information.

>>> from ovirtsdk.api import API

>>> from ovirtsdk.xml import params

>>> api = API('http://192.168.1.181', 'admin at internal', '111111', None,
None, '~/.spicec/ca.crt', None, True)

>>> 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ovirt.org/pipermail/devel/attachments/20130502/8a93581e/attachment-0001.html>


More information about the Devel mailing list