ironic.console.container.fake module

Fake console container provider for disabling .

class ironic.console.container.fake.FakeConsoleContainer[source]

Bases: BaseConsoleContainer

is_stopped(task)[source]

Check whether the console container for this node has stopped.

This is used by the graphical console periodic task to reconcile console sessions with actual container state, so True must only be returned when the container is definitively stopped. A container which is still starting, such as a Pending kubernetes pod, must return False.

Parameters:

task – A TaskManager instance.

Returns:

True if the container is definitively stopped (stopped, exited, or deleted), False if it is running or still starting.

Raises:

ConsoleContainerError if the state cannot be determined.

provider_name = 'fake'
start_container(task, app_name, app_info)[source]

Start a console container for a node.

Calling this will block until a consumable container host and port can be returned.

Parameters:
  • task – A TaskManager instance.

  • app_name – Name of app to run in the container

  • app_info – Dict of app-specific info

Returns:

Tuple of host IP address and published port

Raises:

ConsoleContainerError

stop_all_containers()[source]

Stops all running console containers

This is run on conductor startup and graceful shutdown to ensure no console containers are running. :raises: ConsoleContainerError

stop_container(task)[source]

Stop a console container for a node.

Any existing running container for this node will be stopped.

Parameters:

task – A TaskManager instance.

Raises:

ConsoleContainerError