toolforge.etcdctl

Wrapper around etcdctl handling parameters and such.

exception spicerack.toolforge.etcdctl.TooManyHosts[source]

Bases: SpicerackError

Raised when there's more hosts than supported passed.

exception spicerack.toolforge.etcdctl.UnableToParseOutput[source]

Bases: SpicerackError

Raised when there's an error trying to parse etcdctl output.

class spicerack.toolforge.etcdctl.EtcdClusterHealthStatus(global_status: HealthStatus, members_status: Dict[str, HealthStatus])[source]

Bases: object

Etcd cluster health status.

class spicerack.toolforge.etcdctl.EtcdctlController(*, remote_host: RemoteHosts)[source]

Bases: RemoteHostsAdapter

Node that is able to run etcdctl and control an etcd cluster.

Init.

ensure_node_does_not_exist(member_fqdn: str) str | None[source]

Ensure the non existance of an etcd member, removing it if present.

Makes sure that the given member_fqdn member is not part of the etcd cluster, returns its old member id or None if it was not there.

ensure_node_exists(new_member_fqdn: str, member_peer_url: str | None = None) str[source]

Ensure the existance of an etcd member adding it if not present.

Makes sure that the given new_member_fqdn member exists and is part of the etcd cluster, and returns its member id.

get_cluster_health() EtcdClusterHealthStatus[source]

Gets the current etcd cluster health status.

get_cluster_info() Dict[str, Dict[str, str | int | bool]][source]

Gets the current etcd cluster information.

class spicerack.toolforge.etcdctl.HealthStatus(value)[source]

Bases: Enum

Health status.