From d81fff272743e514b828783d408b8d4d43618684 Mon Sep 17 00:00:00 2001 From: Matthias Bussonnier Date: Mon, 1 Aug 2016 11:27:20 -0700 Subject: [PATCH] Backport PR #1526: reverse nbconfig load order list is in descending priority, so load should iterate back to front, to ensure user config wins the easy part of #1508 --- notebook/services/config/manager.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/notebook/services/config/manager.py b/notebook/services/config/manager.py index 600c0c4c1..2258e4f82 100644 --- a/notebook/services/config/manager.py +++ b/notebook/services/config/manager.py @@ -19,11 +19,12 @@ class ConfigManager(LoggingConfigurable): def get(self, section_name): """Get the config from all config sections.""" config = {} - for p in self.read_config_path: + # step through back to front, to ensure front of the list is top priority + for p in self.read_config_path[::-1]: cm = BaseJSONConfigManager(config_dir=p) recursive_update(config, cm.get(section_name)) return config - + def set(self, section_name, data): """Set the config only to the user's config.""" return self.write_config_manager.set(section_name, data)