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 | 0ca0b25605ebf943945690ef151e6fae6e917edb (patch) | |
| tree | bdfeafcf547f11e8dd35ce542aa581ce09a51d3e | |
| parent | 7fe1f1ecd84caa3a7c3b82f8b21d5fca790888e6 (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 |
