Repository: libcloud Updated Branches: refs/heads/trunk a60e070a0 -> 74a2ce762
added documentation updated the constructor documentation and added description for the callback function. Project: http://git-wip-us.apache.org/repos/asf/libcloud/repo Commit: http://git-wip-us.apache.org/repos/asf/libcloud/commit/9118eb53 Tree: http://git-wip-us.apache.org/repos/asf/libcloud/tree/9118eb53 Diff: http://git-wip-us.apache.org/repos/asf/libcloud/diff/9118eb53 Branch: refs/heads/trunk Commit: 9118eb533f1e788f325ed0065de6dcd461799fd1 Parents: 901ff36 Author: René Kjellerup <rk.katana.st...@gmail.com> Authored: Fri Jun 10 17:26:26 2016 -0700 Committer: Anthony Shaw <anthonys...@apache.org> Committed: Fri Jun 24 13:56:08 2016 +1000 ---------------------------------------------------------------------- libcloud/compute/drivers/libvirt_driver.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/libcloud/blob/9118eb53/libcloud/compute/drivers/libvirt_driver.py ---------------------------------------------------------------------- diff --git a/libcloud/compute/drivers/libvirt_driver.py b/libcloud/compute/drivers/libvirt_driver.py index 7216538..40ef0a9 100644 --- a/libcloud/compute/drivers/libvirt_driver.py +++ b/libcloud/compute/drivers/libvirt_driver.py @@ -68,6 +68,12 @@ class LibvirtNodeDriver(NodeDriver): :param uri: Hypervisor URI (e.g. vbox:///session, qemu:///system, etc.). :type uri: ``str`` + + :param key: the username for a remote libvirtd server + :type key: ``str`` + + :param secret: the password for a remote libvirtd server + :type key: ``str`` """ if not have_libvirt: raise RuntimeError('Libvirt driver requires \'libvirt\' Python ' + @@ -88,6 +94,18 @@ class LibvirtNodeDriver(NodeDriver): self.connection = libvirt.openAuth(uri, auth, 0) def _cred_callback(self, cred, user_data): + """ + Callback for the authentication scheme, which will provide username + and password for the login. Reference: ( http://bit.ly/1U5yyQg ) + + :param cred: The credentials requested and the return + :type cred: ``list`` + + :param user_data: Custom data provided to the authentication routine + :type user_data: ``list`` + + :rtype: ``int`` + """ for credential in cred: if credential[0] == libvirt.VIR_CRED_AUTHNAME: credential[4] = self._key