Question

I'm trying to create a node using the python bindings that are bundled with the zookeeper distribution ( src/contrib/zkpython/ ). Using zookeeper-3.3.1.

The pydoc for create states that if the ACL is NULL then that node will inherit its parents ACL however setting this parameter to None causes an invalid ACL exception.

I've taken a look at parse_acls in zookeeper.c and it seems to conflict with the pydoc but I don't have much experience with py c api.

If I can't set this ACL to null is there some other ACL that will cause it to inherit from a parent?

Was it helpful?

Solution

I had the same problem and found no solution. As workaround you could add an additional step. Example:

import zookeeper as zk
parent_path = "/"
stat, acl = zk.get_acl(zoohandle, parent_path)
ret = zk.create(zoohandle, node_path, "", acl, 0)

Further tip: In zookeeper-3.3.1 the zk.get() only returns up to 512 bytes of the node data. This should be fixed in the next release (3.3.3).

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top