paradrop.backend.pdconfd package

Submodules

paradrop.backend.pdconfd.client module

class Blocking(deferred)[source]

Bases: object

Uses threading.Event to implement blocking on a twisted deferred object.

The wait method will wait for its completion and return its result.

Dear Lance. I hope you stub your toe.

unlock(result)[source]
wait()[source]
callDeferredMethod(*args, **kwargs)[source]
reload(path, dbus=False)[source]

Reload file(s) specified by path.

This function blocks until the request completes. On completion it returns a status string, which is a JSON list of loaded configuration sections with a ‘success’ field. For critical errors such as failure to connect to the D-Bus service, it will return None.

reloadAll(dbus=False)[source]

Reload all files from the system configuration directory.

This function blocks until the request completes. On completion it returns a status string, which is a JSON list of loaded configuration sections with a ‘success’ field. For critical errors such as failure to connect to the D-Bus service, it will return None.

waitSystemUp(dbus=False)[source]

Wait for the configuration daemon to finish its first load.

This function blocks until the request completes. On completion it returns a status string, which is a JSON list of loaded configuration sections with a ‘success’ field. For critical errors such as failure to connect to the D-Bus service, it will return None.

paradrop.backend.pdconfd.main module

This module listens for D-Bus messages and triggers reloading of configuration files. This module is the service side of the implementation. If you want to issue reload commands to the service, see the client.py file instead.

Operation:
  • When triggered, read in UCI configuration files.
  • Pass sections off to appropriate handlers (interface, etc.).
  • Perform some validation (check for required options).
  • Emit commands (start/stop daemon, ip, iw, etc.) into a queue.
  • Issue commands, maybe rollback on failure.
  • Update known state of the system.

Reference: http://excid3.com/blog/an-actually-decent-python-dbus-tutorial/

class ConfigService[source]

Bases: txdbus.objects.DBusObject

configManager = None
dbusInterfaces = [<txdbus.interface.DBusInterface object at 0x7f1dd9525450>]
dbus_Reload(name)[source]
dbus_ReloadAll()[source]
dbus_Test()[source]
dbus_UnloadAll()[source]
dbus_WaitSystemUp()[source]
listen(*args, **kwargs)[source]
run_pdconfd()[source]

Start pdconfd daemon.

This enters the pdconfd main loop.

run_thread()[source]

Start pdconfd service as a thread.

This function schedules pdconfd to run as a thread and returns immediately.

Module contents