[ovirt-devel] ovirt-sdk get_subject() problem

Juan Hernandez jhernand at redhat.com
Wed Oct 29 09:46:16 UTC 2014


On 10/29/2014 10:40 AM, Denis Kirjanov wrote:
> Hi guys, 
> 
> I'm having a problem getting the value from the manager using vm.get_display().get_certificate().get_subject():
> It happens on VM restart and what I get is: 'NoneType' object has no attribute 'get_subject'.
> 
> It happens only with get_subject() since I don't have a problem to get other values like vm address or display port.
> Moreover, the second attempt to query the certificate subject always succeeds...
> 
> Is there a way to overcome this?
> 
> We're using ovirt 3.1 and I've found the same issue here: 
> http://lists.ovirt.org/pipermail/devel/2013-July/005221.html
> 
> Thank you.
> 

When you request the information of a VM not all the details are
populated by default, including the certificate. Thus the
"get_certificate" method returns None. If you want the certificate data
populated you have to use the "all_content" parameter of the method used
to retrieve the VM:

  vm = api.vms.get(name="myvm", all_content=True)

Then you should be able to get the certificate and the subject.

-- 
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 Devel mailing list