pod_porter.util package
Submodules
pod_porter.util.directories module
utilities for directories
pod_porter.util.file_read_write module
utility functions for reading and writing files
- pod_porter.util.file_read_write.create_new_map(map_name_and_path: str) None[source]
Create a new map
- Parameters:
map_name_and_path (str) – The full path to create the new map
- Return type:
None
- Returns:
Nothing it creates the new map
- pod_porter.util.file_read_write.create_tar_gz_file(path: str, file_name: str, output_path: str) None[source]
Create a tar.gz file
- Parameters:
path (str) – The path to the directory to tar.gz
file_name (str) – The name of the file
output_path (str) – The path to save the tar.gz file
- Return type:
None
- Returns:
Nothing it creates the tar.gz file
- pod_porter.util.file_read_write.extract_tar_gz_file(path: str, output_path: str) None[source]
Extract a tar.gz file
- Parameters:
path (str) – The full path to the tar.gz
output_path (str) – The path to save the extracted files
- Return type:
None
- Returns:
Nothing it extracts the tar.gz file
- pod_porter.util.file_read_write.get_ignore_patterns(ignore_file_path: str) list[source]
Get the list of files and directories to ignore
- Parameters:
ignore_file_path (str) – The path to the ignore file
- Return type:
list
- Returns:
A list of files and directories to ignore
- pod_porter.util.file_read_write.should_ignore(path: str, patterns: list) bool[source]
Check if a file or directory should be ignored
- Parameters:
path (str) – The full path to the file or directory
patterns (list) – The list of files and directories to ignore
- Return type:
bool
- Returns:
True if the file or directory should be ignored, False otherwise
- pod_porter.util.file_read_write.write_file(path: str, file_name: str, data: str) None[source]
Write data to a file
- Parameters:
path (str) – The path to the file
file_name (str) – The name of the file
data (str) – The data to write to the file
- Return type:
None
- Returns:
Nothing it writes the data to the file
pod_porter.util.schemas module
Specific Data Schemas for the Pod Porter Application
- class pod_porter.util.schemas.MapSchema(api_version: Literal['v1'], name: str, description: str, version: str, app_version: str)[source]
Bases:
_BaseSchemaMap.yaml Schema
- Variables:
api_version – Name of the Inventory
name – Name of the Inventory
description – Description of the Inventory
version – Description of the Inventory
app_version – Description of the Inventory
- api_version: Literal['v1']
- app_version: str
- description: str
- name: str
- version: str