eta_utility.connectors.common module

This module implements some commonly used connector functions that are protocol independent.

eta_utility.connectors.common.connections_from_nodes(nodes: Nodes, usr: str | None = None, pwd: str | None = None, eneffco_api_token: str | None = None, key_cert: KeyCertPair | None = None) dict[str, Any][source]

The functionality of this function is outdated, instead use directly the from_node function of Connection

Take a list of nodes and return a list of connections.

Parameters:
  • nodes – List of nodes defining servers to connect to.

  • usr – Username to use in case a Node does not specify any.

  • pwd – Password to use in case a Node does not specify any.

  • eneffco_api_token – Token for EnEffCo API authorization.

  • key_cert – Key and certificate pair object from eta_utility for authorization with servers.

Returns:

Dictionary of connection objects {hostname: connection}.

eta_utility.connectors.common.name_map_from_node_sequence(nodes: Nodes) dict[str, N][source]

Convert a Sequence/List of Nodes into a dictionary of nodes, identified by their name.

Warning

Make sure that each node in nodes has a unique Name, otherwise this function will fail.

Parameters:

nodes – Sequence of Node objects.

Returns:

Dictionary of Node objects (format: {node.name: Node}).