Blame view

slapos/README.manager.rst 1.08 KB
Tomáš Peterka committed
1 2 3 4 5
slapos.manager
==============

Manager is a plugin-like class that is being run in multiple phases of slapos node lifecycle.

Jérome Perrin committed
6
-  **format**, manager can format additionally the underlaying OS
Tomáš Peterka committed
7 8 9 10 11 12
-  **software**, manager can react on software installation
-  **instance**, manager can update instance runtime frequently

Constructor will receive configuration of current stage. Then each method receives
object most related to the current operation. For details see <slapos/manager/interface.py>.

Tomáš Peterka committed
13 14 15 16 17 18 19 20 21 22 23 24 25
In code, a list of manager instances can be easily retreived by

    from slapos import manager
    manager_list = manager.from_config(config)

Where `from_config` extracts "manager_list" item from dict-like `config` argument
and then dynamically loads modules named according to the configuration inside
`slapos.manager` package. The manager must be a class named Manager and implementing
interface `slapos.manager.interface.IManager`.

Managers might require a list of user for whom they are allowed to perform tasks.
This list of users is given by "power_user_list" in [slapos] section in the
config file.