Python 2.5需要一个dict,而不是dict?
# python --version
Python 2.5.5
Opensolaris衍生物(NexentaStor),尝试添加zfs权限但这个奇怪的错误阻止了我。
File "/usr/lib/python2.4/site-packages/zfs/dataset.py", line 203, in set_fsacl
return zfs.ioctl.set_fsacl(self.name, un, d)
TypeError: argument 3 must be dict, not dict
这是相关代码块,我添加了一些打印以查看类型等:
def set_fsacl(self, un, d):
"""Add to the "zfs allow"-ed permissions on this Dataset.
un is True if the specified permissions should be removed.
d is a dict specifying which permissions to add/remove:
{ "whostr" -> None # remove all perms for this entity
"whostr" -> { "perm" -> None} # add/remove these perms
} """
print self.name
print un
print d
print type(d)
return zfs.ioctl.set_fsacl(self.name, un, d)
我的print语句提供以下输出:
tank/xenserver_vol1 <-- self.name
False <-- un
{'ud$1001': {'send': None}, 'ul$1001': {'send': None}} <-- d
<type 'dict'> <-- type(d)