zfs/contrib/pyzfs
Brian Behlendorf 4b1c4062d0 pyzfs: python3 support (unit tests)
* Updated unit tests to be compatbile with python 2 or 3.  In most
  cases all that was required was to add the 'b' prefix to existing
  strings to convert them to type bytes for python 3 compatibility.

* There were several places where the python version need to be
  checked to remain compatible with pythong 2 and 3.  Some one
  more seasoned with Python may be able to find a way to rewrite
  these statements in a compatible fashion.

Reviewed-by: John Ramsden <johnramsden@riseup.net>
Reviewed-by: Neal Gompa <ngompa@datto.com>
Reviewed-by: loli10K <ezomori.nozomu@gmail.com>
Signed-off-by: John Wren Kennedy <john.kennedy@delphix.com>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #8096
2019-01-06 10:39:41 -08:00
..
docs/source Adopt pyzfs from ClusterHQ 2018-05-01 10:33:35 -07:00
libzfs_core pyzfs: python3 support (unit tests) 2019-01-06 10:39:41 -08:00
.gitignore Add pyzfs build directories to gitignore 2018-06-11 18:42:12 -07:00
LICENSE Adopt pyzfs from ClusterHQ 2018-05-01 10:33:35 -07:00
Makefile.am Add pyzfs build directories to gitignore 2018-06-11 18:42:12 -07:00
README Adopt pyzfs from ClusterHQ 2018-05-01 10:33:35 -07:00
requirements.txt Adopt pyzfs from ClusterHQ 2018-05-01 10:33:35 -07:00
setup.py pyzfs: python3 support (library 1/2) 2019-01-06 10:39:41 -08:00

README

This package provides a wrapper for libzfs_core C library.

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.

Package documentation: http://pyzfs.readthedocs.org
Package development: https://github.com/zfsonlinux/zfs