All checks were successful
Build and Push Docker Images / build (push) Successful in 7s
25 lines
976 B
Python
25 lines
976 B
Python
# =============================================================================
|
|
# NetBox Local Settings for netbox-branching plugin
|
|
# =============================================================================
|
|
# This file configures DynamicSchemaDict required by netbox-branching.
|
|
# It imports DATABASE from the NetBox Docker configuration and wraps it.
|
|
# =============================================================================
|
|
|
|
import sys
|
|
from netbox_branching.utilities import DynamicSchemaDict
|
|
|
|
# Add the config directory to Python path to import DATABASE
|
|
sys.path.insert(0, '/etc/netbox/config')
|
|
from configuration import DATABASE
|
|
|
|
# Wrap DATABASES with DynamicSchemaDict for dynamic schema support
|
|
# This is required for netbox-branching plugin to function correctly
|
|
DATABASES = DynamicSchemaDict({
|
|
'default': DATABASE,
|
|
})
|
|
|
|
# Employ the custom database router for branch-aware queries
|
|
DATABASE_ROUTERS = [
|
|
'netbox_branching.database.BranchAwareRouter',
|
|
]
|