teuthology.orchestra.daemon package

Submodules

teuthology.orchestra.daemon.cephadmunit module

class teuthology.orchestra.daemon.cephadmunit.CephadmUnit(remote, role, id_, *command_args, **command_kwargs)

Bases: teuthology.orchestra.daemon.state.DaemonState

kill_cmd(sig)
name()
reset()

Does nothing in this implementation

restart(*args, **kwargs)

Restart with a new command passed in the arguments

Parameters:
  • args – positional arguments passed to remote.run
  • kwargs – keyword arguments passed to remote.run
restart_with_args(extra_args)

Restart, adding new paramaters to the current command.

Parameters:extra_args – Extra keyword arguments to be added.
running()

Are we running?

signal(sig, silent=False)

Send a signal to associated remote command

Parameters:sig – signal to send
start(timeout=300)

Start this daemon instance.

stop(timeout=300)

Stop this daemon instance.

Note: this can raise a CommandFailedError, CommandCrashedError, or ConnectionLostError.

Parameters:timeout – timeout to pass to orchestra.run.wait()
wait(timeout=300)

Wait for daemon to exit

Wait for daemon to stop (but don’t trigger the stop). Pass up any exception. Mark the daemon as not running.

wait_for_exit()

clear remote run command value after waiting for exit.

teuthology.orchestra.daemon.group module

class teuthology.orchestra.daemon.group.DaemonGroup(use_systemd=False, use_cephadm=None)

Bases: object

Collection of daemon state instances

add_daemon(remote, type_, id_, *args, **kwargs)

Add a daemon. If there already is a daemon for this id_ and role, stop that daemon. (Re)start the daemon once the new value is set.

Parameters:
  • remote – Remote site
  • type – type of daemon (osd, mds, mon, rgw, for example)
  • id – Id (index into role dictionary)
  • args – Daemonstate positional parameters
  • kwargs – Daemonstate keyword parameters
get_daemon(type_, id_, cluster='ceph')

get the daemon associated with this id_ for this role.

Parameters:
  • type – type of daemon (osd, mds, mon, rgw, for example)
  • id – Id (index into role dictionary)
iter_daemons_of_role(type_, cluster='ceph')

Iterate through all daemon instances for this role. Return dictionary of daemon values.

Parameters:type – type of daemon (osd, mds, mon, rgw, for example)
register_daemon(remote, type_, id_, *args, **kwargs)

Add a daemon. If there already is a daemon for this id_ and role, stop that daemon.

Parameters:
  • remote – Remote site
  • type – type of daemon (osd, mds, mon, rgw, for example)
  • id – Id (index into role dictionary)
  • args – Daemonstate positional parameters
  • kwargs – Daemonstate keyword parameters
resolve_role_list(roles, types, cluster_aware=False)

Resolve a configuration setting that may be None or contain wildcards into a list of roles (where a role is e.g. ‘mds.a’ or ‘osd.0’). This is useful for tasks that take user input specifying a flexible subset of the available roles.

The task calling this must specify what kinds of roles it can can handle using the types argument, where a role type is ‘osd’ or ‘mds’ for example. When selecting roles this is used as a filter, or when an explicit list of roles is passed, the an exception is raised if any are not of a suitable type.

Examples:

# Passing None (i.e. user left config blank) defaults to all roles
# (filtered by ``types``)
None, types=['osd', 'mds', 'mon'] ->
  ['osd.0', 'osd.1', 'osd.2', 'mds.a', mds.b', 'mon.a']
# Wildcards are expanded
roles=['mds.*', 'osd.0'], types=['osd', 'mds', 'mon'] ->
  ['mds.a', 'mds.b', 'osd.0']
# Boring lists are unaltered
roles=['osd.0', 'mds.a'], types=['osd', 'mds', 'mon'] ->
  ['osd.0', 'mds.a']
# Entries in role list that don't match types result in an
# exception
roles=['osd.0', 'mds.a'], types=['osd'] -> RuntimeError
Parameters:
  • roles – List (of roles or wildcards) or None (select all suitable roles)
  • types – List of acceptable role types, for example [‘osd’, ‘mds’].
  • cluster_aware – bool to determine whether to consider include cluster in the returned roles - just for backwards compatibility with pre-jewel versions of ceph-qa-suite
Returns:

List of strings like [“mds.0”, “osd.2”]

teuthology.orchestra.daemon.state module

class teuthology.orchestra.daemon.state.DaemonState(remote, role, id_, *command_args, **command_kwargs)

Bases: object

Daemon State. A daemon exists for each instance of each role.

check_status()

Check to see if the process has exited.

Returns:The exit status, if any
Raises:CommandFailedError, if the process was run with check_status=True
pid
reset()

clear remote run command value.

restart(*args, **kwargs)

Restart with a new command passed in the arguments

Parameters:
  • args – positional arguments passed to remote.run
  • kwargs – keyword arguments passed to remote.run
restart_with_args(extra_args)

Restart, adding new paramaters to the current command.

Parameters:extra_args – Extra keyword arguments to be added.
running()

Are we running? :return: True if remote run command value is set, False otherwise.

signal(sig, silent=False)

Send a signal to associated remote command.

Parameters:sig – signal to send
start(timeout=300)

Start this daemon instance.

stop(timeout=300)

Stop this daemon instance.

Note: this can raise a CommandFailedError, CommandCrashedError, or ConnectionLostError.

Parameters:timeout – timeout to pass to orchestra.run.wait()
wait(timeout=300)

Wait for daemon to exit

Wait for daemon to stop (but don’t trigger the stop). Pass up any exception. Mark the daemon as not running.

wait_for_exit()

clear remote run command value after waiting for exit.

teuthology.orchestra.daemon.systemd module

class teuthology.orchestra.daemon.systemd.SystemDState(remote, role, id_, *command_args, **command_kwargs)

Bases: teuthology.orchestra.daemon.state.DaemonState

check_status()

Check to see if the process has exited.

Returns:The exit status, if any
Raises:CommandFailedError, if the process was run with check_status=True
daemon_type
pid
reset()

Does nothing in this implementation

restart(*args, **kwargs)

Restart with a new command passed in the arguments

Parameters:
  • args – positional arguments passed to remote.run
  • kwargs – keyword arguments passed to remote.run
restart_with_args(extra_args)

Restart, adding new paramaters to the current command.

Parameters:extra_args – Extra keyword arguments to be added.
running()

Are we running? :return: The PID if remote run command value is set, False otherwise.

signal(sig, silent=False)

Send a signal to associated remote command

Parameters:sig – signal to send
start(timeout=300)

Start this daemon instance.

stop(timeout=300)

Stop this daemon instance.

Note: this can raise a CommandFailedError, CommandCrashedError, or ConnectionLostError.

Parameters:timeout – timeout to pass to orchestra.run.wait()
wait(timeout=300)

Wait for daemon to exit

Wait for daemon to stop (but don’t trigger the stop). Pass up any exception. Mark the daemon as not running.

wait_for_exit()

clear remote run command value after waiting for exit.

Module contents