Skip to content

Commit

Permalink
Add a passthrough configuration system
Browse files Browse the repository at this point in the history
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)
  • Loading branch information
chaomodus committed Feb 11, 2020
1 parent 68fbd9b commit b46b469
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions netbox/netbox/settings.py
Expand Up @@ -547,6 +547,13 @@ def _setting(name, default=None):
'::1',
)

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

#
# NetBox internal settings
Expand Down

0 comments on commit b46b469

Please sign in to comment.