Commands

BaseCommand

class pybsd.commands.BaseCommand(env)[source]

Bases: object

Provides a base interface to a shell command so it can be invoked through a BaseSystem

Parameters:env (BaseSystem) – The system on which the command will be will executed.
name

str

a name that identifies the command.

binary

str

The path of the command binary on the host filesystem.

Raises:
  • InvalidCommandNameError – raised when a command doesn’t have a name
  • InvalidCommandExecutorError – raised when the host system doesn’t have an execyutor or it is not callable
  • CommandNotImplementedError – raised when the command’s binary does not exist in the host filesystem
  • CommandConnectionError – raised when connection to a remote host fails
invoke(*args)[source]

Executes the command, passing it arguments.

Parameters:

args (arguments that are passed to the command at execution time) –

Raises:
  • CommandNotImplementedError – raised when the command’s binary does not exist in the host filesystem
  • CommandConnectionError – raised when connection to a remote host fails

EzjailAdmin

class pybsd.commands.EzjailAdmin(env)[source]

Bases: pybsd.commands.base.BaseCommand

Provides an interface to the ezjail-admin command

list_headers[source]

rc: command return code out: command stdout err: command stderr