diff options
| author | Carl Hetherington <cth@carlh.net> | 2020-04-02 15:25:35 +0200 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2020-04-02 15:25:35 +0200 |
| commit | b55f5b1fe5a331c7d7c289fc315196bc8ac02c3a (patch) | |
| tree | bdfeafcf547f11e8dd35ce542aa581ce09a51d3e | |
| parent | 42dbd35840cd734d4b73f0c9d49f401706322938 (diff) | |
Change option_defaults to being a plain dict rather than a method.
| -rwxr-xr-x | cdist | 8 |
1 files changed, 7 insertions, 1 deletions
@@ -934,7 +934,13 @@ class Tree(object): def add_defaults(self, options): """Add the defaults from this into a dict options""" if 'option_defaults' in self.cscript: - for k, v in self.cscript['option_defaults']().items(): + from_cscript = self.cscript['option_defaults'] + if isinstance(from_cscript, dict): + defaults_dict = from_cscript + else: + log("Deprecated cscript option_defaults method; replace with a dict") + defaults_dict = from_cscript() + for k, v in default_dict.items(): if not k in options: options[k] = v |
