The oslo_privsep.priv_context Module

The oslo_privsep.priv_context Module

oslo_privsep.priv_context.CapNameOrInt(value)
class oslo_privsep.priv_context.Method

Bases: enum.Enum

An enumeration.

FORK = 1
ROOTWRAP = 2
class oslo_privsep.priv_context.PrivContext(prefix, cfg_section='privsep', pypath=None, capabilities=None)

Bases: object

conf

Return the oslo.config section object as lazily as possible.

entrypoint(func)

This is intended to be used as a decorator.

helper_command(sockpath)
is_entrypoint(func)
set_client_mode(enabled)
start(method=<Method.ROOTWRAP: 2>)
stop()
oslo_privsep.priv_context.init(root_helper=None)

Initialise oslo.privsep library.

This function should be called at the top of main(), after the command line is parsed, oslo.config is initialised and logging is set up, but before calling any privileged entrypoint, changing user id, forking, or anything else “odd”.

Parameters:root_helper – List of command and arguments to prefix privsep-helper with, in order to run helper as root. Note, ignored if context’s helper_command config option is set.
Creative Commons Attribution 3.0 License

Except where otherwise noted, this document is licensed under Creative Commons Attribution 3.0 License. See all OpenStack Legal Documents.