[node-patches] Change in ovirt-node[node-3.0]: Add elif statement to check password == "" and confirmation ...

fabiand at fedoraproject.org fabiand at fedoraproject.org
Wed Mar 5 11:27:17 UTC 2014


Hello hadong,

I'd like you to do a code review.  Please visit

    http://gerrit.ovirt.org/25397

to review the following change.

Change subject: Add elif statement to check password == "" and confirmation != ""
......................................................................

Add elif statement to check password == "" and confirmation != ""

Change-Id: Ief86f1d922111c1f5b2e5a9e1d990b0064b8a329
Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=1063188
Signed-off-by: hadong <hadong0720 at gmail.com>
---
M src/ovirt/node/utils/security.py
1 file changed, 9 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-node refs/changes/97/25397/1

diff --git a/src/ovirt/node/utils/security.py b/src/ovirt/node/utils/security.py
old mode 100644
new mode 100755
index f9bf0ec..5fea49c
--- a/src/ovirt/node/utils/security.py
+++ b/src/ovirt/node/utils/security.py
@@ -58,17 +58,23 @@
 
     >>> password_check("foo", "")
     Traceback (most recent call last):
-    ValueError: Please Confirm Password
+    ValueError: Please Check Password Confirmation
+
+    >>> password_check("", "foo", 0)
+    Traceback (most recent call last):
+    ValueError: Please Check Password
     '''
     message = None
 
-    if len(password) is 0 and min_length is 0:
+    if len(password) is 0 and len(confirmation) is 0 and min_length is 0:
         pass
     elif len(password) < min_length:
         raise ValueError("Password must be at least %d characters" %
                          min_length)
     elif password != "" and confirmation == "":
-        raise ValueError("Please Confirm Password")
+        raise ValueError("Please Check Password Confirmation")
+    elif password == "" and confirmation != "":
+        raise ValueError("Please Check Password")
     elif password != confirmation:
         raise ValueError("Passwords Do Not Match")
     else:


-- 
To view, visit http://gerrit.ovirt.org/25397
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ief86f1d922111c1f5b2e5a9e1d990b0064b8a329
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-node
Gerrit-Branch: node-3.0
Gerrit-Owner: Fabian Deutsch <fabiand at fedoraproject.org>
Gerrit-Reviewer: hadong <hadong0720 at gmail.com>



More information about the node-patches mailing list