trigger.conf — Configuration & Settings module

Settings and configuration for Trigger.

Values will be read from the module specified by the TRIGGER_SETTINGS environment variable, and then from trigger.conf.global_settings; see the global settings file for a list of all possible variables.

If TRIGGER_SETTINGS is not set, it will attempt to load from /etc/trigger/settings.py and complains if it can’t. The primary public interface for this module is the settings variable, which is a module object containing the variables found in settings.py.

>>> from trigger.conf import settings
>>> settings.FIREWALL_DIR
'/data/firewalls'
>>> settings.REDIS_HOST
'127.0.0.1'
class trigger.conf.DummySettings

Emulates settings and returns empty strings on attribute gets.

trigger.conf.import_path(full_path, global_name)

Import a file with full path specification. Allows one to import from anywhere, something __import__ does not do.

Also adds the module to sys.modules as module_name

Parameters:
  • full_path – The absolute path to the module .py file
  • global_name – The name assigned to the module in sys.modules. To avoid confusion, the global_name should be the same as the variable to which you’re assigning the returned module.

Returns a module object.

class trigger.conf.BaseSettings

Common logic for settings whether set by a module or by the user.

Previous topic

trigger.cmds — Command execution library

Next topic

trigger.netdevices — Network device metadata library

This Page