add 2 environment variables to configurations in order to control plugins:
- PLUGINS: list of plugins in this form -> PLUGINS="plug1,plug2" - PLUGINS_CONFIG: json string -> dict()
This commit is contained in:
parent
4b0f158852
commit
32daef91a7
1 changed files with 6 additions and 0 deletions
|
@ -1,6 +1,7 @@
|
|||
import os
|
||||
import re
|
||||
import socket
|
||||
import json
|
||||
|
||||
# For reference see http://netbox.readthedocs.io/en/latest/configuration/mandatory-settings/
|
||||
# Based on https://github.com/netbox-community/netbox/blob/develop/netbox/netbox/configuration.example.py
|
||||
|
@ -214,3 +215,8 @@ TIME_FORMAT = os.environ.get('TIME_FORMAT', 'g:i a')
|
|||
SHORT_TIME_FORMAT = os.environ.get('SHORT_TIME_FORMAT', 'H:i:s')
|
||||
DATETIME_FORMAT = os.environ.get('DATETIME_FORMAT', 'N j, Y g:i a')
|
||||
SHORT_DATETIME_FORMAT = os.environ.get('SHORT_DATETIME_FORMAT', 'Y-m-d H:i')
|
||||
|
||||
|
||||
# Provide a list of plugins as "plug1,plug2,..."
|
||||
PLUGINS = list(filter(lambda x: x != '', os.environ.get('PLUGINS', '').split(',')))
|
||||
PLUGINS_CONFIG = json.loads(os.environ.get('PLUGINS_CONFIG', '{}'))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue