The ironic_python_agent.agent Module

class ironic_python_agent.agent.Host(hostname, port)

Bases: tuple

class ironic_python_agent.agent.IronicPythonAgent(api_url, advertise_address, listen_address, ip_lookup_attempts, ip_lookup_sleep, network_interface, lookup_timeout, lookup_interval, standalone, hardware_initialization_delay=0)[source]

Bases: ironic_python_agent.extensions.base.ExecuteCommandMixin

Class for base agent functionality.

force_heartbeat()[source]
get_command_result(result_id)[source]

Get a specific command result by ID.

Returns:a ironic_python_agent.extensions.base. BaseCommandResult object.
Raises:RequestedObjectNotFoundError if command with the given ID is not found.
get_node_uuid()[source]

Get UUID for Ironic node.

If the agent has not yet heartbeated to Ironic, it will not have the UUID and this will raise an exception.

Returns:A string containing the UUID for the Ironic node.
Raises:UnknownNodeError if UUID is unknown.
get_status()[source]

Retrieve a serializable status.

Returns:a ironic_python_agent.agent.IronicPythonAgent instance describing the agent’s status.
list_command_results()[source]

Get a list of command results.

Returns:list of ironic_python_agent.extensions.base. BaseCommandResult objects.
run()[source]

Run the Ironic Python Agent.

set_agent_advertise_addr()[source]

Set advertised IP address for the agent, if not already set.

If agent’s advertised IP address is still default (None), try to find a better one. If the agent’s network interface is None, replace that as well.

Raises:LookupAgentIPError if an IP address could not be found
class ironic_python_agent.agent.IronicPythonAgentHeartbeater(agent)[source]

Bases: threading.Thread

Thread that periodically heartbeats to Ironic.

do_heartbeat()[source]

Send a heartbeat to Ironic.

force_heartbeat()[source]
run()[source]

Start the heartbeat thread.

stop()[source]

Stop the heartbeat thread.

class ironic_python_agent.agent.IronicPythonAgentStatus(started_at, version)[source]

Bases: ironic_python_agent.encoding.Serializable

Represents the status of an agent.