ConfigDependency#

class controller.dependencies.config.ConfigDependency(path=PosixPath('/etc/nublado/config.yaml'))#

Bases: object

Dependency to manage a cached Nublado controller configuration.

The controller configuration is read on first request, cached, and returned to all dependency callers unless set_path is called to change the configuration.

Parameters:

path (Path, default: PosixPath('/etc/nublado/config.yaml')) – Path to the Nublado controller configuration.

Attributes Summary

config

Load configuration if needed and return it.

is_initialized

Whether the configuration has been initialized.

Methods Summary

__call__()

Call self as a function.

set_path(path)

Change the configuration path and reload.

Attributes Documentation

config#

Load configuration if needed and return it.

is_initialized#

Whether the configuration has been initialized.

Methods Documentation

async __call__()#

Call self as a function. :rtype: Config

set_path(path)#

Change the configuration path and reload.

Parameters:

path (Path) – New configuration path.

Return type:

None