jceel / py-libzfs

Python libzfs bindings
16 stars 8 forks source link

get_dataset_by_path seems broken. #20

Closed skarekrow closed 7 years ago

skarekrow commented 7 years ago

Using: 8f2f2a57eb4eae3e9695f40a89519dd753c07fa7

>>> import libzfs
>>> zfs = libzfs.ZFS()
>>> import os
>>> print(os.isdir("/ioc-test"))
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: module 'os' has no attribute 'isdir'
>>> print(os.path.isdir("/ioc-test"))
True
>>> zfs.get_dataset_by_path("/ioc-test")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "libzfs.pyx", line 610, in libzfs.ZFS.get_dataset_by_path (libzfs.c:19643)
NameError: name 'zfs' is not defined
>>> for z in zfs.pools: print(z)
...
<libzfs.ZFSPool name 'ioc-test' guid '18073337850464079031'>
<libzfs.ZFSPool name 'zroot' guid '7937033650599865382'>