开发者

Is there anyway to give a Zookeeper node a NULL ACL via python-bindings?

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?


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).

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜