Filesystem represents abstract API definition. It is now implemented by
Utility methods used to access filesystem of containers and images.
Implementations should probably be done using context managers.
- object_instance – instance of the container or image
- mount_point – str, directory where the filesystem will be mounted
copy a file or a directory from container or image to host system. If you are copying directories, the target directory must not exist (this function is using shutil.copytree to copy directories and that’s a requirement of the function). In case the directory exists, OSError on python 2 or FileExistsError on python 3 are raised.
- src – str, path to a file or a directory within container or image
- dest – str, path to a file or a directory on host system
copy a file or a directory from host system to a container – don’t implement for images, those are immutable
- src – str, path to a file or a directory on host system
- dest – str, path to a file or a directory within container
check if directory ‘directory_path’ is present, raise IOError if it’s not a directory
Parameters: directory_path – str, directory to check Returns: True if directory exists, False if directory does not exist
check if file ‘file_path’ is present, raises IOError if file_path is not a file
Parameters: file_path – str, path to the file Returns: True if file exists, False if file does not exist
provide File object specified via ‘file_path’
- file_path – str, path to the file
- mode – str, mode used when opening the file
Get SELinux file context of the selected file.
Parameters: file_path – str, path to the file Returns: str, name of the SELinux file context
provide absolute path within the container
Parameters: path – path with container Returns: str
read file specified via ‘file_path’ and return its content - raises an ConuException if there is an issue accessing the file
Parameters: file_path – str, path to the file to read Returns: str (not bytes), content of the file