[ovirt-users] bug with ConsoleWriter ?

Fabrice Bacchella fabrice.bacchella at orange.fr
Fri Apr 21 15:26:10 UTC 2017


I'm trying to dump informations about console with the following code:

vm = vms_service.list(search='name=fa41')[0]

# Find the service that manages the graphics consoles of the virtual machine:
vm_service = vms_service.vm_service(vm.id)
consoles_service = vm_service.graphics_consoles_service()
console_type = consoles_service.list()[0]

console_type = connection.follow_link(console_type)
buf = None
writer = None
buf = io.BytesIO()
writer = xml.XmlWriter(buf, indent=True)
ConsoleWriter.write_one(console_type, writer)
writer.flush()
print buf.getvalue()
But i got the following result :

Traceback (most recent call last):
  File "./export_console.py", line 69, in <module>
    ConsoleWriter.write_one(console_type, writer)
  File ".../venv/lib/python2.7/site-packages/ovirtsdk4/writers.py", line 1262, in write_one
    if obj.enabled is not None:

If I add print console_type.__dict__, it contains:

{'_address': None, '_instance_type': None, '_href': '/ovirt-engine/api/vms/61a6de0a-2a21-4e90-bc20-29e3f0cd0ad8/graphicsconsoles/7370696365', '_description': None, '_tls_port': None, '_comment': None, '_port': None, '_name': None, '_vm': <ovirtsdk4.types.Vm object at 0x1032e4310>, '_protocol': <GraphicsType.SPICE: 'spice'>, '_template': None, '_id': '7370696365'}


Did I miss something, or is that a but with the console writer ? 


More information about the Users mailing list