Skip to content

Commit

Permalink
get zfs_userspace error from correct handle (#222)
Browse files Browse the repository at this point in the history
We should be getting error from libzfs handle and not dataset handle.
```
File "libzfs.pyx", line 461, in libzfs.ZFS.__exit__
  File "/usr/local/lib/python3.9/dist-packages/middlewared/plugins/zfs.py", line 743, in get_quota
    quotas = resource.userspace(quota_props)
  File "libzfs.pyx", line 3523, in libzfs.ZFSResource.userspace
AttributeError: 'libzfs.ZFSDataset' object has no attribute 'get_error'
```
  • Loading branch information
anodos325 authored Dec 15, 2022
1 parent 1a1f5d3 commit 1a99a45
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion libzfs.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -3529,7 +3529,7 @@ cdef class ZFSResource(ZFSObject):
with nogil:
ret = libzfs.zfs_userspace(self.handle, prop, ZFSResource._userspace_cb, <void*>result)
if ret:
raise self.get_error()
raise self.root.get_error()
results[quota_prop] = result
return results

Expand Down

0 comments on commit 1a99a45

Please sign in to comment.