utils.supported_systems.py

SingletonSupportedSystems Objects

class SingletonSupportedSystems()

This class is a sigleton object for SupportedSystems class

SupportedSystems Objects

class SupportedSystems(SingletonSupportedSystems)

This class saves and checks path of the env selected by user.

reset_params

def reset_params()

Reset varibles of path, used when they are errors

get_entire_path

def get_entire_path()

The method checks and return the complete environment path else raise Exception

Raises:

  • PathDoesNotExist - If the specified path does not exist
  • VariablePathNotDefined - If variables are not filled

Returns:

  • str - The complete environment path selected by the user

set_playbooks_location

def set_playbooks_location(path: str)

Check and set the location of the playbook directory

Arguments:

  • path str - The path of the playbook location

Raises:

  • PathDoesNotExist - If the specified path does not exist
  • VariablePathNotDefined - If variables are not filled

get_os

def get_os() -> list[str]

Search for OS directories contained in the playbook directory

Raises:

  • VariablePathNotDefined - If variable are not filled

Returns:

  • list[str] - The list of OS availables in {playbook}/

get_os_type

def get_os_type() -> list[str]

Search for OS type directories contained in the OS directory selected

Raises:

  • PathDoesNotExist - If the specified path does not exist
  • VariablePathNotDefined - If variables are not filled

Returns:

  • list[str] - The list of OS type availables in {playbook}/{OS}/

get_os_version

def get_os_version() -> list[str]

Search for OS version directories contained in the OS type selected

Raises:

  • PathDoesNotExist - If the specified path does not exist
  • VariablePathNotDefined - If variables are not filled

Returns:

  • list[str] - The list of OS version availables in {playbook}/{OS}/{OS_TYPE}/

set_os

def set_os(os: str) -> None

Set the OS selected by the user

Arguments:

  • os str - OS name selected

Raises:

  • VariablePathNotDefined - If variables are not filled

set_os_type

def set_os_type(os_type: str)

Set the OS type selected by the user

Arguments:

  • os_type str - OS type name selected

Raises:

  • PathDoesNotExist - If the specified path does not exist
  • VariablePathNotDefined - If variables are not filled

set_os_version

def set_os_version(os_version: str)

Set the OS version selected by the user

Arguments:

  • os_version str - OS version name selected

Raises:

  • PathDoesNotExist - If the specified path does not exist
  • VariablePathNotDefined - If variables are not filled