electrolyt.host

Module Contents

Classes

Host

Represent an host from the host database.

HostDB

Host database.

class electrolyt.host.Host(hostname: str, platform: str, version: str, **kwargs: Any)

Bases: e3.env.BaseEnv

Represent an host from the host database.

See e3.env.BaseEnv

class electrolyt.host.HostDB(filename: str | None = None)

Host database.

Variables:

hosts – dict indexed by host name

property hostnames: list[str]

Return the current list of host names.

Returns:

a list of hostnames

add_host(hostname: str, platform: str, version: str, **data: Any) None

Add/Update a host entry.

Parameters:
  • hostname – host name

  • platform – platform name (see e3.platform)

  • version – platform/OS version

  • data – additional host information

load_yaml_db(filename: str) None

Load a yaml configuration file.

The yaml file should be a dictionaty indexed by host name. Each entry should be a dictionary containing at least the following two keys:

  • build_platform: the platform name

  • build_os_version: the platform/os version

Additional keys for a host entry will be considered as additional data

Parameters:

filename – path the yaml file

__getitem__(key: str) Host
get(key: str, default: Host | None = None) Host | None

Return the Host named key of default.

Parameters:
  • key – host name

  • default – default value to return if not found