是否有办法通过 python 绑定为 Zookeeper 节点提供 NULL ACL?

发布于 2024-10-05 16:22:25 字数 425 浏览 0 评论 0原文

我正在尝试使用与 Zookeeper 发行版( src/contrib/zkpython/ )捆绑在一起的 python 绑定创建一个节点。使用zookeeper-3.3.1。

create 的 pydoc 指出,如果 ACL 为 NULL,则该节点将继承其父级 ACL,但是将此参数设置为 None 会导致无效 ACL 异常。

我查看了 Zookeeper.c 中的 parse_acls 似乎与 pydoc 冲突,但我对 py c api 没有太多经验。

如果我无法将此 ACL 设置为 null,是否还有其他 ACL 会导致它从父级继承?

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?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

狼性发作 2024-10-12 16:22:25

我遇到了同样的问题,但没有找到解决方案。作为解决方法,您可以添加一个额外的步骤。示例:

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

进一步提示:在zookeeper-3.3.1 中,zk.get() 最多仅返回 512 字节的节点数据。这应该在下一版本 (3.3.3) 中修复。

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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文