[ovirt-users] debuging Python SDK

Juan Hernández jhernand at redhat.com
Mon Apr 11 10:44:05 UTC 2016


On 04/11/2016 12:24 PM, Fabrice Bacchella wrote:
> I writting code to generate a VM.
> 
> But I'm getting :
> Traceback (most recent call last):
>   ...
>     newvm = self.api.vms.add(params.VM(**kwargs))
>   File
> "build/bdist.macosx-10.10-x86_64/egg/ovirtsdk/infrastructure/brokers.py", line
> 35195, in add
>   File
> "build/bdist.macosx-10.10-x86_64/egg/ovirtsdk/utils/parsehelper.py",
> line 53, in toXml
>   File "build/bdist.macosx-10.10-x86_64/egg/ovirtsdk/xml/params.py",
> line 24888, in export_
>   File "build/bdist.macosx-10.10-x86_64/egg/ovirtsdk/xml/params.py",
> line 24946, in exportChildren
> AttributeError: 'str' object has no attribute 'export_'
> 
> I made a bug in my call to params.VM. But I have no way to know which
> argument is wrong, the message is too terse :
>     AttributeError: 'str' object has no attribute 'export_'
> 
> It should be better if the given attribute name was given, it will save
> me time.
> 

Unfortunately we can't improve that area of the code, because that
"params.py" file is automatically generated using the generateDS.py
tool, and those are the errors it generates.

In version 4 of the SDK (which will work only with version 4 of the
engine) we will use a different approach to generate the code, which
will enable us to do improvements in this area.

Are you still having trouble? Can you share the code that is causing the
error?

-- 
Dirección Comercial: C/Jose Bardasano Baos, 9, Edif. Gorbea 3, planta
3ºD, 28016 Madrid, Spain
Inscrita en el Reg. Mercantil de Madrid – C.I.F. B82657941 - Red Hat S.L.



More information about the Users mailing list