Bug 1124795

Summary: Creating vm from sdk fails due to "TypeError: export()"
Product: [Retired] oVirt Reporter: Ori Gofen <ogofen>
Component: ovirt-engine-sdkAssignee: Juan Hernández <juan.hernandez>
Status: CLOSED DUPLICATE QA Contact: Pavel Stehlik <pstehlik>
Severity: urgent Docs Contact:
Priority: urgent    
Version: 3.5CC: acanan, acathrow, bugs, ecohen, gklein, iheim, rnori, yeylon
Target Milestone: ---Keywords: AutomationBlocker, Regression
Target Release: 3.5.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard: virt
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-08-11 16:35:21 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: Virt RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Bug Depends On:    
Bug Blocks: 1073943    

Description Ori Gofen 2014-07-30 10:33:10 UTC
Description of problem:

creating vm from py-sdk fails with message:

Traceback (most recent call last):
  File "<input>", line 1, in <module>
  File "/usr/lib/python2.6/site-packages/ovirtsdk/infrastructure/brokers.py", line 22895, in add
    body=ParseHelper.toXml(vm),
  File "/usr/lib/python2.6/site-packages/ovirtsdk/utils/parsehelper.py", line 74, in toXml
    entity.export(output, 0, name_=ParseHelper.getXmlTypeInstance(type_name))
  File "/usr/lib/python2.6/site-packages/ovirtsdk/xml/params.py", line 20933, in export
    self.exportChildren(outfile, level + 1, namespace_, name_, pretty_print=pretty_print)
  File "/usr/lib/python2.6/site-packages/ovirtsdk/xml/params.py", line 20979, in exportChildren
    self.template.export(outfile, level, namespace_, name_='template', pretty_print=pretty_print)
TypeError: export() takes at most 3 non-keyword arguments (4 given)

this affects all my py-scripts and, of-course ,art.

code executed:

>>> param=params.VM(name='class_is_broken',cluster=api.clusters.list()[0],template=api.templates.get(name='Blank'))
>>> api.vms.add(param)
Traceback (most recent call last):
  File "<input>", line 1, in <module>
  File "/usr/lib/python2.6/site-packages/ovirtsdk/infrastructure/brokers.py", line 22895, in add ...

when trying to execute instead:

>>> tmp=params.Template(name='Blank')
>>> param=params.VM(name='class_is_broken',cluster=api.clusters.list()[0],template=tmp)
>>> api.vms.add(param)

the object successfully created
Version-Release number of selected component (if applicable):


How reproducible:
100%

Steps to Reproduce:
see description

Actual results:
operation of creating vm fails from sdk,this breaks all of my scripts

Expected results:
operation should be successful 

Additional info:

Comment 1 Ravi Nori 2014-08-11 16:35:21 UTC

*** This bug has been marked as a duplicate of bug 1122546 ***