Skip to content

Commit b46b469

Browse files
committed
Add a passthrough configuration system
This is an implementation of the strategy 3 from this comment: netbox-community/netbox#1814 (comment) Bug: T209182 Change-Id: Icbdf212b7b1f9ff59fef4f5ecf64bfd9fdc41238 (cherry picked from commit 60c58bd)
1 parent 68fbd9b commit b46b469

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

netbox/netbox/settings.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -547,6 +547,13 @@ def _setting(name, default=None):
547547
'::1',
548548
)
549549

550+
# Settings outside of the scope of the above, additional module settings, etc.
551+
# CAUTION: This unconditionally sets variables from the passthrough dictionary
552+
# in the settings module and could lead to odd results.
553+
passthrough_settings = getattr(configuration, 'PASSTHROUGH', {})
554+
settings_module = sys.modules[__name__]
555+
for key, value in passthrough_settings.items():
556+
setattr(settings_module, key, value)
550557

551558
#
552559
# NetBox internal settings

0 commit comments

Comments
 (0)