
--Apple-Mail=_7EAF7C88-C1BC-4F5F-800E-30A0F63EE9E8 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii I writting code to generate a VM. But I'm getting : Traceback (most recent call last): ... newvm =3D 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.= --Apple-Mail=_7EAF7C88-C1BC-4F5F-800E-30A0F63EE9E8 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=us-ascii <html><head><meta http-equiv=3D"Content-Type" content=3D"text/html = charset=3Dus-ascii"></head><body style=3D"word-wrap: break-word; = -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" = class=3D"">I writting code to generate a VM.<div class=3D""><br = class=3D""></div><div class=3D"">But I'm getting :</div><div = class=3D""><div style=3D"margin: 0px; font-size: 11px; font-family: = Menlo;" class=3D"">Traceback (most recent call last):</div><div = style=3D"margin: 0px; font-size: 11px; font-family: Menlo;" = class=3D""> ...</div><div style=3D"margin: 0px; font-size: 11px; = font-family: Menlo;" class=3D""> newvm =3D = self.api.vms.add(params.VM(**kwargs))</div><div style=3D"margin: 0px; = font-size: 11px; font-family: Menlo;" class=3D""> File = "build/bdist.macosx-10.10-x86_64/egg/ovirtsdk/infrastructure/brokers.py", = line 35195, in add</div><div style=3D"margin: 0px; font-size: 11px; = font-family: Menlo;" class=3D""> File = "build/bdist.macosx-10.10-x86_64/egg/ovirtsdk/utils/parsehelper.py", = line 53, in toXml</div><div style=3D"margin: 0px; font-size: 11px; = font-family: Menlo;" class=3D""> File = "build/bdist.macosx-10.10-x86_64/egg/ovirtsdk/xml/params.py", line = 24888, in export_</div><div style=3D"margin: 0px; font-size: 11px; = font-family: Menlo;" class=3D""> File = "build/bdist.macosx-10.10-x86_64/egg/ovirtsdk/xml/params.py", line = 24946, in exportChildren</div><div style=3D"margin: 0px; font-size: = 11px; font-family: Menlo;" class=3D"">AttributeError: 'str' object has = no attribute 'export_'</div></div><div class=3D""><br = class=3D""></div><div class=3D"">I made a bug in my call to <span = style=3D"font-family: Menlo; font-size: 11px;" class=3D"">params.VM. But = I have no way to know which argument is wrong, the message is too terse = :</span></div><div class=3D""><div class=3D""><div style=3D"margin: 0px; = font-size: 11px; font-family: Menlo;" class=3D""> = AttributeError: 'str' object has no attribute = 'export_'</div></div></div><div class=3D""><br class=3D""></div><div = class=3D"">It should be better if the given attribute name was given, it = will save me time.</div></body></html>= --Apple-Mail=_7EAF7C88-C1BC-4F5F-800E-30A0F63EE9E8--

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.

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?
After a few minutes of reflexion and deduction, I found where my mistake was, so I didn't loose too much time with this particular bug. I hope that I will not be bitten by an hard case before version 4 is out.
participants (2)
-
Fabrice Bacchella
-
Juan Hernández