marvis.command_executor.lxd

Execute commands in LXD containers.

Functions

create_handler

Classes

LXDCommandExecutor

The LXDCommandExecutor runs commands in a LXD container.


marvis.command_executor.lxd.create_handler(log, level)[source]
class marvis.command_executor.lxd.LXDCommandExecutor(name, container: pylxd.models.container.Container)[source]

Bases: marvis.command_executor.base.CommandExecutor

The LXDCommandExecutor runs commands in a LXD container.

namestr

The name of the command executor.

containerstr

The container to run the commands in.

container

The container to run the commands in.

execute(command, user=None, shell=None, stdout_logfile=None, stderr_logfile=None)[source]

Execute a command.

Parameters
  • command (str) – The command to run.

  • user (str) – The user to run the command as.

  • shell (str) – The type of shell to use (sh, bash, …).

  • stdout_logfile (str) – The path to the log file to append the stdout output.

  • stderr_logfile (str) – The path to the log file to append the stderr output.

get_logger()

Retrieve the logger for this command executor.

name

The name of the CommandExecutor.

counter

A counter for loggers.

Inheritance Diagramm

Inheritance diagram of marvis.command_executor.lxd