Libvirt Python Bindings - Remote Connection using openAuth.

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

 



Hi,
I am using libvirt with python binding, and I want to connect to a remote host.
I was able to connect after making ssh certificate, but It is not applicable for my project.
So I want to use openAuth() method, but I could not succeed connecting to a remote host using it.

Here is my code 
------------------------

import libvirt

USER = "root"
PASS = "mypasswd"

def authcb(credentials, user_data):
    for credential in credentials:
        if credential[0] == libvirt.VIR_CRED_AUTHNAME:
            credential[4] = USER
        elif credential[0] == libvirt.VIR_CRED_PASSPHRASE:
            credential[4] = PASS
    return 0

auth = [[libvirt.VIR_CRED_AUTHNAME, libvirt.VIR_CRED_PASSPHRASE], authcb, None]
conn = libvirt.openAuth("qemu+ssh://192.168.1.21/system", auth, 0)

print conn.getHostname()
-------------------------------
If there is something wrong, how am I supposed to use it.

If its not the right place to get libvirt-python related help, from where can I get it.


Regards
Sijo





_______________________________________________
libvirt-users mailing list
libvirt-users@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvirt-users

[Index of Archives]     [Virt Tools]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [KDE Users]

  Powered by Linux