sos.archive
— Archive Interface¶
-
class
sos.archive.
Archive
[source] Bases:
object
Abstract base class for archives.
-
add_dir
(path)[source]
-
add_file
(src, dest=None)[source]
-
add_link
(source, link_name)[source]
-
add_node
(path, mode, device)[source]
-
add_string
(content, dest)[source]
-
classmethod
archive_type
(class_)[source] Returns the archive class’s name as a string.
-
cleanup
()[source] Clean up any temporary resources used by an Archive class.
-
finalize
(method)[source] Finalize an archive object via method. This may involve creating An archive that is subsequently compressed or simply closing an archive that supports in-line handling. If method is automatic then the following methods are tried in order: xz, bz2 and gzip
-
get_archive_path
()[source] Return a string representing the path to the temporary archive. For archive classes that implement in-line handling this will be the archive file itself. Archives that use a directory based cache prior to packaging should return the path to the temporary directory where the report content is located
-
get_tmp_dir
()[source] Return a temporary directory that clients of the archive may use to write content to. The content of the path is guaranteed to be included in the generated archive.
-
log
= <logging.Logger object>
-
log_debug
(msg)[source]
-
log_error
(msg)[source]
-
log_info
(msg)[source]
-
log_warn
(msg)[source]
-
name_max
()[source] Return the maximum file name length this archive can support. This is the lesser of the name length limit of the archive format and any temporary file system based cache.
-
set_debug
(debug)[source]
-
-
class
sos.archive.
FileCacheArchive
(name, tmpdir)[source] Bases:
sos.archive.Archive
Abstract superclass for archive types that use a temporary cache directory in the file system.
-
add_dir
(path)[source]
-
add_file
(src, dest=None)[source]
-
add_link
(source, link_name)[source]
-
add_node
(path, mode, device)[source]
-
add_string
(content, dest)[source]
-
cleanup
()[source]
-
dest_path
(name)[source]
-
finalize
(method)[source]
-
get_archive_path
()[source]
-
get_tmp_dir
()[source]
-
makedirs
(path, mode=448)[source]
-
name_max
()[source]
-
open_file
(path)[source]
-
-
class
sos.archive.
TarFileArchive
(name, tmpdir)[source] Bases:
sos.archive.FileCacheArchive
archive class using python TarFile to create tar archives
-
copy_permissions_filter
(tarinfo)[source]
-
get_selinux_context
(path)[source]
-
method
= None
-
name
()[source]
-
name_max
()[source]
-
set_tarinfo_from_stat
(tar_info, fstat, mode=None)[source]
-