]> granicus.if.org Git - zfs/commit
Import pyzfs source code from ClusterHQ
authorAndriy Gapon <avg@FreeBSD.org>
Sat, 3 Mar 2018 10:10:34 +0000 (11:10 +0100)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Tue, 1 May 2018 17:31:11 +0000 (10:31 -0700)
commit6abf922574f39ad597ae122fa43d2fa811970720
tree59b197db57e2b881af2a846da0c6b201013811cc
parent3cbe89b12a55a0ff350d7434834f4f48227896a3
Import pyzfs source code from ClusterHQ

libzfs_core is intended to be a stable interface for programmatic
administration of ZFS.

This wrapper provides one-to-one wrappers for libzfs_core API functions,
but the signatures and types are more natural to Python.
nvlists are wrapped as dictionaries or lists depending on their usage.
Some parameters have default values depending on typical use for
increased convenience.
Enumerations and bit flags become strings and lists of strings in
Python.
Errors are reported as exceptions rather than integer errno-style
error codes.  The wrapper takes care to provide one-to-many mapping
of the error codes to the exceptions by interpreting a context
in which the error code is produced.

Unit tests and automated test for the libzfs_core API are provided
with this package.

Please note that the API tests perform lots of ZFS dataset level
operations and ZFS tries hard to ensure that any modifications
do reach stable storage. That means that the operations are done
synchronously and that, for example, disk caches are flushed.
Thus, the tests can be very slow on real hardware.
It is recommended to place the default temporary directory or
a temporary directory specified by, for instance, TMP environment
variable on a memory backed filesystem.

Original-patch-by: Andriy Gapon <avg@FreeBSD.org>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Ported-by: loli10K <ezomori.nozomu@gmail.com>
Signed-off-by: loli10K <ezomori.nozomu@gmail.com>
Closes #7230
18 files changed:
contrib/pyzfs/LICENSE [new file with mode: 0644]
contrib/pyzfs/README [new file with mode: 0644]
contrib/pyzfs/docs/source/conf.py [new file with mode: 0644]
contrib/pyzfs/docs/source/index.rst [new file with mode: 0644]
contrib/pyzfs/libzfs_core/__init__.py [new file with mode: 0644]
contrib/pyzfs/libzfs_core/_constants.py [new file with mode: 0644]
contrib/pyzfs/libzfs_core/_error_translation.py [new file with mode: 0644]
contrib/pyzfs/libzfs_core/_libzfs_core.py [new file with mode: 0644]
contrib/pyzfs/libzfs_core/_nvlist.py [new file with mode: 0644]
contrib/pyzfs/libzfs_core/bindings/__init__.py [new file with mode: 0644]
contrib/pyzfs/libzfs_core/bindings/libnvpair.py [new file with mode: 0644]
contrib/pyzfs/libzfs_core/bindings/libzfs_core.py [new file with mode: 0644]
contrib/pyzfs/libzfs_core/ctypes.py [new file with mode: 0644]
contrib/pyzfs/libzfs_core/exceptions.py [new file with mode: 0644]
contrib/pyzfs/libzfs_core/test/__init__.py [new file with mode: 0644]
contrib/pyzfs/libzfs_core/test/test_libzfs_core.py [new file with mode: 0644]
contrib/pyzfs/libzfs_core/test/test_nvlist.py [new file with mode: 0644]
contrib/pyzfs/setup.py [new file with mode: 0644]