zfs: add __repr__

main
svalouch 5 years ago
parent e329be5523
commit a692425f5f

@ -62,6 +62,9 @@ class ZFS:
self.pe_helper = pe_helper
self.use_pe_helper = use_pe_helper
def __repr__(self) -> str:
return f'<ZFS(pe_helper="{self._pe_helper}", use_pe_helper="{self._use_pe_helper}")>'
@property
def metadata_namespace(self) -> Optional[str]:
'''

@ -33,6 +33,9 @@ class ZFSCli(ZFS):
super().__init__(metadata_namespace=metadata_namespace)
self.find_executable(path=zfs_exe)
def __repr__(self) -> str:
return f'<ZFSCli(exe="{self.__exe}", pe_helper="{self._pe_helper}", use_pe_helper="{self._use_pe_helper}")>'
def find_executable(self, path: str = None):
'''
Tries to find the executable ``zfs(8)``. If ``path`` points to an executable, it is used instead of relying on

@ -22,6 +22,9 @@ class ZFSNative(ZFS):
use_pe_helper: bool = False, **kwargs) -> None:
super().__init__(metadata_namespace=metadata_namespace)
def __repr__(self) -> str:
return f'<ZFSNative(pe_helper="{self._pe_helper}", use_pe_helper="{self._use_pe_helper}")>'
def set_property(self, dataset: str, key: str, value: str, *, metadata: bool = False, overwrite_metadata_namespace: Optional[str] = None) -> None:
raise NotImplementedError

Loading…
Cancel
Save