Re: python setMetadata issue

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Dec 24, 2013, at 2:13 AM, Umar Draz <unix.co@xxxxxxxxx> wrote:

Hi

I am trying to set Metada of running virtual machine, but its giving me an error.

Thanks for taking the time to report a potential issue. When you report potential issues please make sure to include the version of libvirt you are using. 

Here is my code

import libvirt

conn = libvirt.open('qemu+tcp://10.0.128.12/system')
dom = conn.lookupByName('virtspace')
type = 'VIR_DOMAIN_METADATA_DESCRIPTION'

The type value is not a string, it should be libvirt.VIR_DOMAIN_METADATA_DESCRIPTION
key = ''
uri = ''

The above values must be set to None for when setting the description per the documentation.

dom.setMetadata(conn, type, 'myDescription', key, uri)


and here is the error.

Traceback (most recent call last):
  File "setMeta.py", line 11, in <module>
    dom.setMetadata(conn, type, 'meta_test', key, uri)
  File "/usr/lib64/python2.6/site-packages/libvirt.py", line 1460, in setMetadata
    ret = libvirtmod.virDomainSetMetadata(self._o, type, metadata, key, uri, flags)
AttributeError: virConnect instance has no attribute '__trunc__'

Definitely curious what version you used since we should not error like this despite the argument mix up.
--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]