[node-patches] Change in ovirt-node[master]: ssh: Fix password_authentication return value
fabiand at fedoraproject.org
fabiand at fedoraproject.org
Mon Jul 1 17:58:33 UTC 2013
Fabian Deutsch has uploaded a new change for review.
Change subject: ssh: Fix password_authentication return value
......................................................................
ssh: Fix password_authentication return value
Change-Id: Ie398c84e0e6b62dbe2cf55a3086538b9bc6af9ef
Signed-off-by: Fabian Deutsch <fabiand at fedoraproject.org>
---
M src/ovirt/node/utils/security.py
1 file changed, 8 insertions(+), 1 deletion(-)
git pull ssh://gerrit.ovirt.org:29418/ovirt-node refs/changes/02/16302/1
diff --git a/src/ovirt/node/utils/security.py b/src/ovirt/node/utils/security.py
index 629521f..651d5c4 100644
--- a/src/ovirt/node/utils/security.py
+++ b/src/ovirt/node/utils/security.py
@@ -144,6 +144,13 @@
process.call("service sshd restart &>/dev/null")
def password_authentication(self, enable=None):
+ """Get or set the ssh password authentication
+
+ Args:
+ enable: (optional) If given the auth is set
+ Returns:
+ True if password authentication is enabled, False otherwise
+ """
augpath = "/files/etc/ssh/sshd_config/PasswordAuthentication"
aug = utils.AugeasWrapper()
if enable in [True, False]:
@@ -154,7 +161,7 @@
aug.set(augpath, value)
ofunc.ovirt_store_config("/etc/ssh/sshd_config")
self.restart()
- return aug.get(augpath)
+ return str(aug.get(augpath)).lower() == "yes"
def get_hostkey(self, variant="rsa"):
fn_hostkey = "/etc/ssh/ssh_host_%s_key.pub" % variant
--
To view, visit http://gerrit.ovirt.org/16302
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie398c84e0e6b62dbe2cf55a3086538b9bc6af9ef
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-node
Gerrit-Branch: master
Gerrit-Owner: Fabian Deutsch <fabiand at fedoraproject.org>
More information about the node-patches
mailing list