Hi, Can anyone please share sample Python code for using qemu+tcp with SASL or qemu+tls with SASL? (i.e., connecting to a hypervisor using qemu+tls or qemu+tcp when a username/password using SASL has been defined on the hypervisor) I am having some trouble figuring out how to use callbacks for authenticating from with my Python program. I assume I will have to use?http://libvirt.org/html/libvirt-libvirt.html#virConnectCredentialType, but I can't quite translate that to Python from C. Thanks -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://listman.redhat.com/archives/libvirt-users/attachments/20120502/d24a7565/attachment.htm>
On 05/02/2012 03:00 PM, John Wayne wrote:> Hi, > > Can anyone please share sample Python code for using qemu+tcp with > SASL or qemu+tls with SASL? (i.e., connecting to a hypervisor using > qemu+tls or qemu+tcp when a username/password using SASL has been > defined on the hypervisor)Hi John, The following scripts shoud be what you want: http://libvirt.org/git/?p=libvirt-test-API.git;a=tree;f=repos/remoteAccess;h=f9581f65a1ea6cd04dd9ffb43f214034a12ff3d4;hb=5b50d4be8976f5cc0c7ea4d66a389b189c8ca5e0> > I am having some trouble figuring out how to use callbacks for > authenticating from with my Python program. > I assume I will have to > use http://libvirt.org/html/libvirt-libvirt.html#virConnectCredentialType, > but I can't quite translate that to Python from C. > > Thanks > > > _______________________________________________ > libvirt-users mailing list > libvirt-users at redhat.com > https://www.redhat.com/mailman/listinfo/libvirt-users-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://listman.redhat.com/archives/libvirt-users/attachments/20120502/4158e9b6/attachment.htm>
https://www.redhat.com/archives/libvirt-users/2012-May/msg00005.html? When I run the sample code with the case of ?Python code for using qemu+tcp with SASL, I always got this SASL error: Traceback (most recent call last): ? File "esxList.py", line 102, in ? ? ? conn = libvirt.openAuth(uri, auth, 0) ? File "/usr/lib/python2.4/site-packages/libvirt.py", line 102, in openAuth ? ? if ret is None:raise libvirtError('virConnectOpenAuth() failed') libvirt.libvirtError: authentication failed: Failed to start SASL negotiation: -4 (SASL(-4): no mechanism available:? I have no problem to run the C&java code with qemu+tcp with SASL. Is it possible an error of Python binding? Thanks, -Hubert -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://listman.redhat.com/archives/libvirt-users/attachments/20120521/75fa3cf3/attachment.htm>