Prechádzať zdrojové kódy

ZOOKEEPER-921. zkPython incorrectly checks for existence of required ACL elements (Nicholas Knight via henryr)

git-svn-id: https://svn.apache.org/repos/asf/zookeeper/trunk@1053490 13f79535-47bb-0310-9956-ffa450edef68
Henry Robinson 14 rokov pred
rodič
commit
53e4a8c971

+ 3 - 0
CHANGES.txt

@@ -218,6 +218,9 @@ IMPROVEMENTS:
 
   ZOOKEEPER-836. hostlist as string. (Thomas Koch via breed)
 
+  ZOOKEEPER-921. zkPython incorrectly checks for existence of required
+  ACL elements (Nicholas Knight via henryr)
+
 NEW FEATURES:
   ZOOKEEPER-729. Java client API to recursively delete a subtree.
   (Kay Kay via henry)

+ 3 - 3
src/contrib/zkpython/src/c/zookeeper.c

@@ -301,17 +301,17 @@ int check_is_acl(PyObject *o) {
       return 0;
     }
     entry = PyDict_GetItemString( element, "perms" );
-    if (entry == Py_None) {
+    if (entry == NULL) {
       return 0;
     }
 
     entry = PyDict_GetItemString( element, "scheme" );
-    if (entry == Py_None) {
+    if (entry == NULL) {
       return 0;
     }
 
     entry = PyDict_GetItemString( element, "id" );
-    if (entry == Py_None) {
+    if (entry == NULL) {
       return 0;
     }
   }

+ 1 - 1
src/contrib/zkpython/src/test/acl_test.py

@@ -96,7 +96,7 @@ class ACLTest(zktestbase.TestBase):
       
     def test_invalid_acl2(self):
       """Verify all required keys are present in the ACL."""
-      invalid_acl = [{"schema": "digest", "id": "zebra"}],
+      invalid_acl = [{"schema": "digest", "id": "zebra"}]
       self.assertRaises(zookeeper.InvalidACLException,
                         zookeeper.create,
                         self.handle,