Skip to content

Commit 0ffed69

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) (cherry picked from commit b46b469)
1 parent 3c249a4 commit 0ffed69

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
@@ -576,6 +576,13 @@ def _setting(name, default=None):
576576
'::1',
577577
)
578578

579+
# Settings outside of the scope of the above, additional module settings, etc.
580+
# CAUTION: This unconditionally sets variables from the passthrough dictionary
581+
# in the settings module and could lead to odd results.
582+
passthrough_settings = getattr(configuration, 'PASSTHROUGH', {})
583+
settings_module = sys.modules[__name__]
584+
for key, value in passthrough_settings.items():
585+
setattr(settings_module, key, value)
579586

580587
#
581588
# NetBox internal settings

0 commit comments

Comments
 (0)